@mappedin/react-sdk 6.0.1-beta.45 → 6.0.1-beta.46

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{$ as qs,A as Hx,B as Wx,C as up,D as Qt,E as zx,F as oy,G as Mi,H as Xx,I as Zs,J as Zx,K as Ii,L as Ah,M as Ze,N as ay,O as Lt,P as Yx,Q as ha,R as zr,S as Ee,T as Me,U as dp,V as sy,W as ly,X as Kx,Y as hp,Z as Qx,_ as Ys,a as dx,aa as eC,b as hx,ba as fr,c as fx,ca as tC,d as L,da as rC,e as Qg,ea as cy,f as Oh,fa as Fh,g as Rx,ga as Bh,h as Xs,ha as iC,i as _h,ia as nC,j as Nx,ja as oC,k as Lh,ka as Rh,l as pa,la as aC,m as Si,ma as sC,n as Gx,na as lC,o as Vx,oa as cC,p as iy,pa as Pi,q as De,qa as py,r as ae,ra as pC,s as ua,sa as uC,t as ny,ta as fa,u as Ti,ua as fp,v as kh,va as $s,w as pn,wa as Nh,x as da,xa as Js,y as jx,ya as Ks,z as Ux}from"./chunk-VVO7QO3Y.js";import{ba as Jx,j as qx,u as $x}from"./chunk-FSBH4P52.js";import{a as Ir}from"./chunk-OFX4UKYI.js";import{$ as Px,$a as Ax,A as vx,Aa as Hr,Ba as Eh,C as xx,Ca as Ox,D as ye,Da as _x,E as ne,Fa as Wr,I as Cx,J as Sx,K as Tx,L as pp,M as Q,N as xt,O as Mx,P as jr,Pa as zs,Q as sn,R as ln,S as Le,Ta as Dh,U as ct,Ua as Lx,V as cn,W as Ix,X as de,Y as Ur,Ya as kx,_ as ca,_a as Ci,aa as ey,ab as Fx,b as Th,c as Mh,ca as oo,cb as Bx,d as mx,e as on,f as gx,g as bi,ha as wx,ka as ao,la as Ex,ma as Ph,na as ty,p as yx,pa as Ws,q as bx,r as Ih,ua as Dx,va as so,wa as wh,xa as ry,ya as vi,z as an,za as xi}from"./chunk-FAMEMKII.js";import{a as g,b as M}from"./chunk-GVHB2OJC.js";import{a as l,c as W,d as ux,e as la,f as d,g as s,h as T,i as P,j as G}from"./chunk-BYMKRV3A.js";var iS=W((i1,n1)=>{g();(function(r,t){typeof i1=="object"&&typeof n1<"u"?n1.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(i1,function(){"use strict";function r(v,S,I,w,E){l(function D(R,_,F,B,V){for(;B>F;){if(B-F>600){var N=B-F+1,X=_-F+1,z=Math.log(N),U=.5*Math.exp(2*z/3),te=.5*Math.sqrt(z*U*(N-U)/N)*(X-N/2<0?-1:1),Z=Math.max(F,Math.floor(_-X*U/N+te)),Ce=Math.min(B,Math.floor(_+(N-X)*U/N+te));D(R,_,Z,Ce,V)}var me=R[_],Pe=F,_e=B;for(t(R,F,_),V(R[B],me)>0&&t(R,F,B);Pe<_e;){for(t(R,Pe,_e),Pe++,_e--;V(R[Pe],me)<0;)Pe++;for(;V(R[_e],me)>0;)_e--}V(R[F],me)===0?t(R,F,_e):t(R,++_e,B),_e<=_&&(F=_e+1),_<=_e&&(B=_e-1)}},"t")(v,S,I||0,w||v.length-1,E||e)}l(r,"t");function t(v,S,I){var w=v[S];v[S]=v[I],v[I]=w}l(t,"i");function e(v,S){return v<S?-1:v>S?1:0}l(e,"n");var i=l(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,I){if(!I)return S.indexOf(v);for(var w=0;w<S.length;w++)if(I(v,S[w]))return w;return-1}l(n,"e");function o(v,S){a(v,0,v.children.length,S,v)}l(o,"a");function a(v,S,I,w,E){E||(E=x(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var D=S;D<I;D++){var R=v.children[D];p(E,v.leaf?w(R):R)}return E}l(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}l(p,"o");function c(v,S){return v.minX-S.minX}l(c,"s");function u(v,S){return v.minY-S.minY}l(u,"l");function h(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}l(h,"f");function m(v){return v.maxX-v.minX+(v.maxY-v.minY)}l(m,"u");function y(v,S){return v.minX<=S.minX&&v.minY<=S.minY&&S.maxX<=v.maxX&&S.maxY<=v.maxY}l(y,"m");function b(v,S){return S.minX<=v.maxX&&S.minY<=v.maxY&&S.maxX>=v.minX&&S.maxY>=v.minY}l(b,"c");function x(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}l(x,"p");function C(v,S,I,w,E){for(var D=[S,I];D.length;)if(!((I=D.pop())-(S=D.pop())<=w)){var R=S+Math.ceil((I-S)/w/2)*w;r(v,R,S,I,E),D.push(S,R,R,I)}}return l(C,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(v){var S=this.data,I=[];if(!b(v,S))return I;for(var w=this.toBBox,E=[];S;){for(var D=0;D<S.children.length;D++){var R=S.children[D],_=S.leaf?w(R):R;b(v,_)&&(S.leaf?I.push(R):y(v,_)?this._all(R,I):E.push(R))}S=E.pop()}return I},i.prototype.collides=function(v){var S=this.data;if(!b(v,S))return!1;for(var I=[];S;){for(var w=0;w<S.children.length;w++){var E=S.children[w],D=S.leaf?this.toBBox(E):E;if(b(v,D)){if(S.leaf||y(v,D))return!0;I.push(E)}}S=I.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 I=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var w=this.data;this.data=I,I=w}this._insert(I,this.data.height-I.height-1,!0)}else this.data=I;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 I,w,E,D=this.data,R=this.toBBox(v),_=[],F=[];D||_.length;){if(D||(D=_.pop(),w=_[_.length-1],I=F.pop(),E=!0),D.leaf){var B=n(v,D.children,S);if(B!==-1)return D.children.splice(B,1),_.push(D),this._condense(_),this}E||D.leaf||!y(D,R)?w?(I++,D=w.children[I],E=!1):D=null:(_.push(D),F.push(I),I=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 I=[];v;)v.leaf?S.push.apply(S,v.children):I.push.apply(I,v.children),v=I.pop();return S},i.prototype._build=function(v,S,I,w){var E,D=I-S+1,R=this._maxEntries;if(D<=R)return o(E=x(v.slice(S,I+1)),this.toBBox),E;w||(w=Math.ceil(Math.log(D)/Math.log(R)),R=Math.ceil(D/Math.pow(R,w-1))),(E=x([])).leaf=!1,E.height=w;var _=Math.ceil(D/R),F=_*Math.ceil(Math.sqrt(R));C(v,S,I,F,this.compareMinX);for(var B=S;B<=I;B+=F){var V=Math.min(B+F-1,I);C(v,B,V,_,this.compareMinY);for(var N=B;N<=V;N+=_){var X=Math.min(N+_-1,V);E.children.push(this._build(v,N,X,w-1))}}return o(E,this.toBBox),E},i.prototype._chooseSubtree=function(v,S,I,w){for(;w.push(S),!S.leaf&&w.length-1!==I;){for(var E=1/0,D=1/0,R=void 0,_=0;_<S.children.length;_++){var F=S.children[_],B=h(F),V=(N=v,X=F,(Math.max(X.maxX,N.maxX)-Math.min(X.minX,N.minX))*(Math.max(X.maxY,N.maxY)-Math.min(X.minY,N.minY))-B);V<D?(D=V,E=B<E?B:E,R=F):V===D&&B<E&&(E=B,R=F)}S=R||S.children[0]}var N,X;return S},i.prototype._insert=function(v,S,I){var w=I?v:this.toBBox(v),E=[],D=this._chooseSubtree(w,this.data,S,E);for(D.children.push(v),p(D,w);S>=0&&E[S].children.length>this._maxEntries;)this._split(E,S),S--;this._adjustParentBBoxes(w,E,S)},i.prototype._split=function(v,S){var I=v[S],w=I.children.length,E=this._minEntries;this._chooseSplitAxis(I,E,w);var D=this._chooseSplitIndex(I,E,w),R=x(I.children.splice(D,I.children.length-D));R.height=I.height,R.leaf=I.leaf,o(I,this.toBBox),o(R,this.toBBox),S?v[S-1].children.push(R):this._splitRoot(I,R)},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,I){for(var w,E,D,R,_,F,B,V=1/0,N=1/0,X=S;X<=I-S;X++){var z=a(v,0,X,this.toBBox),U=a(v,X,I,this.toBBox),te=(E=z,D=U,R=void 0,_=void 0,F=void 0,B=void 0,R=Math.max(E.minX,D.minX),_=Math.max(E.minY,D.minY),F=Math.min(E.maxX,D.maxX),B=Math.min(E.maxY,D.maxY),Math.max(0,F-R)*Math.max(0,B-_)),Z=h(z)+h(U);te<V?(V=te,w=X,N=Z<N?Z:N):te===V&&Z<N&&(N=Z,w=X)}return w||I-S},i.prototype._chooseSplitAxis=function(v,S,I){var w=v.leaf?this.compareMinX:c,E=v.leaf?this.compareMinY:u;this._allDistMargin(v,S,I,w)<this._allDistMargin(v,S,I,E)&&v.children.sort(w)},i.prototype._allDistMargin=function(v,S,I,w){v.children.sort(w);for(var E=this.toBBox,D=a(v,0,S,E),R=a(v,I-S,I,E),_=m(D)+m(R),F=S;F<I-S;F++){var B=v.children[F];p(D,v.leaf?E(B):B),_+=m(D)}for(var V=I-S-1;V>=S;V--){var N=v.children[V];p(R,v.leaf?E(N):N),_+=m(R)}return _},i.prototype._adjustParentBBoxes=function(v,S,I){for(var w=I;w>=0;w--)p(S[w],v)},i.prototype._condense=function(v){for(var S=v.length-1,I=void 0;S>=0;S--)v[S].children.length===0?S>0?(I=v[S-1].children).splice(I.indexOf(v[S]),1):this.clear():o(v[S],this.toBBox)},i})});var c1=W(oe=>{"use strict";g();Object.defineProperty(oe,"__esModule",{value:!0});oe.earthRadius=63710088e-1;oe.factors={centimeters:oe.earthRadius*100,centimetres:oe.earthRadius*100,degrees:oe.earthRadius/111325,feet:oe.earthRadius*3.28084,inches:oe.earthRadius*39.37,kilometers:oe.earthRadius/1e3,kilometres:oe.earthRadius/1e3,meters:oe.earthRadius,metres:oe.earthRadius,miles:oe.earthRadius/1609.344,millimeters:oe.earthRadius*1e3,millimetres:oe.earthRadius*1e3,nauticalmiles:oe.earthRadius/1852,radians:1,yards:oe.earthRadius*1.0936};oe.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/oe.earthRadius,yards:1.0936133};oe.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function So(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}l(So,"feature");oe.feature=So;function nw(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return o1(t).geometry;case"LineString":return s1(t).geometry;case"Polygon":return a1(t).geometry;case"MultiPoint":return oS(t).geometry;case"MultiLineString":return nS(t).geometry;case"MultiPolygon":return aS(t).geometry;default:throw new Error(r+" is invalid")}}l(nw,"geometry");oe.geometry=nw;function o1(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(!$h(r[0])||!$h(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return So(i,t,e)}l(o1,"point");oe.point=o1;function ow(r,t,e){return e===void 0&&(e={}),Jh(r.map(function(i){return o1(i,t)}),e)}l(ow,"points");oe.points=ow;function a1(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 So(p,t,e)}l(a1,"polygon");oe.polygon=a1;function aw(r,t,e){return e===void 0&&(e={}),Jh(r.map(function(i){return a1(i,t)}),e)}l(aw,"polygons");oe.polygons=aw;function s1(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return So(i,t,e)}l(s1,"lineString");oe.lineString=s1;function sw(r,t,e){return e===void 0&&(e={}),Jh(r.map(function(i){return s1(i,t)}),e)}l(sw,"lineStrings");oe.lineStrings=sw;function Jh(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}l(Jh,"featureCollection");oe.featureCollection=Jh;function nS(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return So(i,t,e)}l(nS,"multiLineString");oe.multiLineString=nS;function oS(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return So(i,t,e)}l(oS,"multiPoint");oe.multiPoint=oS;function aS(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return So(i,t,e)}l(aS,"multiPolygon");oe.multiPolygon=aS;function lw(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return So(i,t,e)}l(lw,"geometryCollection");oe.geometryCollection=lw;function cw(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}l(cw,"round");oe.round=cw;function sS(r,t){t===void 0&&(t="kilometers");var e=oe.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}l(sS,"radiansToLength");oe.radiansToLength=sS;function l1(r,t){t===void 0&&(t="kilometers");var e=oe.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}l(l1,"lengthToRadians");oe.lengthToRadians=l1;function pw(r,t){return lS(l1(r,t))}l(pw,"lengthToDegrees");oe.lengthToDegrees=pw;function uw(r){var t=r%360;return t<0&&(t+=360),t}l(uw,"bearingToAzimuth");oe.bearingToAzimuth=uw;function lS(r){var t=r%(2*Math.PI);return t*180/Math.PI}l(lS,"radiansToDegrees");oe.radiansToDegrees=lS;function dw(r){var t=r%360;return t*Math.PI/180}l(dw,"degreesToRadians");oe.degreesToRadians=dw;function hw(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 sS(l1(r,t),e)}l(hw,"convertLength");oe.convertLength=hw;function fw(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=oe.areaFactors[t];if(!i)throw new Error("invalid original units");var n=oe.areaFactors[e];if(!n)throw new Error("invalid final units");return r/i*n}l(fw,"convertArea");oe.convertArea=fw;function $h(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}l($h,"isNumber");oe.isNumber=$h;function mw(r){return!!r&&r.constructor===Object}l(mw,"isObject");oe.isObject=mw;function gw(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(!$h(t))throw new Error("bbox must only contain numbers")})}l(gw,"validateBBox");oe.validateBBox=gw;function yw(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")}l(yw,"validateId");oe.validateId=yw});var hS=W(dt=>{"use strict";g();Object.defineProperty(dt,"__esModule",{value:!0});var kt=c1();function Xp(r,t,e){if(r!==null)for(var i,n,o,a,p,c,u,h=0,m=0,y,b=r.type,x=b==="FeatureCollection",C=b==="Feature",v=x?r.features.length:1,S=0;S<v;S++){u=x?r.features[S].geometry:C?r.geometry:r,y=u?u.type==="GeometryCollection":!1,p=y?u.geometries.length:1;for(var I=0;I<p;I++){var w=0,E=0;if(a=y?u.geometries[I]:u,a!==null){c=a.coordinates;var D=a.type;switch(h=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(c,m,S,w,E)===!1)return!1;m++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],m,S,w,E)===!1)return!1;m++,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-h;n++){if(t(c[i][n],m,S,w,E)===!1)return!1;m++}D==="MultiLineString"&&w++,D==="Polygon"&&E++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(E=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-h;o++){if(t(c[i][n][o],m,S,w,E)===!1)return!1;m++}E++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Xp(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(Xp,"coordEach");function bw(r,t,e,i){var n=e;return Xp(r,function(o,a,p,c,u){a===0&&e===void 0?n=o:n=t(n,o,a,p,c,u)},i),n}l(bw,"coordReduce");function cS(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}}l(cS,"propEach");function vw(r,t,e){var i=e;return cS(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}l(vw,"propReduce");function pS(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++);}l(pS,"featureEach");function xw(r,t,e){var i=e;return pS(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}l(xw,"featureReduce");function Cw(r){var t=[];return Xp(r,function(e){t.push(e)}),t}l(Cw,"coordAll");function p1(r,t){var e,i,n,o,a,p,c,u,h,m,y=0,b=r.type==="FeatureCollection",x=r.type==="Feature",C=b?r.features.length:1;for(e=0;e<C;e++){for(p=b?r.features[e].geometry:x?r.geometry:r,u=b?r.features[e].properties:x?r.properties:{},h=b?r.features[e].bbox:x?r.bbox:void 0,m=b?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,y,u,h,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,y,u,h,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],y,u,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}l(p1,"geomEach");function Sw(r,t,e){var i=e;return p1(r,function(n,o,a,p,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,p,c)}),i}l(Sw,"geomReduce");function Kh(r,t){p1(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(kt.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 h=e.coordinates[u],m={type:c,coordinates:h};if(t(kt.feature(m,n),i,u)===!1)return!1}})}l(Kh,"flattenEach");function Tw(r,t,e){var i=e;return Kh(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}l(Tw,"flattenReduce");function uS(r,t){Kh(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,h=0;if(Xp(e,function(m,y,b,x,C){if(p===void 0||i>c||x>u||C>h){p=m,c=i,u=x,h=C,o=0;return}var v=kt.lineString([p,m],e.properties);if(t(v,i,n,C,o)===!1)return!1;o++,p=m})===!1)return!1}}})}l(uS,"segmentEach");function Mw(r,t,e){var i=e,n=!1;return uS(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}l(Mw,"segmentReduce");function dS(r,t){if(!r)throw new Error("geojson is required");Kh(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(kt.lineString(a[p],e.properties),i,n,p)===!1)return!1;break}}})}l(dS,"lineEach");function Iw(r,t,e){var i=e;return dS(r,function(n,o,a,p){o===0&&e===void 0?i=n:i=t(i,n,o,a,p)}),i}l(Iw,"lineReduce");function Pw(r,t){if(t=t||{},!kt.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),kt.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),kt.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),kt.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),kt.lineString([c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}l(Pw,"findSegment");function ww(r,t){if(t=t||{},!kt.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 kt.point(c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),kt.point(c[i],a,t);case"LineString":return o<0&&(o=c.length+o),kt.point(c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),kt.point(c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),kt.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),kt.point(c[i][n][o],a,t)}throw new Error("geojson is invalid")}l(ww,"findPoint");dt.coordAll=Cw;dt.coordEach=Xp;dt.coordReduce=bw;dt.featureEach=pS;dt.featureReduce=xw;dt.findPoint=ww;dt.findSegment=Pw;dt.flattenEach=Kh;dt.flattenReduce=Tw;dt.geomEach=p1;dt.geomReduce=Sw;dt.lineEach=dS;dt.lineReduce=Iw;dt.propEach=cS;dt.propReduce=vw;dt.segmentEach=uS;dt.segmentReduce=Mw});var u1=W((nZ,mS)=>{"use strict";g();var fS=Object.prototype.toString;mS.exports=l(function(t){var e=fS.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&fS.call(t.callee)==="[object Function]"),i},"isArguments")});var MS=W((sZ,TS)=>{"use strict";g();var SS;Object.keys||(Zp=Object.prototype.hasOwnProperty,d1=Object.prototype.toString,gS=u1(),h1=Object.prototype.propertyIsEnumerable,yS=!h1.call({toString:null},"toString"),bS=h1.call(function(){},"prototype"),Yp=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Qh=l(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),vS={$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},xS=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!vS["$"+r]&&Zp.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Qh(window[r])}catch{return!0}}catch{return!0}return!1}(),CS=l(function(r){if(typeof window>"u"||!xS)return Qh(r);try{return Qh(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),SS=l(function(t){var e=t!==null&&typeof t=="object",i=d1.call(t)==="[object Function]",n=gS(t),o=e&&d1.call(t)==="[object String]",a=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var p=bS&&i;if(o&&t.length>0&&!Zp.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 h in t)!(p&&h==="prototype")&&Zp.call(t,h)&&a.push(String(h));if(yS)for(var m=CS(t),y=0;y<Yp.length;++y)!(m&&Yp[y]==="constructor")&&Zp.call(t,Yp[y])&&a.push(Yp[y]);return a},"keys"));var Zp,d1,gS,h1,yS,bS,Yp,Qh,vS,xS,CS;TS.exports=SS});var tf=W((pZ,wS)=>{"use strict";g();var Ew=Array.prototype.slice,Dw=u1(),IS=Object.keys,ef=IS?l(function(t){return IS(t)},"keys"):MS(),PS=Object.keys;ef.shim=l(function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=l(function(i){return Dw(i)?PS(Ew.call(i)):PS(i)},"keys"))}else Object.keys=ef;return Object.keys||ef},"shimObjectKeys");wS.exports=ef});var DS=W((hZ,ES)=>{"use strict";g();ES.exports=Error});var _S=W((mZ,OS)=>{"use strict";g();OS.exports=EvalError});var kS=W((yZ,LS)=>{"use strict";g();LS.exports=RangeError});var FS=W((vZ,AS)=>{"use strict";g();AS.exports=ReferenceError});var f1=W((CZ,BS)=>{"use strict";g();BS.exports=SyntaxError});var Mn=W((TZ,RS)=>{"use strict";g();RS.exports=TypeError});var GS=W((IZ,NS)=>{"use strict";g();NS.exports=URIError});var qp=W((wZ,VS)=>{"use strict";g();VS.exports=l(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 rf=W((OZ,US)=>{"use strict";g();var jS=typeof Symbol<"u"&&Symbol,Ow=qp();US.exports=l(function(){return typeof jS!="function"||typeof Symbol!="function"||typeof jS("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ow()},"hasNativeSymbols")});var WS=W((kZ,HS)=>{"use strict";g();var m1={__proto__:null,foo:{}},_w=Object;HS.exports=l(function(){return{__proto__:m1}.foo===m1.foo&&!(m1 instanceof _w)},"hasProto")});var ZS=W((BZ,XS)=>{"use strict";g();var Lw="Function.prototype.bind called on incompatible ",kw=Object.prototype.toString,Aw=Math.max,Fw="[object Function]",zS=l(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"),Bw=l(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"),Rw=l(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");XS.exports=l(function(t){var e=this;if(typeof e!="function"||kw.apply(e)!==Fw)throw new TypeError(Lw+e);for(var i=Bw(arguments,1),n,o=l(function(){if(this instanceof n){var h=e.apply(this,zS(i,arguments));return Object(h)===h?h:this}return e.apply(t,zS(i,arguments))},"binder"),a=Aw(0,e.length-i.length),p=[],c=0;c<a;c++)p[c]="$"+c;if(n=Function("binder","return function ("+Rw(p,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var u=l(function(){},"Empty");u.prototype=e.prototype,n.prototype=new u,u.prototype=null}return n},"bind")});var nf=W((GZ,YS)=>{"use strict";g();var Nw=ZS();YS.exports=Function.prototype.bind||Nw});var g1=W((jZ,qS)=>{"use strict";g();var Gw=Function.prototype.call,Vw=Object.prototype.hasOwnProperty,jw=nf();qS.exports=jw.call(Gw,Vw)});var ei=W((HZ,e4)=>{"use strict";g();var Se,Uw=DS(),Hw=_S(),Ww=kS(),zw=FS(),Ll=f1(),_l=Mn(),Xw=GS(),QS=Function,y1=l(function(r){try{return QS('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Fa=Object.getOwnPropertyDescriptor;if(Fa)try{Fa({},"")}catch{Fa=null}var b1=l(function(){throw new _l},"throwTypeError"),Zw=Fa?function(){try{return arguments.callee,b1}catch{try{return Fa(arguments,"callee").get}catch{return b1}}}():b1,Dl=rf()(),Yw=WS()(),Ct=Object.getPrototypeOf||(Yw?function(r){return r.__proto__}:null),Ol={},qw=typeof Uint8Array>"u"||!Ct?Se:Ct(Uint8Array),Ba={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Se:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Se:ArrayBuffer,"%ArrayIteratorPrototype%":Dl&&Ct?Ct([][Symbol.iterator]()):Se,"%AsyncFromSyncIteratorPrototype%":Se,"%AsyncFunction%":Ol,"%AsyncGenerator%":Ol,"%AsyncGeneratorFunction%":Ol,"%AsyncIteratorPrototype%":Ol,"%Atomics%":typeof Atomics>"u"?Se:Atomics,"%BigInt%":typeof BigInt>"u"?Se:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Se:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Se:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Se:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Uw,"%eval%":eval,"%EvalError%":Hw,"%Float32Array%":typeof Float32Array>"u"?Se:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Se:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Se:FinalizationRegistry,"%Function%":QS,"%GeneratorFunction%":Ol,"%Int8Array%":typeof Int8Array>"u"?Se:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Se:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Se:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Dl&&Ct?Ct(Ct([][Symbol.iterator]())):Se,"%JSON%":typeof JSON=="object"?JSON:Se,"%Map%":typeof Map>"u"?Se:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Dl||!Ct?Se:Ct(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Se:Promise,"%Proxy%":typeof Proxy>"u"?Se:Proxy,"%RangeError%":Ww,"%ReferenceError%":zw,"%Reflect%":typeof Reflect>"u"?Se:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Se:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Dl||!Ct?Se:Ct(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Se:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Dl&&Ct?Ct(""[Symbol.iterator]()):Se,"%Symbol%":Dl?Symbol:Se,"%SyntaxError%":Ll,"%ThrowTypeError%":Zw,"%TypedArray%":qw,"%TypeError%":_l,"%Uint8Array%":typeof Uint8Array>"u"?Se:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Se:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Se:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Se:Uint32Array,"%URIError%":Xw,"%WeakMap%":typeof WeakMap>"u"?Se:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Se:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Se:WeakSet};if(Ct)try{null.error}catch(r){$S=Ct(Ct(r)),Ba["%Error.prototype%"]=$S}var $S,$w=l(function r(t){var e;if(t==="%AsyncFunction%")e=y1("async function () {}");else if(t==="%GeneratorFunction%")e=y1("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=y1("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&Ct&&(e=Ct(n.prototype))}return Ba[t]=e,e},"doEval"),JS={__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"]},$p=nf(),of=g1(),Jw=$p.call(Function.call,Array.prototype.concat),Kw=$p.call(Function.apply,Array.prototype.splice),KS=$p.call(Function.call,String.prototype.replace),af=$p.call(Function.call,String.prototype.slice),Qw=$p.call(Function.call,RegExp.prototype.exec),eE=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,tE=/\\(\\)?/g,rE=l(function(t){var e=af(t,0,1),i=af(t,-1);if(e==="%"&&i!=="%")throw new Ll("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ll("invalid intrinsic syntax, expected opening `%`");var n=[];return KS(t,eE,function(o,a,p,c){n[n.length]=p?KS(c,tE,"$1"):a||o}),n},"stringToPath"),iE=l(function(t,e){var i=t,n;if(of(JS,i)&&(n=JS[i],i="%"+n[0]+"%"),of(Ba,i)){var o=Ba[i];if(o===Ol&&(o=$w(i)),typeof o>"u"&&!e)throw new _l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Ll("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");e4.exports=l(function(t,e){if(typeof t!="string"||t.length===0)throw new _l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new _l('"allowMissing" argument must be a boolean');if(Qw(/^%?[^%]*%?$/,t)===null)throw new Ll("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=rE(t),n=i.length>0?i[0]:"",o=iE("%"+n+"%",e),a=o.name,p=o.value,c=!1,u=o.alias;u&&(n=u[0],Kw(i,Jw([0,1],u)));for(var h=1,m=!0;h<i.length;h+=1){var y=i[h],b=af(y,0,1),x=af(y,-1);if((b==='"'||b==="'"||b==="`"||x==='"'||x==="'"||x==="`")&&b!==x)throw new Ll("property names with quotes must have matching quotes");if((y==="constructor"||!m)&&(c=!0),n+="."+y,a="%"+n+"%",of(Ba,a))p=Ba[a];else if(p!=null){if(!(y in p)){if(!e)throw new _l("base intrinsic for "+t+" exists, but the property is not available.");return}if(Fa&&h+1>=i.length){var C=Fa(p,y);m=!!C,m&&"get"in C&&!("originalValue"in C.get)?p=C.get:p=p[y]}else m=of(p,y),p=p[y];m&&!c&&(Ba[a]=p)}}return p},"GetIntrinsic")});var lf=W((XZ,t4)=>{"use strict";g();var nE=ei(),sf=nE("%Object.defineProperty%",!0)||!1;if(sf)try{sf({},"a",{value:1})}catch{sf=!1}t4.exports=sf});var pf=W((YZ,r4)=>{"use strict";g();var oE=ei(),cf=oE("%Object.getOwnPropertyDescriptor%",!0);if(cf)try{cf([],"length")}catch{cf=null}r4.exports=cf});var uf=W(($Z,o4)=>{"use strict";g();var i4=lf(),aE=f1(),kl=Mn(),n4=pf();o4.exports=l(function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new kl("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new kl("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new kl("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new kl("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new kl("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new kl("`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=!!n4&&n4(t,e);if(i4)i4(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 aE("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var df=W((QZ,s4)=>{"use strict";g();var v1=lf(),a4=l(function(){return!!v1},"hasPropertyDescriptors");a4.hasArrayLengthDefineBug=l(function(){if(!v1)return null;try{return v1([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");s4.exports=a4});var To=W((rY,u4)=>{"use strict";g();var sE=tf(),lE=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",cE=Object.prototype.toString,pE=Array.prototype.concat,l4=uf(),uE=l(function(r){return typeof r=="function"&&cE.call(r)==="[object Function]"},"isFunction"),c4=df()(),dE=l(function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!uE(i)||!i())return}c4?l4(r,t,e,!0):l4(r,t,e)},"defineProperty"),p4=l(function(r,t){var e=arguments.length>2?arguments[2]:{},i=sE(t);lE&&(i=pE.call(i,Object.getOwnPropertySymbols(t)));for(var n=0;n<i.length;n+=1)dE(r,i[n],t[i[n]],e[i[n]])},"defineProperties");p4.supportsDescriptors=!!c4;u4.exports=p4});var g4=W((oY,m4)=>{"use strict";g();var hE=ei(),d4=uf(),fE=df()(),h4=pf(),f4=Mn(),mE=hE("%Math.floor%");m4.exports=l(function(t,e){if(typeof t!="function")throw new f4("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||mE(e)!==e)throw new f4("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&h4){var a=h4(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(fE?d4(t,"length",e,!0,!0):d4(t,"length",e)),t},"setFunctionLength")});var Ra=W((lY,hf)=>{"use strict";g();var x1=nf(),ff=ei(),gE=g4(),yE=Mn(),v4=ff("%Function.prototype.apply%"),x4=ff("%Function.prototype.call%"),C4=ff("%Reflect.apply%",!0)||x1.call(x4,v4),y4=lf(),bE=ff("%Math.max%");hf.exports=l(function(t){if(typeof t!="function")throw new yE("a function is required");var e=C4(x1,x4,arguments);return gE(e,1+bE(0,t.length-(arguments.length-1)),!0)},"callBind");var b4=l(function(){return C4(x1,v4,arguments)},"applyBind");y4?y4(hf.exports,"apply",{value:b4}):hf.exports.apply=b4});var yr=W((uY,M4)=>{"use strict";g();var S4=ei(),T4=Ra(),vE=T4(S4("String.prototype.indexOf"));M4.exports=l(function(t,e){var i=S4(t,!!e);return typeof i=="function"&&vE(t,".prototype.")>-1?T4(i):i},"callBoundIntrinsic")});var C1=W((fY,D4)=>{"use strict";g();var xE=tf(),w4=qp()(),E4=yr(),I4=Object,CE=E4("Array.prototype.push"),P4=E4("Object.prototype.propertyIsEnumerable"),SE=w4?Object.getOwnPropertySymbols:null;D4.exports=l(function(t,e){if(t==null)throw new TypeError("target must be an object");var i=I4(t);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=I4(arguments[n]),a=xE(o),p=w4&&(Object.getOwnPropertySymbols||SE);if(p)for(var c=p(o),u=0;u<c.length;++u){var h=c[u];P4(o,h)&&CE(a,h)}for(var m=0;m<a.length;++m){var y=a[m];if(P4(o,y)){var b=o[y];i[y]=b}}}return i},"assign")});var T1=W((yY,O4)=>{"use strict";g();var S1=C1(),TE=l(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"),ME=l(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");O4.exports=l(function(){return!Object.assign||TE()||ME()?S1:Object.assign},"getPolyfill")});var L4=W((xY,_4)=>{"use strict";g();var IE=To(),PE=T1();_4.exports=l(function(){var t=PE();return IE(Object,{assign:t},{assign:l(function(){return Object.assign!==t},"assign")}),t},"shimAssign")});var B4=W((TY,F4)=>{"use strict";g();var wE=To(),EE=Ra(),DE=C1(),k4=T1(),OE=L4(),_E=EE.apply(k4()),A4=l(function(t,e){return _E(Object,arguments)},"assign");wE(A4,{getPolyfill:k4,implementation:DE,shim:OE});F4.exports=A4});var N4=W((PY,R4)=>{"use strict";g();var Kp=l(function(){return typeof l(function(){},"f").name=="string"},"functionsHaveNames"),Jp=Object.getOwnPropertyDescriptor;if(Jp)try{Jp([],"length")}catch{Jp=null}Kp.functionsHaveConfigurableNames=l(function(){if(!Kp()||!Jp)return!1;var t=Jp(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var LE=Function.prototype.bind;Kp.boundFunctionsHaveNames=l(function(){return Kp()&&typeof LE=="function"&&l(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");R4.exports=Kp});var j4=W((DY,V4)=>{"use strict";g();var G4=uf(),kE=df()(),AE=N4().functionsHaveConfigurableNames(),FE=Mn();V4.exports=l(function(t,e){if(typeof t!="function")throw new FE("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||AE)&&(kE?G4(t,"name",e,!0,!0):G4(t,"name",e)),t},"setFunctionName")});var M1=W((LY,U4)=>{"use strict";g();var BE=j4(),RE=Mn(),NE=Object;U4.exports=BE(l(function(){if(this==null||this!==NE(this))throw new RE("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 I1=W((FY,H4)=>{"use strict";g();var GE=M1(),VE=To().supportsDescriptors,jE=Object.getOwnPropertyDescriptor;H4.exports=l(function(){if(VE&&/a/mig.flags==="gim"){var t=jE(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:l(function(){e+="d"},"get")}),Object.defineProperty(i,"sticky",{get:l(function(){e+="y"},"get")}),e==="dy")return t.get}}return GE},"getPolyfill")});var X4=W((NY,z4)=>{"use strict";g();var UE=To().supportsDescriptors,HE=I1(),WE=Object.getOwnPropertyDescriptor,zE=Object.defineProperty,XE=TypeError,W4=Object.getPrototypeOf,ZE=/a/;z4.exports=l(function(){if(!UE||!W4)throw new XE("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=HE(),e=W4(ZE),i=WE(e,"flags");return(!i||i.get!==t)&&zE(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var $4=W((jY,q4)=>{"use strict";g();var YE=To(),qE=Ra(),$E=M1(),Z4=I1(),JE=X4(),Y4=qE(Z4());YE(Y4,{getPolyfill:Z4,implementation:$E,shim:JE});q4.exports=Y4});var Mo=W((HY,J4)=>{"use strict";g();var KE=qp();J4.exports=l(function(){return KE()&&!!Symbol.toStringTag},"hasToStringTagShams")});var w1=W((XY,Q4)=>{"use strict";g();var QE=Mo()(),eD=yr(),P1=eD("Object.prototype.toString"),mf=l(function(t){return QE&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:P1(t)==="[object Arguments]"},"isArguments"),K4=l(function(t){return mf(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&P1(t)!=="[object Array]"&&P1(t.callee)==="[object Function]"},"isArguments"),tD=function(){return mf(arguments)}();mf.isLegacyArguments=K4;Q4.exports=tD?mf:K4});var e5=W(()=>{g()});var x5=W((KY,v5)=>{g();var R1=typeof Map=="function"&&Map.prototype,E1=Object.getOwnPropertyDescriptor&&R1?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,yf=R1&&E1&&typeof E1.get=="function"?E1.get:null,t5=R1&&Map.prototype.forEach,N1=typeof Set=="function"&&Set.prototype,D1=Object.getOwnPropertyDescriptor&&N1?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,bf=N1&&D1&&typeof D1.get=="function"?D1.get:null,r5=N1&&Set.prototype.forEach,rD=typeof WeakMap=="function"&&WeakMap.prototype,eu=rD?WeakMap.prototype.has:null,iD=typeof WeakSet=="function"&&WeakSet.prototype,tu=iD?WeakSet.prototype.has:null,nD=typeof WeakRef=="function"&&WeakRef.prototype,i5=nD?WeakRef.prototype.deref:null,oD=Boolean.prototype.valueOf,aD=Object.prototype.toString,sD=Function.prototype.toString,lD=String.prototype.match,G1=String.prototype.slice,Po=String.prototype.replace,cD=String.prototype.toUpperCase,n5=String.prototype.toLowerCase,h5=RegExp.prototype.test,o5=Array.prototype.concat,Ai=Array.prototype.join,pD=Array.prototype.slice,a5=Math.floor,L1=typeof BigInt=="function"?BigInt.prototype.valueOf:null,O1=Object.getOwnPropertySymbols,k1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Al=typeof Symbol=="function"&&typeof Symbol.iterator=="object",At=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Al||!0)?Symbol.toStringTag:null,f5=Object.prototype.propertyIsEnumerable,s5=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function l5(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||h5.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-a5(-r):a5(r);if(i!==r){var n=String(i),o=G1.call(t,n.length+1);return Po.call(n,e,"$&_")+"."+Po.call(Po.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Po.call(t,e,"$&_")}l(l5,"addNumericSeparator");var A1=e5(),c5=A1.custom,p5=g5(c5)?c5:null;v5.exports=l(function r(t,e,i,n){var o=e||{};if(Io(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Io(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=Io(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(Io(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(Io(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 b5(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return p?l5(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return p?l5(t,u):u}var h=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=h&&h>0&&typeof t=="object")return F1(t)?"[Array]":"[Object]";var m=ED(o,i);if(typeof n>"u")n=[];else if(y5(n,t)>=0)return"[Circular]";function y(z,U,te){if(U&&(n=pD.call(n),n.push(U)),te){var Z={depth:o.depth};return Io(o,"quoteStyle")&&(Z.quoteStyle=o.quoteStyle),r(z,Z,i+1,n)}return r(z,o,i+1,n)}if(l(y,"inspect"),typeof t=="function"&&!u5(t)){var b=vD(t),x=gf(t,y);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(x.length>0?" { "+Ai.call(x,", ")+" }":"")}if(g5(t)){var C=Al?Po.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):k1.call(t);return typeof t=="object"&&!Al?Qp(C):C}if(ID(t)){for(var v="<"+n5.call(String(t.nodeName)),S=t.attributes||[],I=0;I<S.length;I++)v+=" "+S[I].name+"="+m5(uD(S[I].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+n5.call(String(t.nodeName))+">",v}if(F1(t)){if(t.length===0)return"[]";var w=gf(t,y);return m&&!wD(w)?"["+B1(w,m)+"]":"[ "+Ai.call(w,", ")+" ]"}if(hD(t)){var E=gf(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!f5.call(t,"cause")?"{ ["+String(t)+"] "+Ai.call(o5.call("[cause]: "+y(t.cause),E),", ")+" }":E.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Ai.call(E,", ")+" }"}if(typeof t=="object"&&a){if(p5&&typeof t[p5]=="function"&&A1)return A1(t,{depth:h-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(xD(t)){var D=[];return t5&&t5.call(t,function(z,U){D.push(y(U,t,!0)+" => "+y(z,t))}),d5("Map",yf.call(t),D,m)}if(TD(t)){var R=[];return r5&&r5.call(t,function(z){R.push(y(z,t))}),d5("Set",bf.call(t),R,m)}if(CD(t))return _1("WeakMap");if(MD(t))return _1("WeakSet");if(SD(t))return _1("WeakRef");if(mD(t))return Qp(y(Number(t)));if(yD(t))return Qp(y(L1.call(t)));if(gD(t))return Qp(oD.call(t));if(fD(t))return Qp(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!dD(t)&&!u5(t)){var _=gf(t,y),F=s5?s5(t)===Object.prototype:t instanceof Object||t.constructor===Object,B=t instanceof Object?"":"null prototype",V=!F&&At&&Object(t)===t&&At in t?G1.call(wo(t),8,-1):B?"Object":"",N=F||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",X=N+(V||B?"["+Ai.call(o5.call([],V||[],B||[]),": ")+"] ":"");return _.length===0?X+"{}":m?X+"{"+B1(_,m)+"}":X+"{ "+Ai.call(_,", ")+" }"}return String(t)},"inspect_");function m5(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}l(m5,"wrapQuotes");function uD(r){return Po.call(String(r),/"/g,"&quot;")}l(uD,"quote");function F1(r){return wo(r)==="[object Array]"&&(!At||!(typeof r=="object"&&At in r))}l(F1,"isArray");function dD(r){return wo(r)==="[object Date]"&&(!At||!(typeof r=="object"&&At in r))}l(dD,"isDate");function u5(r){return wo(r)==="[object RegExp]"&&(!At||!(typeof r=="object"&&At in r))}l(u5,"isRegExp");function hD(r){return wo(r)==="[object Error]"&&(!At||!(typeof r=="object"&&At in r))}l(hD,"isError");function fD(r){return wo(r)==="[object String]"&&(!At||!(typeof r=="object"&&At in r))}l(fD,"isString");function mD(r){return wo(r)==="[object Number]"&&(!At||!(typeof r=="object"&&At in r))}l(mD,"isNumber");function gD(r){return wo(r)==="[object Boolean]"&&(!At||!(typeof r=="object"&&At in r))}l(gD,"isBoolean");function g5(r){if(Al)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!k1)return!1;try{return k1.call(r),!0}catch{}return!1}l(g5,"isSymbol");function yD(r){if(!r||typeof r!="object"||!L1)return!1;try{return L1.call(r),!0}catch{}return!1}l(yD,"isBigInt");var bD=Object.prototype.hasOwnProperty||function(r){return r in this};function Io(r,t){return bD.call(r,t)}l(Io,"has");function wo(r){return aD.call(r)}l(wo,"toStr");function vD(r){if(r.name)return r.name;var t=lD.call(sD.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}l(vD,"nameOf");function y5(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}l(y5,"indexOf");function xD(r){if(!yf||!r||typeof r!="object")return!1;try{yf.call(r);try{bf.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}l(xD,"isMap");function CD(r){if(!eu||!r||typeof r!="object")return!1;try{eu.call(r,eu);try{tu.call(r,tu)}catch{return!0}return r instanceof WeakMap}catch{}return!1}l(CD,"isWeakMap");function SD(r){if(!i5||!r||typeof r!="object")return!1;try{return i5.call(r),!0}catch{}return!1}l(SD,"isWeakRef");function TD(r){if(!bf||!r||typeof r!="object")return!1;try{bf.call(r);try{yf.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}l(TD,"isSet");function MD(r){if(!tu||!r||typeof r!="object")return!1;try{tu.call(r,tu);try{eu.call(r,eu)}catch{return!0}return r instanceof WeakSet}catch{}return!1}l(MD,"isWeakSet");function ID(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}l(ID,"isElement");function b5(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return b5(G1.call(r,0,t.maxStringLength),t)+i}var n=Po.call(Po.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,PD);return m5(n,"single",t)}l(b5,"inspectString");function PD(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":"")+cD.call(t.toString(16))}l(PD,"lowbyte");function Qp(r){return"Object("+r+")"}l(Qp,"markBoxed");function _1(r){return r+" { ? }"}l(_1,"weakCollectionOf");function d5(r,t,e,i){var n=i?B1(e,i):Ai.call(e,", ");return r+" ("+t+") {"+n+"}"}l(d5,"collectionOf");function wD(r){for(var t=0;t<r.length;t++)if(y5(r[t],"\n")>=0)return!1;return!0}l(wD,"singleLineValues");function ED(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=Ai.call(Array(r.indent+1)," ");else return null;return{base:e,prev:Ai.call(Array(t+1),e)}}l(ED,"getIndent");function B1(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+Ai.call(r,","+e)+"\n"+t.prev}l(B1,"indentedJoin");function gf(r,t){var e=F1(r),i=[];if(e){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=Io(r,n)?t(r[n],r):""}var o=typeof O1=="function"?O1(r):[],a;if(Al){a={};for(var p=0;p<o.length;p++)a["$"+o[p]]=o[p]}for(var c in r)Io(r,c)&&(e&&String(Number(c))===c&&c<r.length||Al&&a["$"+c]instanceof Symbol||(h5.call(/[^\w$]/,c)?i.push(t(c,r)+": "+t(r[c],r)):i.push(c+": "+t(r[c],r))));if(typeof O1=="function")for(var u=0;u<o.length;u++)f5.call(r,o[u])&&i.push("["+t(o[u])+"]: "+t(r[o[u]],r));return i}l(gf,"arrObjKeys")});var j1=W((tq,S5)=>{"use strict";g();var C5=ei(),Fl=yr(),DD=x5(),OD=Mn(),vf=C5("%WeakMap%",!0),xf=C5("%Map%",!0),_D=Fl("WeakMap.prototype.get",!0),LD=Fl("WeakMap.prototype.set",!0),kD=Fl("WeakMap.prototype.has",!0),AD=Fl("Map.prototype.get",!0),FD=Fl("Map.prototype.set",!0),BD=Fl("Map.prototype.has",!0),V1=l(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"),RD=l(function(r,t){var e=V1(r,t);return e&&e.value},"listGet"),ND=l(function(r,t,e){var i=V1(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},"listSet"),GD=l(function(r,t){return!!V1(r,t)},"listHas");S5.exports=l(function(){var t,e,i,n={assert:l(function(o){if(!n.has(o))throw new OD("Side channel does not contain "+DD(o))},"assert"),get:l(function(o){if(vf&&o&&(typeof o=="object"||typeof o=="function")){if(t)return _D(t,o)}else if(xf){if(e)return AD(e,o)}else if(i)return RD(i,o)},"get"),has:l(function(o){if(vf&&o&&(typeof o=="object"||typeof o=="function")){if(t)return kD(t,o)}else if(xf){if(e)return BD(e,o)}else if(i)return GD(i,o);return!1},"has"),set:l(function(o,a){vf&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new vf),LD(t,o,a)):xf?(e||(e=new xf),FD(e,o,a)):(i||(i={key:{},next:null}),ND(i,o,a))},"set")};return n},"getSideChannel")});var M5=W((nq,T5)=>{"use strict";g();var VD=g1(),ru=j1()(),In=Mn(),U1={assert:l(function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new In("`O` is not an object");if(typeof t!="string")throw new In("`slot` must be a string");if(ru.assert(r),!U1.has(r,t))throw new In("`"+t+"` is not present on `O`")},"assert"),get:l(function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new In("`O` is not an object");if(typeof t!="string")throw new In("`slot` must be a string");var e=ru.get(r);return e&&e["$"+t]},"get"),has:l(function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new In("`O` is not an object");if(typeof t!="string")throw new In("`slot` must be a string");var e=ru.get(r);return!!e&&VD(e,"$"+t)},"has"),set:l(function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new In("`O` is not an object");if(typeof t!="string")throw new In("`slot` must be a string");var i=ru.get(r);i||(i={},ru.set(r,i)),i["$"+t]=e},"set")};Object.freeze&&Object.freeze(U1);T5.exports=U1});var w5=W((sq,P5)=>{"use strict";g();var iu=M5(),jD=SyntaxError,I5=typeof StopIteration=="object"?StopIteration:null;P5.exports=l(function(t){if(!I5)throw new jD("this environment lacks StopIteration");iu.set(t,"[[Done]]",!1);var e={next:l(function(){var n=iu.get(this,"[[Iterator]]"),o=iu.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(iu.set(n,"[[Done]]",!0),a!==I5)throw a;return{done:!0,value:void 0}}},"next")};return iu.set(e,"[[Iterator]]",t),e},"getStopIterationIterator")});var H1=W((pq,E5)=>{g();var UD={}.toString;E5.exports=Array.isArray||function(r){return UD.call(r)=="[object Array]"}});var W1=W((dq,D5)=>{"use strict";g();var HD=String.prototype.valueOf,WD=l(function(t){try{return HD.call(t),!0}catch{return!1}},"tryStringObject"),zD=Object.prototype.toString,XD="[object String]",ZD=Mo()();D5.exports=l(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:ZD?WD(t):zD.call(t)===XD},"isString")});var X1=W((mq,L5)=>{"use strict";g();var z1=typeof Map=="function"&&Map.prototype?Map:null,YD=typeof Set=="function"&&Set.prototype?Set:null,Cf;z1||(Cf=l(function(t){return!1},"isMap"));var _5=z1?Map.prototype.has:null,O5=YD?Set.prototype.has:null;!Cf&&!_5&&(Cf=l(function(t){return!1},"isMap"));L5.exports=Cf||l(function(t){if(!t||typeof t!="object")return!1;try{if(_5.call(t),O5)try{O5.call(t)}catch{return!0}return t instanceof z1}catch{}return!1},"isMap")});var Y1=W((bq,F5)=>{"use strict";g();var qD=typeof Map=="function"&&Map.prototype?Map:null,Z1=typeof Set=="function"&&Set.prototype?Set:null,Sf;Z1||(Sf=l(function(t){return!1},"isSet"));var k5=qD?Map.prototype.has:null,A5=Z1?Set.prototype.has:null;!Sf&&!A5&&(Sf=l(function(t){return!1},"isSet"));F5.exports=Sf||l(function(t){if(!t||typeof t!="object")return!1;try{if(A5.call(t),k5)try{k5.call(t)}catch{return!0}return t instanceof Z1}catch{}return!1},"isSet")});var Z5=W((Cq,If)=>{"use strict";g();var B5=w1(),R5=w5();rf()()||qp()()?(Tf=Symbol.iterator,If.exports=l(function(t){if(t!=null&&typeof t[Tf]<"u")return t[Tf]();if(B5(t))return Array.prototype[Tf].call(t)},"getIterator")):(N5=H1(),G5=W1(),q1=ei(),V5=q1("%Map%",!0),j5=q1("%Set%",!0),Lr=yr(),$1=Lr("Array.prototype.push"),J1=Lr("String.prototype.charCodeAt"),U5=Lr("String.prototype.slice"),H5=l(function(t,e){var i=t.length;if(e+1>=i)return e+1;var n=J1(t,e);if(n<55296||n>56319)return e+1;var o=J1(t,e+1);return o<56320||o>57343?e+1:e+2},"advanceStringIndex"),Mf=l(function(t){var e=0;return{next:l(function(){var n=e>=t.length,o;return n||(o=t[e],e+=1),{done:n,value:o}},"next")}},"getArrayIterator"),K1=l(function(t,e){if(N5(t)||B5(t))return Mf(t);if(G5(t)){var i=0;return{next:l(function(){var o=H5(t,i),a=U5(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"),!V5&&!j5?If.exports=l(function(t){if(t!=null)return K1(t,!0)},"getIterator"):(W5=X1(),z5=Y1(),Q1=Lr("Map.prototype.forEach",!0),eb=Lr("Set.prototype.forEach",!0),(typeof M>"u"||!M.versions||!M.versions.node)&&(tb=Lr("Map.prototype.iterator",!0),rb=Lr("Set.prototype.iterator",!0)),ib=Lr("Map.prototype.@@iterator",!0)||Lr("Map.prototype._es6-shim iterator_",!0),nb=Lr("Set.prototype.@@iterator",!0)||Lr("Set.prototype._es6-shim iterator_",!0),X5=l(function(t){if(W5(t)){if(tb)return R5(tb(t));if(ib)return ib(t);if(Q1){var e=[];return Q1(t,function(n,o){$1(e,[o,n])}),Mf(e)}}if(z5(t)){if(rb)return R5(rb(t));if(nb)return nb(t);if(eb){var i=[];return eb(t,function(n){$1(i,n)}),Mf(i)}}},"getCollectionIterator"),If.exports=l(function(t){return X5(t)||K1(t)},"getIterator")));var Tf,N5,G5,q1,V5,j5,Lr,$1,J1,U5,H5,Mf,K1,W5,z5,Q1,eb,tb,rb,ib,nb,X5});var ob=W((Mq,q5)=>{"use strict";g();var Y5=l(function(r){return r!==r},"numberIsNaN");q5.exports=l(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||Y5(t)&&Y5(e))},"is")});var ab=W((wq,$5)=>{"use strict";g();var $D=ob();$5.exports=l(function(){return typeof Object.is=="function"?Object.is:$D},"getPolyfill")});var K5=W((Oq,J5)=>{"use strict";g();var JD=ab(),KD=To();J5.exports=l(function(){var t=JD();return KD(Object,{is:t},{is:l(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var rT=W((kq,tT)=>{"use strict";g();var QD=To(),eO=Ra(),tO=ob(),Q5=ab(),rO=K5(),eT=eO(Q5(),Object);QD(eT,{getPolyfill:Q5,implementation:tO,shim:rO});tT.exports=eT});var lb=W((Fq,aT)=>{"use strict";g();var iO=Ra(),oT=yr(),nO=ei(),sb=nO("%ArrayBuffer%",!0),Pf=oT("ArrayBuffer.prototype.byteLength",!0),oO=oT("Object.prototype.toString"),iT=!!sb&&!Pf&&new sb(0).slice,nT=!!iT&&iO(iT);aT.exports=l(Pf||nT?function(t){if(!t||typeof t!="object")return!1;try{return Pf?Pf(t):nT(t,0),!0}catch{return!1}}:sb?function(t){return oO(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var lT=W((Nq,sT)=>{"use strict";g();var aO=Date.prototype.getDay,sO=l(function(t){try{return aO.call(t),!0}catch{return!1}},"tryDateGetDayCall"),lO=Object.prototype.toString,cO="[object Date]",pO=Mo()();sT.exports=l(function(t){return typeof t!="object"||t===null?!1:pO?sO(t):lO.call(t)===cO},"isDateObject")});var hT=W((jq,dT)=>{"use strict";g();var cb=yr(),cT=Mo()(),pT,uT,pb,ub;cT&&(pT=cb("Object.prototype.hasOwnProperty"),uT=cb("RegExp.prototype.exec"),pb={},wf=l(function(){throw pb},"throwRegexMarker"),ub={toString:wf,valueOf:wf},typeof Symbol.toPrimitive=="symbol"&&(ub[Symbol.toPrimitive]=wf));var wf,uO=cb("Object.prototype.toString"),dO=Object.getOwnPropertyDescriptor,hO="[object RegExp]";dT.exports=l(cT?function(t){if(!t||typeof t!="object")return!1;var e=dO(t,"lastIndex"),i=e&&pT(e,"value");if(!i)return!1;try{uT(t,ub)}catch(n){return n===pb}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:uO(t)===hO},"isRegex")});var gT=W((Wq,mT)=>{"use strict";g();var fO=yr(),fT=fO("SharedArrayBuffer.prototype.byteLength",!0);mT.exports=l(fT?function(t){if(!t||typeof t!="object")return!1;try{return fT(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var bT=W((Zq,yT)=>{"use strict";g();var mO=Number.prototype.toString,gO=l(function(t){try{return mO.call(t),!0}catch{return!1}},"tryNumberObject"),yO=Object.prototype.toString,bO="[object Number]",vO=Mo()();yT.exports=l(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:vO?gO(t):yO.call(t)===bO},"isNumberObject")});var CT=W(($q,xT)=>{"use strict";g();var vT=yr(),xO=vT("Boolean.prototype.toString"),CO=vT("Object.prototype.toString"),SO=l(function(t){try{return xO(t),!0}catch{return!1}},"booleanBrandCheck"),TO="[object Boolean]",MO=Mo()();xT.exports=l(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:MO&&Symbol.toStringTag in t?SO(t):CO(t)===TO},"isBoolean")});var IT=W((Qq,db)=>{"use strict";g();var IO=Object.prototype.toString,PO=rf()();PO?(ST=Symbol.prototype.toString,TT=/^Symbol\(.*\)$/,MT=l(function(t){return typeof t.valueOf()!="symbol"?!1:TT.test(ST.call(t))},"isRealSymbolObject"),db.exports=l(function(t){if(typeof t=="symbol")return!0;if(IO.call(t)!=="[object Symbol]")return!1;try{return MT(t)}catch{return!1}},"isSymbol")):db.exports=l(function(t){return!1},"isSymbol");var ST,TT,MT});var ET=W((r$,wT)=>{"use strict";g();var PT=typeof BigInt<"u"&&BigInt;wT.exports=l(function(){return typeof PT=="function"&&typeof BigInt=="function"&&typeof PT(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var _T=W((o$,hb)=>{"use strict";g();var wO=ET()();wO?(DT=BigInt.prototype.valueOf,OT=l(function(t){try{return DT.call(t),!0}catch{}return!1},"tryBigIntObject"),hb.exports=l(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:OT(t)},"isBigInt")):hb.exports=l(function(t){return!1},"isBigInt");var DT,OT});var kT=W((l$,LT)=>{"use strict";g();var EO=W1(),DO=bT(),OO=CT(),_O=IT(),LO=_T();LT.exports=l(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(EO(t))return"String";if(DO(t))return"Number";if(OO(t))return"Boolean";if(_O(t))return"Symbol";if(LO(t))return"BigInt"},"whichBoxedPrimitive")});var BT=W((u$,FT)=>{"use strict";g();var Ef=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,AT=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Df;Ef||(Df=l(function(t){return!1},"isWeakMap"));var mb=Ef?Ef.prototype.has:null,fb=AT?AT.prototype.has:null;!Df&&!mb&&(Df=l(function(t){return!1},"isWeakMap"));FT.exports=Df||l(function(t){if(!t||typeof t!="object")return!1;try{if(mb.call(t,mb),fb)try{fb.call(t,fb)}catch{return!0}return t instanceof Ef}catch{}return!1},"isWeakMap")});var NT=W((f$,yb)=>{"use strict";g();var kO=ei(),RT=yr(),AO=kO("%WeakSet%",!0),gb=RT("WeakSet.prototype.has",!0);gb?(Of=RT("WeakMap.prototype.has",!0),yb.exports=l(function(t){if(!t||typeof t!="object")return!1;try{if(gb(t,gb),Of)try{Of(t,Of)}catch{return!0}return t instanceof AO}catch{}return!1},"isWeakSet")):yb.exports=l(function(t){return!1},"isWeakSet");var Of});var VT=W((y$,GT)=>{"use strict";g();var FO=X1(),BO=Y1(),RO=BT(),NO=NT();GT.exports=l(function(t){if(t&&typeof t=="object"){if(FO(t))return"Map";if(BO(t))return"Set";if(RO(t))return"WeakMap";if(NO(t))return"WeakSet"}return!1},"whichCollection")});var WT=W((x$,HT)=>{"use strict";g();var UT=Function.prototype.toString,Bl=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,vb,_f;if(typeof Bl=="function"&&typeof Object.defineProperty=="function")try{vb=Object.defineProperty({},"length",{get:l(function(){throw _f},"get")}),_f={},Bl(function(){throw 42},null,vb)}catch(r){r!==_f&&(Bl=null)}else Bl=null;var GO=/^\s*class\b/,xb=l(function(t){try{var e=UT.call(t);return GO.test(e)}catch{return!1}},"isES6ClassFunction"),bb=l(function(t){try{return xb(t)?!1:(UT.call(t),!0)}catch{return!1}},"tryFunctionToStr"),Lf=Object.prototype.toString,VO="[object Object]",jO="[object Function]",UO="[object GeneratorFunction]",HO="[object HTMLAllCollection]",WO="[object HTML document.all class]",zO="[object HTMLCollection]",XO=typeof Symbol=="function"&&!!Symbol.toStringTag,ZO=!(0 in[,]),Cb=l(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(jT=document.all,Lf.call(jT)===Lf.call(document.all)&&(Cb=l(function(t){if((ZO||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=Lf.call(t);return(e===HO||e===WO||e===zO||e===VO)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var jT;HT.exports=l(Bl?function(t){if(Cb(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Bl(t,null,vb)}catch(e){if(e!==_f)return!1}return!xb(t)&&bb(t)}:function(t){if(Cb(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(XO)return bb(t);if(xb(t))return!1;var e=Lf.call(t);return e!==jO&&e!==UO&&!/^\[object HTML/.test(e)?!1:bb(t)},"isCallable")});var ZT=W((T$,XT)=>{"use strict";g();var YO=WT(),qO=Object.prototype.toString,zT=Object.prototype.hasOwnProperty,$O=l(function(t,e,i){for(var n=0,o=t.length;n<o;n++)zT.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},"forEachArray"),JO=l(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"),KO=l(function(t,e,i){for(var n in t)zT.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},"forEachObject"),QO=l(function(t,e,i){if(!YO(e))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),qO.call(t)==="[object Array]"?$O(t,e,n):typeof t=="string"?JO(t,e,n):KO(t,e,n)},"forEach");XT.exports=QO});var qT=W((P$,YT)=>{"use strict";g();YT.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var JT=W((E$,$T)=>{"use strict";g();var Sb=qT(),e_=typeof globalThis>"u"?global:globalThis;$T.exports=l(function(){for(var t=[],e=0;e<Sb.length;e++)typeof e_[Sb[e]]=="function"&&(t[t.length]=Sb[e]);return t},"availableTypedArrays")});var rM=W((_$,tM)=>{"use strict";g();var Af=ZT(),t_=JT(),KT=Ra(),Ib=yr(),kf=pf(),r_=Ib("Object.prototype.toString"),eM=Mo()(),QT=typeof globalThis>"u"?global:globalThis,Mb=t_(),Pb=Ib("String.prototype.slice"),Tb=Object.getPrototypeOf,i_=Ib("Array.prototype.indexOf",!0)||l(function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},"indexOf"),Ff={__proto__:null};eM&&kf&&Tb?Af(Mb,function(r){var t=new QT[r];if(Symbol.toStringTag in t){var e=Tb(t),i=kf(e,Symbol.toStringTag);if(!i){var n=Tb(e);i=kf(n,Symbol.toStringTag)}Ff["$"+r]=KT(i.get)}}):Af(Mb,function(r){var t=new QT[r],e=t.slice||t.set;e&&(Ff["$"+r]=KT(e))});var n_=l(function(t){var e=!1;return Af(Ff,function(i,n){if(!e)try{"$"+i(t)===n&&(e=Pb(n,1))}catch{}}),e},"tryAllTypedArrays"),o_=l(function(t){var e=!1;return Af(Ff,function(i,n){if(!e)try{i(t),e=Pb(n,1)}catch{}}),e},"tryAllSlices");tM.exports=l(function(t){if(!t||typeof t!="object")return!1;if(!eM){var e=Pb(r_(t),8,-1);return i_(Mb,e)>-1?e:e!=="Object"?!1:o_(t)}return kf?n_(t):null},"whichTypedArray")});var oM=W((A$,nM)=>{"use strict";g();var a_=yr(),iM=a_("ArrayBuffer.prototype.byteLength",!0),s_=lb();nM.exports=l(function(t){return s_(t)?iM?iM(t):t.byteLength:NaN},"byteLength")});var OM=W((R$,DM)=>{"use strict";g();var PM=B4(),Fi=yr(),aM=$4(),l_=ei(),Rl=Z5(),c_=j1(),sM=rT(),lM=w1(),cM=H1(),pM=lb(),uM=lT(),dM=hT(),hM=gT(),fM=tf(),mM=kT(),gM=VT(),yM=rM(),bM=oM(),vM=Fi("SharedArrayBuffer.prototype.byteLength",!0),xM=Fi("Date.prototype.getTime"),wb=Object.getPrototypeOf,CM=Fi("Object.prototype.toString"),Rf=l_("%Set%",!0),Eb=Fi("Map.prototype.has",!0),Nf=Fi("Map.prototype.get",!0),SM=Fi("Map.prototype.size",!0),Gf=Fi("Set.prototype.add",!0),wM=Fi("Set.prototype.delete",!0),Vf=Fi("Set.prototype.has",!0),Bf=Fi("Set.prototype.size",!0);function TM(r,t,e,i){for(var n=Rl(r),o;(o=n.next())&&!o.done;)if(ti(t,o.value,e,i))return wM(r,o.value),!0;return!1}l(TM,"setHasEqualElement");function EM(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}l(EM,"findLooseMatchingPrimitives");function p_(r,t,e,i,n,o){var a=EM(e);if(a!=null)return a;var p=Nf(t,a),c=PM({},n,{strict:!1});return typeof p>"u"&&!Eb(t,a)||!ti(i,p,c,o)?!1:!Eb(r,a)&&ti(i,p,c,o)}l(p_,"mapMightHaveLoosePrim");function u_(r,t,e){var i=EM(e);return i!=null?i:Vf(t,i)&&!Vf(r,i)}l(u_,"setMightHaveLoosePrim");function MM(r,t,e,i,n,o){for(var a=Rl(r),p,c;(p=a.next())&&!p.done;)if(c=p.value,ti(e,c,n,o)&&ti(i,Nf(t,c),n,o))return wM(r,c),!0;return!1}l(MM,"mapHasEqualEntry");function ti(r,t,e,i){var n=e||{};if(n.strict?sM(r,t):r===t)return!0;var o=mM(r),a=mM(t);if(o!==a)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return n.strict?sM(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),f_(r,t,n,i)}l(ti,"internalDeepEqual");function IM(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))}l(IM,"isBuffer");function d_(r,t,e,i){if(Bf(r)!==Bf(t))return!1;for(var n=Rl(r),o=Rl(t),a,p,c;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new Rf),Gf(c,a.value);else if(!Vf(t,a.value)){if(e.strict||!u_(r,t,a.value))return!1;c||(c=new Rf),Gf(c,a.value)}if(c){for(;(p=o.next())&&!p.done;)if(p.value&&typeof p.value=="object"){if(!TM(c,p.value,e.strict,i))return!1}else if(!e.strict&&!Vf(r,p.value)&&!TM(c,p.value,e.strict,i))return!1;return Bf(c)===0}return!0}l(d_,"setEquiv");function h_(r,t,e,i){if(SM(r)!==SM(t))return!1;for(var n=Rl(r),o=Rl(t),a,p,c,u,h,m;(a=n.next())&&!a.done;)if(u=a.value[0],h=a.value[1],u&&typeof u=="object")c||(c=new Rf),Gf(c,u);else if(m=Nf(t,u),typeof m>"u"&&!Eb(t,u)||!ti(h,m,e,i)){if(e.strict||!p_(r,t,u,h,e,i))return!1;c||(c=new Rf),Gf(c,u)}if(c){for(;(p=o.next())&&!p.done;)if(u=p.value[0],m=p.value[1],u&&typeof u=="object"){if(!MM(c,r,u,m,e,i))return!1}else if(!e.strict&&(!r.has(u)||!ti(Nf(r,u),m,e,i))&&!MM(c,r,u,m,PM({},e,{strict:!1}),i))return!1;return Bf(c)===0}return!0}l(h_,"mapEquiv");function f_(r,t,e,i){var n,o;if(typeof r!=typeof t||r==null||t==null||CM(r)!==CM(t)||lM(r)!==lM(t))return!1;var a=cM(r),p=cM(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 h=dM(r),m=dM(t);if(h!==m||(h||m)&&(r.source!==t.source||aM(r)!==aM(t)))return!1;var y=uM(r),b=uM(t);if(y!==b||(y||b)&&xM(r)!==xM(t)||e.strict&&wb&&wb(r)!==wb(t))return!1;var x=yM(r),C=yM(t);if(x!==C)return!1;if(x||C){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=IM(r),S=IM(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 I=pM(r),w=pM(t);if(I!==w)return!1;if(I||w)return bM(r)!==bM(t)?!1:typeof Uint8Array=="function"&&ti(new Uint8Array(r),new Uint8Array(t),e,i);var E=hM(r),D=hM(t);if(E!==D)return!1;if(E||D)return vM(r)!==vM(t)?!1:typeof Uint8Array=="function"&&ti(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var R=fM(r),_=fM(t);if(R.length!==_.length)return!1;for(R.sort(),_.sort(),n=R.length-1;n>=0;n--)if(R[n]!=_[n])return!1;for(n=R.length-1;n>=0;n--)if(o=R[n],!ti(r[o],t[o],e,i))return!1;var F=gM(r),B=gM(t);return F!==B?!1:F==="Set"||B==="Set"?d_(r,t,e,i):F==="Map"?h_(r,t,e,i):!0}l(f_,"objEquiv");DM.exports=l(function(t,e,i){return ti(t,e,i,c_())},"deepEqual")});var XM=W(Oe=>{"use strict";g();Object.defineProperty(Oe,"__esModule",{value:!0});function m_(r){return r&&r.__esModule?r:{default:r}}l(m_,"_interopRequireDefault");var g_=Object.defineProperty,ke=l((r,t)=>g_(r,"name",{value:t,configurable:!0}),"__name"),y_=OM(),b_=m_(y_),Nl,_M=(Nl=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||!nu(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=Db(t),n=Db(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(!nu(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 nu(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?b_.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return nu(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)}},l(Nl,"_GeojsonEquality"),Nl);ke(_M,"GeojsonEquality");var v_=_M;function nu(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}l(nu,"sameLength");ke(nu,"sameLength");function Db(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}l(Db,"explode");ke(Db,"explode");var nr=63710088e-1,_b={centimeters:nr*100,centimetres:nr*100,degrees:360/(2*Math.PI),feet:nr*3.28084,inches:nr*39.37,kilometers:nr/1e3,kilometres:nr/1e3,meters:nr,metres:nr,miles:nr/1609.344,millimeters:nr*1e3,millimetres:nr*1e3,nauticalmiles:nr/1852,radians:1,yards:nr*1.0936},Ob={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 Pn(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}l(Pn,"feature");ke(Pn,"feature");function LM(r,t,e={}){switch(r){case"Point":return jf(t).geometry;case"LineString":return Hf(t).geometry;case"Polygon":return Uf(t).geometry;case"MultiPoint":return kb(t).geometry;case"MultiLineString":return Lb(t).geometry;case"MultiPolygon":return Ab(t).geometry;default:throw new Error(r+" is invalid")}}l(LM,"geometry");ke(LM,"geometry");function jf(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(!ou(r[0])||!ou(r[1]))throw new Error("coordinates must contain numbers");return Pn({type:"Point",coordinates:r},t,e)}l(jf,"point");ke(jf,"point");function kM(r,t,e={}){return au(r.map(i=>jf(i,t)),e)}l(kM,"points");ke(kM,"points");function Uf(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 Pn({type:"Polygon",coordinates:r},t,e)}l(Uf,"polygon");ke(Uf,"polygon");function AM(r,t,e={}){return au(r.map(i=>Uf(i,t)),e)}l(AM,"polygons");ke(AM,"polygons");function Hf(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Pn({type:"LineString",coordinates:r},t,e)}l(Hf,"lineString");ke(Hf,"lineString");function FM(r,t,e={}){return au(r.map(i=>Hf(i,t)),e)}l(FM,"lineStrings");ke(FM,"lineStrings");function au(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}l(au,"featureCollection");ke(au,"featureCollection");function Lb(r,t,e={}){return Pn({type:"MultiLineString",coordinates:r},t,e)}l(Lb,"multiLineString");ke(Lb,"multiLineString");function kb(r,t,e={}){return Pn({type:"MultiPoint",coordinates:r},t,e)}l(kb,"multiPoint");ke(kb,"multiPoint");function Ab(r,t,e={}){return Pn({type:"MultiPolygon",coordinates:r},t,e)}l(Ab,"multiPolygon");ke(Ab,"multiPolygon");function BM(r,t,e={}){return Pn({type:"GeometryCollection",geometries:r},t,e)}l(BM,"geometryCollection");ke(BM,"geometryCollection");function RM(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}l(RM,"round");ke(RM,"round");function Fb(r,t="kilometers"){let e=_b[t];if(!e)throw new Error(t+" units is invalid");return r*e}l(Fb,"radiansToLength");ke(Fb,"radiansToLength");function Wf(r,t="kilometers"){let e=_b[t];if(!e)throw new Error(t+" units is invalid");return r/e}l(Wf,"lengthToRadians");ke(Wf,"lengthToRadians");function NM(r,t){return Bb(Wf(r,t))}l(NM,"lengthToDegrees");ke(NM,"lengthToDegrees");function GM(r){let t=r%360;return t<0&&(t+=360),t}l(GM,"bearingToAzimuth");ke(GM,"bearingToAzimuth");function Bb(r){return r%(2*Math.PI)*180/Math.PI}l(Bb,"radiansToDegrees");ke(Bb,"radiansToDegrees");function VM(r){return r%360*Math.PI/180}l(VM,"degreesToRadians");ke(VM,"degreesToRadians");function jM(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Fb(Wf(r,t),e)}l(jM,"convertLength");ke(jM,"convertLength");function UM(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=Ob[t];if(!i)throw new Error("invalid original units");let n=Ob[e];if(!n)throw new Error("invalid final units");return r/i*n}l(UM,"convertArea");ke(UM,"convertArea");function ou(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}l(ou,"isNumber");ke(ou,"isNumber");function HM(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}l(HM,"isObject");ke(HM,"isObject");function WM(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(!ou(t))throw new Error("bbox must only contain numbers")})}l(WM,"validateBBox");ke(WM,"validateBBox");function zM(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")}l(zM,"validateId");ke(zM,"validateId");Oe.GeojsonEquality=v_;Oe.areaFactors=Ob;Oe.bearingToAzimuth=GM;Oe.convertArea=UM;Oe.convertLength=jM;Oe.degreesToRadians=VM;Oe.earthRadius=nr;Oe.factors=_b;Oe.feature=Pn;Oe.featureCollection=au;Oe.geometry=LM;Oe.geometryCollection=BM;Oe.isNumber=ou;Oe.isObject=HM;Oe.lengthToDegrees=NM;Oe.lengthToRadians=Wf;Oe.lineString=Hf;Oe.lineStrings=FM;Oe.multiLineString=Lb;Oe.multiPoint=kb;Oe.multiPolygon=Ab;Oe.point=jf;Oe.points=kM;Oe.polygon=Uf;Oe.polygons=AM;Oe.radiansToDegrees=Bb;Oe.radiansToLength=Fb;Oe.round=RM;Oe.validateBBox=WM;Oe.validateId=zM});var iI=W(ht=>{"use strict";g();Object.defineProperty(ht,"__esModule",{value:!0});var x_=Object.defineProperty,It=l((r,t)=>x_(r,"name",{value:t,configurable:!0}),"__name"),Ft=XM();function Gl(r,t,e){if(r!==null)for(var i,n,o,a,p,c,u,h=0,m=0,y,b=r.type,x=b==="FeatureCollection",C=b==="Feature",v=x?r.features.length:1,S=0;S<v;S++){u=x?r.features[S].geometry:C?r.geometry:r,y=u?u.type==="GeometryCollection":!1,p=y?u.geometries.length:1;for(var I=0;I<p;I++){var w=0,E=0;if(a=y?u.geometries[I]:u,a!==null){c=a.coordinates;var D=a.type;switch(h=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(c,m,S,w,E)===!1)return!1;m++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],m,S,w,E)===!1)return!1;m++,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-h;n++){if(t(c[i][n],m,S,w,E)===!1)return!1;m++}D==="MultiLineString"&&w++,D==="Polygon"&&E++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(E=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-h;o++){if(t(c[i][n][o],m,S,w,E)===!1)return!1;m++}E++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Gl(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(Gl,"coordEach");It(Gl,"coordEach");function ZM(r,t,e,i){var n=e;return Gl(r,function(o,a,p,c,u){a===0&&e===void 0?n=o:n=t(n,o,a,p,c,u)},i),n}l(ZM,"coordReduce");It(ZM,"coordReduce");function Rb(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}}l(Rb,"propEach");It(Rb,"propEach");function YM(r,t,e){var i=e;return Rb(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}l(YM,"propReduce");It(YM,"propReduce");function Nb(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}l(Nb,"featureEach");It(Nb,"featureEach");function qM(r,t,e){var i=e;return Nb(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}l(qM,"featureReduce");It(qM,"featureReduce");function $M(r){var t=[];return Gl(r,function(e){t.push(e)}),t}l($M,"coordAll");It($M,"coordAll");function zf(r,t){var e,i,n,o,a,p,c,u,h,m,y=0,b=r.type==="FeatureCollection",x=r.type==="Feature",C=b?r.features.length:1;for(e=0;e<C;e++){for(p=b?r.features[e].geometry:x?r.geometry:r,u=b?r.features[e].properties:x?r.properties:{},h=b?r.features[e].bbox:x?r.bbox:void 0,m=b?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,y,u,h,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,y,u,h,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],y,u,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}l(zf,"geomEach");It(zf,"geomEach");function JM(r,t,e){var i=e;return zf(r,function(n,o,a,p,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,p,c)}),i}l(JM,"geomReduce");It(JM,"geomReduce");function su(r,t){zf(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(Ft.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 h=e.coordinates[u],m={type:c,coordinates:h};if(t(Ft.feature.call(void 0,m,n),i,u)===!1)return!1}})}l(su,"flattenEach");It(su,"flattenEach");function KM(r,t,e){var i=e;return su(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}l(KM,"flattenReduce");It(KM,"flattenReduce");function Gb(r,t){su(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,h=0;if(Gl(e,function(m,y,b,x,C){if(p===void 0||i>c||x>u||C>h){p=m,c=i,u=x,h=C,o=0;return}var v=Ft.lineString.call(void 0,[p,m],e.properties);if(t(v,i,n,C,o)===!1)return!1;o++,p=m})===!1)return!1}}})}l(Gb,"segmentEach");It(Gb,"segmentEach");function QM(r,t,e){var i=e,n=!1;return Gb(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}l(QM,"segmentReduce");It(QM,"segmentReduce");function Vb(r,t){if(!r)throw new Error("geojson is required");su(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(Ft.lineString.call(void 0,a[p],e.properties),i,n,p)===!1)return!1;break}}})}l(Vb,"lineEach");It(Vb,"lineEach");function eI(r,t,e){var i=e;return Vb(r,function(n,o,a,p){o===0&&e===void 0?i=n:i=t(i,n,o,a,p)}),i}l(eI,"lineReduce");It(eI,"lineReduce");function tI(r,t){if(t=t||{},!Ft.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,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),Ft.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),Ft.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),Ft.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),Ft.lineString.call(void 0,[c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}l(tI,"findSegment");It(tI,"findSegment");function rI(r,t){if(t=t||{},!Ft.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,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 Ft.point.call(void 0,c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),Ft.point.call(void 0,c[i],a,t);case"LineString":return o<0&&(o=c.length+o),Ft.point.call(void 0,c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),Ft.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),Ft.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),Ft.point.call(void 0,c[i][n][o],a,t)}throw new Error("geojson is invalid")}l(rI,"findPoint");It(rI,"findPoint");ht.coordAll=$M;ht.coordEach=Gl;ht.coordReduce=ZM;ht.featureEach=Nb;ht.featureReduce=qM;ht.findPoint=rI;ht.findSegment=tI;ht.flattenEach=su;ht.flattenReduce=KM;ht.geomEach=zf;ht.geomReduce=JM;ht.lineEach=Vb;ht.lineReduce=eI;ht.propEach=Rb;ht.propReduce=YM;ht.segmentEach=Gb;ht.segmentReduce=QM});var nI=W(Xf=>{"use strict";g();Object.defineProperty(Xf,"__esModule",{value:!0});var C_=Object.defineProperty,S_=l((r,t)=>C_(r,"name",{value:t,configurable:!0}),"__name"),T_=iI();function jb(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return T_.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}l(jb,"bbox");S_(jb,"bbox");var M_=jb;Xf.bbox=jb;Xf.default=M_});var cI=W((J$,Ub)=>{g();var Bi=iS(),aI=c1(),sI=hS(),Vl=nI().default,I_=sI.featureEach,q$=sI.coordEach,$$=aI.polygon,oI=aI.featureCollection;function lI(r){var t=new Bi(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Vl(e),Bi.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:Vl(n),i.push(n)}):I_(e,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Vl(n),i.push(n)}),Bi.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:Vl(e),Bi.prototype.remove.call(this,e,i)},t.clear=function(){return Bi.prototype.clear.call(this)},t.search=function(e){var i=Bi.prototype.search.call(this,this.toBBox(e));return oI(i)},t.collides=function(e){return Bi.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Bi.prototype.all.call(this);return oI(e)},t.toJSON=function(){return Bi.prototype.toJSON.call(this)},t.fromJSON=function(e){return Bi.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=Vl(e);else if(e.type==="FeatureCollection")i=Vl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}l(lI,"geojsonRbush");Ub.exports=lI;Ub.exports.default=lI});var U0=W((Tu,ec)=>{g();var jL=200,ZI="__lodash_hash_undefined__",UL=800,HL=16,YI=9007199254740991,qI="[object Arguments]",WL="[object Array]",zL="[object AsyncFunction]",XL="[object Boolean]",ZL="[object Date]",YL="[object Error]",$I="[object Function]",qL="[object GeneratorFunction]",$L="[object Map]",JL="[object Number]",KL="[object Null]",JI="[object Object]",QL="[object Proxy]",ek="[object RegExp]",tk="[object Set]",rk="[object String]",ik="[object Undefined]",nk="[object WeakMap]",ok="[object ArrayBuffer]",ak="[object DataView]",sk="[object Float32Array]",lk="[object Float64Array]",ck="[object Int8Array]",pk="[object Int16Array]",uk="[object Int32Array]",dk="[object Uint8Array]",hk="[object Uint8ClampedArray]",fk="[object Uint16Array]",mk="[object Uint32Array]",gk=/[\\^$.*+?()[\]{}|]/g,yk=/^\[object .+?Constructor\]$/,bk=/^(?:0|[1-9]\d*)$/,Ve={};Ve[sk]=Ve[lk]=Ve[ck]=Ve[pk]=Ve[uk]=Ve[dk]=Ve[hk]=Ve[fk]=Ve[mk]=!0;Ve[qI]=Ve[WL]=Ve[ok]=Ve[XL]=Ve[ak]=Ve[ZL]=Ve[YL]=Ve[$I]=Ve[$L]=Ve[JL]=Ve[JI]=Ve[ek]=Ve[tk]=Ve[rk]=Ve[nk]=!1;var KI=typeof global=="object"&&global&&global.Object===Object&&global,vk=typeof self=="object"&&self&&self.Object===Object&&self,Pu=KI||vk||Function("return this")(),QI=typeof Tu=="object"&&Tu&&!Tu.nodeType&&Tu,Mu=QI&&typeof ec=="object"&&ec&&!ec.nodeType&&ec,e7=Mu&&Mu.exports===QI,L0=e7&&KI.process,NI=function(){try{var r=Mu&&Mu.require&&Mu.require("util").types;return r||L0&&L0.binding&&L0.binding("util")}catch{}}(),GI=NI&&NI.isTypedArray;function xk(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}l(xk,"apply");function Ck(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}l(Ck,"baseTimes");function Sk(r){return function(t){return r(t)}}l(Sk,"baseUnary");function Tk(r,t){return r==null?void 0:r[t]}l(Tk,"getValue");function Mk(r,t){return function(e){return r(t(e))}}l(Mk,"overArg");var Ik=Array.prototype,Pk=Function.prototype,um=Object.prototype,k0=Pu["__core-js_shared__"],dm=Pk.toString,_n=um.hasOwnProperty,VI=function(){var r=/[^.]+$/.exec(k0&&k0.keys&&k0.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),t7=um.toString,wk=dm.call(Object),Ek=RegExp("^"+dm.call(_n).replace(gk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cm=e7?Pu.Buffer:void 0,jI=Pu.Symbol,UI=Pu.Uint8Array,HI=cm?cm.allocUnsafe:void 0,r7=Mk(Object.getPrototypeOf,Object),WI=Object.create,Dk=um.propertyIsEnumerable,Ok=Ik.splice,rs=jI?jI.toStringTag:void 0,pm=function(){try{var r=G0(Object,"defineProperty");return r({},"",{}),r}catch{}}(),_k=cm?cm.isBuffer:void 0,zI=Math.max,Lk=Date.now,i7=G0(Pu,"Map"),Iu=G0(Object,"create"),kk=function(){function r(){}return l(r,"object"),function(t){if(!ns(t))return{};if(WI)return WI(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function is(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}l(is,"Hash");function Ak(){this.__data__=Iu?Iu(null):{},this.size=0}l(Ak,"hashClear");function Fk(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}l(Fk,"hashDelete");function Bk(r){var t=this.__data__;if(Iu){var e=t[r];return e===ZI?void 0:e}return _n.call(t,r)?t[r]:void 0}l(Bk,"hashGet");function Rk(r){var t=this.__data__;return Iu?t[r]!==void 0:_n.call(t,r)}l(Rk,"hashHas");function Nk(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Iu&&t===void 0?ZI:t,this}l(Nk,"hashSet");is.prototype.clear=Ak;is.prototype.delete=Fk;is.prototype.get=Bk;is.prototype.has=Rk;is.prototype.set=Nk;function Ln(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}l(Ln,"ListCache");function Gk(){this.__data__=[],this.size=0}l(Gk,"listCacheClear");function Vk(r){var t=this.__data__,e=hm(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():Ok.call(t,e,1),--this.size,!0}l(Vk,"listCacheDelete");function jk(r){var t=this.__data__,e=hm(t,r);return e<0?void 0:t[e][1]}l(jk,"listCacheGet");function Uk(r){return hm(this.__data__,r)>-1}l(Uk,"listCacheHas");function Hk(r,t){var e=this.__data__,i=hm(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}l(Hk,"listCacheSet");Ln.prototype.clear=Gk;Ln.prototype.delete=Vk;Ln.prototype.get=jk;Ln.prototype.has=Uk;Ln.prototype.set=Hk;function tc(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}l(tc,"MapCache");function Wk(){this.size=0,this.__data__={hash:new is,map:new(i7||Ln),string:new is}}l(Wk,"mapCacheClear");function zk(r){var t=mm(this,r).delete(r);return this.size-=t?1:0,t}l(zk,"mapCacheDelete");function Xk(r){return mm(this,r).get(r)}l(Xk,"mapCacheGet");function Zk(r){return mm(this,r).has(r)}l(Zk,"mapCacheHas");function Yk(r,t){var e=mm(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}l(Yk,"mapCacheSet");tc.prototype.clear=Wk;tc.prototype.delete=zk;tc.prototype.get=Xk;tc.prototype.has=Zk;tc.prototype.set=Yk;function rc(r){var t=this.__data__=new Ln(r);this.size=t.size}l(rc,"Stack");function qk(){this.__data__=new Ln,this.size=0}l(qk,"stackClear");function $k(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}l($k,"stackDelete");function Jk(r){return this.__data__.get(r)}l(Jk,"stackGet");function Kk(r){return this.__data__.has(r)}l(Kk,"stackHas");function Qk(r,t){var e=this.__data__;if(e instanceof Ln){var i=e.__data__;if(!i7||i.length<jL-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new tc(i)}return e.set(r,t),this.size=e.size,this}l(Qk,"stackSet");rc.prototype.clear=qk;rc.prototype.delete=$k;rc.prototype.get=Jk;rc.prototype.has=Kk;rc.prototype.set=Qk;function eA(r,t){var e=R0(r),i=!e&&B0(r),n=!e&&!i&&s7(r),o=!e&&!i&&!n&&c7(r),a=e||i||n||o,p=a?Ck(r.length,String):[],c=p.length;for(var u in r)(t||_n.call(r,u))&&!(a&&(u=="length"||n&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||o7(u,c)))&&p.push(u);return p}l(eA,"arrayLikeKeys");function A0(r,t,e){(e!==void 0&&!gm(r[t],e)||e===void 0&&!(t in r))&&N0(r,t,e)}l(A0,"assignMergeValue");function tA(r,t,e){var i=r[t];(!(_n.call(r,t)&&gm(i,e))||e===void 0&&!(t in r))&&N0(r,t,e)}l(tA,"assignValue");function hm(r,t){for(var e=r.length;e--;)if(gm(r[e][0],t))return e;return-1}l(hm,"assocIndexOf");function N0(r,t,e){t=="__proto__"&&pm?pm(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}l(N0,"baseAssignValue");var rA=mA();function fm(r){return r==null?r===void 0?ik:KL:rs&&rs in Object(r)?gA(r):SA(r)}l(fm,"baseGetTag");function XI(r){return wu(r)&&fm(r)==qI}l(XI,"baseIsArguments");function iA(r){if(!ns(r)||xA(r))return!1;var t=j0(r)?Ek:yk;return t.test(PA(r))}l(iA,"baseIsNative");function nA(r){return wu(r)&&l7(r.length)&&!!Ve[fm(r)]}l(nA,"baseIsTypedArray");function oA(r){if(!ns(r))return CA(r);var t=a7(r),e=[];for(var i in r)i=="constructor"&&(t||!_n.call(r,i))||e.push(i);return e}l(oA,"baseKeysIn");function n7(r,t,e,i,n){r!==t&&rA(t,function(o,a){if(n||(n=new rc),ns(o))aA(r,t,a,e,n7,i,n);else{var p=i?i(F0(r,a),o,a+"",r,t,n):void 0;p===void 0&&(p=o),A0(r,a,p)}},p7)}l(n7,"baseMerge");function aA(r,t,e,i,n,o,a){var p=F0(r,e),c=F0(t,e),u=a.get(c);if(u){A0(r,e,u);return}var h=o?o(p,c,e+"",r,t,a):void 0,m=h===void 0;if(m){var y=R0(c),b=!y&&s7(c),x=!y&&!b&&c7(c);h=c,y||b||x?R0(p)?h=p:wA(p)?h=dA(p):b?(m=!1,h=cA(c,!0)):x?(m=!1,h=uA(c,!0)):h=[]:EA(c)||B0(c)?(h=p,B0(p)?h=DA(p):(!ns(p)||j0(p))&&(h=yA(c))):m=!1}m&&(a.set(c,h),n(h,c,i,o,a),a.delete(c)),A0(r,e,h)}l(aA,"baseMergeDeep");function sA(r,t){return MA(TA(r,t,u7),r+"")}l(sA,"baseRest");var lA=pm?function(r,t){return pm(r,"toString",{configurable:!0,enumerable:!1,value:_A(t),writable:!0})}:u7;function cA(r,t){if(t)return r.slice();var e=r.length,i=HI?HI(e):new r.constructor(e);return r.copy(i),i}l(cA,"cloneBuffer");function pA(r){var t=new r.constructor(r.byteLength);return new UI(t).set(new UI(r)),t}l(pA,"cloneArrayBuffer");function uA(r,t){var e=t?pA(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}l(uA,"cloneTypedArray");function dA(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}l(dA,"copyArray");function hA(r,t,e,i){var n=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var p=t[o],c=i?i(e[p],r[p],p,e,r):void 0;c===void 0&&(c=r[p]),n?N0(e,p,c):tA(e,p,c)}return e}l(hA,"copyObject");function fA(r){return sA(function(t,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&bA(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var p=e[i];p&&r(t,p,i,o)}return t})}l(fA,"createAssigner");function mA(r){return function(t,e,i){for(var n=-1,o=Object(t),a=i(t),p=a.length;p--;){var c=a[r?p:++n];if(e(o[c],c,o)===!1)break}return t}}l(mA,"createBaseFor");function mm(r,t){var e=r.__data__;return vA(t)?e[typeof t=="string"?"string":"hash"]:e.map}l(mm,"getMapData");function G0(r,t){var e=Tk(r,t);return iA(e)?e:void 0}l(G0,"getNative");function gA(r){var t=_n.call(r,rs),e=r[rs];try{r[rs]=void 0;var i=!0}catch{}var n=t7.call(r);return i&&(t?r[rs]=e:delete r[rs]),n}l(gA,"getRawTag");function yA(r){return typeof r.constructor=="function"&&!a7(r)?kk(r7(r)):{}}l(yA,"initCloneObject");function o7(r,t){var e=typeof r;return t=t==null?YI:t,!!t&&(e=="number"||e!="symbol"&&bk.test(r))&&r>-1&&r%1==0&&r<t}l(o7,"isIndex");function bA(r,t,e){if(!ns(e))return!1;var i=typeof t;return(i=="number"?V0(e)&&o7(t,e.length):i=="string"&&t in e)?gm(e[t],r):!1}l(bA,"isIterateeCall");function vA(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}l(vA,"isKeyable");function xA(r){return!!VI&&VI in r}l(xA,"isMasked");function a7(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||um;return r===e}l(a7,"isPrototype");function CA(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}l(CA,"nativeKeysIn");function SA(r){return t7.call(r)}l(SA,"objectToString");function TA(r,t,e){return t=zI(t===void 0?r.length-1:t,0),function(){for(var i=arguments,n=-1,o=zI(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var p=Array(t+1);++n<t;)p[n]=i[n];return p[t]=e(a),xk(r,this,p)}}l(TA,"overRest");function F0(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}l(F0,"safeGet");var MA=IA(lA);function IA(r){var t=0,e=0;return function(){var i=Lk(),n=HL-(i-e);if(e=i,n>0){if(++t>=UL)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}l(IA,"shortOut");function PA(r){if(r!=null){try{return dm.call(r)}catch{}try{return r+""}catch{}}return""}l(PA,"toSource");function gm(r,t){return r===t||r!==r&&t!==t}l(gm,"eq");var B0=XI(function(){return arguments}())?XI:function(r){return wu(r)&&_n.call(r,"callee")&&!Dk.call(r,"callee")},R0=Array.isArray;function V0(r){return r!=null&&l7(r.length)&&!j0(r)}l(V0,"isArrayLike");function wA(r){return wu(r)&&V0(r)}l(wA,"isArrayLikeObject");var s7=_k||LA;function j0(r){if(!ns(r))return!1;var t=fm(r);return t==$I||t==qL||t==zL||t==QL}l(j0,"isFunction");function l7(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=YI}l(l7,"isLength");function ns(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}l(ns,"isObject");function wu(r){return r!=null&&typeof r=="object"}l(wu,"isObjectLike");function EA(r){if(!wu(r)||fm(r)!=JI)return!1;var t=r7(r);if(t===null)return!0;var e=_n.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&dm.call(e)==wk}l(EA,"isPlainObject");var c7=GI?Sk(GI):nA;function DA(r){return hA(r,p7(r))}l(DA,"toPlainObject");function p7(r){return V0(r)?eA(r,!0):oA(r)}l(p7,"keysIn");var OA=fA(function(r,t,e){n7(r,t,e)});function _A(r){return function(){return r}}l(_A,"constant");function u7(r){return r}l(u7,"identity");function LA(){return!1}l(LA,"stubFalse");ec.exports=OA});var iv=W((Ou,nc)=>{g();var aF=200,L7="__lodash_hash_undefined__",sF=800,lF=16,k7=9007199254740991,A7="[object Arguments]",cF="[object Array]",pF="[object AsyncFunction]",uF="[object Boolean]",dF="[object Date]",hF="[object Error]",F7="[object Function]",fF="[object GeneratorFunction]",mF="[object Map]",gF="[object Number]",yF="[object Null]",B7="[object Object]",bF="[object Proxy]",vF="[object RegExp]",xF="[object Set]",CF="[object String]",SF="[object Undefined]",TF="[object WeakMap]",MF="[object ArrayBuffer]",IF="[object DataView]",PF="[object Float32Array]",wF="[object Float64Array]",EF="[object Int8Array]",DF="[object Int16Array]",OF="[object Int32Array]",_F="[object Uint8Array]",LF="[object Uint8ClampedArray]",kF="[object Uint16Array]",AF="[object Uint32Array]",FF=/[\\^$.*+?()[\]{}|]/g,BF=/^\[object .+?Constructor\]$/,RF=/^(?:0|[1-9]\d*)$/,je={};je[PF]=je[wF]=je[EF]=je[DF]=je[OF]=je[_F]=je[LF]=je[kF]=je[AF]=!0;je[A7]=je[cF]=je[MF]=je[uF]=je[IF]=je[dF]=je[hF]=je[F7]=je[mF]=je[gF]=je[B7]=je[vF]=je[xF]=je[CF]=je[TF]=!1;var R7=typeof global=="object"&&global&&global.Object===Object&&global,NF=typeof self=="object"&&self&&self.Object===Object&&self,ku=R7||NF||Function("return this")(),N7=typeof Ou=="object"&&Ou&&!Ou.nodeType&&Ou,_u=N7&&typeof nc=="object"&&nc&&!nc.nodeType&&nc,G7=_u&&_u.exports===N7,X0=G7&&R7.process,T7=function(){try{var r=_u&&_u.require&&_u.require("util").types;return r||X0&&X0.binding&&X0.binding("util")}catch{}}(),M7=T7&&T7.isTypedArray;function V7(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}l(V7,"apply");function GF(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}l(GF,"baseTimes");function VF(r){return function(t){return r(t)}}l(VF,"baseUnary");function jF(r,t){return r==null?void 0:r[t]}l(jF,"getValue");function UF(r,t){return function(e){return r(t(e))}}l(UF,"overArg");var HF=Array.prototype,WF=Function.prototype,Cm=Object.prototype,Z0=ku["__core-js_shared__"],Sm=WF.toString,Fn=Cm.hasOwnProperty,I7=function(){var r=/[^.]+$/.exec(Z0&&Z0.keys&&Z0.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),j7=Cm.toString,zF=Sm.call(Object),XF=RegExp("^"+Sm.call(Fn).replace(FF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vm=G7?ku.Buffer:void 0,P7=ku.Symbol,w7=ku.Uint8Array,E7=vm?vm.allocUnsafe:void 0,U7=UF(Object.getPrototypeOf,Object),D7=Object.create,ZF=Cm.propertyIsEnumerable,YF=HF.splice,as=P7?P7.toStringTag:void 0,xm=function(){try{var r=ev(Object,"defineProperty");return r({},"",{}),r}catch{}}(),qF=vm?vm.isBuffer:void 0,O7=Math.max,$F=Date.now,H7=ev(ku,"Map"),Lu=ev(Object,"create"),JF=function(){function r(){}return l(r,"object"),function(t){if(!An(t))return{};if(D7)return D7(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function ss(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}l(ss,"Hash");function KF(){this.__data__=Lu?Lu(null):{},this.size=0}l(KF,"hashClear");function QF(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}l(QF,"hashDelete");function eB(r){var t=this.__data__;if(Lu){var e=t[r];return e===L7?void 0:e}return Fn.call(t,r)?t[r]:void 0}l(eB,"hashGet");function tB(r){var t=this.__data__;return Lu?t[r]!==void 0:Fn.call(t,r)}l(tB,"hashHas");function rB(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Lu&&t===void 0?L7:t,this}l(rB,"hashSet");ss.prototype.clear=KF;ss.prototype.delete=QF;ss.prototype.get=eB;ss.prototype.has=tB;ss.prototype.set=rB;function Bn(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}l(Bn,"ListCache");function iB(){this.__data__=[],this.size=0}l(iB,"listCacheClear");function nB(r){var t=this.__data__,e=Tm(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():YF.call(t,e,1),--this.size,!0}l(nB,"listCacheDelete");function oB(r){var t=this.__data__,e=Tm(t,r);return e<0?void 0:t[e][1]}l(oB,"listCacheGet");function aB(r){return Tm(this.__data__,r)>-1}l(aB,"listCacheHas");function sB(r,t){var e=this.__data__,i=Tm(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}l(sB,"listCacheSet");Bn.prototype.clear=iB;Bn.prototype.delete=nB;Bn.prototype.get=oB;Bn.prototype.has=aB;Bn.prototype.set=sB;function oc(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}l(oc,"MapCache");function lB(){this.size=0,this.__data__={hash:new ss,map:new(H7||Bn),string:new ss}}l(lB,"mapCacheClear");function cB(r){var t=Im(this,r).delete(r);return this.size-=t?1:0,t}l(cB,"mapCacheDelete");function pB(r){return Im(this,r).get(r)}l(pB,"mapCacheGet");function uB(r){return Im(this,r).has(r)}l(uB,"mapCacheHas");function dB(r,t){var e=Im(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}l(dB,"mapCacheSet");oc.prototype.clear=lB;oc.prototype.delete=cB;oc.prototype.get=pB;oc.prototype.has=uB;oc.prototype.set=dB;function ac(r){var t=this.__data__=new Bn(r);this.size=t.size}l(ac,"Stack");function hB(){this.__data__=new Bn,this.size=0}l(hB,"stackClear");function fB(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}l(fB,"stackDelete");function mB(r){return this.__data__.get(r)}l(mB,"stackGet");function gB(r){return this.__data__.has(r)}l(gB,"stackHas");function yB(r,t){var e=this.__data__;if(e instanceof Bn){var i=e.__data__;if(!H7||i.length<aF-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new oc(i)}return e.set(r,t),this.size=e.size,this}l(yB,"stackSet");ac.prototype.clear=hB;ac.prototype.delete=fB;ac.prototype.get=mB;ac.prototype.has=gB;ac.prototype.set=yB;function bB(r,t){var e=J0(r),i=!e&&$0(r),n=!e&&!i&&Y7(r),o=!e&&!i&&!n&&$7(r),a=e||i||n||o,p=a?GF(r.length,String):[],c=p.length;for(var u in r)(t||Fn.call(r,u))&&!(a&&(u=="length"||n&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||X7(u,c)))&&p.push(u);return p}l(bB,"arrayLikeKeys");function Y0(r,t,e){(e!==void 0&&!Pm(r[t],e)||e===void 0&&!(t in r))&&K0(r,t,e)}l(Y0,"assignMergeValue");function vB(r,t,e){var i=r[t];(!(Fn.call(r,t)&&Pm(i,e))||e===void 0&&!(t in r))&&K0(r,t,e)}l(vB,"assignValue");function Tm(r,t){for(var e=r.length;e--;)if(Pm(r[e][0],t))return e;return-1}l(Tm,"assocIndexOf");function K0(r,t,e){t=="__proto__"&&xm?xm(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}l(K0,"baseAssignValue");var xB=LB();function Mm(r){return r==null?r===void 0?SF:yF:as&&as in Object(r)?kB(r):GB(r)}l(Mm,"baseGetTag");function _7(r){return Au(r)&&Mm(r)==A7}l(_7,"baseIsArguments");function CB(r){if(!An(r)||RB(r))return!1;var t=rv(r)?XF:BF;return t.test(HB(r))}l(CB,"baseIsNative");function SB(r){return Au(r)&&q7(r.length)&&!!je[Mm(r)]}l(SB,"baseIsTypedArray");function TB(r){if(!An(r))return NB(r);var t=Z7(r),e=[];for(var i in r)i=="constructor"&&(t||!Fn.call(r,i))||e.push(i);return e}l(TB,"baseKeysIn");function Q0(r,t,e,i,n){r!==t&&xB(t,function(o,a){if(n||(n=new ac),An(o))MB(r,t,a,e,Q0,i,n);else{var p=i?i(q0(r,a),o,a+"",r,t,n):void 0;p===void 0&&(p=o),Y0(r,a,p)}},J7)}l(Q0,"baseMerge");function MB(r,t,e,i,n,o,a){var p=q0(r,e),c=q0(t,e),u=a.get(c);if(u){Y0(r,e,u);return}var h=o?o(p,c,e+"",r,t,a):void 0,m=h===void 0;if(m){var y=J0(c),b=!y&&Y7(c),x=!y&&!b&&$7(c);h=c,y||b||x?J0(p)?h=p:WB(p)?h=DB(p):b?(m=!1,h=PB(c,!0)):x?(m=!1,h=EB(c,!0)):h=[]:zB(c)||$0(c)?(h=p,$0(p)?h=XB(p):(!An(p)||rv(p))&&(h=AB(c))):m=!1}m&&(a.set(c,h),n(h,c,i,o,a),a.delete(c)),Y0(r,e,h)}l(MB,"baseMergeDeep");function W7(r,t){return jB(VB(r,t,K7),r+"")}l(W7,"baseRest");var IB=xm?function(r,t){return xm(r,"toString",{configurable:!0,enumerable:!1,value:qB(t),writable:!0})}:K7;function PB(r,t){if(t)return r.slice();var e=r.length,i=E7?E7(e):new r.constructor(e);return r.copy(i),i}l(PB,"cloneBuffer");function wB(r){var t=new r.constructor(r.byteLength);return new w7(t).set(new w7(r)),t}l(wB,"cloneArrayBuffer");function EB(r,t){var e=t?wB(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}l(EB,"cloneTypedArray");function DB(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}l(DB,"copyArray");function OB(r,t,e,i){var n=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var p=t[o],c=i?i(e[p],r[p],p,e,r):void 0;c===void 0&&(c=r[p]),n?K0(e,p,c):vB(e,p,c)}return e}l(OB,"copyObject");function _B(r){return W7(function(t,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&FB(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var p=e[i];p&&r(t,p,i,o)}return t})}l(_B,"createAssigner");function LB(r){return function(t,e,i){for(var n=-1,o=Object(t),a=i(t),p=a.length;p--;){var c=a[r?p:++n];if(e(o[c],c,o)===!1)break}return t}}l(LB,"createBaseFor");function z7(r,t,e,i,n,o){return An(r)&&An(t)&&(o.set(t,r),Q0(r,t,void 0,z7,o),o.delete(t)),r}l(z7,"customDefaultsMerge");function Im(r,t){var e=r.__data__;return BB(t)?e[typeof t=="string"?"string":"hash"]:e.map}l(Im,"getMapData");function ev(r,t){var e=jF(r,t);return CB(e)?e:void 0}l(ev,"getNative");function kB(r){var t=Fn.call(r,as),e=r[as];try{r[as]=void 0;var i=!0}catch{}var n=j7.call(r);return i&&(t?r[as]=e:delete r[as]),n}l(kB,"getRawTag");function AB(r){return typeof r.constructor=="function"&&!Z7(r)?JF(U7(r)):{}}l(AB,"initCloneObject");function X7(r,t){var e=typeof r;return t=t==null?k7:t,!!t&&(e=="number"||e!="symbol"&&RF.test(r))&&r>-1&&r%1==0&&r<t}l(X7,"isIndex");function FB(r,t,e){if(!An(e))return!1;var i=typeof t;return(i=="number"?tv(e)&&X7(t,e.length):i=="string"&&t in e)?Pm(e[t],r):!1}l(FB,"isIterateeCall");function BB(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}l(BB,"isKeyable");function RB(r){return!!I7&&I7 in r}l(RB,"isMasked");function Z7(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Cm;return r===e}l(Z7,"isPrototype");function NB(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}l(NB,"nativeKeysIn");function GB(r){return j7.call(r)}l(GB,"objectToString");function VB(r,t,e){return t=O7(t===void 0?r.length-1:t,0),function(){for(var i=arguments,n=-1,o=O7(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var p=Array(t+1);++n<t;)p[n]=i[n];return p[t]=e(a),V7(r,this,p)}}l(VB,"overRest");function q0(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}l(q0,"safeGet");var jB=UB(IB);function UB(r){var t=0,e=0;return function(){var i=$F(),n=lF-(i-e);if(e=i,n>0){if(++t>=sF)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}l(UB,"shortOut");function HB(r){if(r!=null){try{return Sm.call(r)}catch{}try{return r+""}catch{}}return""}l(HB,"toSource");function Pm(r,t){return r===t||r!==r&&t!==t}l(Pm,"eq");var $0=_7(function(){return arguments}())?_7:function(r){return Au(r)&&Fn.call(r,"callee")&&!ZF.call(r,"callee")},J0=Array.isArray;function tv(r){return r!=null&&q7(r.length)&&!rv(r)}l(tv,"isArrayLike");function WB(r){return Au(r)&&tv(r)}l(WB,"isArrayLikeObject");var Y7=qF||$B;function rv(r){if(!An(r))return!1;var t=Mm(r);return t==F7||t==fF||t==pF||t==bF}l(rv,"isFunction");function q7(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=k7}l(q7,"isLength");function An(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}l(An,"isObject");function Au(r){return r!=null&&typeof r=="object"}l(Au,"isObjectLike");function zB(r){if(!Au(r)||Mm(r)!=B7)return!1;var t=U7(r);if(t===null)return!0;var e=Fn.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Sm.call(e)==zF}l(zB,"isPlainObject");var $7=M7?VF(M7):SB;function XB(r){return OB(r,J7(r))}l(XB,"toPlainObject");var ZB=W7(function(r){return r.push(void 0,z7),V7(YB,void 0,r)});function J7(r){return tv(r)?bB(r,!0):TB(r)}l(J7,"keysIn");var YB=_B(function(r,t,e,i){Q0(r,t,e,i)});function qB(r){return function(){return r}}l(qB,"constant");function K7(r){return r}l(K7,"identity");function $B(){return!1}l($B,"stubFalse");nc.exports=ZB});var jP=W((Dte,ju)=>{"use strict";g();var fR=!1,us=!1,AP=!0,FP=!1,f={},BP=!1;typeof ju<"u"&&ju.exports?(ju.exports=f,BP=!0):typeof document<"u"?window.ClipperLib=f:self.ClipperLib=f;var Nm;BP?(mt="chrome",Nm="Netscape"):(mt=navigator.userAgent.toString().toLowerCase(),Nm=navigator.appName);var mt,xe={};mt.indexOf("chrome")!=-1&&mt.indexOf("chromium")==-1?xe.chrome=1:xe.chrome=0;mt.indexOf("chromium")!=-1?xe.chromium=1:xe.chromium=0;mt.indexOf("safari")!=-1&&mt.indexOf("chrome")==-1&&mt.indexOf("chromium")==-1?xe.safari=1:xe.safari=0;mt.indexOf("firefox")!=-1?xe.firefox=1:xe.firefox=0;mt.indexOf("firefox/17")!=-1?xe.firefox17=1:xe.firefox17=0;mt.indexOf("firefox/15")!=-1?xe.firefox15=1:xe.firefox15=0;mt.indexOf("firefox/3")!=-1?xe.firefox3=1:xe.firefox3=0;mt.indexOf("opera")!=-1?xe.opera=1:xe.opera=0;mt.indexOf("msie 10")!=-1?xe.msie10=1:xe.msie10=0;mt.indexOf("msie 9")!=-1?xe.msie9=1:xe.msie9=0;mt.indexOf("msie 8")!=-1?xe.msie8=1:xe.msie8=0;mt.indexOf("msie 7")!=-1?xe.msie7=1:xe.msie7=0;mt.indexOf("msie ")!=-1?xe.msie=1:xe.msie=0;f.biginteger_used=null;var Fo,mR=0xdeadbeefcafe,LP=(mR&16777215)==15715070;function j(r,t,e){f.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}l(j,"BigInteger");function Ie(){return new j(null)}l(Ie,"nbi");function gR(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}l(gR,"am1");function yR(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,h=p*c+u*a;c=a*c+((h&32767)<<15)+e[i]+(n&1073741823),n=(c>>>30)+(h>>>15)+p*u+(n>>>30),e[i++]=c&1073741823}return n}l(yR,"am2");function bR(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,h=p*c+u*a;c=a*c+((h&16383)<<14)+e[i]+n,n=(c>>28)+(h>>14)+p*u,e[i++]=c&268435455}return n}l(bR,"am3");LP&&Nm=="Microsoft Internet Explorer"?(j.prototype.am=yR,Fo=30):LP&&Nm!="Netscape"?(j.prototype.am=gR,Fo=26):(j.prototype.am=bR,Fo=28);j.prototype.DB=Fo;j.prototype.DM=(1<<Fo)-1;j.prototype.DV=1<<Fo;var Ev=52;j.prototype.FV=Math.pow(2,Ev);j.prototype.F1=Ev-Fo;j.prototype.F2=2*Fo-Ev;var vR="0123456789abcdefghijklmnopqrstuvwxyz",Vm=new Array,uc,Fr;uc=48;for(Fr=0;Fr<=9;++Fr)Vm[uc++]=Fr;uc=97;for(Fr=10;Fr<36;++Fr)Vm[uc++]=Fr;uc=65;for(Fr=10;Fr<36;++Fr)Vm[uc++]=Fr;function kP(r){return vR.charAt(r)}l(kP,"int2char");function RP(r,t){var e=Vm[r.charCodeAt(t)];return e==null?-1:e}l(RP,"intAt");function xR(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}l(xR,"bnpCopyTo");function CR(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}l(CR,"bnpFromInt");function Ao(r){var t=Ie();return t.fromInt(r),t}l(Ao,"nbv");function SR(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:RP(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)!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&j.ZERO.subTo(this,this)}l(SR,"bnpFromString");function TR(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}l(TR,"bnpClamp");function MR(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=kP(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+=kP(i));return n?o:"0"}l(MR,"bnToString");function IR(){var r=Ie();return j.ZERO.subTo(this,r),r}l(IR,"bnNegate");function PR(){return this.s<0?this.negate():this}l(PR,"bnAbs");function wR(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}l(wR,"bnCompareTo");function jm(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}l(jm,"nbits");function ER(){return this.t<=0?0:this.DB*(this.t-1)+jm(this[this.t-1]^this.s&this.DM)}l(ER,"bnBitLength");function DR(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}l(DR,"bnpDLShiftTo");function OR(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}l(OR,"bnpDRShiftTo");function _R(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()}l(_R,"bnpLShiftTo");function LR(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()}l(LR,"bnpRShiftTo");function kR(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()}l(kR,"bnpSubTo");function AR(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&&j.ZERO.subTo(t,t)}l(AR,"bnpMultiplyTo");function FR(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()}l(FR,"bnpSquareTo");function BR(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=Ie());var o=Ie(),a=this.s,p=r.s,c=this.DB-jm(i[i.t-1]);c>0?(i.lShiftTo(c,o),n.lShiftTo(c,e)):(i.copyTo(o),n.copyTo(e));var u=o.t,h=o[u-1];if(h!=0){var m=h*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),y=this.FV/m,b=(1<<this.F1)/m,x=1<<this.F2,C=e.t,v=C-u,S=t==null?Ie():t;for(o.dlShiftTo(v,S),e.compareTo(S)>=0&&(e[e.t++]=1,e.subTo(S,e)),j.ONE.dlShiftTo(u,S),S.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--v>=0;){var I=e[--C]==h?this.DM:Math.floor(e[C]*y+(e[C-1]+x)*b);if((e[C]+=o.am(0,I,e,v,0,u))<I)for(o.dlShiftTo(v,S),e.subTo(S,e);e[C]<--I;)e.subTo(S,e)}t!=null&&(e.drShiftTo(u,t),a!=p&&j.ZERO.subTo(t,t)),e.t=u,e.clamp(),c>0&&e.rShiftTo(c,e),a<0&&j.ZERO.subTo(e,e)}}}l(BR,"bnpDivRemTo");function RR(r){var t=Ie();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(j.ZERO)>0&&r.subTo(t,t),t}l(RR,"bnMod");function ds(r){this.m=r}l(ds,"Classic");function NR(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}l(NR,"cConvert");function GR(r){return r}l(GR,"cRevert");function VR(r){r.divRemTo(this.m,null,r)}l(VR,"cReduce");function jR(r,t,e){r.multiplyTo(t,e),this.reduce(e)}l(jR,"cMulTo");function UR(r,t){r.squareTo(t),this.reduce(t)}l(UR,"cSqrTo");ds.prototype.convert=NR;ds.prototype.revert=GR;ds.prototype.reduce=VR;ds.prototype.mulTo=jR;ds.prototype.sqrTo=UR;function HR(){if(this.t<1)return 0;var r=this[0];if((r&1)==0)return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}l(HR,"bnpInvDigit");function hs(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}l(hs,"Montgomery");function WR(r){var t=Ie();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(j.ZERO)>0&&this.m.subTo(t,t),t}l(WR,"montConvert");function zR(r){var t=Ie();return r.copyTo(t),this.reduce(t),t}l(zR,"montRevert");function XR(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)}l(XR,"montReduce");function ZR(r,t){r.squareTo(t),this.reduce(t)}l(ZR,"montSqrTo");function YR(r,t,e){r.multiplyTo(t,e),this.reduce(e)}l(YR,"montMulTo");hs.prototype.convert=WR;hs.prototype.revert=zR;hs.prototype.reduce=XR;hs.prototype.mulTo=YR;hs.prototype.sqrTo=ZR;function qR(){return(this.t>0?this[0]&1:this.s)==0}l(qR,"bnpIsEven");function $R(r,t){if(r>4294967295||r<1)return j.ONE;var e=Ie(),i=Ie(),n=t.convert(this),o=jm(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)}l($R,"bnpExp");function JR(r,t){var e;return r<256||t.isEven()?e=new ds(t):e=new hs(t),this.exp(r,e)}l(JR,"bnModPowInt");j.prototype.copyTo=xR;j.prototype.fromInt=CR;j.prototype.fromString=SR;j.prototype.clamp=TR;j.prototype.dlShiftTo=DR;j.prototype.drShiftTo=OR;j.prototype.lShiftTo=_R;j.prototype.rShiftTo=LR;j.prototype.subTo=kR;j.prototype.multiplyTo=AR;j.prototype.squareTo=FR;j.prototype.divRemTo=BR;j.prototype.invDigit=HR;j.prototype.isEven=qR;j.prototype.exp=$R;j.prototype.toString=MR;j.prototype.negate=IR;j.prototype.abs=PR;j.prototype.compareTo=wR;j.prototype.bitLength=ER;j.prototype.mod=RR;j.prototype.modPowInt=JR;j.ZERO=Ao(0);j.ONE=Ao(1);function KR(){var r=Ie();return this.copyTo(r),r}l(KR,"bnClone");function QR(){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]}l(QR,"bnIntValue");function eN(){return this.t==0?this.s:this[0]<<24>>24}l(eN,"bnByteValue");function tN(){return this.t==0?this.s:this[0]<<16>>16}l(tN,"bnShortValue");function rN(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}l(rN,"bnpChunkSize");function iN(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}l(iN,"bnSigNum");function nN(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=Ao(e),n=Ie(),o=Ie(),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}l(nN,"bnpToRadix");function oN(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=RP(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&&j.ZERO.subTo(this,this)}l(oN,"bnpFromRadix");function aN(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(j.ONE.shiftLeft(r-1),Dv,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(j.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)}}l(aN,"bnpFromNumber");function sN(){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)!=0&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(t[n++]=i);return t}l(sN,"bnToByteArray");function lN(r){return this.compareTo(r)==0}l(lN,"bnEquals");function cN(r){return this.compareTo(r)<0?this:r}l(cN,"bnMin");function pN(r){return this.compareTo(r)>0?this:r}l(pN,"bnMax");function uN(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()}l(uN,"bnpBitwiseTo");function dN(r,t){return r&t}l(dN,"op_and");function hN(r){var t=Ie();return this.bitwiseTo(r,dN,t),t}l(hN,"bnAnd");function Dv(r,t){return r|t}l(Dv,"op_or");function fN(r){var t=Ie();return this.bitwiseTo(r,Dv,t),t}l(fN,"bnOr");function NP(r,t){return r^t}l(NP,"op_xor");function mN(r){var t=Ie();return this.bitwiseTo(r,NP,t),t}l(mN,"bnXor");function GP(r,t){return r&~t}l(GP,"op_andnot");function gN(r){var t=Ie();return this.bitwiseTo(r,GP,t),t}l(gN,"bnAndNot");function yN(){for(var r=Ie(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}l(yN,"bnNot");function bN(r){var t=Ie();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}l(bN,"bnShiftLeft");function vN(r){var t=Ie();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}l(vN,"bnShiftRight");function xN(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}l(xN,"lbit");function CN(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+xN(this[r]);return this.s<0?this.t*this.DB:-1}l(CN,"bnGetLowestSetBit");function SN(r){for(var t=0;r!=0;)r&=r-1,++t;return t}l(SN,"cbit");function TN(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=SN(this[e]^t);return r}l(TN,"bnBitCount");function MN(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}l(MN,"bnTestBit");function IN(r,t){var e=j.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}l(IN,"bnpChangeBit");function PN(r){return this.changeBit(r,Dv)}l(PN,"bnSetBit");function wN(r){return this.changeBit(r,GP)}l(wN,"bnClearBit");function EN(r){return this.changeBit(r,NP)}l(EN,"bnFlipBit");function DN(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()}l(DN,"bnpAddTo");function ON(r){var t=Ie();return this.addTo(r,t),t}l(ON,"bnAdd");function _N(r){var t=Ie();return this.subTo(r,t),t}l(_N,"bnSubtract");function LN(r){var t=Ie();return this.multiplyTo(r,t),t}l(LN,"bnMultiply");function kN(){var r=Ie();return this.squareTo(r),r}l(kN,"bnSquare");function AN(r){var t=Ie();return this.divRemTo(r,t,null),t}l(AN,"bnDivide");function FN(r){var t=Ie();return this.divRemTo(r,null,t),t}l(FN,"bnRemainder");function BN(r){var t=Ie(),e=Ie();return this.divRemTo(r,t,e),new Array(t,e)}l(BN,"bnDivideAndRemainder");function RN(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}l(RN,"bnpDMultiply");function NN(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]}}l(NN,"bnpDAddOffset");function Uu(){}l(Uu,"NullExp");function VP(r){return r}l(VP,"nNop");function GN(r,t,e){r.multiplyTo(t,e)}l(GN,"nMulTo");function VN(r,t){r.squareTo(t)}l(VN,"nSqrTo");Uu.prototype.convert=VP;Uu.prototype.revert=VP;Uu.prototype.mulTo=GN;Uu.prototype.sqrTo=VN;function jN(r){return this.exp(r,new Uu)}l(jN,"bnPow");function UN(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()}l(UN,"bnpMultiplyLowerTo");function HN(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)}l(HN,"bnpMultiplyUpperTo");function dc(r){this.r2=Ie(),this.q3=Ie(),j.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}l(dc,"Barrett");function WN(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=Ie();return r.copyTo(t),this.reduce(t),t}l(WN,"barrettConvert");function zN(r){return r}l(zN,"barrettRevert");function XN(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)}l(XN,"barrettReduce");function ZN(r,t){r.squareTo(t),this.reduce(t)}l(ZN,"barrettSqrTo");function YN(r,t,e){r.multiplyTo(t,e),this.reduce(e)}l(YN,"barrettMulTo");dc.prototype.convert=WN;dc.prototype.revert=zN;dc.prototype.reduce=XN;dc.prototype.mulTo=YN;dc.prototype.sqrTo=ZN;function qN(r,t){var e=r.bitLength(),i,n=Ao(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 ds(t):t.isEven()?o=new dc(t):o=new hs(t);var a=new Array,p=3,c=i-1,u=(1<<i)-1;if(a[1]=o.convert(this),i>1){var h=Ie();for(o.sqrTo(a[1],h);p<=u;)a[p]=Ie(),o.mulTo(h,a[p-2],a[p]),p+=2}var m=r.t-1,y,b=!0,x=Ie(),C;for(e=jm(r[m])-1;m>=0;){for(e>=c?y=r[m]>>e-c&u:(y=(r[m]&(1<<e+1)-1)<<c-e,m>0&&(y|=r[m-1]>>this.DB+e-c)),p=i;(y&1)==0;)y>>=1,--p;if((e-=p)<0&&(e+=this.DB,--m),b)a[y].copyTo(n),b=!1;else{for(;p>1;)o.sqrTo(n,x),o.sqrTo(x,n),p-=2;p>0?o.sqrTo(n,x):(C=n,n=x,x=C),o.mulTo(x,a[y],n)}for(;m>=0&&(r[m]&1<<e)==0;)o.sqrTo(n,x),C=n,n=x,x=C,--e<0&&(e=this.DB-1,--m)}return o.revert(n)}l(qN,"bnModPow");function $N(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}l($N,"bnGCD");function JN(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}l(JN,"bnpModInt");function KN(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return j.ZERO;for(var e=r.clone(),i=this.clone(),n=Ao(1),o=Ao(0),a=Ao(0),p=Ao(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(j.ONE)!=0)return j.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}l(KN,"bnModInverse");var zt=[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],QN=(1<<26)/zt[zt.length-1];function eG(r){var t,e=this.abs();if(e.t==1&&e[0]<=zt[zt.length-1]){for(t=0;t<zt.length;++t)if(e[0]==zt[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<zt.length;){for(var i=zt[t],n=t+1;n<zt.length&&i<QN;)i*=zt[n++];for(i=e.modInt(i);t<n;)if(i%zt[t++]==0)return!1}return e.millerRabin(r)}l(eG,"bnIsProbablePrime");function tG(r){var t=this.subtract(j.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>zt.length&&(r=zt.length);for(var n=Ie(),o=0;o<r;++o){n.fromInt(zt[Math.floor(Math.random()*zt.length)]);var a=n.modPow(i,this);if(a.compareTo(j.ONE)!=0&&a.compareTo(t)!=0){for(var p=1;p++<e&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(j.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}l(tG,"bnpMillerRabin");j.prototype.chunkSize=rN;j.prototype.toRadix=nN;j.prototype.fromRadix=oN;j.prototype.fromNumber=aN;j.prototype.bitwiseTo=uN;j.prototype.changeBit=IN;j.prototype.addTo=DN;j.prototype.dMultiply=RN;j.prototype.dAddOffset=NN;j.prototype.multiplyLowerTo=UN;j.prototype.multiplyUpperTo=HN;j.prototype.modInt=JN;j.prototype.millerRabin=tG;j.prototype.clone=KR;j.prototype.intValue=QR;j.prototype.byteValue=eN;j.prototype.shortValue=tN;j.prototype.signum=iN;j.prototype.toByteArray=sN;j.prototype.equals=lN;j.prototype.min=cN;j.prototype.max=pN;j.prototype.and=hN;j.prototype.or=fN;j.prototype.xor=mN;j.prototype.andNot=gN;j.prototype.not=yN;j.prototype.shiftLeft=bN;j.prototype.shiftRight=vN;j.prototype.getLowestSetBit=CN;j.prototype.bitCount=TN;j.prototype.testBit=MN;j.prototype.setBit=PN;j.prototype.clearBit=wN;j.prototype.flipBit=EN;j.prototype.add=ON;j.prototype.subtract=_N;j.prototype.multiply=LN;j.prototype.divide=AN;j.prototype.remainder=FN;j.prototype.divideAndRemainder=BN;j.prototype.modPow=qN;j.prototype.modInverse=KN;j.prototype.pow=jN;j.prototype.gcd=$N;j.prototype.isProbablePrime=eG;j.prototype.square=kN;var be=j;be.prototype.IsNegative=function(){return this.compareTo(be.ZERO)==-1};be.op_Equality=function(r,t){return r.compareTo(t)==0};be.op_Inequality=function(r,t){return r.compareTo(t)!=0};be.op_GreaterThan=function(r,t){return r.compareTo(t)>0};be.op_LessThan=function(r,t){return r.compareTo(t)<0};be.op_Addition=function(r,t){return new be(r).add(new be(t))};be.op_Subtraction=function(r,t){return new be(r).subtract(new be(t))};be.Int128Mul=function(r,t){return new be(r).multiply(new be(t))};be.op_Division=function(r,t){return r.divide(t)};be.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Gm>"u"&&(Gm=l(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 Gm;f.Path=function(){return[]};f.Paths=function(){return[]};f.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};f.DoublePoint0=function(){this.X=0,this.Y=0};f.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};f.DoublePoint2=function(r,t){this.X=r,this.Y=t};f.PolyNode=function(){this.m_Parent=null,this.m_polygon=new f.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};f.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};f.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};f.PolyNode.prototype.Contour=function(){return this.m_polygon};f.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};f.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};f.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};f.PolyNode.prototype.Childs=function(){return this.m_Childs};f.PolyNode.prototype.Parent=function(){return this.m_Parent};f.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};f.PolyTree=function(){this.m_AllPolys=[],f.PolyNode.call(this)};f.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};f.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};f.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};Gm(f.PolyTree,f.PolyNode);f.Math_Abs_Int64=f.Math_Abs_Int32=f.Math_Abs_Double=function(r){return Math.abs(r)};f.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};xe.msie||xe.opera||xe.safari?f.Cast_Int32=function(r){return r|0}:f.Cast_Int32=function(r){return~~r};xe.chrome?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:xe.firefox&&typeof Number.toInteger=="function"?f.Cast_Int64=function(r){return Number.toInteger(r)}:xe.msie7||xe.msie8?f.Cast_Int64=function(r){return parseInt(r,10)}:xe.msie?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:f.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};f.Clear=function(r){r.length=0};f.PI=3.141592653589793;f.PI2=2*3.141592653589793;f.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,us)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof f.DoublePoint){var e=r[0];this.X=f.Clipper.Round(e.X),this.Y=f.Clipper.Round(e.Y),this.Z=0}else{var i=r[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof f.DoublePoint){var e=r[0];this.X=f.Clipper.Round(e.X),this.Y=f.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};f.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};f.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};us?(f.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y),this.Z=0},f.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},f.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(f.IntPoint0=function(){this.X=0,this.Y=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y)},f.IntPoint2=function(r,t){this.X=r,this.Y=t});f.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};f.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};f.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};f.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};f.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};f.PolyType={ptSubject:0,ptClip:1};f.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};f.JoinType={jtSquare:0,jtRound:1,jtMiter:2};f.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};FP&&(f.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});f.EdgeSide={esLeft:0,esRight:1};f.Direction={dRightToLeft:0,dLeftToRight:1};f.TEdge=function(){this.Bot=new f.IntPoint,this.Curr=new f.IntPoint,this.Top=new f.IntPoint,this.Delta=new f.IntPoint,this.Dx=0,this.PolyTyp=f.PolyType.ptSubject,this.Side=f.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};f.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new f.IntPoint};f.MyIntersectNodeSort=function(){};f.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};f.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};f.Scanbeam=function(){this.Y=0,this.Next=null};f.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};f.OutPt=function(){this.Idx=0,this.Pt=new f.IntPoint,this.Next=null,this.Prev=null};f.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new f.IntPoint};f.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};f.ClipperBase.horizontal=-9007199254740992;f.ClipperBase.Skip=-2;f.ClipperBase.Unassigned=-1;f.ClipperBase.tolerance=1e-20;fR?(f.ClipperBase.loRange=46340,f.ClipperBase.hiRange=46340):(f.ClipperBase.loRange=47453132,f.ClipperBase.hiRange=0xfffffffffffff);f.ClipperBase.near_zero=function(r){return r>-f.ClipperBase.tolerance&&r<f.ClipperBase.tolerance};f.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};f.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(f.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};f.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,i){return i?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&be.op_Equality(be.Int128Mul(r.X-t.X,e.Y-t.Y),be.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};f.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var i=t;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,e))return!0;if(i=i.Next,i==t)break}return!1};f.ClipperBase.prototype.SlopesEqual=f.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,n,o,a,p,c;return t==3?(e=r[0],i=r[1],c=r[2],c?be.op_Equality(be.Int128Mul(e.Delta.Y,i.Delta.X),be.Int128Mul(e.Delta.X,i.Delta.Y)):f.Cast_Int64(e.Delta.Y*i.Delta.X)==f.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(n=r[0],o=r[1],a=r[2],c=r[3],c?be.op_Equality(be.Int128Mul(n.Y-o.Y,o.X-a.X),be.Int128Mul(n.X-o.X,o.Y-a.Y)):f.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-f.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?be.op_Equality(be.Int128Mul(n.Y-o.Y,a.X-p.X),be.Int128Mul(n.X-o.X,a.Y-p.Y)):f.Cast_Int64((n.Y-o.Y)*(a.X-p.X))-f.Cast_Int64((n.X-o.X)*(a.Y-p.Y))===0)};f.ClipperBase.SlopesEqual3=function(r,t,e){return e?be.op_Equality(be.Int128Mul(r.Delta.Y,t.Delta.X),be.Int128Mul(r.Delta.X,t.Delta.Y)):f.Cast_Int64(r.Delta.Y*t.Delta.X)==f.Cast_Int64(r.Delta.X*t.Delta.Y)};f.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?be.op_Equality(be.Int128Mul(r.Y-t.Y,t.X-e.X),be.Int128Mul(r.X-t.X,t.Y-e.Y)):f.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-f.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};f.ClipperBase.SlopesEqual5=function(r,t,e,i,n){return n?be.op_Equality(be.Int128Mul(r.Y-t.Y,e.X-i.X),be.Int128Mul(r.X-t.X,e.Y-i.Y)):f.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-f.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};f.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,i=this.m_edges[r].length;e<i;++e)this.m_edges[r][e]=null;f.Clear(this.m_edges[r])}f.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};f.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};f.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>f.ClipperBase.hiRange||r.Y>f.ClipperBase.hiRange||-r.X>f.ClipperBase.hiRange||-r.Y>f.ClipperBase.hiRange)&&f.Error("Coordinate outside allowed range in RangeTest()."):(r.X>f.ClipperBase.loRange||r.Y>f.ClipperBase.loRange||-r.X>f.ClipperBase.loRange||-r.Y>f.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};f.ClipperBase.prototype.InitEdge=function(r,t,e,i){r.Next=t,r.Prev=e,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};f.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};f.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;f.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||f.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=f.ClipperBase.horizontal&&r.Prev.Dx!=f.ClipperBase.horizontal)break;for(;r.Prev.Dx==f.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==f.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};f.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,n,o;if(r.Dx==f.ClipperBase.horizontal&&(t?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=f.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=f.ClipperBase.Skip;)i=i.Next;if(i.Dx==f.ClipperBase.horizontal&&i.Next.OutIdx!=f.ClipperBase.Skip){for(n=i;n.Prev.Dx==f.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==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=f.ClipperBase.Skip;)i=i.Prev;if(i.Dx==f.ClipperBase.horizontal&&i.Prev.OutIdx!=f.ClipperBase.Skip){for(n=i;n.Next.Dx==f.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==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==f.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var a=new f.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};f.ClipperBase.prototype.AddPath=function(r,t,e){AP?!e&&t==f.PolyType.ptClip&&f.Error("AddPath: Open paths must be subject."):e||f.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&f.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&f.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new f.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,h=c;;){if(f.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==c&&(c=u.Next),u=this.RemoveEdge(u),h=u;continue}if(u.Prev==u.Next)break;if(e&&f.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==c&&(c=u.Next),u=this.RemoveEdge(u),u=u.Prev,h=u;continue}if(u=u.Next,u==h)break}if(!e&&u==u.Next||e&&u.Prev==u.Next)return!1;e||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=f.ClipperBase.Skip);var m=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=f.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var y=new f.LocalMinima;for(y.Next=null,y.Y=u.Bot.Y,y.LeftBound=null,y.RightBound=u,y.RightBound.Side=f.EdgeSide.esRight,y.RightBound.WindDelta=0;u.Next.OutIdx!=f.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(y),this.m_edges.push(n),!0}this.m_edges.push(n);for(var b,x=null;u=this.FindNextLocMin(u),u!=x;){x==null&&(x=u);var y=new f.LocalMinima;y.Next=null,y.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(y.LeftBound=u.Prev,y.RightBound=u,b=!1):(y.LeftBound=u,y.RightBound=u.Prev,b=!0),y.LeftBound.Side=f.EdgeSide.esLeft,y.RightBound.Side=f.EdgeSide.esRight,e?y.LeftBound.Next==y.RightBound?y.LeftBound.WindDelta=-1:y.LeftBound.WindDelta=1:y.LeftBound.WindDelta=0,y.RightBound.WindDelta=-y.LeftBound.WindDelta,u=this.ProcessBound(y.LeftBound,b);var C=this.ProcessBound(y.RightBound,!b);y.LeftBound.OutIdx==f.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==f.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),b||(u=C)}return!0};f.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};f.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return f.IntPoint.op_Equality(r,e)||f.IntPoint.op_Equality(r,t)||f.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};f.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};f.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=f.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};f.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};f.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};f.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,us&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};f.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=f.EdgeSide.esLeft,t.OutIdx=f.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=f.EdgeSide.esRight,t.OutIdx=f.ClipperBase.Unassigned),r=r.Next}};f.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=f.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=f.PolyFillType.pftEvenOdd,this.m_SubjFillType=f.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,f.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=f.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,us&&(this.ZFillFunction=null)};f.Clipper.ioReverseSolution=1;f.Clipper.ioStrictlySimple=2;f.Clipper.ioPreserveCollinear=4;f.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),f.ClipperBase.prototype.Clear.call(this))};f.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};f.Clipper.prototype.Reset=function(){f.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};f.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new f.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new f.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new f.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};f.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof f.PolyTree;if(t==4&&!e){var i=r[0],n=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&f.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,f.Clear(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,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],c=r[1];return this.Execute(i,c,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}};f.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};f.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),f.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var 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{f.Clear(this.m_Joins),f.Clear(this.m_GhostJoins)}};f.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};f.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);f.Clear(this.m_PolyOuts)};f.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};f.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};f.Clipper.prototype.AddJoin=function(r,t,e){var i=new f.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};f.Clipper.prototype.AddGhostJoin=function(r,t){var e=new f.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};us&&(f.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});f.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(i=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(f.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&f.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var 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&&f.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&&f.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}}}};f.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};f.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<f.Clipper.TopX(r,t.Top.Y):r.Top.X>f.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};f.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_SubjFillType==f.PolyFillType.pftEvenOdd:this.m_ClipFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_ClipFillType==f.PolyFillType.pftEvenOdd:this.m_SubjFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==f.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case f.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case f.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case f.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case f.ClipType.ctIntersection:switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctUnion:switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case f.ClipType.ctDifference:if(r.PolyTyp==f.PolyType.ptSubject)switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctXor:if(r.WindDelta===0)switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};f.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=f.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,i=t.PrevInAEL;i!==null;)i.PolyTyp==t.PolyTyp&&i.WindDelta!==0&&(e=!e),i=i.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};f.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};f.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};f.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};f.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};f.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};f.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,n,o;if(f.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=f.EdgeSide.esLeft,t.Side=f.EdgeSide.esRight,n=r,n.PrevInAEL==t?o=t.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=f.EdgeSide.esRight,t.Side=f.EdgeSide.esLeft,n=t,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&f.Clipper.TopX(o,e.Y)==f.Clipper.TopX(n,e.Y)&&f.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};f.Clipper.prototype.CreateOutRec=function(){var r=new f.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};f.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==f.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var n=new f.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),us&&(f.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):f.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&&f.IntPoint.op_Equality(t,o.Pt))return o;if(!e&&f.IntPoint.op_Equality(t,o.Prev.Pt))return o.Prev;var n=new f.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),us&&(f.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):f.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}};f.Clipper.prototype.SwapPoints=function(r,t){var e=new f.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};f.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,i){return r.X>e.X==r.X<i.X||t.X>e.X==t.X<i.X||e.X>r.X==e.X<t.X||i.X>r.X==i.X<t.X||r.X==e.X&&t.X==i.X?!0:r.X==i.X&&t.X==e.X};f.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new f.OutPt;return i.Pt.X=e.X,i.Pt.Y=e.Y,t==r.Next?(r.Next=i,t.Prev=i,i.Next=t,i.Prev=r):(t.Next=i,r.Prev=i,i.Next=r,i.Prev=t),i};f.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;e&&(t.IsHole=!0)};f.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?f.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};f.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;f.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;f.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var n=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;f.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var o=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;f.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var a=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=o&&i>=a||n>=o&&n>=a};f.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;f.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};f.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,i=t.BottomPt;return e.Pt.Y>i.Pt.Y?r:e.Pt.Y<i.Pt.Y?t:e.Pt.X<i.Pt.X?r:e.Pt.X>i.Pt.X||e.Next==e?t:i.Next==i||this.FirstIsBottomPt(e,i)?r:t};f.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};f.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};f.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],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==f.EdgeSide.esLeft?(t.Side==f.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=f.EdgeSide.esLeft):(t.Side==f.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=f.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 h=r.OutIdx,m=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==m){y.OutIdx=h,y.Side=u;break}y=y.NextInAEL}i.Idx=e.Idx};f.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};f.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};f.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};f.Clipper.prototype.IntersectEdges=function(r,t,e,i){var 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(AP&&(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==f.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!=f.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),p&&(t.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):f.Error("Error intersecting polylines")),o&&(t.OutIdx<0?this.DeleteFromAEL(t):f.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,h,m,y;r.PolyTyp==f.PolyType.ptSubject?(u=this.m_SubjFillType,m=this.m_ClipFillType):(u=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==f.PolyType.ptSubject?(h=this.m_SubjFillType,y=this.m_ClipFillType):(h=this.m_ClipFillType,y=this.m_SubjFillType);var b,x;switch(u){case f.PolyFillType.pftPositive:b=r.WindCnt;break;case f.PolyFillType.pftNegative:b=-r.WindCnt;break;default:b=Math.abs(r.WindCnt);break}switch(h){case f.PolyFillType.pftPositive:x=t.WindCnt;break;case f.PolyFillType.pftNegative:x=-t.WindCnt;break;default:x=Math.abs(t.WindCnt);break}if(a&&p)n||o||b!==0&&b!=1||x!==0&&x!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=f.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if(a)(x===0||x==1)&&(this.AddOutPt(r,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if(p)(b===0||b==1)&&(this.AddOutPt(t,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if((b===0||b==1)&&(x===0||x==1)&&!n&&!o){var C,v;switch(m){case f.PolyFillType.pftPositive:C=r.WindCnt2;break;case f.PolyFillType.pftNegative:C=-r.WindCnt2;break;default:C=Math.abs(r.WindCnt2);break}switch(y){case f.PolyFillType.pftPositive:v=t.WindCnt2;break;case f.PolyFillType.pftNegative:v=-t.WindCnt2;break;default:v=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(b==1&&x==1)switch(this.m_ClipType){case f.ClipType.ctIntersection:C>0&&v>0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctUnion:C<=0&&v<=0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctDifference:(r.PolyTyp==f.PolyType.ptClip&&C>0&&v>0||r.PolyTyp==f.PolyType.ptSubject&&C<=0&&v<=0)&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else f.Clipper.SwapSides(r,t)}n!=o&&(n&&r.OutIdx>=0||o&&t.OutIdx>=0)&&(f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(t)};f.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};f.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};f.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&f.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,f.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};f.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};f.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=f.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=f.Direction.dRightToLeft)};f.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=f.EdgeSide.esLeft&&(e=e.Prev),t&&(f.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};f.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,n=e.Left,o=e.Right,a=r,p=null;a.NextInLML!==null&&f.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 h=this.GetNextInAEL(u,i);if(i==f.Direction.dLeftToRight&&u.Curr.X<=o||i==f.Direction.dRightToLeft&&u.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),u==p&&c){i==f.Direction.dLeftToRight?this.IntersectEdges(r,u,u.Top,!1):this.IntersectEdges(u,r,u.Top,!1),p.OutIdx>=0&&f.Error("ProcessHorizontal error");return}else if(i==f.Direction.dLeftToRight){var m=new f.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(r,u,m,!0)}else{var m=new f.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(u,r,m,!0)}this.SwapPositionsInAEL(r,u)}else if(i==f.Direction.dLeftToRight&&u.Curr.X>=o||i==f.Direction.dRightToLeft&&u.Curr.X<=n)break;u=h}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&f.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left: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 y=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var b=r.PrevInAEL,h=r.NextInAEL;if(b!==null&&b.Curr.X==r.Bot.X&&b.Curr.Y==r.Bot.Y&&b.WindDelta!==0&&b.OutIdx>=0&&b.Curr.Y>b.Top.Y&&f.ClipperBase.SlopesEqual(r,b,this.m_UseFullRange)){var x=this.AddOutPt(b,r.Bot);this.AddJoin(y,x,r.Top)}else if(h!==null&&h.Curr.X==r.Bot.X&&h.Curr.Y==r.Bot.Y&&h.WindDelta!==0&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&f.ClipperBase.SlopesEqual(r,h,this.m_UseFullRange)){var x=this.AddOutPt(h,r.Bot);this.AddJoin(y,x,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else p!==null?p.OutIdx>=0?(i==f.Direction.dLeftToRight?this.IntersectEdges(r,p,r.Top,!1):this.IntersectEdges(p,r,r.Top,!1),p.OutIdx>=0&&f.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(p)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};f.Clipper.prototype.GetNextInAEL=function(r,t){return t==f.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};f.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};f.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};f.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};f.Clipper.prototype.GetMaximaPair=function(r){var t=null;return f.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:f.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!f.ClipperBase.IsHorizontal(t))?null:t};f.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,f.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};f.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=f.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var n=e.NextInSEL,o=new f.IntPoint;if(e.Curr.X>n.Curr.X){!this.IntersectPoint(e,n,o)&&e.Curr.X>n.Curr.X+1&&f.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(e.Dx)>Math.abs(n.Dx)?o.X=f.Clipper.TopX(n,r):o.X=f.Clipper.TopX(e,r));var a=new f.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}};f.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};f.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};f.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var i=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=i}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};f.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var rG=l(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),iG=l(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),nG=l(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),oG=l(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");xe.msie?f.Clipper.Round=rG:xe.chromium?f.Clipper.Round=nG:xe.safari?f.Clipper.Round=oG:f.Clipper.Round=iG;f.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+f.Clipper.Round(r.Dx*(t-r.Bot.Y))};f.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,n;if(f.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,f.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(n=t.Bot.Y-t.Bot.X/t.Dx,e.Y=f.Clipper.Round(e.X/t.Dx+n));else if(t.Delta.X===0)e.X=t.Bot.X,f.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=f.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=t.Bot.X-t.Bot.Y*t.Dx;var o=(n-i)/(r.Dx-t.Dx);e.Y=f.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=f.Clipper.Round(r.Dx*o+i):e.X=f.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=f.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=f.Clipper.TopX(r,e.Y):e.X=f.Clipper.TopX(t,e.Y)}return!0};f.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var i=this.GetMaximaPair(t);e=i===null||!f.ClipperBase.IsHorizontal(i)}if(e){var n=t.PrevInAEL;this.DoMaxima(t),n===null?t=this.m_ActiveEdges:t=n.NextInAEL}else{if(this.IsIntermediate(t,r)&&f.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=f.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var 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&&f.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&&f.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}};f.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,i=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):f.Error("DoMaxima error")};f.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};f.Clipper.Orientation=function(r){return f.Clipper.Area(r)>=0};f.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};f.Clipper.prototype.BuildResult=function(r){f.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];if(i.Pts!==null){var 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)}}}};f.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new f.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))}};f.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(f.IntPoint.op_Equality(e.Pt,e.Next.Pt)||f.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||f.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var i=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,i=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};f.Clipper.prototype.DupOutPt=function(r,t){var e=new f.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};f.Clipper.prototype.GetOverlap=function(r,t,e,i,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};f.Clipper.prototype.JoinHorz=function(r,t,e,i,n,o){var a=r.Pt.X>t.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight,p=e.Pt.X>i.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight;if(a==p)return!1;if(a==f.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),f.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),f.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==f.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),f.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),f.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==f.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};f.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,n=new f.OutPt,o=r.OutPt2,a=new f.OutPt,p=r.OutPt1.Pt.Y==r.OffPt.Y;if(p&&f.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&f.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(n=r.OutPt1.Next;n!=i&&f.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&&f.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 h={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,h))return!1;var m=h.Left,y=h.Right,b=new f.IntPoint,x;return i.Pt.X>=m&&i.Pt.X<=y?(b.X=i.Pt.X,b.Y=i.Pt.Y,x=i.Pt.X>n.Pt.X):o.Pt.X>=m&&o.Pt.X<=y?(b.X=o.Pt.X,b.Y=o.Pt.Y,x=o.Pt.X>a.Pt.X):n.Pt.X>=m&&n.Pt.X<=y?(b.X=n.Pt.X,b.Y=n.Pt.Y,x=n.Pt.X>i.Pt.X):(b.X=a.Pt.X,b.Y=a.Pt.Y,x=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,b,x)}else{for(n=i.Next;f.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var C=n.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(C){for(n=i.Prev;f.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;f.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var v=a.Pt.Y>o.Pt.Y||!f.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(v){for(a=o.Prev;f.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!f.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||t==e&&C==v?!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)}};f.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new f.IntRect(0,0,0,0);var i=new f.IntRect;for(i.left=r[t][0].X,i.right=i.left,i.top=r[t][0].Y,i.bottom=i.top;t<e;t++)for(var 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};f.Clipper.prototype.GetBounds2=function(r){var t=r,e=new f.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};f.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var 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};f.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};f.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var i=this.PointInPolygon(e.Pt,t);if(i>=0)return i!=0;e=e.Next}while(e!=r);return!0};f.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,t.Pts)&&(n.FirstLeft=t)}};f.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)};f.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};f.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],i=this.GetOutRec(e.OutPt1.Idx),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||f.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)}}};f.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};f.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var i=e.Next;i!=t.Pts;){if(f.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var 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)}};f.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};f.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};FP&&(f.Clipper.OffsetPaths=function(r,t,e,i,n){var o=new f.Paths,a=new f.ClipperOffset(n,n);return a.AddPaths(r,e,i),a.Execute(o,t),o});f.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,e,t,t),e};f.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=f.PolyFillType.pftEvenOdd);var e=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,e,t,t),e};f.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};f.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,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)};f.Clipper.SlopesNearCollinear=function(r,t,e,i){return f.Clipper.DistanceFromLineSqrd(t,r,e)<i};f.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,n=r.Y-t.Y;return i*i+n*n<=e};f.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};f.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var i=new Array(e),n=0;n<e;++n)i[n]=new f.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;)f.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=f.Clipper.ExcludeOp(a),e--):f.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(f.Clipper.ExcludeOp(a.Next),a=f.Clipper.ExcludeOp(a),e-=2):f.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=f.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 f.IntPoint(a.Pt),a=a.Next;return i=null,p};f.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,n=r.length;i<n;i++)e[i]=f.Clipper.CleanPolygon(r[i],t);return e};f.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),h=0,m=r.length,y=r[h];h<m;h++,y=r[h])u[h]=new f.IntPoint(t[c].X+y.X,t[c].Y+y.Y);p.push(u)}else for(var c=0;c<a;c++){for(var u=new Array(o),h=0,m=r.length,y=r[h];h<m;h++,y=r[h])u[h]=new f.IntPoint(t[c].X-y.X,t[c].Y-y.Y);p.push(u)}for(var b=new Array,c=0;c<a-1+n;c++)for(var h=0;h<o;h++){var x=new Array;x.push(p[c%a][h%o]),x.push(p[(c+1)%a][h%o]),x.push(p[(c+1)%a][(h+1)%o]),x.push(p[c%a][(h+1)%o]),f.Clipper.Orientation(x)||x.reverse(),b.push(x)}var C=new f.Clipper(0);return C.AddPaths(b,f.PolyType.ptSubject,!0),C.Execute(f.ClipType.ctUnion,p,f.PolyFillType.pftNonZero,f.PolyFillType.pftNonZero),p};f.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],n=r[2];return f.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 f.Clipper,c,u=0,h=o.length;u<h;++u){var c=f.Clipper.Minkowski(e,o[u],!0,n);p.AddPaths(c,f.PolyType.ptSubject,!0)}n&&p.AddPaths(o,f.PolyType.ptClip,!0);var m=new f.Paths;return p.Execute(f.ClipType.ctUnion,m,a,a),m}};f.Clipper.MinkowskiDiff=function(r,t,e){return f.Clipper.Minkowski(r,t,!1,e)};f.Clipper.PolyTreeToPaths=function(r){var t=new Array;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntAny,t),t};f.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case f.Clipper.NodeType.ntOpen:return;case f.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,p=o[n];n<a;n++,p=o[n])f.Clipper.AddPolyNodeToPaths(p,t,e)};f.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new f.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};f.Clipper.ClosedPathsFromPolyTree=function(r){var t=new f.Paths;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntClosed,t),t};Gm(f.Clipper,f.ClipperBase);f.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};f.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=f.ClipperOffset.def_arc_tolerance),this.m_destPolys=new f.Paths,this.m_srcPoly=new f.Path,this.m_destPoly=new f.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new f.IntPoint,this.m_polyNodes=new f.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};f.ClipperOffset.two_pi=6.28318530717959;f.ClipperOffset.def_arc_tolerance=.25;f.ClipperOffset.prototype.Clear=function(){f.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};f.ClipperOffset.Round=f.Clipper.Round;f.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var n=new f.PolyNode;if(n.m_jointype=t,n.m_endtype=e,e==f.EndType.etClosedLine||e==f.EndType.etClosedPolygon)for(;i>0&&f.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++)f.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==f.EndType.etClosedPolygon&&o<2||e!=f.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),e==f.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new f.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 f.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};f.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],t,e)};f.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!f.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==f.EndType.etClosedPolygon||t.m_endtype==f.EndType.etClosedLine&&f.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==f.EndType.etClosedLine&&!f.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};f.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new f.DoublePoint(0,0);var n=1/Math.sqrt(e*e+i*i);return e*=n,i*=n,new f.DoublePoint(i,-e)};f.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,f.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==f.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=f.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*f.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*f.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(f.ClipperOffset.two_pi/n),this.m_cos=Math.cos(f.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/f.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||e.m_endtype!=f.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(e.m_jointype==f.JoinType.jtRound)for(var a=1,p=0,c=1;c<=n;c++){this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),f.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 f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),f.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(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(e.m_endtype==f.EndType.etClosedLine||e.m_endtype==f.EndType.etClosedPolygon?this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new f.DoublePoint(this.m_normals[o-2])),e.m_endtype==f.EndType.etClosedPolygon){for(var h=o-1,c=0;c<o;c++)h=this.OffsetPoint(c,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==f.EndType.etClosedLine){for(var h=o-1,c=0;c<o;c++)h=this.OffsetPoint(c,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=this.m_normals[o-1],c=o-1;c>0;c--)this.m_normals[c]=new f.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new f.DoublePoint(-m.X,-m.Y),h=0;for(var c=o-1;c>=0;c--)h=this.OffsetPoint(c,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var h=0,c=1;c<o-1;++c)h=this.OffsetPoint(c,h,e.m_jointype);var y;if(e.m_endtype==f.EndType.etOpenButt){var c=o-1;y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*r),f.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*r)),this.m_destPoly.push(y),y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*r),f.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*r)),this.m_destPoly.push(y)}else{var c=o-1;h=o-2,this.m_sinA=0,this.m_normals[c]=new f.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),e.m_endtype==f.EndType.etOpenSquare?this.DoSquare(c,h):this.DoRound(c,h)}for(var c=o-1;c>0;c--)this.m_normals[c]=new f.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new f.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),h=o-1;for(var c=h-1;c>0;--c)h=this.OffsetPoint(c,h,e.m_jointype);e.m_endtype==f.EndType.etOpenButt?(y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(y),y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(y)):(h=1,this.m_sinA=0,e.m_endtype==f.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};f.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof f.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new f.Clipper(0);if(n.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var o=f.Clipper.GetBounds(this.m_destPolys),a=new f.Path;if(a.push(new f.IntPoint(o.left-10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.top-10)),a.push(new f.IntPoint(o.left-10,o.top-10)),n.AddPath(a,f.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftNegative,f.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];f.Clear(e),this.FixOrientations(),this.DoOffset(i);var n=new f.Clipper(0);if(n.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var o=f.Clipper.GetBounds(this.m_destPolys),a=new f.Path;a.push(new f.IntPoint(o.left-10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.top-10)),a.push(new f.IntPoint(o.left-10,o.top-10)),n.AddPath(a,f.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};f.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new f.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case f.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);i>=this.m_miterLim?this.DoMiter(r,t,i):this.DoSquare(r,t);break}case f.JoinType.jtSquare:this.DoSquare(r,t);break;case f.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};f.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};f.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),f.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};f.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),i=f.Cast_Int32(f.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),n=this.m_normals[t].X,o=this.m_normals[t].Y,a,p=0;p<i;++p)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),f.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 f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};f.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};f.JS={};f.JS.AreaOfPolygon=function(r,t){return t||(t=1),f.Clipper.Area(r)/(t*t)};f.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=f.Clipper.Area(r[i]);return e/(t*t)};f.JS.BoundsOfPath=function(r,t){return f.JS.BoundsOfPaths([r],t)};f.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=f.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};f.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=f.JS.Clone(i);if(typeof t!="number"||t===null)return f.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||t<0)return i;e||(i=[i]);for(var n=i.length,o,a,p,c,u,h,m,y=[],b=0;b<n;b++)if(a=i[b],o=a.length,o!==0){if(o<3){p=a,y.push(p);continue}for(p=a,c=t*t,u=a[0],h=1,m=1;m<o;m++)(a[m].X-u.X)*(a[m].X-u.X)+(a[m].Y-u.Y)*(a[m].Y-u.Y)<=c||(p[h]=a[m],u=a[m],h++);u=a[h-1],(a[0].X-u.X)*(a[0].X-u.X)+(a[0].Y-u.Y)*(a[0].Y-u.Y)<=c&&h--,h<o&&p.splice(h,o-h),p.length&&y.push(p)}return!e&&y.length?y=y[0]:!e&&y.length===0?y=[]:e&&y.length===0&&(y=[[]]),y};f.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,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};f.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return f.Error("Tolerance is not a number in Lighten()."),f.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return f.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,n,o,a,p,c,u,h,m,y,b,x,C,v,S,I,w=r.length,E=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?(b=1,n.push({X:n[0].X,Y:n[0].Y}),p=n.length):b=0,y=[],i=0;i<p-2;i++)c=n[i],h=n[i+1],u=n[i+2],S=c.X,I=c.Y,x=u.X-S,C=u.Y-I,(x!==0||C!==0)&&(v=((h.X-S)*x+(h.Y-I)*C)/(x*x+C*C),v>1?(S=u.X,I=u.Y):v>0&&(S+=x*v,I+=C*v)),x=h.X-S,C=h.Y-I,m=x*x+C*C,m<=E&&(y[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<p-1;i++)y[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[p-1].X,Y:n[p-1].Y}),b&&n.pop(),y.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};f.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,h=0,m=r.length;if(m<2)return 0;for(t&&(r[m]=r[0],m++);--m;)o=r[m],p=o.X,c=o.Y,a=r[m-1],u=a.X,h=a.Y,n+=i((p-u)*(p-u)+(c-h)*(c-h));return t&&r.pop(),n/e};f.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,n=0;n<r.length;n++)i+=f.JS.PerimeterOfPath(r[n],t,e);return i};f.JS.ScaleDownPath=function(r,t){var e,i;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=i.X/t,i.Y=i.Y/t};f.JS.ScaleDownPaths=function(r,t){var e,i,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};f.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)};f.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)};f.ExPolygons=function(){return[]};f.ExPolygon=function(){this.outer=null,this.holes=null};f.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new f.ExPolygon;e.outer=r.Contour();var i=r.Childs(),n=i.length;e.holes=new Array(n);var o,a,p,c,u,h;for(p=0;p<n;p++)for(o=i[p],e.holes[p]=o.Contour(),c=0,u=o.Childs(),h=u.length;c<h;c++)a=u[c],f.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(e)};f.JS.ExPolygonsToPaths=function(r){var t,e,i,n,o=new f.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};f.JS.PolyTreeToExPolygons=function(r){var t=new f.ExPolygons,e,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)e=n[i],f.JS.AddOuterPolyNodeToExPolygons(e,t);return t};ju.exports=f});var c9=W((Ade,Rg)=>{g();(function(){"use strict";function r(a,p){var c=a.x-p.x,u=a.y-p.y;return c*c+u*u}l(r,"getSqDist");function t(a,p,c){var u=p.x,h=p.y,m=c.x-u,y=c.y-h;if(m!==0||y!==0){var b=((a.x-u)*m+(a.y-h)*y)/(m*m+y*y);b>1?(u=c.x,h=c.y):b>0&&(u+=m*b,h+=y*b)}return m=a.x-u,y=a.y-h,m*m+y*y}l(t,"getSqSegDist");function e(a,p){for(var c=a[0],u=[c],h,m=1,y=a.length;m<y;m++)h=a[m],r(h,c)>p&&(u.push(h),c=h);return c!==h&&u.push(h),u}l(e,"simplifyRadialDist");function i(a,p,c,u,h){for(var m=u,y,b=p+1;b<c;b++){var x=t(a[b],a[p],a[c]);x>m&&(y=b,m=x)}m>u&&(y-p>1&&i(a,p,y,u,h),h.push(a[y]),c-y>1&&i(a,y,c,u,h))}l(i,"simplifyDPStep");function n(a,p){var c=a.length-1,u=[a[0]];return i(a,0,c,p,u),u.push(a[c]),u}l(n,"simplifyDouglasPeucker");function o(a,p,c){if(a.length<=2)return a;var u=p!==void 0?p*p:1;return a=c?a:e(a,u),a=n(a,u),a}l(o,"simplify"),typeof define=="function"&&define.amd?define(function(){return o}):typeof Rg<"u"?(Rg.exports=o,Rg.exports.default=o):typeof self<"u"?self.simplify=o:window.simplify=o})()});g();g();var Qs=class Qs{constructor(t,e,i){d(this,"__type",Qs.__type);d(this,"id",De());d(this,"latitude");d(this,"longitude");d(this,"floorId");d(this,"verticalOffset");var n;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(n=t.verticalOffset)!=null?n:0;else{if(e==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=e,this.floorId=i,this.verticalOffset=0}}static is(t){return t.__type===Qs.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};l(Qs,"Coordinate"),d(Qs,"__type","coordinate");var uy=Qs,se=uy;g();var dy=class dy{constructor(t){d(this,"id");this.id=t}};l(dy,"BaseMetaData");var pt=dy;var wi,Ut,ma,lo,el=class el extends pt{constructor(e,i){super(i.mvfData.properties.id);d(this,"__type",el.__type);T(this,wi);T(this,Ut,{});T(this,ma);T(this,lo);P(this,wi,e),P(this,ma,i.floorId),P(this,lo,i.mvfData)}static is(e){return e.__type===el.__type}get locations(){return s(this,Ut).locations?s(this,Ut).locations:(s(this,Ut).locations=(s(this,wi).locationIdsByNodeId[this.id]||[]).map(e=>s(this,wi).getById("enterprise-location",e)).filter(Boolean),s(this,Ut).locations)}get space(){var e;return s(this,wi).getById("space",(e=s(this,wi).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=s(this,wi).getById("floor",s(this,ma));if(e==null)throw new Error("Floor ".concat(s(this,ma)," not found!"));return e}get coordinate(){if(s(this,Ut).coordinate==null){let[e,i]=s(this,lo).geometry.coordinates;s(this,Ut).coordinate=new se(i,e,s(this,ma))}return s(this,Ut).coordinate}get externalId(){var e;return(e=s(this,lo).properties.externalId)!=null?e:""}get neighbors(){if(s(this,Ut).neighbours==null){let e=s(this,lo).properties.neighbors.map(i=>{let n=s(this,wi).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});s(this,Ut).neighbours=e}return s(this,Ut).neighbours}get geoJSON(){return{...s(this,lo),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(s(this,Ut)))delete s(this,Ut)[e]}};wi=new WeakMap,Ut=new WeakMap,ma=new WeakMap,lo=new WeakMap,l(el,"Node"),d(el,"__type","node");var hy=el,un=hy;g();g();var ga,fy=class fy{constructor(t,e){d(this,"id");T(this,ga);this.id=t}get geoJSONBoundingBox(){return s(this,ga)?s(this,ga):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(P(this,ga,Zs(this.geoJSON)),s(this,ga))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};ga=new WeakMap,l(fy,"BaseMapData");var Xr=fy;var co,Pr,Zr,rl,mp,gy,tl=class tl extends Xr{constructor(e,i){super(i.mvfData.id,e);T(this,mp);d(this,"__type",tl.__type);T(this,co);T(this,Pr,{});T(this,Zr);T(this,rl);P(this,co,e),P(this,Zr,i.mvfData),P(this,rl,i.facadeId)}static is(e){return e.__type===tl.__type}get type(){return s(this,Zr).type}get name(){var e;return(e=G(this,mp,gy).call(this,"name"))!=null?e:""}get shortName(){var e;return(e=G(this,mp,gy).call(this,"shortName"))!=null?e:""}get externalId(){var e;return(e=s(this,Zr).externalId)!=null?e:""}get floors(){var e,i;if(s(this,Pr).floors==null){let n=((i=(e=s(this,Zr).floors)!=null?e:s(this,Zr).maps)!=null?i:[]).reduce((o,a)=>{let p=s(this,co).floorsById[a];return p&&o.push(p),o},[]);n.length===0&&L.error("Floor stack ".concat(this.id," has no floors")),s(this,Pr).floors=n}return s(this,Pr).floors}get defaultFloor(){if(s(this,Pr).defaultFloor!=null)return s(this,Pr).defaultFloor;let e=s(this,Zr).defaultFloor?s(this,co).getById("floor",s(this,Zr).defaultFloor):void 0;return s(this,Pr).defaultFloor=e||this.floors.reduce((i,n)=>Math.abs(n.elevation)<Math.abs(i.elevation)?n:i),s(this,Pr).defaultFloor}get facade(){return s(this,rl)?s(this,co).facadesById[s(this,rl)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,Pr)))delete s(this,Pr)[e]}};co=new WeakMap,Pr=new WeakMap,Zr=new WeakMap,rl=new WeakMap,mp=new WeakSet,gy=l(function(e){return s(this,co).getPropTranslation(this.__type,e,this.id,s(this,Zr)[e])},"#translate"),l(tl,"FloorStack"),d(tl,"__type","floor-stack");var my=tl,gp=my;g();g();g();g();g();g();var bp,dn,yp=class yp extends pt{constructor(e){super(String(De()));T(this,bp,{});T(this,dn);P(this,dn,e.mvfData)}static is(e){return e.__type===yp.__type}get url(){return s(this,dn).url}get name(){if("displayName"in s(this,dn))return s(this,dn).displayName;if("label"in s(this,dn))return s(this,dn).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,bp)))delete s(this,bp)[e]}};bp=new WeakMap,dn=new WeakMap,l(yp,"Hyperlink"),d(yp,"__type","hyperlink");var yy=yp,po=yy;g();g();function vp(r){return typeof r=="string"?r:r.id}l(vp,"getId");function vy(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}l(vy,"isPosition");var by=8,Ei=l(r=>typeof r=="number"?r.toFixed(by):vy(r)?r[1].toFixed(by)+"-"+r[0].toFixed(by):r.map(t=>Ei(t)).join("-"),"serializeCoords"),n8=l(r=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,e=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(r)||e.test(r)},"isPrivateCdnAsset"),Gh=l(r=>{if(!n8(r))return null;let t="";r.startsWith("https://")?(t="https://",r=r.slice(8)):r.startsWith("http://")&&(t="http://",r=r.slice(7));let[e,i,n]=r.split("/");return{origin:t+e,mapId:i,fileName:n}},"parseCdnAssetUrl");var Cp,uo,ya,xp=class xp extends pt{constructor(e){super(String(De()));T(this,Cp,{});T(this,uo);T(this,ya);P(this,uo,e.mvfData),P(this,ya,e.mapData)}static is(e){return e.__type===xp.__type}get url(){let e=s(this,uo).url;if(s(this,ya).tokenManager==null)return e;let i=Gh(s(this,uo).url);if(i==null)return e;let n=i.mapId;try{if(s(this,ya).tokenManager.isEnterpriseMode())return e;let o=s(this,ya).tokenManager.getSasToken(n).token;if(o==null||o==="")throw new Error("SAS token empty!");return"".concat(e,"?").concat(o)}catch(o){return L.error("Error getting SAS token for image",{error:o,url:e}),e}}get name(){return s(this,uo).altText}get altText(){return s(this,uo).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,Cp)))delete s(this,Cp)[e]}};Cp=new WeakMap,uo=new WeakMap,ya=new WeakMap,l(xp,"ImageMetaData"),d(xp,"__type","image");var xy=xp,ho=xy;var il,Yr,hn,Cy=class Cy extends Xr{constructor(e,i){super(i.properties.id,e);T(this,il);T(this,Yr);T(this,hn,{});P(this,il,e),P(this,Yr,i)}get externalId(){var e;return(e=s(this,Yr).properties.externalId)!=null?e:""}get name(){var i,n,o,a,p;let e="";return"details"in s(this,Yr).properties||(e=(i=s(this,Yr).properties.externalId)!=null?i:""),e===""&&(e=(o=(n=s(this,Yr).properties.details)==null?void 0:n.name)!=null?o:""),e===""&&(e=(p=(a=this.locationProfiles.find(c=>c.name&&c.name.length>0))==null?void 0:a.name)!=null?p:""),e}get description(){var i,n,o,a;let e=(n=(i=s(this,Yr).properties.details)==null?void 0:i.description)!=null?n:"";return e===""&&(e=(a=(o=this.locationProfiles.find(p=>p.description&&p.description.length>0))==null?void 0:o.description)!=null?a:""),e}get images(){var i,n,o,a,p;if(s(this,hn).images!=null)return s(this,hn).images;let e=(o=(n=(i=s(this,Yr).properties.details)==null?void 0:i.images)==null?void 0:n.map(c=>new ho({mvfData:c,mapData:s(this,il)})))!=null?o:[];return(e==null||e.length===0)&&(e=(p=(a=this.locationProfiles.find(c=>c.images.length>0))==null?void 0:a.images)!=null?p:[]),s(this,hn).images=e,e}get links(){var i,n,o,a,p;if(s(this,hn).links!=null)return s(this,hn).links;let e=(o=(n=(i=s(this,Yr).properties.details)==null?void 0:i.links)==null?void 0:n.map(c=>new po({mvfData:c})))!=null?o:[];return(e==null||e.length===0)&&(e=(p=(a=this.locationProfiles.find(c=>c.links.length>0))==null?void 0:a.links)!=null?p:[]),s(this,hn).links=e,e}get locationProfiles(){var e;return(e=s(this,il).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}};il=new WeakMap,Yr=new WeakMap,hn=new WeakMap,l(Cy,"DetailedMapData");var Tt=Cy;var Sp,ba,ol,al,nl=class nl extends Tt{constructor(e,i){super(e,i.mvfData);d(this,"__type",nl.__type);T(this,Sp);T(this,ba);T(this,ol,{});T(this,al);P(this,Sp,e),P(this,ba,i.floorId),P(this,al,i.mvfData)}static is(e){return e.__type===nl.__type}get center(){var e;if(s(this,ol).center==null){let[i,n]=(e=s(this,al).properties.center)!=null?e:[0,0];s(this,ol).center=new se(n,i,s(this,ba))}return s(this,ol).center}get floor(){let e=s(this,Sp).getById("floor",s(this,ba));if(e==null)throw new Error("Floor ".concat(s(this,ba)," not found!"));return e}get geoJSON(){return{...s(this,al),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Sp=new WeakMap,ba=new WeakMap,ol=new WeakMap,al=new WeakMap,l(nl,"Area"),d(nl,"__type","area");var Sy=nl,fn=Sy;g();var va,mn,xa,ll,sl=class sl extends Tt{constructor(e,i){super(e,i.mvfData);d(this,"__type",sl.__type);T(this,va);T(this,mn);T(this,xa);T(this,ll);P(this,mn,{}),P(this,ll,i.mvfData),P(this,va,e),P(this,xa,i.floorId)}static is(e){return e.__type===sl.__type}get floor(){let e=s(this,va).getById("floor",s(this,xa));if(e==null)throw new Error("Floor ".concat(s(this,xa)," not found!"));return e}get center(){if(s(this,mn).center==null){let[[e,i],[n,o]]=s(this,ll).geometry.coordinates,a=(e+n)/2,p=(i+o)/2;s(this,mn).center=new se(p,a,s(this,xa))}return s(this,mn).center}get isExterior(){var n;let e=s(this,va).obstructionIdByEntranceId[this.id],i=s(this,va).getMVFFeatureById("obstruction",e);return(n=i==null?void 0:i.properties.footprintComponent)!=null?n:!1}get geoJSON(){return{...s(this,ll),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,mn)))delete s(this,mn)[e]}};va=new WeakMap,mn=new WeakMap,xa=new WeakMap,ll=new WeakMap,l(sl,"Door"),d(sl,"__type","door");var Ty=sl,qr=Ty;g();var fo,Ca,mr,Di,cl=class cl extends Tt{constructor(e,i){super(e,i.mvfData);d(this,"__type",cl.__type);T(this,fo);T(this,Ca);T(this,mr,{});T(this,Di);P(this,fo,e),P(this,Ca,i.floorId),P(this,Di,i.mvfData)}getMvfData(){return s(this,Di)}static is(e){return e.__type===cl.__type}get type(){return a8(s(this,Di).properties.kind)}get locations(){if(s(this,mr).locations)return s(this,mr).locations;s(this,mr).locations=[];let e=s(this,fo).mvfLocationsBySpaceId[s(this,Di).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let n=s(this,fo).getById("enterprise-location",i.id);n&&s(this,mr).locations.push(n)}return s(this,mr).locations}get floor(){let e=s(this,fo).getById("floor",s(this,Ca));if(e==null)throw new Error("Floor ".concat(s(this,Ca)," not found!"));return e}get doors(){return s(this,Di).properties.destinationNodes.reduce((e,i)=>{let n=s(this,fo).doorsByNodeId[i];return n&&e.push(n),e},[])}get center(){var e;if(s(this,mr).center==null){let[i,n]=(e=s(this,Di).properties.center)!=null?e:[0,0];s(this,mr).center=new se(n,i,s(this,Ca))}return s(this,mr).center}get geoJSON(){return{...s(this,Di),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,mr)))delete s(this,mr)[e]}};fo=new WeakMap,Ca=new WeakMap,mr=new WeakMap,Di=new WeakMap,l(cl,"Space"),d(cl,"__type","space");var My=cl,o8=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function a8(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return o8.includes(t)?t:"room"}l(a8,"validateSpaceType");var ut=My;g();var wr,Ne,Er,Tp,Py,pl=class pl extends Xr{constructor(e,i){super(i.mvfData.properties.id,e);T(this,Tp);d(this,"__type",pl.__type);T(this,wr);T(this,Ne,{});T(this,Er);P(this,wr,e),P(this,Er,i.mvfData)}static is(e){return e.__type===pl.__type}get focusTarget(){return this}get name(){var e,i;return"name"in s(this,Er).properties?(i=G(this,Tp,Py).call(this,"name"))!=null?i:"":(e=s(this,Er).properties.externalId)!=null?e:""}get shortName(){var e,i;return"shortName"in s(this,Er).properties?(i=G(this,Tp,Py).call(this,"shortName"))!=null?i:"":(e=s(this,Er).properties.externalId)!=null?e:""}get externalId(){var e;return(e=s(this,Er).properties.externalId)!=null?e:""}get elevation(){return s(this,Er).properties.elevation}get spaces(){if(s(this,Ne).spaces==null){let e=s(this,wr).spaces.filter(i=>i.floor.id===this.id);s(this,Ne).spaces=e}return s(this,Ne).spaces}get geoJSON(){var e;return{type:"Feature",properties:null,geometry:(e=s(this,Er).geometry)!=null?e:{type:"Polygon",coordinates:[]}}}get objects(){if(s(this,Ne).objects==null){let e=s(this,wr).objects.filter(i=>i.floor.id===this.id);s(this,Ne).objects=e}return s(this,Ne).objects}get connections(){if(s(this,Ne).connections==null){let e=s(this,wr).connections.filter(i=>i.floors.includes(this));s(this,Ne).connections=e}return s(this,Ne).connections}get doors(){if(s(this,Ne).doors==null){let e=s(this,wr).doors.filter(i=>i.floor.id===this.id);s(this,Ne).doors=e}return s(this,Ne).doors}get annotations(){if(s(this,Ne).annotations==null){let e=s(this,wr).annotations.filter(i=>i.floor.id===this.id);s(this,Ne).annotations=e}return s(this,Ne).annotations}get pois(){if(s(this,Ne).pois==null){let e=s(this,wr).pointsOfInterest.filter(i=>i.floor.id===this.id);s(this,Ne).pois=e}return s(this,Ne).pois}get floorStack(){if(s(this,Ne).floorStack==null){let e=s(this,wr).floorStacks.find(i=>i.floors.includes(this));s(this,Ne).floorStack=e}return s(this,Ne).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,Ne)))delete s(this,Ne)[e]}};wr=new WeakMap,Ne=new WeakMap,Er=new WeakMap,Tp=new WeakSet,Py=l(function(e){let i=s(this,Er).properties[e];return s(this,wr).getPropTranslation(this.__type,e,this.id,i)},"#translate"),l(pl,"Floor"),d(pl,"__type","floor");var Iy=pl,er=Iy;g();g();g();var Mp=l(r=>r!=null,"notNull");g();function Ip(r){let t;if(ut.is(r)||qr.is(r)||tr.is(r)||fn.is(r)||Dr.is(r))t=r.center;else if(gn.is(r)||yn.is(r))t=r.coordinate;else if(se.is(r))t=r;else if(un.is(r))t=r.coordinate;else if(Oi.is(r))t=r.coordinates[0];else return;return t}l(Ip,"getCoordinateFromStuffs");g();g();var Sa={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},_i="ExteriorWalls",mo="Walls",dC=0,ul="InteriorDoors",dl="ExteriorDoors",tt="GeometryLayer",bn="LabelsLayer",Li="MarkersLayer",Pp="FootprintLayer",hl="OcclusionLayer",hC="ImagesLayer",Ta="FacadesLayer";var fC=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],mC={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function wy(r){var t,e;(t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)&&L.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}l(wy,"validateOptions");function Ey(r,t){var n,o,a,p,c,u;let e=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||t.outdoorViewToken,i={...Sa,...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=Sa.outdoorView)==null?void 0:p.layersHiddenByGeometry,...r==null?void 0:r.outdoorView},bearing:(u=(c=r==null?void 0:r.bearing)!=null?c:t.naturalBearing)!=null?u:0,imagePlacementOptions:{...Sa.imagePlacementOptions,...r==null?void 0:r.imagePlacementOptions},multiFloorView:{...Sa.multiFloorView,...r==null?void 0:r.multiFloorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}l(Ey,"handleShow3DMapOptionDefault");function gC(r){let t={remove_watermark:!1};if(r)try{let e=Oh(r);Object.assign(t,e.capabilities)}catch(e){L.error("Error decoding capabilities from token",e)}return t}l(gC,"handleTokenCapabilities");var go,Or,vn,fl=class fl extends Tt{constructor(e,i){let n=Object.values(i.mvfDataByFloorId)[0];super(e,n);d(this,"__type",fl.__type);T(this,go);T(this,Or);T(this,vn);P(this,Or,{}),P(this,go,e),P(this,vn,i.mvfDataByFloorId)}static is(e){return e.__type===fl.__type}get accessible(){var e;return(e=Object.values(s(this,vn))[0].properties.accessible)!=null?e:!1}get type(){var e,i;return(i=(e=Object.values(s(this,vn))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get extra(){return Object.values(s(this,vn))[0].properties.extra}get coordinates(){return s(this,Or).coordinates==null&&(s(this,Or).coordinates=Object.entries(s(this,vn)).map(([e,i])=>new se(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),s(this,Or).coordinates}get nodes(){return Object.values(s(this,vn))[0].properties.nodes.map(e=>s(this,go).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?s(this,go).getById("floor",e.floorId):void 0).filter(Mp)}get locationProfiles(){var i,n,o,a,p;if(s(this,Or).locationProfiles!=null)return s(this,Or).locationProfiles;let e=super.locationProfiles;if(e==null||e.length===0){let c=[(n=(i=this.coordinates[0])==null?void 0:i.longitude)!=null?n:0,(a=(o=this.coordinates[0])==null?void 0:o.latitude)!=null?a:0],u=Ei(c),h=(p=s(this,go).mvfConnectionIdsByLatLon[u])!=null?p:[];for(let m of h){let y=s(this,go).locationProfilesByAttachedFeatureId[m];if(y!=null){e=y;break}}}return s(this,Or).locationProfiles=e!=null?e:[],e}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id),extra:this.extra}}destroy(){for(let e of Object.keys(s(this,Or)))delete s(this,Or)[e]}};go=new WeakMap,Or=new WeakMap,vn=new WeakMap,l(fl,"Connection"),d(fl,"__type","connection");var Dy=fl,yo=Dy;g();var wp,Ma,bo,Ia,ml=class ml extends Tt{constructor(e,i){super(e,i.mvfData);d(this,"__type",ml.__type);T(this,wp);T(this,Ma);T(this,bo,{});T(this,Ia);P(this,wp,e),P(this,Ma,i.floorId),P(this,Ia,i.mvfData)}static is(e){return e.__type===ml.__type}get type(){let e=s(this,Ia).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=s(this,wp).getById("floor",s(this,Ma));if(e==null)throw new Error("Floor ".concat(s(this,Ma)," not found!"));return e}get center(){var e;if(s(this,bo).center==null){let[i,n]=(e=s(this,Ia).properties.center)!=null?e:[0,0];s(this,bo).center=new se(n,i,s(this,Ma))}return s(this,bo).center}get geoJSON(){return{...s(this,Ia),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(s(this,bo)))s(this,bo)[e]=null}};wp=new WeakMap,Ma=new WeakMap,bo=new WeakMap,Ia=new WeakMap,l(ml,"MapObject"),d(ml,"__type","object");var Oy=ml,tr=Oy;g();var Ep,Pa,vo,yl,gl=class gl extends Tt{constructor(e,i){super(e,i.mvfData);d(this,"__type",gl.__type);T(this,Ep);T(this,Pa);T(this,vo,{});T(this,yl);P(this,Ep,e),P(this,yl,i.mvfData),P(this,Pa,i.floorId)}static is(e){return e.__type===gl.__type}get floor(){let e=s(this,Ep).getById("floor",s(this,Pa));if(e==null)throw new Error("Floor ".concat(s(this,Pa)," not found!"));return e}get coordinate(){var e;if(s(this,vo).coordinate==null){let[i,n]=(e=s(this,yl).geometry.coordinates)!=null?e:[0,0];s(this,vo).coordinate=new se(n,i,s(this,Pa))}return s(this,vo).coordinate}get geoJSON(){return{...s(this,yl),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in s(this,vo))s(this,vo)[e]=null}};Ep=new WeakMap,Pa=new WeakMap,vo=new WeakMap,yl=new WeakMap,l(gl,"PointOfInterest"),d(gl,"__type","point-of-interest");var _y=gl,gn=_y;g();var Dp,wa,xo,Ea,Op,ky,bl=class bl extends Tt{constructor(e,i){super(e,i.mvfData);T(this,Op);d(this,"__type",bl.__type);T(this,Dp);T(this,wa);T(this,xo,{});T(this,Ea);P(this,Dp,e),P(this,wa,i.floorId),P(this,Ea,i.mvfData)}static is(e){return e.__type===bl.__type}get group(){return G(this,Op,ky).call(this).group}get type(){return G(this,Op,ky).call(this).type}get coordinate(){if(s(this,xo).coordinate==null){let[e,i]=s(this,Ea).geometry.coordinates;s(this,xo).coordinate=new se(i,e,s(this,wa))}return s(this,xo).coordinate}get floor(){let e=s(this,Dp).getById("floor",s(this,wa));if(e==null)throw new Error("Floor ".concat(s(this,wa)," not found!"));return e}get geoJSON(){return{...s(this,Ea),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(s(this,xo)))delete s(this,xo)[e]}};Dp=new WeakMap,wa=new WeakMap,xo=new WeakMap,Ea=new WeakMap,Op=new WeakSet,ky=l(function(){let[e,i]=s(this,Ea).properties.symbolId.split("--");return{group:e,type:i}},"#getGroupAndTypeFromSymbolId"),l(bl,"Annotation"),d(bl,"__type","annotation");var Ly=bl,yn=Ly;g();var s8=l((r,t)=>{var c,u,h,m,y,b,x,C,v,S,I;let e={},i={},n={},o={},a={},p={};for(let w of r["location.json"]||[]){let E=new Da(t,{mvfData:w});if(e[w.id]=E,w.externalId&&(o[w.externalId]==null&&(o[w.externalId]=[]),o[w.externalId].push(E)),w.categories)for(let R of w.categories)a[R]==null&&(a[R]=[]),a[R].push(E);let D=[...(u=(c=w.obstructions)==null?void 0:c.map(R=>R.id))!=null?u:[],...(m=(h=w.spaces)==null?void 0:h.map(R=>R.id))!=null?m:[],...(b=(y=w.annotations)==null?void 0:y.map(R=>R.id))!=null?b:[],...(x=w.connections)!=null?x:[],...(v=(C=w.entrances)==null?void 0:C.map(R=>R.id))!=null?v:[],...(I=(S=w.areas)==null?void 0:S.map(R=>R.id))!=null?I:[]];for(let R of D)R&&(p[R]==null&&(p[R]=[]),p[R].push(E))}for(let w of r["category.json"]||[]){let E=new Lp(t,{mvfData:w});i[w.id]=E,w.parent&&(n[w.parent]==null&&(n[w.parent]=[]),n[w.parent].push(E))}return{locationCategoriesByParentId:n,locationProfilesById:e,locationCategoriesById:i,locationProfilesByExternalId:o,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:p}},"processMVFLocationProfilesAndCategories"),l8=l((r,t,e)=>{var v,S;let i={},n={},o={},a={},p={},c={},u={},h={},m={},y={},b={},x={},C=globalThis.Object.keys(r.space);for(let I of C){let w=r.space[I];if(w!=null)for(let E of w.features){x[E.properties.id]=I,u[E.properties.id]=E;for(let D of E.properties.destinationNodes)p[D]==null&&(p[D]=[]),p[D].push(E.properties.id);if(E.properties.kind==="desk-entrance"&&(c[E.properties.externalId]==null&&(c[E.properties.externalId]=[]),c[E.properties.externalId].push(...E.properties.destinationNodes)),!["void","desk-entrance"].includes((v=E.properties.kind)!=null?v:"")){if((S=E.properties.kind)!=null&&S.includes("connection")){let D=Ei(E.geometry.coordinates);y[D]==null&&(y[D]=[]),y[D].push(E.properties.id);continue}if(E.properties.kind==="poi"){let D=new gn(e,{floorId:I,mvfData:E});o[E.properties.id]=D,m[I]||(m[I]=[]),m[I].push(E),E.properties.externalId&&(a[E.properties.externalId]==null&&(a[E.properties.externalId]=[]),a[E.properties.externalId].push(D))}else{let D=new ut(e,{floorId:I,mvfData:E});i[E.properties.id]=D,E.properties.externalId&&(n[E.properties.externalId]==null&&(n[E.properties.externalId]=[]),n[E.properties.externalId].push(D)),h[I]||(h[I]=[]),h[I].push(E)}}}}for(let I in y){let w=y[I],E={};for(let R of w){let _=x[R],F=u[R],B=t==null?void 0:t["n_"+F.properties.id.split("s_")[1]];E[_]={...F,properties:{...F.properties,accessible:(B==null?void 0:B.accessible)===!0}}}let D=new yo(e,{mvfDataByFloorId:E});b[D.id]=D}return{spacesById:i,spacesByExternalId:n,poisById:o,poisByExternalId:a,connectionsById:b,spaceIdsByDestinationNodeId:p,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:u,connectionIdsByLatLon:y,mvfSpacesByFloorId:h,mvfPoisByFloorId:m}},"processMVFSpaces"),c8=l((r,t)=>{var a,p;let e={},i={},n={},o={};for(let c of r["node.geojson"].features){n[c.properties.id]=c;let u=new un(t,{mvfData:c,floorId:(a=c.properties.floor)!=null?a:c.properties.map});e[c.properties.id]=u,c.properties.externalId&&(i[c.properties.externalId]==null&&(i[c.properties.externalId]=[]),i[c.properties.externalId].push(u));let h=(p=c.properties.floor)!=null?p:c.properties.map;o[h]||(o[h]=[]),o[h].push(c)}return{nodesById:e,nodesByExternalId:i,mvfNodesById:n,mvfNodesByFloorId:o}},"processMVFNodes"),p8=l((r,t)=>{let e={},i={},n={},o={},a=globalThis.Object.keys(r.obstruction);for(let p of a){let c=r.obstruction[p];if(c!=null)for(let u of c.features){n[u.properties.id]=u;for(let m of u.properties.entrances)o[m]=u.properties.id;if(u.properties.kind==="Wall")continue;let h=new tr(t,{floorId:p,mvfData:u});e[u.properties.id]=h,u.properties.externalId&&(i[u.properties.externalId]==null&&(i[u.properties.externalId]=[]),i[u.properties.externalId].push(h))}}return{objectsById:e,objectsByExternalId:i,mvfObstructionById:n,obstructionIdByEntranceId:o}},"processMVFObstructions"),u8=l((r,t)=>{let e={},i={},n={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let o of r["floor.geojson"].features){n[o.properties.id]=o.properties;let a=new er(t,{mvfData:o});e[o.properties.id]=a,o.properties.externalId&&(i[o.properties.externalId]==null&&(i[o.properties.externalId]=[]),i[o.properties.externalId].push(a))}else for(let o of r["map.geojson"]){n[o.id]=o;let a=new er(t,{mvfData:{properties:o}});e[o.id]=a}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:n}},"processMVFFloors"),d8=l((r,t)=>{var c;let e={},i={},n={},o={},a={},p=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(p!=null)for(let u of p){let h=(c=r.facade)==null?void 0:c[u.id],m=new gp(t,{mvfData:u,facadeId:h==null?void 0:h.id});if(e[u.id]=m,u.externalId&&(i[u.externalId]==null&&(i[u.externalId]=[]),i[u.externalId].push(m)),n[u.id]=u,h){let y=new Dr(t,{mvfData:h,floorStackId:u.id});o[h.id]=y;for(let b of h.spaces)a[b.spaceId]=y}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:n,facadesById:o,facadesBySpaceId:a}},"processMVFFloorStacks"),h8=l((r,t)=>{let e={},i={},n=r["connection.json"].reduce((o,a)=>{a.nodes.forEach(c=>o[c]=a),e[a.id]=a;let p=t==null?void 0:t[a.nodes[0]];if(p!=null){let c=Ei(p.geometry.coordinates);i[c]==null&&(i[c]=[]),i[c].push(a.id)}return o},{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:n,mvfConnectionIdsByLatLon:i}},"processMVFConnections"),f8=l((r,t)=>{let e={},i={},n={},o={},a={},p=globalThis.Object.keys(r.entrance);for(let c of p){let u=r.entrance[c];if(u!=null)for(let h of u.features){o[h.properties.id]=h;let m=new qr(t,{floorId:c,mvfData:h});h.properties.node&&(n[h.properties.node]=m),e[h.properties.id]=m,h.properties.externalId&&(i[h.properties.externalId]==null&&(i[h.properties.externalId]=[]),i[h.properties.externalId].push(m)),a[c]||(a[c]=[]),a[c].push(h)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:n,mvfEntrancesById:o,mvfEntrancesByFloorId:a}},"processMVFEntrances"),m8=l((r,t,e)=>{var i;if(r.textAreas!=null)for(let n in r.textAreas){let o=(i=r.textAreas[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.textArea=p,u.textArea&&(u.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),g8=l((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"),y8=l((r,t)=>{var i,n;if(((i=r.enterprise)==null?void 0:i.enterpriseStyles)==null)return;let e=(n=r.enterprise)==null?void 0:n.enterpriseStyles;for(let o in e){let a=e[o];a.geometryAnchors.forEach(p=>{let c=t[p.geometryId];if(c!=null){let u=c.properties;u.style={styleId:o,edgeOffset:a.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),b8=l((r,t,e)=>{if(!(r.enterprise==null||r.enterprise.textures==null))for(let i of r.enterprise.textures)for(let n of i.geometryAnchors){let o=t[n.geometryId]||e[n.geometryId];if(o!=null){let a=o.properties;a.textures==null&&(a.textures=[]),a.textures.push(i)}}},"processMVFEnterpriseTextures"),v8=l((r,t)=>{let e={},i={},n={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n};let o=globalThis.Object.keys(r.annotation);for(let a of o){let p=r.annotation[a];if(p!=null)for(let c of p.features){i[c.properties.id]=c;let u=new yn(t,{floorId:a,mvfData:c});e[c.properties.id]=u,n[a]||(n[a]=[]),n[a].push(c)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n}},"processMVFAnnotations"),x8=l((r,t)=>{let e={},i={},n={};if(r.area==null)return{areasById:e,areasByExternalId:i,mvfAreasById:n};let o=globalThis.Object.keys(r.area);for(let a of o){let p=r.area[a];if(p!=null)for(let c of p.features){n[c.properties.id]=c;let u=new fn(t,{floorId:a,mvfData:c});e[c.properties.id]=u,c.properties.externalId&&(i[c.properties.externalId]==null&&(i[c.properties.externalId]=[]),i[c.properties.externalId].push(u))}}return{areasById:e,areasByExternalId:i,mvfAreasById:n}},"processMVFAreas"),yC=l((r,t)=>{var S,I,w,E,D,R,_,F,B,V,N,X,z;let e={},i={},n={},o={},a=((I=(S=r.enterprise)==null?void 0:S.locations)!=null?I:[]).reduce((U,te)=>(U[te.id]=te,U),{}),p={},c={},u={},h={},m={},y={},b=((w=r.enterprise)==null?void 0:w.venue)||{},x={},C={};for(let U of(D=(E=r.enterprise)==null?void 0:E.categories)!=null?D:[]){let te=new _p(t,{mvfData:U});p[U.id]=te,U.externalId&&(c[U.externalId]==null&&(c[U.externalId]=[]),c[U.externalId].push(te)),u[U.id]=U,U.locations.forEach(Z=>{m[Z]==null&&(m[Z]=[]),m[Z].push(U.id)})}let v={};for(let U of(_=(R=r.enterprise)==null?void 0:R.locationInstances)!=null?_:[]){let te=a[U.parent],Z=Object.keys(te),Ce={};for(let Pe of Z)Ce[Pe]=void 0;let me={...Ce,polygons:[],nodes:[],...U};v[me.parent]==null&&(v[me.parent]=[]),v[me.parent].push(new Oi(t,{mvfData:me,categoryIds:((B=(F=r.enterprise)==null?void 0:F.categoryPriorities)==null?void 0:B[me.id])||m[me.id],parentId:U.parent})),x[me.id]=U}for(let U in r.space){let te=r.space[U];if(te!=null)for(let Z of te.features)for(let Ce of Z.properties.destinationNodes)C[Ce]==null&&(C[Ce]=[]),C[Ce].push(Z.properties.id)}for(let U of(N=(V=r.enterprise)==null?void 0:V.locations)!=null?N:[]){let te=new Oi(t,{mvfData:U,categoryIds:((z=(X=r.enterprise)==null?void 0:X.categoryPriorities)==null?void 0:z[U.id])||m[U.id],locationInstances:v[U.id]});n[U.id]=te,U.externalId&&(o[U.externalId]==null&&(o[U.externalId]=[]),o[U.externalId].push(te)),U.nodes.forEach(Z=>{y[Z.id]==null&&(y[Z.id]=[]),y[Z.id].push(U.id)});for(let Z of U.polygons)h[Z.id]==null&&(h[Z.id]=[]),h[Z.id].push(U)}if(t.enterpriseMode===!0){for(let U in t.mvfConnectionsById){let te={},Z=t.mvfConnectionsById[U];for(let Ce of t.mvfConnectionsById[U].nodes){let me=t.nodesById[Ce];me!=null&&(te[me.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[me.coordinate.longitude,me.coordinate.latitude]},properties:{id:U,externalId:Z.externalId,kind:"enterprise."+Z.type,destinationNodes:[],flags:"",type:Z.type,nodes:Z.nodes,accessible:Z.accessible,extra:Z.extra,details:Z.details}})}Object.keys(te).length>0&&(e[U]=new yo(t,{mvfDataByFloorId:te}),Z.externalId&&(i[Z.externalId]==null&&(i[Z.externalId]=[]),i[Z.externalId].push(e[U])))}t.connectionsById=e}return{spaceIdsByNodeId:C,connectionsByExternalId:i,locationIdsByNodeId:y,mvfLocationsBySpaceId:h,mvfLocationsById:a,mvfCategoriesById:u,locationsById:n,locationsByExternalId:o,locationInstancesById:x,categoriesById:p,categoriesByExternalId:c,venue:b}},"createEnterpriseDataFromMVF"),bC=l((r,t)=>{let{nodesById:e,nodesByExternalId:i,mvfNodesById:n,mvfNodesByFloorId:o}=c8(r,t),{mvfConnectionsById:a,mvfConnectionsByNodeId:p,mvfConnectionIdsByLatLon:c}=h8(r,n),{spacesById:u,spacesByExternalId:h,spaceIdsByDestinationNodeId:m,poisById:y,poisByExternalId:b,mvfSpacesById:x,objectEntranceNodeIdsByObstructionId:C,connectionsById:v,connectionIdsByLatLon:S,mvfSpacesByFloorId:I,mvfPoisByFloorId:w}=l8(r,p,t),{objectsById:E,objectsByExternalId:D,mvfObstructionById:R,obstructionIdByEntranceId:_}=p8(r,t),{floorsById:F,floorsByExternalId:B,mvfFloorsById:V}=u8(r,t),{floorStacksById:N,floorStacksByExternalId:X,mvfFloorStacksById:z,facadesById:U,facadesBySpaceId:te}=d8(r,t),{doorsById:Z,doorsByExternalId:Ce,doorsByNodeId:me,mvfEntrancesById:Pe,mvfEntrancesByFloorId:_e}=f8(r,t),{annotationsById:dr,mvfAnnotationsById:_t,mvfAnnotationsByFloorId:st}=v8(r,t),{areasById:et,areasByExternalId:hr,mvfAreasById:Vr}=x8(r,t);g8(r,x,R),m8(r,x,R),y8(r,x),b8(r,x,R);let{locationCategoriesByParentId:ge,locationProfilesById:ve,locationCategoriesById:$e,locationProfilesByExternalId:vt,locationProfilesByCategoryId:lt,locationProfilesByAttachedFeatureId:nn}=s8(r,t);return{spacesById:u,spacesByExternalId:h,nodesById:e,nodesByExternalId:i,objectsById:E,objectsByExternalId:D,floorsById:F,floorsByExternalId:B,floorStacksById:N,floorStacksByExternalId:X,facadesById:U,facadesBySpaceId:te,connectionsById:v,doorsById:Z,doorsByExternalId:Ce,doorsByNodeId:me,poisById:y,poisByExternalId:b,annotationsById:dr,areasById:et,areasByExternalId:hr,spaceIdsByDestinationNodeId:m,objectEntranceNodeIdsByObstructionId:C,obstructionIdByEntranceId:_,connectionIdsByLatLon:S,locationProfilesById:ve,locationCategoriesById:$e,locationProfilesByExternalId:vt,locationProfilesByCategoryId:lt,locationCategoriesByParentId:ge,mvfSpacesById:x,mvfNodesById:n,mvfObstructionById:R,mvfFloorsById:V,mvfFloorStacksById:z,mvfConnectionsById:a,mvfConnectionsByNodeId:p,mvfEntrancesById:Pe,mvfAnnotationsById:_t,mvfNodesByFloorId:o,mvfSpacesByFloorId:I,mvfPoisByFloorId:w,mvfAreasById:Vr,mvfEntrancesByFloorId:_e,mvfAnnotationsByFloorId:st,locationProfilesByAttachedFeatureId:nn,mvfConnectionIdsByLatLon:c}},"createDataFromMVF");g();g();g();var C8=l(function(){let t=globalThis.fetch;return{fetch(...e){if(!Mp(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")(),vC=C8.fetch;var TC=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],xC=TC[0],MC="https://api-gateway.mappedin.com/track-analytics/a/",IC="deny-watchposition",PC="load-mapview",wC="load-mapdata",EC="change-language",DC="query-directions";var xn,$r,vl,Vh,Fy=class Fy{constructor(){T(this,vl);T(this,xn,Object.freeze({}));T(this,$r);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",Vx((t,e)=>this.sendAnalyticEvent(DC,{start:t,end:e,type:"location_to_location"}),2500));P(this,$r,G(this,vl,Vh).call(this,s(this,xn)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){P(this,xn,{}),P(this,$r,G(this,vl,Vh).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return P(this,xn,Object.freeze(Object.assign({},s(this,xn),t))),P(this,$r,G(this,vl,Vh).call(this,t)),s(this,$r)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=Ay({...s(this,$r),mapId:e.mapId})),e.context&&(e.context=SC(e.context)),e.baseUri&&(e.analyticsBaseUrl=Ay({baseUri:e.baseUri,mapId:s(this,$r).mapId})),Object.assign(s(this,$r),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 s(this,$r)}getContext(){return this.getState().context||s(this,xn).context||xC}getSessionId(){return this.getState().sessionId||s(this,xn).sessionId||CC()}sendAnalyticEvent(t,e={}){let i=this.getState(),n=T8(i.analyticsBaseUrl,t),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&L.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return L.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)),vC(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(t,e){if(I8.includes(t))return L.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=M8.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(wC,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(EC,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(IC)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(PC,{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)}};xn=new WeakMap,$r=new WeakMap,vl=new WeakSet,Vh=l(function(t){var i,n,o,a;let e=(i=t.baseUri)!=null?i:MC;return{baseUri:e,analyticsBaseUrl:Ay({...t,baseUri:e}),version:((n=M==null?void 0:M.env)==null?void 0:n.npm_package_version)||"v6",deviceId:t.deviceId||S8(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||CC(),platformString:t.platformString||"",context:SC(t.context)||xC,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"),l(Fy,"AnalyticsInternal");var xl=Fy;function Ay({mapId:r,baseUri:t=MC}){return"".concat(t).concat(r,"/")}l(Ay,"getBaseUrl");function S8(){return ua.getInstance().loadLocalData("deviceId")}l(S8,"getDeviceIDFromStorage");function CC(){return ua.getInstance().loadSessionData("id")}l(CC,"getSessionIDFromStorage");function T8(r,t){return r+t}l(T8,"buildUrl");function SC(r){return TC.find(t=>t===r)}l(SC,"getValidContext");var M8=["$select-location","$select-category","$query-suggest","$query-search"],I8=[PC,wC,DC,IC,EC],VH=new xl,Cn,By=class By{constructor(t){T(this,Cn);d(this,"capture");d(this,"updateState");P(this,Cn,t),this.capture=s(this,Cn).capture.bind(s(this,Cn)),this.updateState=s(this,Cn).updateState.bind(s(this,Cn))}getState(){return Object.assign({},s(this,Cn).getState())}};Cn=new WeakMap,l(By,"Analytics");var kp=By;g();var P8=new Set(["polygons"]),Jr,He,rr,Ap,Cl=class Cl extends pt{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Cl.__type);d(this,"description");d(this,"name","");d(this,"amenity");d(this,"externalId","");d(this,"extra");d(this,"gallery");d(this,"instances");d(this,"logo");d(this,"operationHours");d(this,"phone");d(this,"picture");d(this,"shortName");d(this,"showFloatingLabelWhenImagePresent");d(this,"showLogo");d(this,"siblingGroups");d(this,"social");d(this,"sortOrder",-1);d(this,"states");d(this,"tags");d(this,"type","");T(this,Jr);T(this,He,{});T(this,rr);T(this,Ap);P(this,Jr,e),P(this,rr,i.mvfData),P(this,Ap,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let n in i.mvfData)!P8.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(i.parentId){let o=s(this,Jr).locationsById[i.parentId];return s(this,rr)[n]!=null?s(this,Jr).getPropTranslation(this.__type,n,s(this,rr).id,s(this,rr)[n]):s(this,Jr).getPropTranslation(this.__type,n,s(this,rr).id,o[n])}return s(this,Jr).getPropTranslation(this.__type,n,s(this,rr).id,s(this,rr)[n])}})}static is(e){return e.__type===Cl.__type}get focusTarget(){return this.spaces}get categories(){return s(this,He).categories?s(this,He).categories:(s(this,He).categories=(s(this,Ap).map(e=>s(this,Jr).getById("enterprise-category",e))||[]).filter(Boolean),s(this,He).categories)}get coordinates(){if(s(this,He).coordinates)return s(this,He).coordinates;s(this,He).coordinates=[];for(let e=0;e<this.nodes.length;e++)s(this,He).coordinates.push(this.nodes[e].coordinate);return s(this,He).coordinates}get nodes(){if(s(this,He).nodes)return s(this,He).nodes;s(this,He).nodes=[];for(let e=0;e<s(this,rr).nodes.length;e++){let i=s(this,Jr).getById("node",s(this,rr).nodes[e].id);i&&s(this,He).nodes.push(i)}return s(this,He).nodes}get spaces(){if(s(this,He).spaces)return s(this,He).spaces;s(this,He).spaces=[];for(let e=0;e<s(this,rr).polygons.length;e++){let i=s(this,Jr).getById("space",s(this,rr).polygons[e].id);i&&s(this,He).spaces.push(i)}return s(this,He).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,He)))delete s(this,He)[e]}};Jr=new WeakMap,He=new WeakMap,rr=new WeakMap,Ap=new WeakMap,l(Cl,"EnterpriseLocation"),d(Cl,"__type","enterprise-location");var Ry=Cl,Oi=Ry;g();var w8=new Set,Oa,Ht,ki,Sl=class Sl extends pt{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Sl.__type);d(this,"name","");d(this,"color");d(this,"externalId","");d(this,"extra");d(this,"icon");d(this,"iconFromDefaultList");d(this,"sortOrder",-1);d(this,"picture");T(this,Oa);T(this,Ht,{});T(this,ki);P(this,Oa,e),P(this,ki,i.mvfData);for(let n in i.mvfData)!w8.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,Oa).getPropTranslation(this.__type,n,s(this,ki).id,s(this,ki)[n])}})}static is(e){return e.__type===Sl.__type}get children(){if(s(this,Ht).children)return s(this,Ht).children;s(this,Ht).children=[];for(let e=0;e<s(this,ki).children.length;e++){let i=s(this,Oa).getById("enterprise-category",s(this,ki).children[e]);i&&s(this,Ht).children.push(i)}return s(this,Ht).children}get locations(){if(s(this,Ht).locations)return s(this,Ht).locations;s(this,Ht).locations=[];for(let e=0;e<s(this,ki).locations.length;e++){let i=s(this,Oa).getById("enterprise-location",s(this,ki).locations[e]);i&&s(this,Ht).locations.push(i)}return s(this,Ht).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Ht)))delete s(this,Ht)[e]}};Oa=new WeakMap,Ht=new WeakMap,ki=new WeakMap,l(Sl,"EnterpriseCategory"),d(Sl,"__type","enterprise-category");var Ny=Sl,_p=Ny;g();var E8=new Set,Fp,Bp,Tl=class Tl extends pt{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Tl.__type);d(this,"countrycode");d(this,"externalId","");d(this,"defaultLanguage",{code:"en",name:"English"});d(this,"defaultMap");d(this,"extra");d(this,"icon");d(this,"languages",[]);d(this,"links",[]);d(this,"logo");d(this,"mappedinWebUrl");d(this,"slug","");d(this,"topLocations");d(this,"tzid");T(this,Fp,{});T(this,Bp);P(this,Bp,i.mvfData);for(let n in i.mvfData)!E8.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(e){return e.__type===Tl.__type}get name(){var e;return(e=s(this,Bp).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Fp)))delete s(this,Fp)[e]}};Fp=new WeakMap,Bp=new WeakMap,l(Tl,"EnterpriseVenue"),d(Tl,"__type","enterprise-venue");var Gy=Tl,jh=Gy;g();g();function Ml(r){return r.endsWith("/")?r:"".concat(r,"/")}l(Ml,"normalizeUrl");g();var Il="https://app.mappedin.com/",OC="https://auth.mappedin.com/";g();g();var D8=l(r=>{let t=Date.now();return r-t},"fromNow"),Uh=l((r,t)=>D8(r)<=t*60*1e3,"shouldRefreshToken");var LC=60,kC=LC*60*1e3,_C="accessTokens";async function Rp(r,t=!1){let e="".concat(r.key),i=ua.getInstance(),n=(i==null?void 0:i.loadSessionData(_C))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&!Uh(n[e].expiresTimestamp*1e3,LC))return n[e];let a=t?await O8(r,o):await _8(r,o),p={...n,[e]:a};return i==null||i.saveSessionData(_C,p),a}l(Rp,"getAccessToken");async function O8(r,t){var o;let e="".concat((o=r.baseAuthUri)!=null?o:OC,"oauth2/token"),i=await Kr()(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}}l(O8,"fetchAccessTokenEnterprise");async function _8(r,t){let e="".concat(r.baseAuthUri?Ml(r.baseAuthUri):Il,"api/api-key/token"),i=await Kr()(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}}l(_8,"fetchAccessToken");g();var FC=60,BC=FC*60*1e3,AC="miSasTokens";async function Vy(r,t){let e="".concat(t,"__").concat(r.mapId),i=ua.getInstance(),n=(i==null?void 0:i.loadSessionData(AC))||{};if(n[e]&&!Uh(n[e].expires,FC))return n[e];let o=await L8(r,t),a={...n,[e]:{token:o.token,expires:new Date(o.expires).getTime()}};return i==null||i.saveSessionData(AC,a),o}l(Vy,"getSasToken");async function L8(r,t){let e="".concat(r.baseUri?Ml(r.baseUri):Il,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await Kr()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let n=await i.json();return{token:n.token,expires:new Date(n.expires).getTime()}}l(L8,"fetchSasToken");var RC=globalThis.fetch,GC,k8=(GC=M==null?void 0:M.env)==null?void 0:GC.npm_package_version;function Kr(){if(RC==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return RC}l(Kr,"isomorphicFetch");var jy={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function VC(r){var e;let t={...jy,...r};return t.headers={...t.headers,"mappedin-sdk-version":k8},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}l(VC,"parseOptions");function A8(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete 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));let o={method:"GET",headers:n};return r.secure&&(t+="&withcdntoken"),{req:o,url:t}}l(A8,"constructParamsForRequest");async function F8(r,t,e=!1){let i=A8(r,t,e),n=await Kr()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}l(F8,"generateAPIRequest");var B8=l(r=>{let t=r!=null&&typeof r=="object"&&"perspectives"in r&&r.perspectives!=null&&typeof r.perspectives=="object"?r.perspectives:null;if(t==null||Object.keys(t).length===0)return L.warn("No perspectives available in response!"),null;let e={};for(let[i,n]of Object.entries(t)){let o="url"in n&&typeof n.url=="string"?n.url:null,a="locale_packs"in n&&typeof n.locale_packs=="object"?n.locale_packs:null;if(o==null||a==null){L.warn("Perspective ".concat(i," is missing url or locale_packs!"));continue}e[i]={url:o,locale_packs:a}}return e},"getPerspectivesFromResponse");async function R8(r,t="exports/mvf/1/bundle"){var u,h;let e=VC({baseUri:"https://api-gateway.mappedin.com/",...jy,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((u=e.version)!=null?u:"2.0.0");e.headers["Content-Type"]="application/zip";let n=await F8(e,i),o=n.url,a=n.locale_packs,p=(h=e.perspective)!=null?h:jy.perspective,c=B8(n);if(p!=null&&p!==""&&c!=null){let m=c[p];m==null?L.warn("Perspective ".concat(p," not found in response! Loading default perspective instead.")):(L.log('Loading perspective "'.concat(p,'"')),o=m.url,a=m.locale_packs)}return{url:o,localePacks:a,updated_at:n.updated_at}}l(R8,"getVenueMVFURL");var Np=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function Uy(r,{signal:t}){let e=await(await Kr()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}l(Uy,"getLanguagePackUnitArray");async function Pl(r){let e=(await import("./browser-4WZEG5RQ.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let n=e["enterprise/locations.json"];n&&(i.enterprise.locations=JSON.parse(Np().decode(n)));let o=e["enterprise/categories.json"];o&&(i.enterprise.categories=JSON.parse(Np().decode(o)))}return e["floorstack.json"]&&(i["floorstack.json"]=JSON.parse(Np().decode(e["floorstack.json"]))),e["floor.geojson"]&&(i["floor.geojson"]=JSON.parse(Np().decode(e["floor.geojson"]))),e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Np().decode(e["manifest.json"]))),i}l(Pl,"parseLanguagePack");async function jC(r,{signal:t}){try{let e=await(await Kr()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Pl(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}l(jC,"downloadLanguagePack");async function Hy(r){return new Promise(async(t,e)=>{try{let i=r.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:n,localePacks:o}=await R8(r,i),a=await Kr()(n).then(c=>c.arrayBuffer()),p=new Uint8Array(a);t({compressed:p,localePacks:o})}catch(i){e(i)}})}l(Hy,"downloadVenueBundleMVFAPIGateway");async function Wy(r,t){return new Promise(async(e,i)=>{try{let{url:n}=await N8(r,t),o=await Kr()(n).then(p=>p.arrayBuffer()),a=new Uint8Array(o);e(a)}catch(n){i(n)}})}l(Wy,"downloadMVF");async function N8(r,t){let e="".concat(r.baseUri?Ml(r.baseUri):Il,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await Kr()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}l(N8,"getMakerBundleURL");function Gp(r){var i,n,o,a,p,c,u,h,m,y,b,x,C,v,S,I,w,E;let t=new TextDecoder,e=t.decode.bind(t);try{let D={"connection.json":JSON.parse(e(r["connection.json"])),"manifest.geojson":JSON.parse(e(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(e(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(e(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(e(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":r["tileset.json"]?JSON.parse(e(r["tileset.json"])):void 0};if(r.enterprise!=null&&(D.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(D.enterprise.locations=JSON.parse(e((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(D.enterprise.categories=JSON.parse(e((a=r.enterprise)==null?void 0:a["categories.json"]))),(p=r.enterprise)!=null&&p["venue.json"]&&(D.enterprise.venue=JSON.parse(e((c=r.enterprise)==null?void 0:c["venue.json"]))),(u=r.enterprise)!=null&&u["layers.json"]&&(D.enterprise.layers=JSON.parse(e((h=r.enterprise)==null?void 0:h["layers.json"]))),(m=r.enterprise)!=null&&m["locationInstances.json"]&&(D.enterprise.locationInstances=JSON.parse(e((y=r.enterprise)==null?void 0:y["locationInstances.json"]))),(b=r.enterprise)!=null&&b["enterpriseStyles.json"]&&(D.enterprise.enterpriseStyles=JSON.parse(e((x=r.enterprise)==null?void 0:x["enterpriseStyles.json"]))),(C=r.enterprise)!=null&&C["textures.json"]&&(D.enterprise.textures=JSON.parse(e((v=r.enterprise)==null?void 0:v["textures.json"]))),(S=r.enterprise)!=null&&S["floorText.json"]&&(D.enterprise.floorText=JSON.parse(e((I=r.enterprise)==null?void 0:I["floorText.json"]))),(w=r.enterprise)!=null&&w["categoryPriorities.json"]&&(D.enterprise.categoryPriorities=JSON.parse(e((E=r.enterprise)==null?void 0:E["categoryPriorities.json"])))),r["floorstack.json"]!=null?D["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(D["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),D["floorstack.json"]==null&&D["mapstack.json"]==null&&D["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(D["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),D["floor.geojson"]==null&&D["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(D["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(D["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(D["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(D["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){D.annotation={};let _=Object.keys(r.annotation);for(let F of _){let B=F.replace(/\.json|\.geojson/g,"");D.annotation[B]=JSON.parse(e(r.annotation[F]))}}let R=Object.keys(r.space);for(let _ of R){let F=_.replace(/\.json|\.geojson/g,"");D.space[F]=JSON.parse(e(r.space[_]))}if(r.obstruction!=null){let _=Object.keys(r.obstruction);for(let F of _){let B=F.replace(/\.json|\.geojson/g,"");D.obstruction[B]=JSON.parse(e(r.obstruction[F]))}}else D.obstruction={};if(r.entrance!=null){let _=Object.keys(r.entrance);for(let F of _){let B=F.replace(/\.json|\.geojson/g,"");D.entrance[B]=JSON.parse(e(r.entrance[F]))}}else D.entrance={};if("floorImages"in r&&r.floorImages!=null){D.floorImages={};for(let _ of Object.keys(r.floorImages)){let F=_.replace(/\.json|\.geojson/g,"");D.floorImages[F]=JSON.parse(e(r.floorImages[_]))}}if("textAreas"in r&&r.textAreas!=null){D.textAreas={};for(let _ of Object.keys(r.textAreas)){let F=_.replace(/\.json|\.geojson/g,"");D.textAreas[F]=JSON.parse(e(r.textAreas[_]))}}if("facade"in r&&r.facade!=null){D.facade={};for(let _ of Object.keys(r.facade)){let F=_.replace(/\.json|\.geojson/g,"");D.facade[F]=JSON.parse(e(r.facade[_]))}}if("area"in r&&r.area!=null){D.area={};for(let _ of Object.keys(r.area)){let F=_.replace(/\.json|\.geojson/g,"");D.area[F]=JSON.parse(e(r.area[_]))}}return D}catch(D){throw L.error(D),new Error("MVF parsing failed! Probably encountered a bad file.")}}l(Gp,"parseMVF");function G8(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}l(G8,"validateStaticMVFFiles");async function Vp(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-4WZEG5RQ.js")).unzipSync(r);if(!G8(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"){L.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)}})}l(Vp,"unzipMVF");function _a(){let r="us",t={};function e(){return H8(z8(r),t)}return l(e,"getState"),{updateByUserOption(i){var n,o;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(n=i.analytics)!=null&&n.baseUri&&(t.analyticsBaseUri=(o=i.analytics)==null?void 0:o.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?NC.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?NC.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}l(_a,"createEnvControl");var UC=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),NC=Object.freeze({...UC,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),V8=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),j8=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),U8=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function H8(r,t){return{...r,...t}}l(H8,"getAuthStateByEnvironment");var W8={eu:V8,us:UC,"us-staging-enterprise":j8,"us-staging-self-serve":U8};function z8(r){return W8[r]}l(z8,"getEnvironmentAuthState");var zy=l(r=>{var e,i;let t=Object.values((i=(e=r["floorstack.json"])!=null?e:r["mapstack.json"])!=null?i:{});return t.length===1?[]:t.filter(n=>n.type!=="Outdoor").map(n=>n.id.replace("fs_","").replace("ms_",""))},"getBuildingIds");g();function Xy(r){var n,o,a,p,c,u;let t=((o=(n=r.enterprise)==null?void 0:n.locations)==null?void 0:o.reduce((h,m)=>(h[m.id]=m,h),{}))||{};for(let h of((a=r.enterprise)==null?void 0:a.locationInstances)||[])t[h.id]=h;let e={};for(let h of r["floorstack.json"]||[])e[h.id]=h;let i={};for(let h of((p=r["floor.geojson"])==null?void 0:p.features)||[])h.properties&&h.properties.id&&(i[h.properties.id]=h.properties);return{type:"downloaded",data:r,optimized:{"enterprise-location":t,"enterprise-category":((u=(c=r.enterprise)==null?void 0:c.categories)==null?void 0:u.reduce((h,m)=>(h[m.id]=m,h),{}))||{},"floor-stack":e,floor:i}}}l(Xy,"parseLocalePackToLanguagePack");function HC(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}l(HC,"isMappedinCdnUrl");function WC(r){let t=r.split("?")[1];return!!(t!=null&&t.includes("sv="))}l(WC,"hasSasToken");g();g();g();g();g();g();g();var Zy=class Zy{constructor({origin:t,destination:e,distance:i=0,angle:n=0,pathWeight:o=0,multiplicativeDistanceWeightScaling:a=!0}){d(this,"origin");d(this,"destination");d(this,"distance");d(this,"angle");d(this,"weight");if(this.origin=t,this.destination=e,this.distance=i,this.angle=n,this.weight=o||0,a?t.properties.floor===e.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===e.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};l(Zy,"Edge");var La=Zy;g();g();g();g();function _r(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")}l(_r,"getCoord");function gr(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")}l(gr,"getCoords");function wl(r){return r.type==="Feature"?r.geometry:r}l(wl,"getGeom");function zC(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}l(zC,"getType");function Sn(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=_r(r),n=wl(t),o=n.type,a=t.bbox,p=n.coordinates;if(a&&X8(i,a)===!1)return!1;o==="Polygon"&&(p=[p]);for(var c=!1,u=0;u<p.length&&!c;u++)if(XC(i,p[u][0],e.ignoreBoundary)){for(var h=!1,m=1;m<p[u].length&&!h;)XC(i,p[u][m],!e.ignoreBoundary)&&(h=!0),m++;h||(c=!0)}return c}l(Sn,"booleanPointInPolygon");function XC(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],h=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(h)return!e;var m=p>r[1]!=u>r[1]&&r[0]<(c-a)*(r[1]-p)/(u-p)+a;m&&(i=!i)}return i}l(XC,"inRing");function X8(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}l(X8,"inBBox");g();g();function Tn([r,t],[e,i]){let n=t-i,o=r-e;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}l(Tn,"getAngle");g();var Z8=63710088e-1;function Qr(r,t){let[e,i]=r.map(h=>h*Math.PI/180),[n,o]=t.map(h=>h*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 Z8*u}l(Qr,"getDistance");g();g();function Hh(r,t,e,i){let[n,o]=r,[a,p]=t,[c,u]=e,[h,m]=i;if(o===p&&n===a||u===m&&c===h)return null;let y=(h-c)*(p-o)-(m-u)*(a-n);if(y===0)return null;let b=((m-u)*(n-c)-(h-c)*(o-u))/y,x=((p-o)*(n-c)-(a-n)*(o-u))/y;if(b<0||b>1||x<0||x>1)return null;let C=o+b*(p-o);return[n+b*(a-n),C]}l(Hh,"getLineIntersection");g();g();function ka(r,t,e,i){i===void 0&&(i={});var n=_r(r),o=Qt(n[0]),a=Qt(n[1]),p=Qt(e),c=Wx(t,i.units),u=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(p)),h=o+Math.atan2(Math.sin(p)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(u)),m=up(h),y=up(u);return Ti([m,y],i.properties)}l(ka,"destination");function Yy(r,t,e,i){let n=ka(r,e/1e3,i),o=ka(t,e/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}l(Yy,"getOffsetLine");g();function qy(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}l(qy,"radToDegNormalized");var ZC=111e3;function YC(r,t,e=[],i=0){let n=!0,o=r.geometry.coordinates,a=t.geometry.coordinates,p=qy(Tn(o,a)-Math.PI/2),c=qy(Tn(o,a)+Math.PI/2),u=i/ZC,h=i/(ZC*Math.cos(o[1]*Math.PI/180)),m=Math.min(o[1],a[1])-u,y=Math.max(o[1],a[1])+u,b=Math.min(o[0],a[0])-h,x=Math.max(o[0],a[0])+h;for(let C of e)if(!(Math.max(C[0][1],C[1][1])<m||Math.min(C[0][1],C[1][1])>y||Math.max(C[0][0],C[1][0])<b||Math.min(C[0][0],C[1][0])>x)){if(i>0){let v=Yy(o,a,i,p),S=Yy(o,a,i,c);if(Hh(v[0],v[1],C[0],C[1])||Hh(S[0],S[1],C[0],C[1])){n=!1;return}}else if(Hh(o,a,C[0],C[1])){n=!1;return}}return n}l(YC,"hasLineOfSight");var Aa,Mt,$y,qC,$C,JC,KC,QC,eS,zh,Jy=class Jy{constructor({nodes:t,groupBy:e,multiplicativeDistanceWeightScaling:i}){T(this,Mt);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);T(this,Aa);T(this,zh,l((t,e)=>{let i=0;for(let n of e)(!n[s(this,Aa)]||n[s(this,Aa)]===t.properties[s(this,Aa)])&&Sn(t.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i},"#getZonalCost"));P(this,Aa,e);let{features:n}=t;this.nodesById=G(this,Mt,qC).call(this,n),G(this,Mt,$C).call(this),G(this,Mt,JC).call(this,n,e,{multiplicativeDistanceWeightScaling:i})}getShortestEuclideanDistance(t,e){return e.reduce((i,n)=>{let o=Qr(t.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,disabledConnectionNodeIds:n,zones:o}){let a=G(this,Mt,$y).call(this,t),p=G(this,Mt,$y).call(this,e);if(a.length===0||p.length===0)return[];let{frontier:c,cameFrom:u,costSoFar:h}=G(this,Mt,KC).call(this,a,p);for(;c.length>0;){let m=c.shift();if(!m)break;if(G(this,Mt,QC).call(this,m.origin,p))return G(this,Mt,eS).call(this,u,m.origin.properties.id);for(let y of this.edges[m.origin.properties.id]){if(n!=null&&n.has(y.origin.properties.id)&&y.destination.properties.map!==y.origin.properties.map)continue;let b=h[m.origin.properties.id]+y.weight+s(this,zh).call(this,y.destination,o);if(!(b===1/0||i!=null&&i.has(y.destination.properties.id))&&(h[y.destination.properties.id]==null||b<h[y.destination.properties.id])){let x=b+this.getShortestEuclideanDistance(y.destination,p);h[y.destination.properties.id]=b,u[y.destination.properties.id]=y,c.push({origin:y.destination,priority:x})}}c.sort((y,b)=>y.priority-b.priority)}return[]}};Aa=new WeakMap,Mt=new WeakSet,$y=l(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),qC=l(function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},"#createNodesById"),$C=l(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"),JC=l(function(t,e,i){t.forEach(n=>{let o=e==="default"?e:n.properties[e];this.nodesByGroup.has(o)||this.nodesByGroup.set(o,[]),this.nodesByGroup.get(o).push(n),this.edges[n.properties.id]=n.properties.neighbors.map(({id:a,weight:p})=>{let c=this.nodesById[a],u=Qr(n.geometry.coordinates,c.geometry.coordinates),h=Tn(n.geometry.coordinates,c.geometry.coordinates);return new La({origin:n,destination:c,pathWeight:p,distance:u,angle:h,multiplicativeDistanceWeightScaling:i==null?void 0:i.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),KC=l(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"),QC=l(function(t,e){return e.some(i=>i.properties.id===t.properties.id)},"#isDestinationNode"),eS=l(function(t,e){let i=[],n=t[e];for(;n;)i.push(n),n=t[n.origin.properties.id];return i.reverse()},"#reconstructPath"),zh=new WeakMap,l(Jy,"NavigationGraph");var Wh=Jy;var Y8=.4,Ky=class Ky{constructor({nodes:t,geojsonCollection:e,groupBy:i="default",multiplicativeDistanceWeightScaling:n}){d(this,"groupBy");d(this,"graph");d(this,"geometryEdgesByMapId",new Map);d(this,"generatePath",l(t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<t.length;o++){let{origin:a,destination:p}=t[o],c={id:a.properties.id,angle:t[o].angle,distance:t[o].distance,destination:p.properties.id,edges:this.graph.edges[a.properties.id]};this.groupBy!=="default"&&(c.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:c})}let n={id:e.properties.id,edges:this.graph.edges[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"));d(this,"getDistance",l((t,e)=>Qr(t,e),"getDistance"));d(this,"getAngle",l((t,e)=>Tn(t,e),"getAngle"));this.groupBy=i,this.graph=new Wh({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:n}),((e==null?void 0:e.features)||[]).forEach(a=>{let p=null;if(a.geometry.type==="LineString"?p=a.geometry.coordinates:a.geometry.type==="Polygon"&&(p=a.geometry.coordinates.flat()),p){let c=this.groupBy==="default"?this.groupBy:a.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),p.forEach((u,h)=>{this.geometryEdgesByMapId.get(c).push([u,p[h+1]||p[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:n,disabledConnectionNodeIds:o,simplify:a,multiplicativeDistanceWeightScaling:p}){var m,y;let c=(m=a==null?void 0:a.enabled)!=null?m:!0,u=t!=null?t:[],h=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:u,excludedNodeIds:new Set(n),disabledConnectionNodeIds:new Set(o)});return h.length===0?{type:"FeatureCollection",features:[]}:(c&&(h=this.simplifyAllSteps(h,(y=a==null?void 0:a.bufferRadius)!=null?y:Y8,p)),this.generatePath(h))}simplifyAllSteps(t,e,i){var u,h;let n=[],o=[t[0]];for(let m=1;m<t.length;m++)if(this.groupBy!=="default"&&t[m].origin.properties[this.groupBy]!==t[m-1].origin.properties[this.groupBy]){let y=t[m-1].origin.properties[this.groupBy],b=(u=this.geometryEdgesByMapId.get(y))!=null?u:[];n.push(...this.simplifySteps(o,b,e,i)),o=[t[m]]}else o.push(t[m]);let a=t[t.length-1],p=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],c=(h=this.geometryEdgesByMapId.get(p))!=null?h:[];return n.push(...this.simplifySteps(o,c,e,i)),n}simplifySteps(t,e,i,n){if(t.length<3)return t;let o=[t[0]],a=1;for(let p=a+2;p<t.length;p++)if(t[a].origin.properties.preventSmoothing||!YC(t[a].origin,t[p].origin,e,i)){let c=p-1;o.push(new La({...t[a],destination:t[c].origin,distance:Qr(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates),angle:Tn(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates)})),a=c}return o.push(new La({...t[a],destination:t[t.length-1].origin,distance:Qr(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:Tn(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:n}),t[t.length-1]),o}};l(Ky,"Navigator");var El=Ky;g();var Pj={};ux(Pj,{Annotation:()=>yn,Area:()=>fn,Connection:()=>yo,Coordinate:()=>se,DOORS:()=>Sd,Door:()=>qr,E_SDK_LOG_LEVEL:()=>hx,EnterpriseCategory:()=>_p,EnterpriseLocation:()=>Oi,EnterpriseVenue:()=>jh,Facade:()=>Dr,Floor:()=>er,FloorStack:()=>gp,Hyperlink:()=>po,ImageMetaData:()=>ho,LocationCategory:()=>Lp,LocationProfile:()=>Da,MAPPEDIN_COLORS:()=>mC,MapObject:()=>tr,Node:()=>un,PointOfInterest:()=>gn,Space:()=>ut,WALLS:()=>Cd,__setWatermarkOnClickFn:()=>vj,createMapLibreOverlay:()=>Mj,disableText3DWorker:()=>f9,enableTestMode:()=>Xb,getMapData:()=>F9,getMapDataEnterprise:()=>Tj,hydrateMapData:()=>Sj,hydrateMapDataFromMVF:()=>xj,parseMVF:()=>Gp,preloadFont:()=>pv,setLoggerLevel:()=>fx,setUseEnterpriseAPI:()=>Cj,setWorkersUrl:()=>x9,show3dMap:()=>B9,show3dMapGeojson:()=>Ij,unzipMVF:()=>Vp});g();g();g();g();var Up,Hp,Wp,Qy=class Qy{constructor(t,e,{enabled:i=!1}={}){T(this,Up);d(this,"searchInstance");T(this,Hp);T(this,Wp);d(this,"enabled",!1);P(this,Up,t),P(this,Hp,e),P(this,Wp,()=>{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 L.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return L.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return L.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-7LLUWCE5.js").then(({InternalSearch:t})=>new t(s(this,Up)))),s(this,Hp).on("language-change",s(this,Wp)),await this.searchInstance)}};Up=new WeakMap,Hp=new WeakMap,Wp=new WeakMap,l(Qy,"Search");var jp=Qy;var tS=new WeakMap,Je,t1=class t1 extends ae{constructor(e,{search:i}={}){super();T(this,Je);d(this,"Analytics");d(this,"Search");d(this,"Query");d(this,"getDirections",l((e,i,n)=>s(this,Je).getDirections(e,i,n),"getDirections"));d(this,"getDirectionsMultiDestination",l((e,i,n)=>s(this,Je).getDirectionsMultiDestination(e,i,n),"getDirectionsMultiDestination"));P(this,Je,e),tS.set(this,e),this.Analytics=new kp(e.Analytics),this.Query=e.Query,this.Search=new jp(this,e,{enabled:i==null?void 0:i.enabled}),s(this,Je).on("language-change",n=>{this.publish("language-change",n)})}getEnv(){return s(this,Je).getEnv()}getAccessToken(){var e;return(e=s(this,Je).tokenManager)==null?void 0:e.getAccessToken().token}get mapName(){return s(this,Je).mapName}get mapCenter(){return s(this,Je).mapCenter}get organizationId(){return s(this,Je).organizationId}get outdoorViewToken(){return s(this,Je).outdoorViewToken}getByType(e){return s(this,Je).getByType(e)}getById(e,i){return s(this,Je).getById(e,i)}getByExternalId(e,i){return s(this,Je).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return s(this,Je).changeLanguage(e)}get currentLanguage(){return s(this,Je).currentLanguage}get naturalBearing(){var e;return(e=s(this,Je).naturalBearing)!=null?e:0}getDistance(e,i){return s(this,Je).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return s(this,Je).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return s(this,Je).toJSONBundle({downloadLanguagePacks:e})}};Je=new WeakMap,l(t1,"MapData");var e1=t1,Xh=e1;function zp(r){let t=tS.get(r);if(!t)throw new Error("MapDataInternal not found");return t}l(zp,"getMapDataInternal");g();g();g();g();g();function q8(r,t,e){e===void 0&&(e={});for(var i=_r(r),n=gr(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")),$8(n[o],n[o+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}l(q8,"booleanPointOnLine");function $8(r,t,e,i,n){var o=e[0],a=e[1],p=r[0],c=r[1],u=t[0],h=t[1],m=e[0]-p,y=e[1]-c,b=u-p,x=h-c,C=m*x-y*b;if(n!==null){if(Math.abs(C)>n)return!1}else if(C!==0)return!1;if(i){if(i==="start")return Math.abs(b)>=Math.abs(x)?b>0?p<o&&o<=u:u<=o&&o<p:x>0?c<a&&a<=h:h<=a&&a<c;if(i==="end")return Math.abs(b)>=Math.abs(x)?b>0?p<=o&&o<u:u<o&&o<=p:x>0?c<=a&&a<h:h<a&&a<=c;if(i==="both")return Math.abs(b)>=Math.abs(x)?b>0?p<o&&o<u:u<o&&o<p:x>0?c<a&&a<h:h<a&&a<c}else return Math.abs(b)>=Math.abs(x)?b>0?p<=o&&o<=u:u<=o&&o<=p:x>0?c<=a&&a<=h:h<=a&&a<=c;return!1}l($8,"isPointOnLineSegment");var rS=q8;g();function J8(r,t){t===void 0&&(t={});var e=Zs(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Ti([i,n],t.properties,t)}l(J8,"center");var Zh=J8;g();g();function K8(r,t,e){e===void 0&&(e={});var i=_r(r),n=_r(t),o=Qt(n[1]-i[1]),a=Qt(n[0]-i[0]),p=Qt(i[1]),c=Qt(n[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(p)*Math.cos(c);return Hx(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}l(K8,"distance");var Co=K8;function Yh(r,t){return t===void 0&&(t={}),Xx(r,function(e,i){var n=i.geometry.coordinates;return e+Co(n[0],n[1],t)},0)}l(Yh,"length");g();g();g();function qh(r,t,e){if(e===void 0&&(e={}),e.final===!0)return Q8(r,t);var i=_r(r),n=_r(t),o=Qt(i[0]),a=Qt(n[0]),p=Qt(i[1]),c=Qt(n[1]),u=Math.sin(a-o)*Math.cos(c),h=Math.cos(p)*Math.sin(c)-Math.sin(p)*Math.cos(c)*Math.cos(a-o);return up(Math.atan2(u,h))}l(qh,"bearing");function Q8(r,t){var e=qh(t,r);return e=(e+180)%360,e}l(Q8,"calculateFinalBearing");g();g();function ew(r){if(!r)throw new Error("geojson is required");var t=[];return Mi(r,function(e){tw(e,t)}),da(t)}l(ew,"lineSegment");function tw(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=gr(i);break;case"LineString":e=[gr(i)]}e.forEach(function(n){var o=rw(n,r.properties);o.forEach(function(a){a.id=t.length,t.push(a)})})}}l(tw,"lineSegmentFeature");function rw(r,t){var e=[];return r.reduce(function(i,n){var o=pn([i,n],t);return o.bbox=iw(i,n),e.push(o),n}),e}l(rw,"createSegments");function iw(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]}l(iw,"bbox");var r1=ew;var uI=la(cI(),1);function P_(r,t){var e={},i=[];if(r.type==="LineString"&&(r=ny(r)),t.type==="LineString"&&(t=ny(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=pI(r,t);return n&&i.push(n),da(i)}var o=(0,uI.default)();return o.load(r1(t)),oy(r1(r),function(a){oy(o.search(a),function(p){var c=pI(a,p);if(c){var u=gr(c).join(",");e[u]||(e[u]=!0,i.push(c))}})}),da(i)}l(P_,"lineIntersect");function pI(r,t){var e=gr(r),i=gr(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],h=i[1][0],m=i[1][1],y=(m-u)*(a-n)-(h-c)*(p-o),b=(h-c)*(o-u)-(m-u)*(n-c),x=(a-n)*(o-u)-(p-o)*(n-c);if(y===0)return null;var C=b/y,v=x/y;if(C>=0&&C<=1&&v>=0&&v<=1){var S=n+C*(a-n),I=o+C*(p-o);return Ti([S,I])}return null}l(pI,"intersects");var jl=P_;function w_(r,t,e){e===void 0&&(e={});var i=Ti([1/0,1/0],{dist:1/0}),n=0;return Mi(r,function(o){for(var a=gr(o),p=0;p<a.length-1;p++){var c=Ti(a[p]);c.properties.dist=Co(t,c,e);var u=Ti(a[p+1]);u.properties.dist=Co(t,u,e);var h=Co(c,u,e),m=Math.max(c.properties.dist,u.properties.dist),y=qh(c,u),b=ka(t,m,y+90,e),x=ka(t,m,y-90,e),C=jl(pn([b.geometry.coordinates,x.geometry.coordinates]),pn([c.geometry.coordinates,u.geometry.coordinates])),v=null;C.features.length>0&&(v=C.features[0],v.properties.dist=Co(t,v,e),v.properties.location=n+Co(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+h),v&&v.properties.dist<i.properties.dist&&(i=v,i.properties.index=p),n+=h}}),i}l(w_,"nearestPointOnLine");var lu=w_;function E_(r,t,e){var i=gr(e);if(zC(e)!=="LineString")throw new Error("line must be a LineString");var n=lu(e,r),o=lu(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),pn(p,e.properties)}l(E_,"lineSlice");var Hb=E_;var D_=1e-7;function Wb(r){return{type:"Point",coordinates:r}}l(Wb,"point");function O_(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,n=e.map(o=>lu(r,Wb(o)));return i.reduce((o,a)=>{let p=Hb(Wb(a),n[0],r),c=Hb(Wb(a),n[1],r),u=Yh(p)<Yh(c)?p:c;return u.properties={...r.properties,entrances:[]},o.concat([u])},[])}l(O_,"splitObstructionByEntrance");function zb(r,t){return t.reduce((e,i)=>{let n={epsilon:D_},o=e.obstructions.findIndex(p=>rS(Zh(i),p,n)),a=e.obstructions[o];if(a){let[p,c]=O_(a,i);e.entrances.push(i),e.obstructions.splice(o,1,p,c)}return e},{obstructions:[r],entrances:[]})}l(zb,"findAndSplitObstructionByAllEntrances");g();g();g();g();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:l(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var dI="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";g();g();var hI=!1;function Xb(){hI=!0}l(Xb,"enableTestMode");function fI(){return hI}l(fI,"isTestMode");var Zb=class Zb{constructor(t){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new Le);d(this,"width",0);d(this,"height",0);d(this,"options",{});d(this,"renderer");d(this,"enabledLayers",new Set([0,1]));d(this,"handleWebGLContextCreationError",l(t=>{var e,i;(i=(e=this.options).onWebGLContextCreationError)==null||i.call(e,t)},"handleWebGLContextCreationError"));d(this,"handleWebGLContextLost",l(t=>{var e,i;(i=(e=this.options).onWebGLContextLost)==null||i.call(e,t)},"handleWebGLContextLost"));d(this,"handleWebGLContextRestored",l(t=>{var e,i;(i=(e=this.options).onWebGLContextRestored)==null||i.call(e,t)},"handleWebGLContextRestored"));var e,i,n,o,a;try{this.options=t,fI()?(this.renderer={setSize:l(()=>{},"setSize"),state:{reset:l(()=>{},"reset")},properties:{get:l(()=>{},"get")},getSize:l(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:l(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:l(()=>1,"getClearAlpha"),getClearColor:l(()=>new Le,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:l(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:l(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:l(()=>{},"setRenderTarget"),setClearColor:l(()=>{},"setClearColor"),clear:l(()=>{},"clear"),render:l(()=>{},"render"),domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new Bx({canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Le((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(i=t.backgroundAlpha)!=null?i:1}catch(p){L.error(p),t.onWebGLRendererError&&t.onWebGLRendererError(p)}(n=this.domElement())==null||n.addEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(a=this.domElement())==null||a.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,e,i,n,o;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t)),(i=this.domElement())==null||i.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(n=this.domElement())==null||n.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(o=this.domElement())==null||o.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,e){if(this.renderer){this.renderer.state.reset();for(let i of this.enabledLayers.values())e.layers.enable(i);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){M.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}};l(Zb,"Renderer");var Zf=Zb;g();g();var mI='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';g();g();g();g();g();function gI(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}l(gI,"contains");g();function yI(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}l(yI,"intersectPoint");g();function bI(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}l(bI,"intersects");g();function wn(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}l(wn,"appendItems");g();var Yb=class Yb{constructor(t,e,i,n,o){d(this,"x");d(this,"y");d(this,"w");d(this,"h");d(this,"userData");this.userData=typeof o>"u"?null:o,this.x=t,this.y=e,this.w=i,this.h=n}contains(t){return t===this?!1:gI(this,t)}intersects(t){return bI(this,t)}intersectsPoint(t){return yI(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};l(Yb,"Rectangle");var ft=Yb;var Na=class Na{constructor(t,e){d(this,"topLeft");d(this,"topRight");d(this,"bottomLeft");d(this,"bottomRight");d(this,"divided",!1);d(this,"boundary");d(this,"capacity",16);d(this,"objects",[]);d(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:n}=this.boundary;this.topLeft=new Na(new ft(t,e,i/2,n/2),this),this.topRight=new Na(new ft(t+i/2,e,i/2,n/2),this),this.bottomLeft=new Na(new ft(t,e+n/2,i/2,n/2),this),this.bottomRight=new Na(new ft(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&&(wn(e,this.topLeft.queryRect(t)),wn(e,this.topRight.queryRect(t)),wn(e,this.bottomLeft.queryRect(t)),wn(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(wn(e,this.topLeft.queryPoint(t)),wn(e,this.topRight.queryPoint(t)),wn(e,this.bottomLeft.queryPoint(t)),wn(e,this.bottomRight.queryPoint(t))),e}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(e=>e.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};l(Na,"QuadTree");var Ri=Na;g();g();var vI=["","","low","medium","high","always-visible"];function xI(r){return Math.min(5,Math.max(2,r))}l(xI,"clampTierNumber");function Ul(r){if(typeof r=="number")return xI(r);let t=vI.indexOf(r);return t===-1?3:t}l(Ul,"convertCollisionRankingTierToNumber");function cu(r){let t=xI(r);return vI[t]}l(cu,"convertNumberToCollisionRankingTier");function SI(r,t,e){let i,n,o,a=null,p=0;e||(e={});let c=l(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 h=t-(u-p);return i=globalThis,n=arguments,h<=0||h>t?(a&&(clearTimeout(a),a=null),p=u,o=r.apply(i,n),a||(i=n=null)):!a&&e.trailing!==!1&&(a=setTimeout(c,h)),o}}l(SI,"throttle");var Ga=!1,qb="",L_=150,Jb=class Jb extends ae{constructor(e,i,n=qb?new Worker(qb):new Worker(URL.createObjectURL(new Blob([mI],{type:"text/javascript"})))){super();d(this,"worker");d(this,"debugContext");d(this,"debugCanvas");d(this,"collidersDirty",!0);d(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);d(this,"visibleCollidersQTree",new Ri(new ft(0,0,0,0)));d(this,"interactiveCollidersQTree",new Ri(new ft(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",l(()=>{Ga=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",l(()=>{Ga=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));d(this,"currentMsgId","");d(this,"working",!1);d(this,"_postMessage",l(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));d(this,"componentArray",[]);d(this,"update",l((e,i,n="bottom-left",o=!1)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let p;for(let c of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(c);u&&(p=u.components[0],this.componentArray.push(p))}this.resize(e,i,n),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(p=>p.collisionDirty===!0);a&&this.componentArray.sort((p,c)=>c.rank-p.rank);for(let p=0;p<this.componentArray.length;p++)if(this.packedMessage){let c=this.componentArray[p].toPackedMessage(o&&!a);this.packedMessage[0][p]==null&&(this.packedMessage[0][p]=[]),this.packedMessage[0][p][0]==null&&(this.packedMessage[0][p][0]=[]),this.packedMessage[0][p][0]=c.bboxes,this.packedMessage[0][p][1]=c.enabled&&this.componentArray[p].visible&&!this.componentArray[p].isOccluded?1:0,this.packedMessage[0][p][2]=c.rank===5?1:0,this.packedMessage[0][p][3]=c.x,this.packedMessage[0][p][4]=c.y,this.packedMessage[0][p][5]=c.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][p][6]=c.lockedToStrategyIndex}this.working||this.postMessage()},"update"));d(this,"resolve",l(e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,n=-1,o,a,p;Ga&&(this.visibleCollidersQTree=new Ri(new ft(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Ri(new ft(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let c=0;c<this.componentArray.length;c++){let u=this.componentArray[c];i[c]!=null&&(n=i[c][0],o=i[c][2],u.offscreen=i[c][1]===1,n!==-1&&o!=null?(p=new ft(o.x,o.y,o.w,o.h,{entityId:u.id}),Ga&&this.visibleCollidersQTree.insert(p),a=this.coreState.geometry2DMap.get(u.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new ft(o.x,o.y,o.w,o.h,{entityId:u.id})),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),n!==-1&&n!==u.currentStrategyIndex&&(u.activeBoundingBox=p,u.onStrategySelected(n))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),n!==-1&&n!==u.currentStrategyIndex&&u.onStrategySelected(n)))}Ga&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",l(()=>{Ga&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));d(this,"destroy",l(()=>{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=SI(this._postMessage,L_,!1),Ga?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}};l(Jb,"CollisionSystem");var Yf=Jb;function $b(r){qb=r}l($b,"setWorkerUrl");g();g();g();g();var Qb=class Qb{constructor(t){d(this,"type");d(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};l(Qb,"Tap");var qf=Qb,e0=class e0{constructor(){d(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};l(e0,"TapsController");var $f=e0;g();function TI(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 Me&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}l(TI,"getUniqueIntersectedGroupContainers");var Hl,t0=class t0 extends ae{constructor(e,i,n,o,a){super();d(this,"raycaster",new Ci);d(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});d(this,"coreState");d(this,"camera");d(this,"worldPlane");d(this,"_quadtree",new Ri(new ft(0,0,0,0)));d(this,"_container");d(this,"lastPointerEvent");d(this,"cursor","grab");d(this,"touchesCount",0);d(this,"isUserInteracting");d(this,"hasTouched",!1);T(this,Hl);d(this,"onPointerMoveRaf",l(e=>{this.lastPointerEvent=e,s(this,Hl)&&cancelAnimationFrame(s(this,Hl)),P(this,Hl,requestAnimationFrame(()=>{this.onPointerMove(e)}))},"onPointerMoveRaf"));d(this,"onPointerMove",l(e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()},"onPointerMove"));d(this,"tapsControl",new $f);d(this,"onPointerDown",l(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 qf(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));d(this,"clickTimeout");d(this,"onPointerUp",l(e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));d(this,"dirty3D",!0);d(this,"cachedHitBoxes",{entities:[],groups:[]});d(this,"ndcPoint",new ne);d(this,"debugPanel");this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=e,this.coreState=i,this.worldPlane=o,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}getThreeDIntersectsFromXY(e){return this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(n=>{var o,a;return((o=n.object)==null?void 0:o.name)==="worldPlane"||((a=n.object)==null?void 0:a.visible)})}getGroupContainerIntersectsFromXY(e){this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0);let i=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(o=>o.object.visible),n;return i!=null&&i.length>0&&(n=TI(i)),n}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:n,entity2D:o,position:a,groupContainers:p}=this.intersect(i);(this.detect3DEntityHover(n)||this.detect2DEntityHover(o)||this.detect3DContainerHover(p))&&(this.state.hovered3DEntity=n,this.state.lastHover=n,this.state.hovered2DEntity=o,this.state.hovered3DContainers=p,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:p})),this.handleCursor()}handleCursor(){var a;let e=!!(this.state.hovered3DEntity&&((a=this.state.hovered3DEntity)!=null&&a.components[2])||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=B_(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"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),(e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path"||(e==null?void 0:e.type)==="custom-geometry"?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var v,S,I,w,E;let i=[e.offsetX,e.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(D=>D.intersectsPoint(i)),a=this.coreState.containerOffset[0],p=this.coreState.containerOffset[1];this.ndcPoint.x=(e.clientX-p)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-a)/this._container.clientHeight)*2+1;let c=this.getThreeDIntersectsFromXY(this.ndcPoint),u=(v=c[0])==null?void 0:v.point,h=[],m=[];for(let D of c.filter(R=>R.object.name!=="worldPlane"))D.object instanceof de&&D.object.material.depthTest===!1?h.push(D):m.push(D);let y=(I=(S=h[0])!=null?S:m[0])!=null?I:void 0,b,x;if(y!=null){if(b=N_(y.object,this.coreState.geometry3DMap),!b){let D=(w=y==null?void 0:y.instanceId)!=null?w:y==null?void 0:y.batchId;b=D!=null&&(y!=null&&y.object.userData.entities)?this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entities[D]):this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entityId)}b!=null&&b.components[2]&&(x=b)}let C=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((E=o==null?void 0:o.userData)==null?void 0:E.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:x,position:u,groupContainers:C}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&II(this.state.lastHover,!1,this.coreState),e&&II(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!Gx(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var 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}};Hl=new WeakMap,l(t0,"InteractionSystem");var uu=t0;function II(r,t,e){var a;let i=r.components[2];i&&i.hover!==!0&&(i.hover=t?"user-interaction":!1,i.dirty=!0);let n=(a=r.components[0].textMesh)==null?void 0:a.userData.entityId;if(!n)return;let o=e.geometry3DMap.get(n);(o==null?void 0:o.type)==="text3d"&&(o.components[1].hoverByPolygon=t,o.components[1].dirty=!0)}l(II,"updateHover");function B_(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}l(B_,"processCursor");function R_(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof oo)return;if(t.userData.isSingleModel)return t;t=t.parent}}l(R_,"findModelParent");function N_(r,t){let e=R_(r);return e?t.get(e.userData.entityId):void 0}l(N_,"findModelParentEntity");g();g();var we;(function(r){r.assertEqual=n=>n;function t(n){}l(t,"assertIs"),r.assertIs=t;function e(n){throw new Error}l(e,"assertNever"),r.assertNever=e,r.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},r.getValidEnumValues=n=>{let o=r.objectKeys(n).filter(p=>typeof n[n[p]]!="number"),a={};for(let p of o)a[p]=n[p];return r.objectValues(a)},r.objectValues=n=>r.objectKeys(n).map(function(o){return n[o]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},r.find=(n,o)=>{for(let a of n)if(o(a))return a},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}l(i,"joinValues"),r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(we||(we={}));var i0;(function(r){r.mergeShapes=(t,e)=>({...t,...e})})(i0||(i0={}));var q=we.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Eo=l(r=>{switch(typeof r){case"undefined":return q.undefined;case"string":return q.string;case"number":return isNaN(r)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(r)?q.array:r===null?q.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?q.promise:typeof Map<"u"&&r instanceof Map?q.map:typeof Set<"u"&&r instanceof Set?q.set:typeof Date<"u"&&r instanceof Date?q.date:q.object;default:return q.unknown}},"getParsedType"),H=we.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),G_=l(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),im=class im extends Error{constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let e=t||function(o){return o.message},i={_errors:[]},n=l(o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(e(a));else{let p=i,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(p[u]=p[u]||{_errors:[]},p[u]._errors.push(e(a))):p[u]=p[u]||{_errors:[]},p=p[u],c++}}},"processError");return n(this),i}static assert(t){if(!(t instanceof im))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,we.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},i=[];for(let n of this.issues)n.path.length>0?(e[n.path[0]]=e[n.path[0]]||[],e[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:e}}get formErrors(){return this.flatten()}};l(im,"ZodError");var vr=im;vr.create=r=>new vr(r);var Yl=l((r,t)=>{let e;switch(r.code){case H.invalid_type:r.received===q.undefined?e="Required":e="Expected ".concat(r.expected,", received ").concat(r.received);break;case H.invalid_literal:e="Invalid literal value, expected ".concat(JSON.stringify(r.expected,we.jsonStringifyReplacer));break;case H.unrecognized_keys:e="Unrecognized key(s) in object: ".concat(we.joinValues(r.keys,", "));break;case H.invalid_union:e="Invalid input";break;case H.invalid_union_discriminator:e="Invalid discriminator value. Expected ".concat(we.joinValues(r.options));break;case H.invalid_enum_value:e="Invalid enum value. Expected ".concat(we.joinValues(r.options),", received '").concat(r.received,"'");break;case H.invalid_arguments:e="Invalid function arguments";break;case H.invalid_return_type:e="Invalid function return type";break;case H.invalid_date:e="Invalid date";break;case H.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(e='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(e="".concat(e," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?e='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?e='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):we.assertNever(r.validation):r.validation!=="regex"?e="Invalid ".concat(r.validation):e="Invalid";break;case H.too_small:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):e="Invalid input";break;case H.too_big:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?e="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):e="Invalid input";break;case H.custom:e="Invalid input";break;case H.invalid_intersection_types:e="Intersection results could not be merged";break;case H.not_multiple_of:e="Number must be a multiple of ".concat(r.multipleOf);break;case H.not_finite:e="Number must be finite";break;default:e=t.defaultError,we.assertNever(r)}return{message:e}},"errorMap"),EI=Yl;function V_(r){EI=r}l(V_,"setErrorMap");function Jf(){return EI}l(Jf,"getErrorMap");var Kf=l(r=>{let{data:t,path:e,errorMaps:i,issueData:n}=r,o=[...e,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let p="",c=i.filter(u=>!!u).slice().reverse();for(let u of c)p=u(a,{data:t,defaultError:p}).message;return{...n,path:o,message:p}},"makeIssue"),j_=[];function Y(r,t){let e=Jf(),i=Kf({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===Yl?void 0:Yl].filter(n=>!!n)});r.common.issues.push(i)}l(Y,"addIssueToContext");var nm=class nm{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let i=[];for(let n of e){if(n.status==="aborted")return pe;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,e){let i=[];for(let n of e){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return nm.mergeObjectSync(t,i)}static mergeObjectSync(t,e){let i={};for(let n of e){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return pe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}};l(nm,"ParseStatus");var Bt=nm,pe=Object.freeze({status:"aborted"}),zl=l(r=>({status:"dirty",value:r}),"DIRTY"),Wt=l(r=>({status:"valid",value:r}),"OK"),n0=l(r=>r.status==="aborted","isAborted"),o0=l(r=>r.status==="dirty","isDirty"),vu=l(r=>r.status==="valid","isValid"),xu=l(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Qf(r,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(r):i?i.value:t.get(r)}l(Qf,"__classPrivateFieldGet");function DI(r,t,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,e):n?n.value=e:t.set(r,e),e}l(DI,"__classPrivateFieldSet");var re;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(re||(re={}));var du,hu,s0=class s0{constructor(t,e,i,n){this._cachedPath=[],this.parent=t,this.data=e,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};l(s0,"ParseInputLazyPath");var Ar=s0,PI=l((r,t)=>{if(vu(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new vr(r.common.issues);return this._error=e,this._error}}},"handleResult");function he(r){if(!r)return{};let{errorMap:t,invalid_type_error:e,required_error:i,description:n}=r;if(t&&(e||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:l((a,p)=>{var c,u;let{message:h}=r;return a.code==="invalid_enum_value"?{message:h!=null?h:p.defaultError}:typeof p.data>"u"?{message:(c=h!=null?h:i)!==null&&c!==void 0?c:p.defaultError}:a.code!=="invalid_type"?{message:p.defaultError}:{message:(u=h!=null?h:e)!==null&&u!==void 0?u:p.defaultError}},"customMap"),description:n}}l(he,"processCreateParams");var l0=class l0{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Eo(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Bt,ctx:{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(xu(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let i=this.safeParse(t,e);if(i.success)return i.data;throw i.error}safeParse(t,e){var i;let n={common:{issues:[],async:(i=e==null?void 0:e.async)!==null&&i!==void 0?i:!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},o=this._parseSync({data:t,path:n.path,parent:n});return PI(n,o)}async parseAsync(t,e){let i=await this.safeParseAsync(t,e);if(i.success)return i.data;throw i.error}async safeParseAsync(t,e){let i={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(xu(n)?n:Promise.resolve(n));return PI(i,o)}refine(t,e){let i=l(n=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(n):e,"getIssueProperties");return this._refinement((n,o)=>{let a=t(n),p=l(()=>o.addIssue({code:H.custom,...i(n)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(p(),!1)):a?!0:(p(),!1)})}refinement(t,e){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof e=="function"?e(i,n):e),!1))}_refinement(t){return new xr({schema:this,typeName:le.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return kr.create(this,this._def)}nullable(){return Vi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return On.create(this,this._def)}promise(){return _o.create(this,this._def)}or(t){return Za.create([this,t],this._def)}and(t){return Ya.create(this,t,this._def)}transform(t){return new xr({...he(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new Qa({...he(this._def),innerType:this,defaultValue:e,typeName:le.ZodDefault})}brand(){return new Cu({typeName:le.ZodBranded,type:this,...he(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new es({...he(this._def),innerType:this,catchValue:e,typeName:le.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Su.create(this,t)}readonly(){return ts.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l(l0,"ZodType");var fe=l0,U_=/^c[^\s-]{8,}$/i,H_=/^[0-9a-z]+$/,W_=/^[0-9A-HJKMNP-TV-Z]{26}$/,z_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,X_=/^[a-z0-9_-]{21}$/i,Z_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Y_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,q_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",r0,$_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,J_=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,K_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OI="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Q_=new RegExp("^".concat(OI,"$"));function _I(r){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?t="".concat(t,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}l(_I,"timeRegexSource");function eL(r){return new RegExp("^".concat(_I(r),"$"))}l(eL,"timeRegex");function LI(r){let t="".concat(OI,"T").concat(_I(r)),e=[];return e.push(r.local?"Z?":"Z"),r.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(e.join("|"),")"),new RegExp("^".concat(t,"$"))}l(LI,"datetimeRegex");function tL(r,t){return!!((t==="v4"||!t)&&$_.test(r)||(t==="v6"||!t)&&J_.test(r))}l(tL,"isValidIP");var Va=class Va extends fe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==q.string){let o=this._getOrReturnCtx(t);return Y(o,{code:H.invalid_type,expected:q.string,received:o.parsedType}),pe}let i=new Bt,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),Y(n,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),Y(n,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,p=t.data.length<o.value;(a||p)&&(n=this._getOrReturnCtx(t,n),a?Y(n,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):p&&Y(n,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")Y_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"email",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")r0||(r0=new RegExp(q_,"u")),r0.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"emoji",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")z_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"uuid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")X_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"nanoid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")U_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"cuid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")H_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"cuid2",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")W_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"ulid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),Y(n,{validation:"url",code:H.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"regex",code:H.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),Y(n,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),Y(n,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),Y(n,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?LI(o).test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{code:H.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?Q_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{code:H.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?eL(o).test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{code:H.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?Z_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"duration",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?tL(t.data,o.version)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"ip",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?K_.test(t.data)||(n=this._getOrReturnCtx(t,n),Y(n,{validation:"base64",code:H.invalid_string,message:o.message}),i.dirty()):we.assertNever(o);return{status:i.value,value:t.data}}_regex(t,e,i){return this.refinement(n=>t.test(n),{validation:e,code:H.invalid_string,...re.errToObj(i)})}_addCheck(t){return new Va({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...re.errToObj(t)})}url(t){return this._addCheck({kind:"url",...re.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...re.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...re.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...re.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...re.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...re.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...re.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...re.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...re.errToObj(t)})}datetime(t){var e,i;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(e=t==null?void 0:t.offset)!==null&&e!==void 0?e:!1,local:(i=t==null?void 0:t.local)!==null&&i!==void 0?i:!1,...re.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...re.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...re.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...re.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...re.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...re.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...re.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...re.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...re.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...re.errToObj(e)})}nonempty(t){return this.min(1,re.errToObj(t))}trim(){return new Va({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Va({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Va({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};l(Va,"ZodString");var Do=Va;Do.create=r=>{var t;return new Do({checks:[],typeName:le.ZodString,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...he(r)})};function rL(r,t){let e=(r.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=e>i?e:i,o=parseInt(r.toFixed(n).replace(".","")),a=parseInt(t.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}l(rL,"floatSafeRemainder");var fu=class fu extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==q.number){let o=this._getOrReturnCtx(t);return Y(o,{code:H.invalid_type,expected:q.number,received:o.parsedType}),pe}let i,n=new Bt;for(let o of this._def.checks)o.kind==="int"?we.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),Y(i,{code:H.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),Y(i,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),Y(i,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?rL(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),Y(i,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),Y(i,{code:H.not_finite,message:o.message}),n.dirty()):we.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,re.toString(e))}gt(t,e){return this.setLimit("min",t,!1,re.toString(e))}lte(t,e){return this.setLimit("max",t,!0,re.toString(e))}lt(t,e){return this.setLimit("max",t,!1,re.toString(e))}setLimit(t,e,i,n){return new fu({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:re.toString(n)}]})}_addCheck(t){return new fu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:re.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:re.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&we.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(e===null||i.value>e)&&(e=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(e)&&Number.isFinite(t)}};l(fu,"ZodNumber");var ja=fu;ja.create=r=>new ja({checks:[],typeName:le.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...he(r)});var mu=class mu extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==q.bigint){let o=this._getOrReturnCtx(t);return Y(o,{code:H.invalid_type,expected:q.bigint,received:o.parsedType}),pe}let i,n=new Bt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),Y(i,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),Y(i,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),Y(i,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):we.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,re.toString(e))}gt(t,e){return this.setLimit("min",t,!1,re.toString(e))}lte(t,e){return this.setLimit("max",t,!0,re.toString(e))}lt(t,e){return this.setLimit("max",t,!1,re.toString(e))}setLimit(t,e,i,n){return new mu({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:re.toString(n)}]})}_addCheck(t){return new mu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};l(mu,"ZodBigInt");var Ua=mu;Ua.create=r=>{var t;return new Ua({checks:[],typeName:le.ZodBigInt,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...he(r)})};var c0=class c0 extends fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==q.boolean){let i=this._getOrReturnCtx(t);return Y(i,{code:H.invalid_type,expected:q.boolean,received:i.parsedType}),pe}return Wt(t.data)}};l(c0,"ZodBoolean");var Ha=c0;Ha.create=r=>new Ha({typeName:le.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...he(r)});var om=class om extends fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==q.date){let o=this._getOrReturnCtx(t);return Y(o,{code:H.invalid_type,expected:q.date,received:o.parsedType}),pe}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return Y(o,{code:H.invalid_date}),pe}let i=new Bt,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),Y(n,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),Y(n,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):we.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new om({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:re.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:re.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};l(om,"ZodDate");var Wa=om;Wa.create=r=>new Wa({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:le.ZodDate,...he(r)});var p0=class p0 extends fe{_parse(t){if(this._getType(t)!==q.symbol){let i=this._getOrReturnCtx(t);return Y(i,{code:H.invalid_type,expected:q.symbol,received:i.parsedType}),pe}return Wt(t.data)}};l(p0,"ZodSymbol");var ql=p0;ql.create=r=>new ql({typeName:le.ZodSymbol,...he(r)});var u0=class u0 extends fe{_parse(t){if(this._getType(t)!==q.undefined){let i=this._getOrReturnCtx(t);return Y(i,{code:H.invalid_type,expected:q.undefined,received:i.parsedType}),pe}return Wt(t.data)}};l(u0,"ZodUndefined");var za=u0;za.create=r=>new za({typeName:le.ZodUndefined,...he(r)});var d0=class d0 extends fe{_parse(t){if(this._getType(t)!==q.null){let i=this._getOrReturnCtx(t);return Y(i,{code:H.invalid_type,expected:q.null,received:i.parsedType}),pe}return Wt(t.data)}};l(d0,"ZodNull");var Xa=d0;Xa.create=r=>new Xa({typeName:le.ZodNull,...he(r)});var h0=class h0 extends fe{constructor(){super(...arguments),this._any=!0}_parse(t){return Wt(t.data)}};l(h0,"ZodAny");var Oo=h0;Oo.create=r=>new Oo({typeName:le.ZodAny,...he(r)});var f0=class f0 extends fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Wt(t.data)}};l(f0,"ZodUnknown");var Dn=f0;Dn.create=r=>new Dn({typeName:le.ZodUnknown,...he(r)});var m0=class m0 extends fe{_parse(t){let e=this._getOrReturnCtx(t);return Y(e,{code:H.invalid_type,expected:q.never,received:e.parsedType}),pe}};l(m0,"ZodNever");var ri=m0;ri.create=r=>new ri({typeName:le.ZodNever,...he(r)});var g0=class g0 extends fe{_parse(t){if(this._getType(t)!==q.undefined){let i=this._getOrReturnCtx(t);return Y(i,{code:H.invalid_type,expected:q.void,received:i.parsedType}),pe}return Wt(t.data)}};l(g0,"ZodVoid");var $l=g0;$l.create=r=>new $l({typeName:le.ZodVoid,...he(r)});var Xl=class Xl extends fe{_parse(t){let{ctx:e,status:i}=this._processInputParams(t),n=this._def;if(e.parsedType!==q.array)return Y(e,{code:H.invalid_type,expected:q.array,received:e.parsedType}),pe;if(n.exactLength!==null){let a=e.data.length>n.exactLength.value,p=e.data.length<n.exactLength.value;(a||p)&&(Y(e,{code:a?H.too_big:H.too_small,minimum:p?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&e.data.length<n.minLength.value&&(Y(e,{code:H.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&e.data.length>n.maxLength.value&&(Y(e,{code:H.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),e.common.async)return Promise.all([...e.data].map((a,p)=>n.type._parseAsync(new Ar(e,a,e.path,p)))).then(a=>Bt.mergeArray(i,a));let o=[...e.data].map((a,p)=>n.type._parseSync(new Ar(e,a,e.path,p)));return Bt.mergeArray(i,o)}get element(){return this._def.type}min(t,e){return new Xl({...this._def,minLength:{value:t,message:re.toString(e)}})}max(t,e){return new Xl({...this._def,maxLength:{value:t,message:re.toString(e)}})}length(t,e){return new Xl({...this._def,exactLength:{value:t,message:re.toString(e)}})}nonempty(t){return this.min(1,t)}};l(Xl,"ZodArray");var On=Xl;On.create=(r,t)=>new On({type:r,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...he(t)});function Wl(r){if(r instanceof or){let t={};for(let e in r.shape){let i=r.shape[e];t[e]=kr.create(Wl(i))}return new or({...r._def,shape:l(()=>t,"shape")})}else return r instanceof On?new On({...r._def,type:Wl(r.element)}):r instanceof kr?kr.create(Wl(r.unwrap())):r instanceof Vi?Vi.create(Wl(r.unwrap())):r instanceof Gi?Gi.create(r.items.map(t=>Wl(t))):r}l(Wl,"deepPartialify");var br=class br extends fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=we.objectKeys(t);return this._cached={shape:t,keys:e}}_parse(t){if(this._getType(t)!==q.object){let u=this._getOrReturnCtx(t);return Y(u,{code:H.invalid_type,expected:q.object,received:u.parsedType}),pe}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),p=[];if(!(this._def.catchall instanceof ri&&this._def.unknownKeys==="strip"))for(let u in n.data)a.includes(u)||p.push(u);let c=[];for(let u of a){let h=o[u],m=n.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new Ar(n,m,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof ri){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of p)c.push({key:{status:"valid",value:h},value:{status:"valid",value:n.data[h]}});else if(u==="strict")p.length>0&&(Y(n,{code:H.unrecognized_keys,keys:p}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of p){let m=n.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new Ar(n,m,n.path,h)),alwaysSet:h in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let h of c){let m=await h.key,y=await h.value;u.push({key:m,value:y,alwaysSet:h.alwaysSet})}return u}).then(u=>Bt.mergeObjectSync(i,u)):Bt.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return re.errToObj,new br({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:l((e,i)=>{var n,o,a,p;let c=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,e,i).message)!==null&&a!==void 0?a:i.defaultError;return e.code==="unrecognized_keys"?{message:(p=re.errToObj(t).message)!==null&&p!==void 0?p:c}:{message:c}},"errorMap")}:{}})}strip(){return new br({...this._def,unknownKeys:"strip"})}passthrough(){return new br({...this._def,unknownKeys:"passthrough"})}extend(t){return new br({...this._def,shape:l(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new br({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:l(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:le.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new br({...this._def,catchall:t})}pick(t){let e={};return we.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(e[i]=this.shape[i])}),new br({...this._def,shape:l(()=>e,"shape")})}omit(t){let e={};return we.objectKeys(this.shape).forEach(i=>{t[i]||(e[i]=this.shape[i])}),new br({...this._def,shape:l(()=>e,"shape")})}deepPartial(){return Wl(this)}partial(t){let e={};return we.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];t&&!t[i]?e[i]=n:e[i]=n.optional()}),new br({...this._def,shape:l(()=>e,"shape")})}required(t){let e={};return we.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])e[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof kr;)o=o._def.innerType;e[i]=o}}),new br({...this._def,shape:l(()=>e,"shape")})}keyof(){return kI(we.objectKeys(this.shape))}};l(br,"ZodObject");var or=br;or.create=(r,t)=>new or({shape:l(()=>r,"shape"),unknownKeys:"strip",catchall:ri.create(),typeName:le.ZodObject,...he(t)});or.strictCreate=(r,t)=>new or({shape:l(()=>r,"shape"),unknownKeys:"strict",catchall:ri.create(),typeName:le.ZodObject,...he(t)});or.lazycreate=(r,t)=>new or({shape:r,unknownKeys:"strip",catchall:ri.create(),typeName:le.ZodObject,...he(t)});var y0=class y0 extends fe{_parse(t){let{ctx:e}=this._processInputParams(t),i=this._def.options;function n(o){for(let p of o)if(p.result.status==="valid")return p.result;for(let p of o)if(p.result.status==="dirty")return e.common.issues.push(...p.ctx.common.issues),p.result;let a=o.map(p=>new vr(p.ctx.common.issues));return Y(e,{code:H.invalid_union,unionErrors:a}),pe}if(l(n,"handleResults"),e.common.async)return Promise.all(i.map(async o=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await o._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let c of i){let u={...e,common:{...e.common,issues:[]},parent:null},h=c._parseSync({data:e.data,path:e.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return e.common.issues.push(...o.ctx.common.issues),o.result;let p=a.map(c=>new vr(c));return Y(e,{code:H.invalid_union,unionErrors:p}),pe}}get options(){return this._def.options}};l(y0,"ZodUnion");var Za=y0;Za.create=(r,t)=>new Za({options:r,typeName:le.ZodUnion,...he(t)});var En=l(r=>r instanceof qa?En(r.schema):r instanceof xr?En(r.innerType()):r instanceof $a?[r.value]:r instanceof Ja?r.options:r instanceof Ka?we.objectValues(r.enum):r instanceof Qa?En(r._def.innerType):r instanceof za?[void 0]:r instanceof Xa?[null]:r instanceof kr?[void 0,...En(r.unwrap())]:r instanceof Vi?[null,...En(r.unwrap())]:r instanceof Cu||r instanceof ts?En(r.unwrap()):r instanceof es?En(r._def.innerType):[],"getDiscriminator"),am=class am extends fe{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==q.object)return Y(e,{code:H.invalid_type,expected:q.object,received:e.parsedType}),pe;let i=this.discriminator,n=e.data[i],o=this.optionsMap.get(n);return o?e.common.async?o._parseAsync({data:e.data,path:e.path,parent:e}):o._parseSync({data:e.data,path:e.path,parent:e}):(Y(e,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,i){let n=new Map;for(let o of e){let a=En(o.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let p of a){if(n.has(p))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(p)));n.set(p,o)}}return new am({typeName:le.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:n,...he(i)})}};l(am,"ZodDiscriminatedUnion");var em=am;function a0(r,t){let e=Eo(r),i=Eo(t);if(r===t)return{valid:!0,data:r};if(e===q.object&&i===q.object){let n=we.objectKeys(t),o=we.objectKeys(r).filter(p=>n.indexOf(p)!==-1),a={...r,...t};for(let p of o){let c=a0(r[p],t[p]);if(!c.valid)return{valid:!1};a[p]=c.data}return{valid:!0,data:a}}else if(e===q.array&&i===q.array){if(r.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<r.length;o++){let a=r[o],p=t[o],c=a0(a,p);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return e===q.date&&i===q.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}l(a0,"mergeValues");var b0=class b0 extends fe{_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=l((o,a)=>{if(n0(o)||n0(a))return pe;let p=a0(o.value,a.value);return p.valid?((o0(o)||o0(a))&&e.dirty(),{status:e.value,value:p.data}):(Y(i,{code:H.invalid_intersection_types}),pe)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};l(b0,"ZodIntersection");var Ya=b0;Ya.create=(r,t,e)=>new Ya({left:r,right:t,typeName:le.ZodIntersection,...he(e)});var sm=class sm extends fe{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.array)return Y(i,{code:H.invalid_type,expected:q.array,received:i.parsedType}),pe;if(i.data.length<this._def.items.length)return Y(i,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&i.data.length>this._def.items.length&&(Y(i,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let o=[...i.data].map((a,p)=>{let c=this._def.items[p]||this._def.rest;return c?c._parse(new Ar(i,a,i.path,p)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>Bt.mergeArray(e,a)):Bt.mergeArray(e,o)}get items(){return this._def.items}rest(t){return new sm({...this._def,rest:t})}};l(sm,"ZodTuple");var Gi=sm;Gi.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gi({items:r,typeName:le.ZodTuple,rest:null,...he(t)})};var gu=class gu extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.object)return Y(i,{code:H.invalid_type,expected:q.object,received:i.parsedType}),pe;let n=[],o=this._def.keyType,a=this._def.valueType;for(let p in i.data)n.push({key:o._parse(new Ar(i,p,i.path,p)),value:a._parse(new Ar(i,i.data[p],i.path,p)),alwaysSet:p in i.data});return i.common.async?Bt.mergeObjectAsync(e,n):Bt.mergeObjectSync(e,n)}get element(){return this._def.valueType}static create(t,e,i){return e instanceof fe?new gu({keyType:t,valueType:e,typeName:le.ZodRecord,...he(i)}):new gu({keyType:Do.create(),valueType:t,typeName:le.ZodRecord,...he(e)})}};l(gu,"ZodRecord");var tm=gu,v0=class v0 extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.map)return Y(i,{code:H.invalid_type,expected:q.map,received:i.parsedType}),pe;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([p,c],u)=>({key:n._parse(new Ar(i,p,i.path,[u,"key"])),value:o._parse(new Ar(i,c,i.path,[u,"value"]))}));if(i.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,h=await c.value;if(u.status==="aborted"||h.status==="aborted")return pe;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),p.set(u.value,h.value)}return{status:e.value,value:p}})}else{let p=new Map;for(let c of a){let u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return pe;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),p.set(u.value,h.value)}return{status:e.value,value:p}}}};l(v0,"ZodMap");var Jl=v0;Jl.create=(r,t,e)=>new Jl({valueType:t,keyType:r,typeName:le.ZodMap,...he(e)});var yu=class yu extends fe{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.set)return Y(i,{code:H.invalid_type,expected:q.set,received:i.parsedType}),pe;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(Y(i,{code:H.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),e.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(Y(i,{code:H.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),e.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let h of c){if(h.status==="aborted")return pe;h.status==="dirty"&&e.dirty(),u.add(h.value)}return{status:e.value,value:u}}l(a,"finalizeSet");let p=[...i.data.values()].map((c,u)=>o._parse(new Ar(i,c,i.path,u)));return i.common.async?Promise.all(p).then(c=>a(c)):a(p)}min(t,e){return new yu({...this._def,minSize:{value:t,message:re.toString(e)}})}max(t,e){return new yu({...this._def,maxSize:{value:t,message:re.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};l(yu,"ZodSet");var Kl=yu;Kl.create=(r,t)=>new Kl({valueType:r,minSize:null,maxSize:null,typeName:le.ZodSet,...he(t)});var Zl=class Zl extends fe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==q.function)return Y(e,{code:H.invalid_type,expected:q.function,received:e.parsedType}),pe;function i(p,c){return Kf({data:p,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Jf(),Yl].filter(u=>!!u),issueData:{code:H.invalid_arguments,argumentsError:c}})}l(i,"makeArgsIssue");function n(p,c){return Kf({data:p,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Jf(),Yl].filter(u=>!!u),issueData:{code:H.invalid_return_type,returnTypeError:c}})}l(n,"makeReturnsIssue");let o={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof _o){let p=this;return Wt(async function(...c){let u=new vr([]),h=await p._def.args.parseAsync(c,o).catch(b=>{throw u.addIssue(i(c,b)),u}),m=await Reflect.apply(a,this,h);return await p._def.returns._def.type.parseAsync(m,o).catch(b=>{throw u.addIssue(n(m,b)),u})})}else{let p=this;return Wt(function(...c){let u=p._def.args.safeParse(c,o);if(!u.success)throw new vr([i(c,u.error)]);let h=Reflect.apply(a,this,u.data),m=p._def.returns.safeParse(h,o);if(!m.success)throw new vr([n(h,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Zl({...this._def,args:Gi.create(t).rest(Dn.create())})}returns(t){return new Zl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,i){return new Zl({args:t||Gi.create([]).rest(Dn.create()),returns:e||Dn.create(),typeName:le.ZodFunction,...he(i)})}};l(Zl,"ZodFunction");var rm=Zl,x0=class x0 extends fe{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};l(x0,"ZodLazy");var qa=x0;qa.create=(r,t)=>new qa({getter:r,typeName:le.ZodLazy,...he(t)});var C0=class C0 extends fe{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return Y(e,{received:e.data,code:H.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:t.data}}get value(){return this._def.value}};l(C0,"ZodLiteral");var $a=C0;$a.create=(r,t)=>new $a({value:r,typeName:le.ZodLiteral,...he(t)});function kI(r,t){return new Ja({values:r,typeName:le.ZodEnum,...he(t)})}l(kI,"createZodEnum");var bu=class bu extends fe{constructor(){super(...arguments),du.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),i=this._def.values;return Y(e,{expected:we.joinValues(i),received:e.parsedType,code:H.invalid_type}),pe}if(Qf(this,du,"f")||DI(this,du,new Set(this._def.values),"f"),!Qf(this,du,"f").has(t.data)){let e=this._getOrReturnCtx(t),i=this._def.values;return Y(e,{received:e.data,code:H.invalid_enum_value,options:i}),pe}return Wt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return bu.create(t,{...this._def,...e})}exclude(t,e=this._def){return bu.create(this.options.filter(i=>!t.includes(i)),{...this._def,...e})}};l(bu,"ZodEnum");var Ja=bu;du=new WeakMap;Ja.create=kI;var S0=class S0 extends fe{constructor(){super(...arguments),hu.set(this,void 0)}_parse(t){let e=we.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==q.string&&i.parsedType!==q.number){let n=we.objectValues(e);return Y(i,{expected:we.joinValues(n),received:i.parsedType,code:H.invalid_type}),pe}if(Qf(this,hu,"f")||DI(this,hu,new Set(we.getValidEnumValues(this._def.values)),"f"),!Qf(this,hu,"f").has(t.data)){let n=we.objectValues(e);return Y(i,{received:i.data,code:H.invalid_enum_value,options:n}),pe}return Wt(t.data)}get enum(){return this._def.values}};l(S0,"ZodNativeEnum");var Ka=S0;hu=new WeakMap;Ka.create=(r,t)=>new Ka({values:r,typeName:le.ZodNativeEnum,...he(t)});var T0=class T0 extends fe{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==q.promise&&e.common.async===!1)return Y(e,{code:H.invalid_type,expected:q.promise,received:e.parsedType}),pe;let i=e.parsedType===q.promise?e.data:Promise.resolve(e.data);return Wt(i.then(n=>this._def.type.parseAsync(n,{path:e.path,errorMap:e.common.contextualErrorMap})))}};l(T0,"ZodPromise");var _o=T0;_o.create=(r,t)=>new _o({type:r,typeName:le.ZodPromise,...he(t)});var M0=class M0 extends fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:l(a=>{Y(i,a),a.fatal?e.abort():e.dirty()},"addIssue"),get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let a=n.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async p=>{if(e.value==="aborted")return pe;let c=await this._def.schema._parseAsync({data:p,path:i.path,parent:i});return c.status==="aborted"?pe:c.status==="dirty"||e.value==="dirty"?zl(c.value):c});{if(e.value==="aborted")return pe;let p=this._def.schema._parseSync({data:a,path:i.path,parent:i});return p.status==="aborted"?pe:p.status==="dirty"||e.value==="dirty"?zl(p.value):p}}if(n.type==="refinement"){let a=l(p=>{let c=n.refinement(p,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p},"executeRefinement");if(i.common.async===!1){let p=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return p.status==="aborted"?pe:(p.status==="dirty"&&e.dirty(),a(p.value),{status:e.value,value:p.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(p=>p.status==="aborted"?pe:(p.status==="dirty"&&e.dirty(),a(p.value).then(()=>({status:e.value,value:p.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!vu(a))return a;let p=n.transform(a.value,o);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:p}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>vu(a)?Promise.resolve(n.transform(a.value,o)).then(p=>({status:e.value,value:p})):a);we.assertNever(n)}};l(M0,"ZodEffects");var xr=M0;xr.create=(r,t,e)=>new xr({schema:r,typeName:le.ZodEffects,effect:t,...he(e)});xr.createWithPreprocess=(r,t,e)=>new xr({schema:t,effect:{type:"preprocess",transform:r},typeName:le.ZodEffects,...he(e)});var I0=class I0 extends fe{_parse(t){return this._getType(t)===q.undefined?Wt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};l(I0,"ZodOptional");var kr=I0;kr.create=(r,t)=>new kr({innerType:r,typeName:le.ZodOptional,...he(t)});var P0=class P0 extends fe{_parse(t){return this._getType(t)===q.null?Wt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};l(P0,"ZodNullable");var Vi=P0;Vi.create=(r,t)=>new Vi({innerType:r,typeName:le.ZodNullable,...he(t)});var w0=class w0 extends fe{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return e.parsedType===q.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};l(w0,"ZodDefault");var Qa=w0;Qa.create=(r,t)=>new Qa({innerType:r,typeName:le.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...he(t)});var E0=class E0 extends fe{_parse(t){let{ctx:e}=this._processInputParams(t),i={...e,common:{...e.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return xu(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new vr(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new vr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};l(E0,"ZodCatch");var es=E0;es.create=(r,t)=>new es({innerType:r,typeName:le.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...he(t)});var D0=class D0 extends fe{_parse(t){if(this._getType(t)!==q.nan){let i=this._getOrReturnCtx(t);return Y(i,{code:H.invalid_type,expected:q.nan,received:i.parsedType}),pe}return{status:"valid",value:t.data}}};l(D0,"ZodNaN");var Ql=D0;Ql.create=r=>new Ql({typeName:le.ZodNaN,...he(r)});var iL=Symbol("zod_brand"),O0=class O0 extends fe{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return this._def.type._parse({data:i,path:e.path,parent:e})}unwrap(){return this._def.type}};l(O0,"ZodBranded");var Cu=O0,lm=class lm extends fe{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.common.async)return l(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?pe:o.status==="dirty"?(e.dirty(),zl(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})},"handleAsync")();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?pe:n.status==="dirty"?(e.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,e){return new lm({in:t,out:e,typeName:le.ZodPipeline})}};l(lm,"ZodPipeline");var Su=lm,_0=class _0 extends fe{_parse(t){let e=this._def.innerType._parse(t),i=l(n=>(vu(n)&&(n.value=Object.freeze(n.value)),n),"freeze");return xu(e)?e.then(n=>i(n)):i(e)}unwrap(){return this._def.innerType}};l(_0,"ZodReadonly");var ts=_0;ts.create=(r,t)=>new ts({innerType:r,typeName:le.ZodReadonly,...he(t)});function AI(r,t={},e){return r?Oo.create().superRefine((i,n)=>{var o,a;if(!r(i)){let p=typeof t=="function"?t(i):typeof t=="string"?{message:t}:t,c=(a=(o=p.fatal)!==null&&o!==void 0?o:e)!==null&&a!==void 0?a:!0,u=typeof p=="string"?{message:p}:p;n.addIssue({code:"custom",...u,fatal:c})}}):Oo.create()}l(AI,"custom");var nL={object:or.lazycreate},le;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(le||(le={}));var oL=l((r,t={message:"Input not instance of ".concat(r.name)})=>AI(e=>e instanceof r,t),"instanceOfType"),FI=Do.create,BI=ja.create,aL=Ql.create,sL=Ua.create,RI=Ha.create,lL=Wa.create,cL=ql.create,pL=za.create,uL=Xa.create,dL=Oo.create,hL=Dn.create,fL=ri.create,mL=$l.create,gL=On.create,yL=or.create,bL=or.strictCreate,vL=Za.create,xL=em.create,CL=Ya.create,SL=Gi.create,TL=tm.create,ML=Jl.create,IL=Kl.create,PL=rm.create,wL=qa.create,EL=$a.create,DL=Ja.create,OL=Ka.create,_L=_o.create,wI=xr.create,LL=kr.create,kL=Vi.create,AL=xr.createWithPreprocess,FL=Su.create,BL=l(()=>FI().optional(),"ostring"),RL=l(()=>BI().optional(),"onumber"),NL=l(()=>RI().optional(),"oboolean"),GL={string:l(r=>Do.create({...r,coerce:!0}),"string"),number:l(r=>ja.create({...r,coerce:!0}),"number"),boolean:l(r=>Ha.create({...r,coerce:!0}),"boolean"),bigint:l(r=>Ua.create({...r,coerce:!0}),"bigint"),date:l(r=>Wa.create({...r,coerce:!0}),"date")},VL=pe,O=Object.freeze({__proto__:null,defaultErrorMap:Yl,setErrorMap:V_,getErrorMap:Jf,makeIssue:Kf,EMPTY_PATH:j_,addIssueToContext:Y,ParseStatus:Bt,INVALID:pe,DIRTY:zl,OK:Wt,isAborted:n0,isDirty:o0,isValid:vu,isAsync:xu,get util(){return we},get objectUtil(){return i0},ZodParsedType:q,getParsedType:Eo,ZodType:fe,datetimeRegex:LI,ZodString:Do,ZodNumber:ja,ZodBigInt:Ua,ZodBoolean:Ha,ZodDate:Wa,ZodSymbol:ql,ZodUndefined:za,ZodNull:Xa,ZodAny:Oo,ZodUnknown:Dn,ZodNever:ri,ZodVoid:$l,ZodArray:On,ZodObject:or,ZodUnion:Za,ZodDiscriminatedUnion:em,ZodIntersection:Ya,ZodTuple:Gi,ZodRecord:tm,ZodMap:Jl,ZodSet:Kl,ZodFunction:rm,ZodLazy:qa,ZodLiteral:$a,ZodEnum:Ja,ZodNativeEnum:Ka,ZodPromise:_o,ZodEffects:xr,ZodTransformer:xr,ZodOptional:kr,ZodNullable:Vi,ZodDefault:Qa,ZodCatch:es,ZodNaN:Ql,BRAND:iL,ZodBranded:Cu,ZodPipeline:Su,ZodReadonly:ts,custom:AI,Schema:fe,ZodSchema:fe,late:nL,get ZodFirstPartyTypeKind(){return le},coerce:GL,any:dL,array:gL,bigint:sL,boolean:RI,date:lL,discriminatedUnion:xL,effect:wI,enum:DL,function:PL,instanceof:oL,intersection:CL,lazy:wL,literal:EL,map:ML,nan:aL,nativeEnum:OL,never:fL,null:uL,nullable:kL,number:BI,object:yL,oboolean:NL,onumber:RL,optional:LL,ostring:BL,pipeline:FL,preprocess:AL,promise:_L,record:TL,set:IL,strictObject:bL,string:FI,symbol:cL,transformer:wI,tuple:SL,undefined:pL,union:vL,unknown:hL,void:mL,NEVER:VL,ZodIssueCode:H,quotelessJson:G_,ZodError:vr});var h7=la(U0());var Eu=4,kA=8,AA="0.6",d7="low-priority-pin",H0=O.object({rank:O.union([O.enum(["low","medium","high","always-visible"]),O.number()]).optional(),interactive:O.union([O.boolean(),O.literal("pointer-events-auto")]).optional(),id:O.string().optional(),anchor:O.union([O.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),O.array(O.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:O.boolean().optional(),zIndex:O.number().optional(),lowPriorityPin:O.object({enabled:O.boolean().optional(),size:O.number().positive().optional(),color:O.string().optional()}).optional()});function f7(r,t,e){O.array(O.number()).min(2).max(3).parse(r),O.string().parse(t),H0.parse(e)}l(f7,"validateMarker");var FA=Object.freeze({enabled:!0,size:kA,color:"#666"}),os=class os{constructor(t,e={}){d(this,"id");d(this,"type","marker");d(this,"rank",0);d(this,"initialRank",0);d(this,"activeAnchor","center");d(this,"pointerEvents","none");d(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...FA}});d(this,"projection",new ne);d(this,"enabled",!0);d(this,"canShow",!1);d(this,"visible",!0);d(this,"isOccluded",!1);d(this,"offscreen",!1);d(this,"strategyIndex",-1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"markerContainer");d(this,"containerEl");d(this,"contentEl",null);d(this,"contentHtml","");d(this,"style",{top:"0px",left:"0px"});d(this,"dirty",!1);d(this,"attachedDirty",!0);d(this,"collisionDirty",!0);d(this,"visibilityNeedsUpdate","show");d(this,"animation",null);d(this,"currentStrategyIndex",-1);d(this,"onStrategySelected",l((t,e=!1)=>{var n,o;if(this.currentStrategyIndex===t&&!e)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",d7);let a=this.options.lowPriorityPin,p=a.size,c=a.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(p,"px")),this.markerContainer.style.setProperty("--pin-color",c),this.markerContainer.style.opacity=AA,this.style.top=-p/2+"px",this.style.left=-p/2+"px"}else{this.activeAnchor=(o=(n=this.strategies[t])==null?void 0:n.name)!=null?o:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:a,height:p}=this.dimensions,c=-p/2+"px",u=-a/2+"px";switch(this.style.top=c,this.style.left=u,this.activeAnchor){case"top":{this.style.top=-p+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-a+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-p+"px",this.style.left=-a+"px";break}case"top-right":{this.style.top=-p+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-a+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=c,this.style.left=u}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));d(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var i,n,o;if(this.id=(e==null?void 0:e.id)||De(),this.options=(0,h7.default)(this.options,e),typeof e.rank=="string")this.rank=Ul(e.rank);else if(e.rank!=null&&e.rank>0)this.rank=e.rank;else{let a=Math.trunc(M.env.NODE_ENV==="test"?os.testId:os.testId*10)/10;os.testId+=.001,this.rank=a}typeof e.interactive=="string"&&(this.pointerEvents=e.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(i=this.markerContainer.firstElementChild)!=null?i:null,this.contentEl=(o=(n=this.markerContainer.firstElementChild)==null?void 0:n.firstElementChild)!=null?o:null}updateDimensions(t,e){if(t!=null&&e!=null)this.dimensions={width:t,height:e};else{let{width:i,height:n}=this.markerContainer.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var o;let{width:t,height:e}=this.dimensions;if(t===0||e===0)return[];let n=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(a=>({name:a,getBoundingBox:l(()=>{let p=e/2,c=e/2,u=t/2,h=t/2;switch(a){case"top":{p=e,c=0;break}case"bottom":{p=0,c=e;break}case"left":{u=t,h=0;break}case"right":{u=0,h=t;break}case"top-left":{p=e,u=t,c=0,h=0;break}case"top-right":{p=e,h=t,c=0,u=0;break}case"bottom-left":{c=e,u=t,p=0,h=0;break}case"bottom-right":{c=e,h=t,p=0,u=0;break}}return[p+Eu,c+Eu,u+Eu,h+Eu]},"getBoundingBox")}));if((o=this.options.lowPriorityPin)!=null&&o.enabled){let a={name:d7,getBoundingBox:l(()=>{let p=Math.max(2,Eu/2);return[this.options.lowPriorityPin.size/2+p,this.options.lowPriorityPin.size/2+p,this.options.lowPriorityPin.size/2+p,this.options.lowPriorityPin.size/2+p]},"getBoundingBox")};n.push(a)}return n}toPackedMessage(t=!1){var i;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let e=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&e&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,e&&this.currentStrategyIndex!==((i=this.packedMessage.bboxes[0])==null?void 0:i[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&e?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return(t=this.options.lowPriorityPin)!=null&&t.enabled?Array.isArray(this.options.anchor)?this.options.anchor.length:1:-1}destroy(){}};l(os,"MarkerComponent"),d(os,"testId",0);var ji=os;g();g();g();g();g();var W0=class W0{constructor(){d(this,"hover",!1);d(this,"dirty",!1)}};l(W0,"InteractionComponent");var ic=W0;g();g();function ym(r){"@babel/helpers - typeof";return ym=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},ym(r)}l(ym,"_typeof");var BA=/^\s+/,RA=/\s+$/;function K(r,t){if(r=r||"",t=t||{},r instanceof K)return r;if(!(this instanceof K))return new K(r,t);var e=NA(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}l(K,"tinycolor");K.prototype={isDark:l(function(){return this.getBrightness()<128},"isDark"),isLight:l(function(){return!this.isDark()},"isLight"),isValid:l(function(){return this._ok},"isValid"),getOriginalInput:l(function(){return this._originalInput},"getOriginalInput"),getFormat:l(function(){return this._format},"getFormat"),getAlpha:l(function(){return this._a},"getAlpha"),getBrightness:l(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:l(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:l(function(t){return this._a=C7(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:l(function(){var t=g7(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:l(function(){var t=g7(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:l(function(){var t=m7(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:l(function(){var t=m7(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:l(function(t){return y7(this._r,this._g,this._b,t)},"toHex"),toHexString:l(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:l(function(t){return UA(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:l(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:l(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:l(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:l(function(){return{r:Math.round(We(this._r,255)*100)+"%",g:Math.round(We(this._g,255)*100)+"%",b:Math.round(We(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:l(function(){return this._a==1?"rgb("+Math.round(We(this._r,255)*100)+"%, "+Math.round(We(this._g,255)*100)+"%, "+Math.round(We(this._b,255)*100)+"%)":"rgba("+Math.round(We(this._r,255)*100)+"%, "+Math.round(We(this._g,255)*100)+"%, "+Math.round(We(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:l(function(){return this._a===0?"transparent":this._a<1?!1:eF[y7(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:l(function(t){var e="#"+b7(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=K(t);i="#"+b7(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},"toFilter"),toString:l(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:l(function(){return K(this.toString())},"clone"),_applyModification:l(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:l(function(){return this._applyModification(XA,arguments)},"lighten"),brighten:l(function(){return this._applyModification(ZA,arguments)},"brighten"),darken:l(function(){return this._applyModification(YA,arguments)},"darken"),desaturate:l(function(){return this._applyModification(HA,arguments)},"desaturate"),saturate:l(function(){return this._applyModification(WA,arguments)},"saturate"),greyscale:l(function(){return this._applyModification(zA,arguments)},"greyscale"),spin:l(function(){return this._applyModification(qA,arguments)},"spin"),_applyCombination:l(function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},"_applyCombination"),analogous:l(function(){return this._applyCombination(KA,arguments)},"analogous"),complement:l(function(){return this._applyCombination($A,arguments)},"complement"),monochromatic:l(function(){return this._applyCombination(QA,arguments)},"monochromatic"),splitcomplement:l(function(){return this._applyCombination(JA,arguments)},"splitcomplement"),triad:l(function(){return this._applyCombination(v7,[3])},"triad"),tetrad:l(function(){return this._applyCombination(v7,[4])},"tetrad")};K.fromRatio=function(r,t){if(ym(r)=="object"){var e={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?e[i]=r[i]:e[i]=Du(r[i]));r=e}return K(r,t)};function NA(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=nF(r)),ym(r)=="object"&&(kn(r.r)&&kn(r.g)&&kn(r.b)?(t=GA(r.r,r.g,r.b),a=!0,p=String(r.r).substr(-1)==="%"?"prgb":"rgb"):kn(r.h)&&kn(r.s)&&kn(r.v)?(i=Du(r.s),n=Du(r.v),t=jA(r.h,i,n),a=!0,p="hsv"):kn(r.h)&&kn(r.s)&&kn(r.l)&&(i=Du(r.s),o=Du(r.l),t=VA(r.h,i,o),a=!0,p="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=C7(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}}l(NA,"inputToRGB");function GA(r,t,e){return{r:We(r,255)*255,g:We(t,255)*255,b:We(e,255)*255}}l(GA,"rgbToRgb");function m7(r,t,e){r=We(r,255),t=We(t,255),e=We(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}}l(m7,"rgbToHsl");function VA(r,t,e){var i,n,o;r=We(r,360),t=We(t,100),e=We(e,100);function a(u,h,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?u+(h-u)*6*m:m<1/2?h:m<2/3?u+(h-u)*(2/3-m)*6:u}if(l(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}}l(VA,"hslToRgb");function g7(r,t,e){r=We(r,255),t=We(t,255),e=We(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}}l(g7,"rgbToHsv");function jA(r,t,e){r=We(r,360)*6,t=We(t,100),e=We(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],h=[p,e,e,a,o,o][c],m=[o,o,p,e,e,a][c];return{r:u*255,g:h*255,b:m*255}}l(jA,"hsvToRgb");function y7(r,t,e,i){var n=[ni(Math.round(r).toString(16)),ni(Math.round(t).toString(16)),ni(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("")}l(y7,"rgbToHex");function UA(r,t,e,i,n){var o=[ni(Math.round(r).toString(16)),ni(Math.round(t).toString(16)),ni(Math.round(e).toString(16)),ni(S7(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("")}l(UA,"rgbaToHex");function b7(r,t,e,i){var n=[ni(S7(i)),ni(Math.round(r).toString(16)),ni(Math.round(t).toString(16)),ni(Math.round(e).toString(16))];return n.join("")}l(b7,"rgbaToArgbHex");K.equals=function(r,t){return!r||!t?!1:K(r).toRgbString()==K(t).toRgbString()};K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function HA(r,t){t=t===0?0:t||10;var e=K(r).toHsl();return e.s-=t/100,e.s=bm(e.s),K(e)}l(HA,"_desaturate");function WA(r,t){t=t===0?0:t||10;var e=K(r).toHsl();return e.s+=t/100,e.s=bm(e.s),K(e)}l(WA,"_saturate");function zA(r){return K(r).desaturate(100)}l(zA,"_greyscale");function XA(r,t){t=t===0?0:t||10;var e=K(r).toHsl();return e.l+=t/100,e.l=bm(e.l),K(e)}l(XA,"_lighten");function ZA(r,t){t=t===0?0:t||10;var e=K(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)))),K(e)}l(ZA,"_brighten");function YA(r,t){t=t===0?0:t||10;var e=K(r).toHsl();return e.l-=t/100,e.l=bm(e.l),K(e)}l(YA,"_darken");function qA(r,t){var e=K(r).toHsl(),i=(e.h+t)%360;return e.h=i<0?360+i:i,K(e)}l(qA,"_spin");function $A(r){var t=K(r).toHsl();return t.h=(t.h+180)%360,K(t)}l($A,"_complement");function v7(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=K(r).toHsl(),i=[K(r)],n=360/t,o=1;o<t;o++)i.push(K({h:(e.h+o*n)%360,s:e.s,l:e.l}));return i}l(v7,"polyad");function JA(r){var t=K(r).toHsl(),e=t.h;return[K(r),K({h:(e+72)%360,s:t.s,l:t.l}),K({h:(e+216)%360,s:t.s,l:t.l})]}l(JA,"_splitcomplement");function KA(r,t,e){t=t||6,e=e||30;var i=K(r).toHsl(),n=360/e,o=[K(r)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,o.push(K(i));return o}l(KA,"_analogous");function QA(r,t){t=t||6;for(var e=K(r).toHsv(),i=e.h,n=e.s,o=e.v,a=[],p=1/t;t--;)a.push(K({h:i,s:n,v:o})),o=(o+p)%1;return a}l(QA,"_monochromatic");K.mix=function(r,t,e){e=e===0?0:e||50;var i=K(r).toRgb(),n=K(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 K(a)};K.readability=function(r,t){var e=K(r),i=K(t);return(Math.max(e.getLuminance(),i.getLuminance())+.05)/(Math.min(e.getLuminance(),i.getLuminance())+.05)};K.isReadable=function(r,t,e){var i=K.readability(r,t),n,o;switch(o=!1,n=oF(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};K.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=K.readability(r,t[u]),o>n&&(n=o,i=K(t[u]));return K.isReadable(r,i,{level:p,size:c})||!a?i:(e.includeFallbackColors=!1,K.mostReadable(r,["#fff","#000"],e))};var z0=K.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"},eF=K.hexNames=tF(z0);function tF(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}l(tF,"flip");function C7(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}l(C7,"boundAlpha");function We(r,t){rF(r)&&(r="100%");var e=iF(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)}l(We,"bound01");function bm(r){return Math.min(1,Math.max(0,r))}l(bm,"clamp01");function Cr(r){return parseInt(r,16)}l(Cr,"parseIntFromHex");function rF(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}l(rF,"isOnePointZero");function iF(r){return typeof r=="string"&&r.indexOf("%")!=-1}l(iF,"isPercentage");function ni(r){return r.length==1?"0"+r:""+r}l(ni,"pad2");function Du(r){return r<=1&&(r=r*100+"%"),r}l(Du,"convertToPercentage");function S7(r){return Math.round(parseFloat(r)*255).toString(16)}l(S7,"convertDecimalToHex");function x7(r){return Cr(r)/255}l(x7,"convertHexToDecimal");var ii=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 kn(r){return!!ii.CSS_UNIT.exec(r)}l(kn,"isValidCSSUnit");function nF(r){r=r.replace(BA,"").replace(RA,"").toLowerCase();var t=!1;if(z0[r])r=z0[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=ii.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=ii.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=ii.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=ii.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=ii.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=ii.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=ii.hex8.exec(r))?{r:Cr(e[1]),g:Cr(e[2]),b:Cr(e[3]),a:x7(e[4]),format:t?"name":"hex8"}:(e=ii.hex6.exec(r))?{r:Cr(e[1]),g:Cr(e[2]),b:Cr(e[3]),format:t?"name":"hex"}:(e=ii.hex4.exec(r))?{r:Cr(e[1]+""+e[1]),g:Cr(e[2]+""+e[2]),b:Cr(e[3]+""+e[3]),a:x7(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=ii.hex3.exec(r))?{r:Cr(e[1]+""+e[1]),g:Cr(e[2]+""+e[2]),b:Cr(e[3]+""+e[3]),format:t?"name":"hex"}:!1}l(nF,"stringInputToObject");function oF(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}}l(oF,"validateWCAG2Parms");var nv=la(iv());var av=O.object({rank:O.union([O.enum(["low","medium","high","always-visible"]),O.number()]).optional(),interactive:O.boolean().optional(),appearance:O.object({margin:O.number().min(6).optional(),text:O.object({numLines:O.number().optional(),lineHeight:O.number().optional(),size:O.number().optional(),maxWidth:O.number().optional(),foregroundColor:O.string().optional(),backgroundColor:O.string().optional()}).optional(),marker:O.object({size:O.number().optional(),foregroundColor:O.object({active:O.string().optional(),inactive:O.string().optional()}).optional(),backgroundColor:O.object({active:O.string().optional(),inactive:O.string().optional()}).optional()}).optional()}).optional()});function rP(r,t,e){O.array(O.number()).min(2).max(3).parse(r),O.string().parse(t),av.parse(e||{})}l(rP,"validateLabel");var sc={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}}},JB={lightOnDark:{...sc,text:{...sc.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...sc.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...sc,text:{...sc.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...sc.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},KB="LOW_PRIORITY",Q7=4,QB=6,eR=20,tR=2.5,rR=2,iR="cover",nR=-1/0,eP=6.5,tP={heightAbovePolygon:0,appearance:JB.darkOnLight};var ls=class ls{constructor(t,e,i){d(this,"lines",0);d(this,"id");d(this,"rank");d(this,"type","label");d(this,"initialRank");d(this,"contextConfigured",!1);d(this,"fillText");d(this,"newStyle",{});d(this,"opacity",0);d(this,"visibilityNeedsUpdate",!1);d(this,"text");d(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});d(this,"projection",new ne);d(this,"labelCacheId");d(this,"_cache",{});d(this,"appearance");d(this,"options");d(this,"visible",!0);d(this,"enabled",!0);d(this,"isOccluded",!1);d(this,"offscreen",!1);d(this,"canShow",!1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"currentStrategyIndex",-1);d(this,"totalMarkerSize",0);d(this,"dirty",!0);d(this,"attachedDirty",!0);d(this,"collisionDirty",!0);d(this,"lastTextAlign");d(this,"imageHash");d(this,"markerSize",0);d(this,"iconVisible",!1);d(this,"dp");d(this,"animate",!0);d(this,"onStrategySelected",l(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},"onStrategySelected"));d(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=e.id)!=null?o:De(),this.options=(0,nv.default)({},e,tP),this.text=t,this.dp=(p=1)=>p*i.pixelRatio,typeof e.rank=="string")this.rank=Ul(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(M.env.NODE_ENV==="test"?ls.testId:ls.testId*10)/10;ls.testId+=.001,this.rank=p,this.initialRank=p}let n=(0,nv.default)({},this.options.appearance,tP.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||K(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||K(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||eR,iconPadding:(a=n.marker.iconPadding)!=null?a:rR,iconFit:n.marker.iconFit||iR,iconOverflow:n.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:n.marker.iconVisibleAtZoomLevel==null?nR:n.marker.iconVisibleAtZoomLevel}}}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(eP),this.totalMarkerSize=Math.ceil((this.markerSize+tR)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:e}=this.dimensions,{margin:i}=this.appearance,n=Math.max(QB,i),o=this.iconVisible?n/2:0,a=this.iconVisible?this.totalMarkerSize:eP,p=[{name:"RIGHT",getBoundingBox:l(()=>{let c=Math.max(this.totalMarkerSize,e);return[c/2+n,c/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+t+n]},"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=this.totalMarkerSize/2+Q7,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:l(()=>{let c=Math.max(this.totalMarkerSize,e);return[c/2+n,c/2+n,this.totalMarkerSize/2+t+n,this.totalMarkerSize/2+n]},"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=-t-this.totalMarkerSize/2-Q7,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:l(()=>{let c=this.dp();return[e+this.totalMarkerSize/2/c+n,this.totalMarkerSize/2+n,t/2+n,t/2+n]},"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-e-this.totalMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:KB,getBoundingBox:l(()=>[a/2+o,a/2+o,a/2+o,a/2+o],"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:l(()=>[this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n],"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:p}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var e;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((e=this.packedMessage.bboxes[0])==null?void 0:e[4])){let i=this.packedMessage.bboxes.findIndex(n=>n[4]===this.currentStrategyIndex);if(i!==-1){let n=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(n)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let n=this.strategies[i];i===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...n.getBoundingBox(),i]):this.packedMessage.bboxes.push([...n.getBoundingBox(),i])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};l(ls,"LabelComponent"),d(ls,"testId",0);var ov=ls,Ui=ov;g();g();var dv=class dv extends ae{constructor(e,i){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"textSet",new Set);d(this,"batchedTextMap",new Map);d(this,"debugTextAreaMesh",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}remove(e){this.textSet.delete(e)}update(e){var p,c,u;let i,n,o,a=[];for(let h of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(h),(i==null?void 0:i.type)==="text3d"){n=i.components[0],o=i.components[1];let m=(p=n.mesh)==null?void 0:p.parent;if(!m||!(m instanceof Me)||!(n instanceof Lo))continue;if("textArea"in n.feature.properties&&n.mesh!=null&&n.polygonEntityId!=null&&n.textMesh==null&&n.mesh.parent!=null&&((u=(c=n.feature.properties)==null?void 0:c.textArea)==null?void 0:u.position)!=null){if(this.textSet.has(n.polygonEntityId))continue;this.textSet.add(n.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,lc().then(({BatchedText:x})=>{let C=new x;return C.type="batchedtext",m.add(C),C}));let b=this.batchedTextMap.get(m);if(!b)throw new Error("batched text required");a.push(iP({entityId:h,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(n.mesh!=null&&n.textMesh==null&&n.mesh.parent!=null){if(this.textSet.has(h.toString()))continue;this.textSet.add(h.toString()),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,lc().then(({BatchedText:x})=>{let C=new x;return C.type="batchedtext",m.add(C),C}));let b=this.batchedTextMap.get(m);if(!b)throw new Error("batched text required");a.push(iP({entityId:h,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let y=this.batchedTextMap.get(m);n.textMesh&&y&&n.polygonEntityId!=null&&Promise.all([y,Promise.resolve({meshComponent:n,styleComponent:o})]).then(([b,{meshComponent:x,styleComponent:C}])=>{let{textMesh:v}=x;if(b&&v){let S=uv(b,v);x.visible&&!S?b.add(v):!x.visible&&S&&b.remove(v)}C.flipToFaceCamera&&this.flipIfNeeded(x,e)})}return Promise.all(a)}flipIfNeeded(e,i){let n=e.textMesh;if(!n)return!1;let o=n.rotation.z,a=cy(o+i);a>Math.PI/2&&a<3*Math.PI/2&&(n.rotation.z=cy(o+Math.PI))}showTextAreaMesh(){let e,i;for(let n of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(n),(e==null?void 0:e.type)==="text3d"&&(i=e.components[0],"textArea"in i.feature.properties)){let o=i.feature.properties.textArea;if(!o)continue;let a=new Hr(o.maxWidth,o.maxHeight),p=new de(a,new ct({color:"pink"})),{textMesh:c}=i;if(!c)continue;let u=this.convertTo3DMapPosition(o.position,Fu);p.position.copy(u),p.position.z=c.position.z-.1,p.rotation.z=c.rotation.z,sv.identity(),sv.makeRotationAxis(new Q(0,0,1),c.userData.rotationZ),Fu.set(o.maxWidth/2,0,0),Fu.applyMatrix4(sv),p.position.x-=Fu.x,p.position.y-=Fu.y,this.rendererState.entityScene.add(p),this.debugTextAreaMesh.set(n,p)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(e=>{this.rendererState.entityScene.remove(e)}),this.debugTextAreaMesh.clear(),this.publish("render")}};l(dv,"Text3DSystem");var wm=dv;function cv(r){lc().then(({configureTroikaTextBuilder:t})=>{t({useWorker:r})})}l(cv,"configureWorker");var sv=new jr,Fu=new Q,lv;async function pv(r){let{preloadFont:t}=await lc();return t(r)}l(pv,"preloadFont");function lc(){return lv||(lv=import("./text3d-OPI6K2SH.js").then(r=>r)),lv}l(lc,"getText3DService");async function iP({entityId:r,textComponent:t,styleComponent:e,convertTo3DMapPosition:i,batchedMeshPromise:n,rendererState:o,type:a="text-area"}){return Promise.all([lc(),Promise.resolve({entityId:r,meshComponent:t,styleComponent:e})]).then(([{createTroikaTextPoint:p,createTroikaTextArea:c},u])=>a==="text-area"?c(u.entityId,u.meshComponent,u.styleComponent,i):p(u.entityId,u.meshComponent,u.styleComponent,i)).catch(p=>{L.warn("Trouble creating text: ",p)}).then(p=>{if(!(p!=null&&p.text))return;let c=[Promise.resolve(p.text),n,Promise.resolve()];if(t.polygonEntityId){let u=o.geometry3DMap.get(t.polygonEntityId);if((u==null?void 0:u.type)==="geometry"){let h=u.components[0],m=u.components[1];h.textMesh=p.text,h.mesh!=null&&(p.text.position.z=m.altitude+m.height+oR)}}else c[2]=lc().then(({syncText:u})=>u(p.text));return Promise.all(c)}).then(p=>{if(!p)return;let[c,u]=p;u.add(c),t.batchedText||(t.batchedText=u)})}l(iP,"createText");function uv(r,t){return r._members.has(t)}l(uv,"doesBatchedTextContainsText");var oR=.5;var aR=O.object({visible:O.boolean(),color:O.string(),flipToFaceCamera:O.boolean(),font:O.string().optional(),fontSize:O.number(),margin:O.union([O.number(),O.tuple([O.number(),O.number(),O.number(),O.number()])]),outlineColor:O.string(),outlineOpacity:O.number(),outlineBlur:O.union([O.number(),O.string()]),outlineWidth:O.number(),outlineOffsetX:O.number(),outlineOffsetY:O.number(),strokeWidth:O.number(),maxWidth:O.number().optional(),maxHeight:O.number().optional(),strokeOpacity:O.number(),strokeColor:O.string(),fillOpacity:O.number(),hoverColor:O.string().optional(),id:O.union([O.string(),O.number()]),type:O.literal("text3d"),position:O.tuple([O.number(),O.number(),O.number()]),content:O.string()}),nP=aR.partial().omit({id:!0,type:!0}).strict(),oP=nP.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),aP=O.object({appearance:nP.optional(),parentId:O.string().optional()}).strict(),hv=class hv{constructor(t){d(this,"mesh",new zr);d(this,"textMesh");d(this,"type","text3d");d(this,"feature");d(this,"parent");d(this,"batchedText");d(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?uv(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};l(hv,"Text3DComponent");var Lo=hv;g();var fv=class fv{constructor(t){d(this,"color");d(this,"dirty",!0);d(this,"visible",!0);d(this,"edgeColors");d(this,"geometry");d(this,"ranges");d(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};l(fv,"OutlineComponent");var cc=fv;g();g();g();var mv=class mv extends wx{constructor(e){let i=e,n=3,o=n*4;super(new Float32Array(e*o),n,e,Ih,bx);d(this,"_width");d(this,"_height");d(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 Le(i[n],i[n+1],i[n+2]),a=new Le(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}};l(mv,"BatchedPropertiesTexture");var Em=mv;var sP="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";var lP="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of `==` comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var cR=-.05,pR=1,gv=class gv extends Wr{constructor(e,i,n=1){super(e);d(this,"propertiesTexture");d(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});d(this,"colorSpace",an);d(this,"showTextures",l(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 Em(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,h=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor,y=this.uniforms.uBlendTexture;this.uniforms=o.uniforms,o.vertexShader=sP,o.fragmentShader=lP,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:p,uGradientStart:c,uMinSideAlpha:{value:cR},uMaxSideAlpha:{value:pR},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:h,uRepeatYFactor:m,uBlendTexture: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=bi,e.wrapT=bi,e.colorSpace=this.colorSpace,this.uniforms.uTexture.value=e}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(e){e.wrapS=bi,e.wrapT=bi,e.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=e}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(e){e!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=e,this.colorSpace=e?vx:an,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}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()}};l(gv,"BatchedStandardMaterial");var cs=gv;g();function cP(r,t){var p,c,u;let e=0;for(let h of r)e+=((c=(p=h.components[0])==null?void 0:p.geometry)==null?void 0:c.attributes.position.count)||0;let i=new Le(t.color),n;n=new cs({color:i,side:t.side==="back"?mx:t.side==="front"?Mh:on,opacity:(u=t.opacity)!=null?u:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},r.length);let o=new Ah(r.length,e,0,n),a;for(let h of r)a=h.components[0],!(!(a instanceof Ze)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.addInstance(a.instanceIndex),o.userData.entities[a.instanceIndex]=h.id,n instanceof cs&&n.setColor(a.instanceIndex,i,t.topColor?new Le(t.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}l(cP,"batchGeometries");function Dm(r){return K(r).darken(30).toRgbString()}l(Dm,"darkenColorForOutline");function pP(r,t,e,i){if(t.length<1)return;r.boundingBox||r.computeBoundingBox();let n=r.boundingBox,o=r.getAttribute("position"),a=r.getAttribute("normal"),p=r.getAttribute("uv"),c,u;r.index?(c=r.index.count/3,u=l(function(w,E){return r.index.getX(w*3+E)},"meshIndex")):(c=o.count/3,u=l(function(w,E){return w*3+E},"meshIndex"));let h=new jr;h.makeRotationFromQuaternion(new pp().setFromEuler(new sn(0,0,e/180*Math.PI)));let m=t.find(w=>w.face==="top"),y;m&&(y={min:i(m.bounds[1],m.bounds[0],0),max:i(m.bounds[3],m.bounds[2],n.max.z)});let b=t.find(w=>w.face==="side"),x;if(b&&(x={min:i(b.bounds[1],b.bounds[0],0),max:i(b.bounds[3],b.bounds[2],n.max.z)}),!(!x&&!y))for(let w=0;w<c;++w){let E=a.getX(u(w,0))+a.getX(u(w,1))+a.getX(u(w,2)),D=a.getY(u(w,0))+a.getY(u(w,1))+a.getY(u(w,2)),R=a.getZ(u(w,0))+a.getZ(u(w,1))+a.getZ(u(w,2)),_=Math.abs(E),F=Math.abs(D),B=Math.abs(R);var C,v;_<=F&&_<=B?(C="x",F<=B?v="y":v="z"):F<=_&&F<=B?(C="y",_<=B?v="x":v="z"):(C="z",_<=F?v="x":v="y"),C==="z"&&(C=v,v="z");let V,N,X,z,U,te;if(v==="z"||C==="z"){if(!b||!x)continue;V=b.repeat.u,N=b.repeat.v,X=b.offset.u,z=b.offset.v,U=b.rotation,te=x}else{if(!m||!y)continue;V=m.repeat.u,N=m.repeat.v,X=m.offset.u,z=m.offset.v,U=(360-e+m.rotation)%360,te=y}let{min:Z,max:Ce}=te,me=new ln;me.position.set(Z.x,Z.y,0),me.updateMatrix(),me.updateMatrixWorld();let Pe=Z.clone().applyMatrix4(h),_e=Ce.clone().applyMatrix4(h),dr=Math.abs(_e.x-Pe.x),_t=Math.abs(_e.y-Pe.y),st=new Q(dr,_t,Ce.z).applyMatrix4(me.matrixWorld),et=Math.abs(st[C]-Z[C]),hr=Math.abs(st[v]-Z[v]),Vr=U*Math.PI/180||0,ge=Math.cos(Vr),ve=Math.sin(Vr),$e=me.matrixWorld.clone().invert(),vt=new pp().setFromEuler(new sn(0,0,e/180*Math.PI));for(let lt=0;lt<3;lt++){let gi=new Q(o.getX(u(w,lt)),o.getY(u(w,lt)),o.getZ(u(w,lt))).applyMatrix4($e);gi.applyQuaternion(vt);let yi=gi.applyMatrix4(me.matrixWorld),jt=yi.x,no=yi.y,sp=yi.z;var S,I;C==="x"?S=V*(jt-Z[C])/et+X:C==="y"?S=V*(no-Z[C])/et+X:S=V*(sp-Z[C])/et+X,v==="x"?I=N*(jt-Z[v])/hr+z:v==="y"?I=N*(no-Z[v])/hr+z:I=N*(sp-Z[v])/hr+z,S-=.5,I-=.5;let lp=S*ge-I*ve+.5,cp=S*ve+I*ge+.5;p.setX(u(w,lt),lp),p.setY(u(w,lt),cp)}}}l(pP,"updateUVsLegacy");g();var yv=class yv{constructor(){d(this,"focusMesh");d(this,"dirty",!0)}};l(yv,"FocusableComponent");var pc=yv;function wt(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"||r.type==="custom-geometry")return t===!0?(r instanceof ha&&r.components[1]===void 0?(r.components[1]=new ic,r.components[1].dirty=!0):r instanceof Ee&&r.components[2]===void 0?(r.components[2]=new ic,r.components[2].dirty=!0):r instanceof Me&&r.components[1]===void 0&&(r.components[1]=new ic,r.components[1].dirty=!0),!0):(r instanceof ha?r.components[1]=void 0:r instanceof Ee?r.components[2]=void 0:r instanceof Me&&(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),wt(i,t,e);return!0}}return!1}l(wt,"updateInteractivity");function uP(r,t,e){if(!(!(e!=null&&e.color)&&!("topColor"in e))){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())if(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);let p=i.components[3];p&&(p.color=Dm(n.color||o.color),p.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),"topColor"in e&&(o.topColor=e.topColor,o.dirty=!0),!0}return!1}}l(uP,"updateGroupColor");function dP(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}l(dP,"updateGroupShading");function hP(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))}l(hP,"updateImageProps");function vv(r,t,e){if(e!==void 0){if(r.type==="geometry"){let i=r.components[1];if(i.height!==e)return i.height=e,i.dirty=!0,r.components[3]&&(r.components[3].dirty=!0),!0}else if(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.height===i.height&&(o.components[1].height=e,o.components[1].dirty=!0),o.components[3]&&(o.components[3].dirty=!0))}return r.components[0].height=e,!0}}return!1}l(vv,"updateHeight");function xv(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&&t.color!==r.components[1].color&&(r.components[1].color=t.color,r.components[3]&&(r.components[3].color=t.color,r.components[3].dirty=!0)),"topColor"in t&&(r.components[1].topColor=t.topColor),r.components[1].dirty=!0)}l(xv,"updateColor");function Cv(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)))}l(Cv,"updatePosition");function Sv(r,t){var e;return t!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==t&&r.parentObject3D instanceof Me?((e=r.parentObject3D)==null||e.removeEntity(r),t.addEntity(r),!0):!1}l(Sv,"updateParent");function fP(r,t){t!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==t&&(r.components[0].enabled=t)}l(fP,"updateEnabled");function mP(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,i.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(i.options.anchor=t.anchor,i.collisionDirty=!0),t.dynamicResize!==void 0)return i.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{H0.parse(t.options||{})}catch(n){return L.error(n),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(i.pointerEvents="auto",wt(r,!1,e)):(i.pointerEvents="none",wt(r,t.options.interactive,e))),gP(r,t.options.rank),!0}}return!1}l(mP,"updateMarker");function gP(r,t){return t!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Ul(t),!0):!1}l(gP,"updateRank");function yP(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{av.parse(t.options||{})}catch(u){L.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&&(oC(c.appearance,((o=t.options)==null?void 0:o.appearance)||{}),c.dirty=!0),wt(r,(a=t.options)==null?void 0:a.interactive,e),gP(r,(p=t.options)==null?void 0:p.rank)}}l(yP,"updateLabel");function bP(r,t){t!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=t,r.components[1].dirty=!0)}l(bP,"updateHoverColor");function vP(r,t){if(t!==void 0){let e=r.components[2];if(r.type==="geometry"&&e!=null)return e.hover=t,e.dirty=!0,!0}return!1}l(vP,"updateHovered");function Tv(r,t){t!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=t)}l(Tv,"updateFlipImageToFaceCamera");function Hi(r,t,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){r.components[1].visible=e,r.components[1].dirty=!0;let i=r.components[3];i&&(i.visible=e,i.dirty=!0)}else r.type==="geometry-group"?r.setVisible(e):r.type==="group-container"?(r.setVisible(e),e===!1&&r.traverse(i=>{if(i instanceof Yx){let n=t.geometry2DMap.get(i.userData.entityId);if(n){let o=n.components[0];o instanceof Ui&&(o.canShow=e)}}})):r.type==="label"&&(r.components[0].visible=e);return!0}return!1}l(Hi,"updateVisibility");function Mv(r,t,e){if(e!==void 0){if(r.type==="geometry-group"){let i=r.components[0];if(i.opacity!==e){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||a.opacity===i.opacity)&&(a.opacity=e,a.dirty=!0))}return r.setOpacity(e),i.opacity=e,!0}}else if(r.type==="group-container"&&r.opacity!==e){r.setOpacity(e);let i=1;return r.parent instanceof Me&&(i=r.parent.opacity),xP(r,t,i),!0}}return!1}l(Mv,"updateOpacity");function xP(r,t,e=1){if(r.type==="group-container"&&"children"in r&&r.children.length>0){let i=e*r.opacity;r.userData.computedOpacity=i;for(let n of r.children)(n instanceof Lt&&n.type==="geometry-group"||n instanceof Me&&n.type==="group-container")&&xP(n,t,i)}else if(r.type==="geometry-group")for(let i of r.userData.entities3D.values()){let n=t.geometry3DMap.get(i),o;((n==null?void 0:n.type)==="geometry"||(n==null?void 0:n.type)==="model")&&(o=n.components[1],o.dirty=!0)}}l(xP,"cascadeOpacity");function CP(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)}}l(CP,"updateGroupTexture");function SP(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 Ze){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}l(SP,"updateIndividualGeometryTexture");function TP(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],n=r.components[3];n&&(n.dirty=!0),i.detached===!1&&(i.detached=!0,i.dirty=!0),t===0?e.visible=!1:e.visible=!0,e.dirty=!0;let o=r.parentObject3D;return(o==null?void 0:o.type)==="geometry-group"&&(o.userData.shadingDirty=!0),!0}}return!1}l(TP,"updateIndividualGeometryOpacity");function Om(r,t){if(t!==void 0)if(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;if(r.type==="geometry-group")return r.setAltitude(t),!0}return!1}l(Om,"updateAltitude");function _m(r,t,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)for(let i of r.userData.entities3D.values()){let n=t.geometry3DMap.get(i);n instanceof Ee&&_m(n,t,e)}else if(r.type==="geometry"){let i=r.components[3],n=r.components[1];!i&&e===!0?r.components[3]=new cc(n.color):i&&(i.visible=e,i.dirty=!0)}return!0}return!1}l(_m,"updateOutline");function Iv(r,t){if(t!==void 0){if(r.type==="geometry"){let e=r.components[0];if(r.type==="geometry"&&e&&e instanceof Ze&&e.focusable!==t)return e.focusable=t,!0}else if(r.type==="group-container"){let e=r.components[2]!==void 0;if(t===!0&&!e)return r.components[2]=new pc,!0;if(t===!1&&e)return r.components[2]=void 0,!0}}return!1}l(Iv,"updateFocusable");function MP(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.renderOrder!==t){e.renderOrder=t;let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),i.imageMesh&&(i.imageMesh.renderOrder=t+1),e.dirty=!0,!0}}return!1}l(MP,"updateIndividualGeometryRenderOrder");function IP(r,t,e){let{visible:i,color:n}=e;if(r.type!=="path")return;let o=r.components[0];i!=null&&Hi(r,t,i),n!=null&&xv(r,{color:n}),Object.assign(o,Pv(e)),tC(e)||(o.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(o.dirty=!0),(e.nearZoomLevel!=null||e.farZoomLevel!=null)&&(o.dirty=!0))}l(IP,"handlePathUpdate");function Pv(r){return fr(r,dR)}l(Pv,"pickPathOptions");var dR=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel"];function PP(r){if(!(r instanceof Ee&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}l(PP,"assetGeometryIsText3D");var Lm=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function wP(r,t,e){Hi(r,t,e.visible);let i=r.components[1],n=fr(e,Lm);"margin"in e&&L.warn("update to margin is not supported atm"),"content"in e&&L.warn("content update is not supported atm");try{oP.parse(n)}catch(o){L.error(o);return}Object.keys(n).length>0&&(Object.assign(i,n),i.dirty=!0)}l(wP,"handleText3DUpdate");var hR=["color","material","opacity","verticalOffset","rotation","position","scale"];function EP(r,t){let e=fr(t,hR),i=r.components[1],n=r.components[0];Object.keys(e).length>0&&(e.material&&(i.material=e.material),e.opacity!=null&&(i.opacity=e.opacity,e.opacity===0?i.visible=!1:i.visible=!0,i.dirty=!0),e.verticalOffset!=null&&(i.verticalOffset=e.verticalOffset),e.color!=null&&(i.color=e.color),e.position!=null&&(n.feature.geometry.coordinates=e.position,n.positionDirty=!0),e.rotation!=null&&(i.rotation=e.rotation),e.scale!=null&&(i.scale=e.scale),i.dirty=!0)}l(EP,"handleModelStyleUpdate");var ps,Wi,km,ko,DP,Ru,Am,OP,_P,Nu,Fm,Gu,Vu,Bm,wv=class wv{constructor(t){T(this,ko);T(this,ps,null);T(this,Wi);d(this,"getCurrentSceneGLTF",l(async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await G(this,ko,DP).call(this),n=s(this,km).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"));T(this,km,l(t=>{let{scale:e,light:i,onlyVisible:n}=t,o=new oo,a=new xt().setFromObject(s(this,Wi).entityScene);if(s(this,Ru).call(this,s(this,Wi).entityScene,o,n),i){let p=new Dh(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"));T(this,Ru,l((t,e,i)=>{t.material&&(t instanceof Ph?G(this,ko,OP).call(this,t).forEach(n=>e.add(n)):t instanceof Ws&&e.add(G(this,ko,_P).call(this,t))),t.children.forEach(n=>{(!i||n.visible)&&s(this,Ru).call(this,n,e,i)})},"#processObject3D"));T(this,Am,l((t,e,i)=>{let n=new _x({color:new Le(t),metalness:0});return n.opacity=e,n.transparent=i,n},"#createStandardMaterial"));T(this,Nu,l(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,h=e.attributes.uv;return s(this,Fm).call(this,c,u),s(this,Vu).call(this,n,p,o,a),h&&s(this,Bm).call(this,h),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=on),t},"#convertGeometry"));T(this,Fm,l((t,e)=>{let i=new Q,n=new Q;for(let o=0;o<t.count;o++)i.fromBufferAttribute(t,o),s(this,Gu).call(this,i),t.setXYZ(o,i.x,i.y,i.z),e&&(n.fromBufferAttribute(e,o),s(this,Gu).call(this,n),e.setXYZ(o,n.x,n.y,n.z))},"#convertAttributes"));T(this,Gu,l(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));T(this,Vu,l((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 sn)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"));T(this,Bm,l(t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),n=t.getY(e);t.setXY(e,i,n)}},"#convertUVs"));P(this,Wi,t),s(this,Wi).entityScene=t.entityScene,s(this,Wi).geometry3DMap=t.geometry3DMap}destroy(){P(this,ps,null)}};ps=new WeakMap,Wi=new WeakMap,km=new WeakMap,ko=new WeakSet,DP=l(async function(){if(!s(this,ps)){let{GLTFExporter:t}=await import("./GLTFExporter-64BG5G32.js");P(this,ps,new t)}return s(this,ps)},"#getGLTFExporter"),Ru=new WeakMap,Am=new WeakMap,OP=l(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=>s(this,Wi).geometry3DMap.get(c)),o=new Map;return n.forEach(c=>{var b;if(!c||!(c instanceof Ee))return;let u=c.components[1],h=c.components[2];if(!u.visible||u instanceof Ii&&u.opacity===0||u instanceof fp||u instanceof Nh)return;let m=h!=null&&h.hover?u.hoverColor||s(this,Wi).hoverColor:u.color,y="".concat(m,"-").concat(u.opacity,"-").concat(Number(u.visible));o.has(y)||o.set(y,[]),(b=o.get(y))==null||b.push(c)}),o.forEach((c,u)=>{let[h,m,y]=u.split("-"),b=c.reduce((S,I)=>{if(I.type==="custom-geometry")return S;let w=I.components[0];return"geometry"in w&&w.geometry instanceof Ix&&S.push(w.geometry),S},[]),x=s(this,Am).call(this,h,Number(m),t.material.transparent),C=Ir(b,!0),v=new de(C,x);v.position.copy(t.position),v.rotation.copy(t.rotation),v.scale.copy(t.scale),v.visible=!!y,s(this,Vu).call(this,v.position,v.scale,v.rotation,v.quaternion),e.push(s(this,Nu).call(this,v))}),e},"#processBatchedMesh"),_P=l(function(t){let e=t.geometry.clone(),i=t.material,n=new ct({color:i.color,side:on});n.opacity=i.opacity,n.transparent=i.transparent;let o=new Ws(e,n);return o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o.visible=t.visible,s(this,Nu).call(this,o)},"#processLineSegments"),Nu=new WeakMap,Fm=new WeakMap,Gu=new WeakMap,Vu=new WeakMap,Bm=new WeakMap,l(wv,"ExporterSystem");var Bu=wv;g();g();g();var Ov=la(jP());function UP(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}l(UP,"JSClipperError");UP.prototype=Error.prototype;Ov.default.Error=function(r){throw new UP(r)};var gt=Ov.default;var aG="gray",sG=.1,Hu=100,_v=new gt.ClipperOffset;function lG(r,t){_v.Clear(),t/=2;let e=r.map(n=>({X:n.x*Hu,Y:n.y*Hu}));_v.AddPath(e,gt.JoinType.jtMiter,gt.EndType.etClosedPolygon);let i=new gt.Paths;return _v.Execute(i,t*Hu),i.length?i.map(o=>o.map(a=>({x:a.X/Hu,y:a.Y/Hu}))):[r]}l(lG,"offset");function Um(r,t,e){var y,b,x,C,v;let{color:i=aG,opacity:n=1,altitude:o=0,height:a=sG}=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}},u=r.geometry.coordinates[0].map(S=>{let I=t(S[1],S[0]);return p.min.x=Math.min(p.min.x,I.x),p.min.y=Math.min(p.min.y,I.y),p.max.x=Math.max(p.max.x,I.x),p.max.y=Math.max(p.max.y,I.y),I});((b=(y=r.properties)==null?void 0:y.style)==null?void 0:b.edgeOffset)!=null&&r.properties.style.edgeOffset!==0||((x=r.properties)==null?void 0:x.image)!=null?u=lG(u,((v=(C=r.properties)==null?void 0:C.style)==null?void 0:v.edgeOffset)||0):u=[u];let h=[];for(let S of u){let I=new vi;I.moveTo(S[0].x,S[0].y),S.slice(1).forEach(R=>I.lineTo(R.x,R.y)),I.lineTo(S[0].x,S[0].y);let w=r.geometry.coordinates.slice(1);I.holes=w.map(R=>{let _=R.map(B=>t(B[1],B[0])),F=new so;return F.moveTo(_[0].x,_[0].y),_.slice(1).forEach(B=>F.lineTo(B.x,B.y)),F.lineTo(_[0].x,_[0].y),F});let E={bevelEnabled:!1,depth:a},D=new xi(I,E);D.userData={style:{color:i,opacity:n}},h.push(D)}if(h.length===1)return h[0];let m=Ir(h);return m.userData={style:{color:i,opacity:n},_split:!0},m}l(Um,"renderPolygonGeometry");g();var cG="gray",pG=.1;function Hm(r,t,e){let{color:i=cG,opacity:n=1,altitude:o=0,height:a=pG}=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(m=>{let y=new vi,b=m[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});y.moveTo(b[0].x,b[0].y),b.slice(1).forEach(v=>y.lineTo(v.x,v.y)),y.lineTo(b[0].x,b[0].y);let x=m.slice(1);y.holes=x.map(v=>{let S=v.map(w=>t(w[1],w[0])),I=new so;return I.moveTo(S[0].x,S[0].y),S.slice(1).forEach(w=>I.lineTo(w.x,w.y)),I.lineTo(S[0].x,S[0].y),I});let C=new xi(y,c);u.push(C)});let h=Ir(u);return h.translate(0,0,o||0),h.userData={style:{color:i,opacity:n}},h}l(Hm,"renderMultiPolygonGeometry");g();var uG="gray",Lv=new gt.ClipperOffset,Xt=100;function HP(r,t,e){let{color:i=uG,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 h=[];for(let C=0;C<r.geometry.coordinates.length-1;C++){let v=t(r.geometry.coordinates[C][1],r.geometry.coordinates[C][0]),S=t(r.geometry.coordinates[C+1][1],r.geometry.coordinates[C+1][0]);h.push([v,S])}Lv.AddPaths(h.map(C=>C.map(v=>({X:v.x*Xt,Y:v.y*Xt}))),a==="round"?gt.JoinType.jsRound:a==="miter"?gt.JoinType.jsMiter:gt.JoinType.jsSquare,p==="round"?gt.EndType.etOpenRound:p==="butt"?gt.EndType.etOpenButt:gt.EndType.etOpenSquare);let m=new gt.PolyTree;Lv.Execute(m,o/2*Xt);let y=[],b={bevelEnabled:!1,depth:c};for(let C of m.m_AllPolys){let v=new vi;if(C.IsHole())continue;let S=C.m_polygon;v.moveTo(S[0].X/Xt,S[0].Y/Xt),S.slice(1).forEach(I=>v.lineTo(I.X/Xt,I.Y/Xt)),v.lineTo(S[0].X/Xt,S[0].Y/Xt),v.holes=C.m_Childs.map(I=>{let w=new so,E=I.m_polygon;return w.moveTo(E[0].X/Xt,E[0].Y/Xt),E.slice(1).forEach(D=>w.lineTo(D.X/Xt,D.Y/Xt)),w.lineTo(E[0].X/Xt,E[0].Y/Xt),w}),y.push(new xi(v,b))}let x=Ir(y);return x.translate(0,0,u||0),x.userData={style:{color:i,opacity:n}},Lv.Clear(),x}l(HP,"renderLineStringGeometry");g();var Zt=100,dG=.22,hG=.01;function WP(r,t,e={}){let{width:i=dG,height:n=hG,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},h=new gt.ClipperOffset,m=r.geometry.coordinates.map(C=>C.map(v=>t(v[1],v[0])));h.AddPaths(m.map(C=>C.map(v=>({X:v.x*Zt,Y:v.y*Zt}))),gt.JoinType.jsMiter,gt.EndType.etOpenRound);let y=new gt.PolyTree;h.Execute(y,i/2*Zt);let b=[];for(let C of y.m_AllPolys){let v=new vi;if(C.IsHole())continue;c.min.x=Math.min(c.min.x,C.m_polygon[0].X),c.min.y=Math.min(c.min.y,C.m_polygon[0].Y),c.max.x=Math.max(c.max.x,C.m_polygon[0].X),c.max.y=Math.max(c.max.y,C.m_polygon[0].Y);let S=C.m_polygon;v.moveTo(S[0].X/Zt,S[0].Y/Zt),S.slice(1).forEach(I=>v.lineTo(I.X/Zt,I.Y/Zt)),v.lineTo(S[0].X/Zt,S[0].Y/Zt),v.holes=C.m_Childs.map(I=>{let w=new so,E=I.m_polygon;return w.moveTo(E[0].X/Zt,E[0].Y/Zt),E.slice(1).forEach(D=>w.lineTo(D.X/Zt,D.Y/Zt)),w.lineTo(E[0].X/Zt,E[0].Y/Zt),w}),b.push(new xi(v,u))}let x=Ir(b);return x.translate(0,0,p||0),x.userData={style:{color:o,opacity:a}},h.Clear(),x}l(WP,"renderMultiLineStringGeometry");g();g();var hc=O.object({type:O.enum(["Point"]),coordinates:O.array(O.number()).min(2).max(3)});var fG=O.object({rotation:O.array(O.number()).length(3).optional(),altitude:O.number().optional(),scale:O.array(O.number()).length(3).optional(),interactive:O.boolean().optional(),verticalOffset:O.number().optional(),id:O.union([O.number(),O.string()]).optional()}),mG=O.object({type:O.enum(["Feature"]),geometry:hc,properties:fG}),gG=O.object({type:O.enum(["FeatureCollection"]),features:O.array(mG)}),yG=O.object({color:O.string()}),bG=O.object({url:O.string(),color:O.string().optional(),opacity:O.number().optional(),material:O.record(O.string(),yG).optional()});function XP(r,t,e){O.union([O.number(),O.string()]).parse(r),gG.parse(t),bG.parse(e)}l(XP,"validateModelGroup");var Wu,zu,kv=class kv{constructor(t){d(this,"mesh");d(this,"type","model");d(this,"positionDirty",!0);d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new Le);d(this,"position",new Q);T(this,Wu,0);T(this,zu,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return s(this,Wu)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Wu,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(ye.degToRad(t[0]),ye.degToRad(t[1]),ye.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return s(this,zu)}set opacity(t){var e,i,n;if(this.mesh){if(this.mesh.children[0]instanceof ao){for(let o of this.mesh.children)if(o instanceof ao){((e=o.userData)==null?void 0:e.originalOpacity)===void 0&&(o.userData.originalOpacity=o.material.opacity);let a=Pi(t,0,(i=o.userData)==null?void 0:i.originalOpacity,0,1);o.material.opacity=a,o.material.transparent=a<1,o.material.needsUpdate=!0}}else(n=this.mesh)==null||n.traverse(o=>{o instanceof de&&o.material&&(Array.isArray(o.material)?o.material.forEach(a=>{zP(a,t)}):zP(o.material,t))});P(this,zu,t)}}};Wu=new WeakMap,zu=new WeakMap,l(kv,"ModelComponent");var Bo=kv;function zP(r,t){r.opacity!==t&&(t===1?(r.opacity=1,r.transparent=!1):(r.opacity=t,r.transparent=!0),r.needsUpdate=!0)}l(zP,"updateMaterialOpacity");g();function Wm(r){var p,c;let t=r.components[0],e=r.components[1];e.opacity!=null&&e.opacity!==t.opacity&&(t.opacity=e.opacity);let i=e.material,n=e.color;if(i||n){let u=vG(n,i);(p=t.mesh)==null||p.traverse(h=>{h instanceof de&&h.material&&(Array.isArray(h.material)?h.material.forEach(m=>{u[m.name]?m.color.set(u[m.name].color):m.color.set(n)}):u[h.material.name]?h.material.color.set(u[h.material.name].color):h.material.color.set(n))})}let o=(c=t.feature.geometry.coordinates[2])!=null?c:0,a=e.verticalOffset+o;t.altitude!==a&&(t.altitude=a),e.visible!==t.visible&&(t.visible=e.visible),e.rotation&&t.setRotation(e.rotation),e.scale&&t.setScale(e.scale)}l(Wm,"applyModelGeometryStyle");function vG(r,t){let e={};if(r&&Object.assign(e,{Default:{color:r},Fabric:{color:r},Mpdn_Logo:{color:r},CouchLogo:{color:r}}),t)for(let i in t)t[i].color&&(e[i]?e[i].color=t[i].color:e[i]={color:t[i].color});return e}l(vG,"consolidateColorAndMaterial");function ZP(r,t){var a,p;let e=r.components[0],n=(a=r.components[1].verticalOffset)!=null?a:0,o=e.feature.geometry.coordinates.slice();o[2]=((p=o[2])!=null?p:0)+n,e.mesh?e.mesh.position.copy(t(o)):e.position.copy(t(o))}l(ZP,"applyModelPosition");function xG(r){let{color:t,opacity:e,topColor:i,texture:n,topTexture:o}=r;return"".concat(t).concat(e).concat(i||"").concat(n||"").concat(o||"")}l(xG,"generateIndex");var CG=1e4,Av=class Av extends ae{constructor(e,i){super();d(this,"state");d(this,"convertTo3DMapPosition");d(this,"loader");d(this,"optimizePromise",[]);this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:e}=await import("./GLTFLoader-ELXGWZD3.js");return this.loader=new e,this.loader}createEntityFromFeature(e,i,n){var p,c;let o=new Ze(i),a=new Ee(o,new Ii({...n,url:(c=(p=i.properties)==null?void 0:p.image)==null?void 0:c.path}));return n!=null&&n.outline&&(a.components[3]=new cc(Dm(n.color))),a.id=e,a}createModelFromFeature(e,i,n){let o=new Bo(i),a={...n};i.properties.verticalOffset!=null&&(a.verticalOffset=i.properties.verticalOffset),i.properties.rotation!=null&&(a.rotation=i.properties.rotation),i.properties.scale!=null&&(a.scale=i.properties.scale);let p=new Nh(a),c=new Ee(o,p);return c.id=e,c}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 jr,a=new sn,p=new pp,c=new Q,u=new zr,h=await this.getGLTFLoader(),m=new Promise(y=>{h.load(i,b=>{"entities3D"in n.userData&&(n.userData.entities3D.size>1?b.scene.traverse(x=>{let C=x;if("isMesh"in C&&C.isMesh===!0){let v=new ao(C.geometry,C.material,e.size);v.userData={entities:{}},u.add(v),n.add(u)}}):(b.scene.traverse(x=>{"isMesh"in x&&x.isMesh===!0&&(x.position.set(0,0,0),x.rotation.set(0,0,0),x.scale.set(1,1,1),x.updateMatrix())}),u.add(b.scene),n.add(u),u.userData.isSingleModel=!0,u.userData.entityId=e.values().next().value,u.userData.type="model")),y()})});return this.optimizePromise.push(m.then(()=>{var x,C,v,S,I,w,E,D,R,_,F,B;let y=0,b;for(let V of e.values()){if(b=this.state.geometry3DMap.get(V),!b||(b==null?void 0:b.type)!=="model")continue;let N=b.components[0],X=b.components[1],z=b.components[0].feature;N.mesh=u,N.instanceIndex=y,Wm(b),b.components[1].dirty=!1;let{x:U,y:te}=this.convertTo3DMapPosition(z.geometry.coordinates[1],z.geometry.coordinates[0],0);N.position.set(U,te,N.altitude),a.set(ye.degToRad((C=(x=X.rotation)==null?void 0:x[0])!=null?C:Ks[0]),ye.degToRad((S=(v=X.rotation)==null?void 0:v[1])!=null?S:Ks[1]),ye.degToRad((w=(I=X.rotation)==null?void 0:I[2])!=null?w:Ks[2])),c.set((D=(E=X.scale)==null?void 0:E[0])!=null?D:Js[0],(_=(R=X.scale)==null?void 0:R[1])!=null?_:Js[1],(B=(F=X.scale)==null?void 0:F[2])!=null?B:Js[2]),p.setFromEuler(a),o.compose(N.position,p,c),u.children.forEach(Z=>{!b||(b==null?void 0:b.type)!=="model"||!(Z instanceof ao)||(Z.setMatrixAt(y,o),Z.userData.entities[y]=b.id)}),N.mesh.userData.isSingleModel&&(N.mesh.matrix.copy(o),N.mesh.matrix.decompose(N.mesh.position,N.mesh.quaternion,N.mesh.scale)),y++}this.publish("model-loaded")})),u}populateEntityGroup(e){var p;let i,n,o,a;for(let c of e.values())a=this.state.geometry3DMap.get(c),a.components[0]instanceof Ze&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=Um(n,this.convertTo3DMapPosition,o),(p=n.properties)!=null&&p.textures&&n.properties.textures.length>0&&pP(i,n.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=Hm(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=HP(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=WP(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof Lt||e instanceof Me)){for(let a of e.children)this.optimize(a);if(e instanceof Me||e.userData.dirty===!1)return;let n={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(a){L.warn(a)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let o=0;if(e.userData.dirty){let a=0,p;for(let c of e.userData.entities3D.values()){p=this.state.geometry3DMap.get(c);let u=p==null?void 0:p.components[0];if((p==null?void 0:p.type)==="geometry"){let h=p.components[1];a++,a>=CG&&(a=0,o++);let m=xG(h)+o;n[m]===void 0&&(n[m]={style:h,entities:[]}),n[m].entities.push(p)}else u&&"mesh"in u&&u.mesh&&((i=u.mesh)==null?void 0:i.parent)!==e&&e.add(u.mesh)}for(let c in n){let u=cP(n[c].entities,n[c].style);e.add(u),e.userData.dirty=!1}for(let c of e.userData.entities3D.values())if(p=this.state.geometry3DMap.get(c),p!=null&&p.entities2D.size>0)for(let u of p.entities2D.values())u&&(p.attach(u),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};l(Av,"MeshCreationAndOptimizationSystem");var zm=Av;g();var Fv=class Fv{constructor(t,e){d(this,"state");d(this,"dirty",!0);d(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let i=t.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let i=t.components[0];i instanceof ji&&i.enabled&&i.markerContainer&&!this.domTree.contains(i.markerContainer)&&(i.markerContainer.userData={entityId:t.id},this.domTree.appendChild(i.markerContainer),i.updateDimensions())}this.dirty=!1}}};l(Fv,"DOMVisibilitySystem");var Xm=Fv;g();var Bv=class Bv{constructor(t,e){d(this,"state");d(this,"project");this.state=t,this.project=e}update(){let t,e=0,i,n;for(let o of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(o),t){n=t.components[0];let a=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(a instanceof Ee)if(this.state.geometry3DIdsInScene.has(a.id)){i=a.components[1],n=t.components[0],(i.dirty||t.components[0].attachedDirty)&&(e=i.height,t.setAltitude(e));let p=i.visible&&i.opacity>0;n.visible!==p&&(n.visible=p)}else n.visible===!0&&(n.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};l(Bv,"TwoDProjectionSystem");var Zm=Bv;g();g();var SG=l(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")(),YP=l(({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}=SG(i);c.font=p;let u=[],h=r.split(" "),m=0,y=0,b=0;for(;y<h.length;){let S=h[y];if(m===n&&m>0){u[m-1]+="...";break}if(u[m]==null&&(u[m]=S,y++),h.length===1){u[m]=S;break}if(h[y]==null)break;let{width:I}=c.measureText(u[m]+" "+h[y]);I<=e*i?(u[m]+=" "+h[y],y++):m++}u.forEach(S=>{let{width:I}=c.measureText(S);b=Math.max(I,b)});let x=t*i*o,C=u.length*x;return{maxWidth:b,maxHeight:C,lines:u.length,draw:l((S,I,w)=>{u.length===1?(a.strokeText&&S.strokeText(u[0],I,w),S.fillText(u[0],I,w)):(a.strokeText&&(S.strokeText(u[0],I,w-x/2),S.strokeText(u[1],I,w+x/2)),S.fillText(u[0],I,w-x/2),S.fillText(u[1],I,w+x/2))},"draw")}},"shaveText");g();function qP(r){let t=new Image;return r&&(/<svg[\s\S]*>/i.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}l(qP,"createImage");var TG=3.5,MG=2.5,IG=2,PG=5,Xu=2.5;var Rv=class Rv extends ae{constructor(e,i,n){super();d(this,"dirty",!1);d(this,"state");d(this,"colliderContext");d(this,"colliderCanvas");d(this,"transformRequestFunc");d(this,"transformRequest",l(async e=>this.transformRequestFunc?await this.transformRequestFunc(e):{url:e},"transformRequest"));d(this,"pinCache",{});d(this,"imageCache",{});d(this,"imagePromiseCache",{});d(this,"imageDimensionsCache",{});d(this,"textCache",{});d(this,"update",l(e=>{let i=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let n,o,a,p,c,u,h;for(let m of this.state.geometry2DIdsInScene)if(h=this.state.geometry2DMap.get(m),h!=null&&(u=h.components[0],u instanceof Ui&&!h.disposed)){if(c=u.appearance.marker.iconVisibleAtZoomLevel,u.appearance.marker.icon!=null&&c&&e>=c!==u.iconVisible&&(u.iconVisible=e>=c,u.dirty=!0),(u.dirty||this.dirty)&&u.calculateMarkerSize(),o=u.appearance.marker.foregroundColor,a=u.appearance.marker.backgroundColor,p=Xs(u.markerSize,2),n="".concat(o.active,"-").concat(o.inactive,"-").concat(a.active,"-").concat(a.inactive,"-").concat(p,"-").concat(u.iconVisible),u.labelCacheId=n,this.pinCache[n]||this.prepare(u,n,this.colliderContext),u.appearance.marker.icon&&(!u.imageHash||u.dirty)&&this.cacheImage(u),this.textCache[u.id]==null||u.dirty||this.dirty){u.collisionDirty=!0,this.textCache[u.id]={};let{textDrawFn:y,width:b,height:x}=this.processText(u.text,u.appearance.text.size,u.appearance.text.maxWidth,u.appearance.text.numLines,u.appearance.text.lineHeight);["left","center","right"].forEach(v=>{this.textCache[u.id][v]=this.textToCanvas(y,u.appearance.text.size,v,b,x,u.appearance.text.foregroundColor,u.appearance.text.backgroundColor)}),u.dimensions={width:Math.ceil(b/i),height:Math.ceil(x/i)},u.currentStrategyIndex===-1&&(u.currentStrategyIndex=0);let C=u.strategies[u.currentStrategyIndex];if(C){C.onStrategySelected(u);let v=u.style;u.style=u.newStyle,u.newStyle=v}}u.canShow&&u.visible&&(u.enabled||u.visibilityNeedsUpdate!==!1)&&this.draw(u,n,this.colliderContext),u.dirty=!1}this.dirty=!1},"update"));d(this,"processText",l((e,i,n,o,a)=>{let p=this.state.pixelRatio,{draw:c,maxWidth:u,maxHeight:h}=YP({text:e,size:i,pixelRatio:p,maxWidth:n,maxLines:o,lineHeight:a});return{textDrawFn:c,width:u+Xu*p*2,height:h+Xu*p*2}},"processText"));d(this,"textToCanvas",l((e,i,n,o,a,p,c)=>{let u=this.state.pixelRatio,h,m=o,y=a;window.OffscreenCanvas!=null&&!eC()?h=new OffscreenCanvas(m,y):(h=document.createElement("canvas"),h.width=m,h.height=y,h.style.width=m+"px",h.style.height=y+"px");let b=h.getContext("2d",{willReadFrequently:!0});if(!b)return;b.textAlign=n,b.font="bold ".concat(i*u,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=Xu*u,b.fillStyle=p,b.strokeStyle=c;let x=n==="left"?0:n==="center"?m/2:m-Xu*u/2;return e(b,x,(y+Xu*u/2)/2),h},"textToCanvas"));d(this,"cacheImage",l(e=>{if(!e.appearance.marker.icon)return;let i=sC(e.appearance.marker.icon);this.imagePromiseCache[i]||(this.imagePromiseCache[i]=new Promise(n=>{this.transformRequest(e.appearance.marker.icon).then(o=>{let a=qP(o.url);a.onload=()=>{this.imageCache[i]=a,this.publish("img:loaded"),n(a)}})})),e.imageHash!==i&&(e.imageHash=i,this.imagePromiseCache[i].then(()=>{e.dirty=!0}))},"cacheImage"));d(this,"createPinCanvas",l((e,i,n,o)=>{let a,p=this.state.pixelRatio,c=e.totalMarkerSize*2*p;window.OffscreenCanvas!=null?a=new OffscreenCanvas(c,c):(a=document.createElement("canvas"),a.width=c,a.height=c,a.style.width=c/p+"px",a.style.height=c/p+"px");let u=a.getContext("2d");return u.shadowColor="rgba(0,0,0,0.3)",u.shadowOffsetY=IG*p,u.shadowBlur=PG*p,u.beginPath(),u.arc(c/2,c/2,i/2+MG*p/2,0,2*Math.PI),u.fillStyle=n,u.fill(),u.beginPath(),u.arc(c/2,c/2,i/2,0,2*Math.PI),u.shadowColor="transparent",u.fillStyle=o,u.fill(),a},"createPinCanvas"));d(this,"prepare",l((e,i,n)=>{let o=this.state.pixelRatio;n.lineWidth=4*o;let a=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active),p=this.createPinCanvas(e,e.iconVisible?e.markerSize:TG*o,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[i]=[a,p]},"prepare"));this.state=e,this.colliderCanvas=i,this.colliderContext=i.getContext("2d"),this.transformRequestFunc=n}draw(e,i,n){var u,h;if(!e.canShow||!e.visible)return;n.save(),n.globalAlpha=e.opacity;let o=this.state.pixelRatio,a=e.projection.x*o,p=e.projection.y*o,c=e.style.pinVisibility===1?this.pinCache[i][0]:this.pinCache[i][1];if(n.drawImage(c,a-e.totalMarkerSize*o,p-e.totalMarkerSize*o),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imageCache[e.imageHash]){let m=this.imageCache[e.imageHash],y=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*o,b=e.appearance.marker.iconFit,x=y,C=y,v="".concat(e.imageHash,"_").concat(b);if(this.imageDimensionsCache[v])x=this.imageDimensionsCache[v].width,C=this.imageDimensionsCache[v].height;else{let S=m.width*o,I=m.height*o;if(b==="contain"){let w=Math.sqrt(S**2+I**2),E=y/w;x=S*E,C=I*E}if(b==="cover"){let w=y/S,E=y/I,D=Math.max(w,E);x=S*D,C=I*D}}n.save(),n.beginPath(),n.arc(a,p,y/2,0,2*Math.PI),n.closePath(),((h=(u=e==null?void 0:e.appearance)==null?void 0:u.marker)==null?void 0:h.iconOverflow)!=="visible"&&n.clip(),n.drawImage(m,a-x/2,p-C/2,x,C),n.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left&&e.style.top&&n.drawImage(this.textCache[e.id][e.style.textAlign],a+e.style.left*o,p+e.style.top*o),n.restore()}};l(Rv,"TwoDDrawSystem");var Ym=Rv;g();g();var Ro=class Ro{constructor(){d(this,"loader");this.loader=new zs}static getInstance(){return Ro.instance||(Ro.instance=new Ro),Ro.instance}getLoader(){return this.loader}load(t){return new Promise((e,i)=>{this.loader.load(t,e,void 0,i)})}};l(Ro,"TextureLoaderSingleton"),d(Ro,"instance");var Nv=Ro,No=Nv.getInstance();function wG(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]}l(wG,"processColor");var fs,Zu,Gv=class Gv extends ae{constructor(e,i){super();T(this,fs);d(this,"state");d(this,"convertTo3DMapPosition");d(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=i,this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,n){var o;if(i.texture!==e.texture&&i.texture!==""&&G(this,fs,Zu).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&G(this,fs,Zu).call(this,i.topTexture,e,"topTexture"),(e.texture==null||e.topTexture==null)&&Array.isArray((o=e.feature.properties)==null?void 0:o.textures)&&e.feature.properties.textures.length>0)for(let a of e.feature.properties.textures)a.face==="top"&&e.topTexture!==a.path?G(this,fs,Zu).call(this,a.path,e,"topTexture"):a.face==="side"&&e.texture!==a.path&&G(this,fs,Zu).call(this,a.path,e,"texture"),e.blendTexture=!0;(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 o,a,p,c,u,h,m,y;let e,i,n;for(let b of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(b),n instanceof Lt&&n.type==="geometry-group"){let x=n.components[0];if(n.userData.shadingDirty){let C=n.userData.entities3D.values().next().value;if(C==null)continue;let v=this.state.geometry3DMap.get(C);v instanceof Ee&&(v.type==="geometry"||v.type==="custom-geometry")&&(e=v.components[0],n.userData.shadingDirty&&x.shading&&this.setShading(e,x.shading));let S,I;for(let w of n.userData.entities3D.values())S=this.state.geometry3DMap.get(w),I=S.components[0],S.type==="geometry"&&I.detached&&n.userData.shadingDirty&&x.shading&&this.setShading(I,x.shading);n.userData.shadingDirty=!1}if(x.dirty){let C=n.getfirstChildEntityId();if(C){let S=this.state.geometry3DMap.get(C),I=S==null?void 0:S.components[0];I instanceof Ze&&this.processTextures(I,x)}let v=x.opacity*fa(n);n.getOpacity()!==v&&n.setOpacity(v),x.dirty=!1}}else if(n&&(n.type==="geometry"||n.type==="custom-geometry")&&((o=n.components[1])!=null&&o.dirty||(a=n.components[2])!=null&&a.dirty)){let x=n.components[0],C=n.components[1];i=n.components[2];let v=wG(n,this.state.hoverColor);if(x.setColor(v[0],v[1]),C.visible!==x.visible&&(x.visible=C.visible,x instanceof Ze&&x.textMesh)){let I=this.state.geometry3DMap.get(x.textMesh.userData.entityId);(I==null?void 0:I.type)==="text3d"&&I.components[0].polygonEntityId!=null&&(I.components[0].visible=C.visible)}C.altitude!==x.altitude&&(x.altitude=C.altitude);let S=C.opacity*fa(n);S!==x.opacity&&(x.opacity=S),C.renderOrder!==x.renderOrder&&(x.renderOrder=C.renderOrder),C.dirty=!1,x instanceof Ze&&this.processTextures(x,C,i),n.components[2]&&(n.components[2].dirty=!1)}else if((n==null?void 0:n.type)==="model")n.components[1].dirty&&(Wm(n),n.components[1].dirty=!1),n.components[0].positionDirty&&(ZP(n,this.convertTo3DMapPosition),n.components[0].positionDirty=!1);else if((n==null?void 0:n.type)==="image"&&((p=n.components[1])!=null&&p.dirty)){e=n.components[0];let x=n.components[1];x.visible!==e.visible&&(e.visible=x.visible),x.dirty=!1}else if((n==null?void 0:n.type)==="text3d"&&((c=n.components[1])!=null&&c.dirty)&&n.components[0].polygonEntityId!=null){e=n.components[0];let x=n.components[1];x.visible!=null&&x.visible!==e.visible&&(e.visible=x.visible);let{textMesh:C}=e;if(C){Object.assign(C,x.getState());let v=(u=x.hoverColor)!=null?u:this.state.text3dHoverColor;C.color=x.hoverByPolygon?v:(h=x.color)!=null?h:$s.color,C.outlineColor=x.hoverByPolygon?v:(m=x.outlineColor)!=null?m:$s.outlineColor,C.strokeColor=x.hoverByPolygon?v:(y=x.strokeColor)!=null?y:$s.strokeColor}x.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};fs=new WeakSet,Zu=l(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)=>{No.getLoader().load(e,c=>{n==="topTexture"?i.topTexture=c:i.texture=c,i.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{L.error("Failed to load texture: ".concat(e)),p("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,o)}},"#loadTexture"),l(Gv,"DrawSystem");var qm=Gv;g();var Vv=class Vv extends ae{constructor(e){super();d(this,"state");d(this,"animating",new Map);d(this,"isAnimating",!1);d(this,"startTime",-1);d(this,"showDuration",300);d(this,"hideDuration",250);d(this,"update",l(()=>{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 Ui&&(i.visibilityNeedsUpdate==="show"?(i.canShow=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));d(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[n,o]]of this.animating.entries()){let a=o===1?this.showDuration:this.hideDuration,p=(e-this.startTime)/a;i.opacity=Pi(p,0,1,n,o,o===0?lC:cC),e-this.startTime>=a&&(o===1?i.canShow=!0:o===0&&(i.canShow=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};l(Vv,"TwoDVisibilitySystem");var $m=Vv;g();var jv=class jv extends ae{constructor(e,i,n,o,a,p,c){super();d(this,"state");d(this,"renderer");d(this,"mode");d(this,"scene");d(this,"cameraObject");d(this,"viewCamera");d(this,"systems");d(this,"needs2DRecompute",!1);d(this,"twoDdirty",!0);d(this,"threeDdirty",!0);d(this,"frameId",null);d(this,"twoDFrameId",null);d(this,"animationFrameId",null);d(this,"nextFrame",null);d(this,"update",l((e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)==null)return Promise.resolve();if(e){let n=this.commitRenderState();return this.paint(),n}else return this.frameId?Promise.resolve():new Promise(n=>{this.frameId=requestAnimationFrame(()=>{var o,a;return((o=this.renderer)==null?void 0:o.renderer)==null?n():this.mode==="standalone"?(a=this.commitRenderState())==null?void 0:a.then(()=>{this.paint(),n()}):n()})})},"update"));d(this,"animate2D",l(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));d(this,"drawEntities2D",l(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));d(this,"updateEntities2D",l(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));d(this,"commitRenderState",l(()=>{try{let e=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),nC(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),iC(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let i=this.systems.meshOptimizationSystem.update();i&&e.push(i),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let n=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!n)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(e)}catch(e){L.error("Render failed: ",e)}},"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),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};l(jv,"RenderSystem");var Jm=jv;g();var EG=O.object({interactive:O.boolean().optional(),id:O.string().optional(),nearRadius:O.number().optional(),farRadius:O.number().optional(),accentColor:O.string().optional(),displayArrowsOnPath:O.boolean().optional(),animateArrowsOnPath:O.boolean().optional(),nearZoomLevel:O.number().optional(),farZoomLevel:O.number().optional()}),DG=O.object({type:O.enum(["Feature"]),geometry:hc,properties:O.object({parentId:O.any().optional()})});function $P(r,t){O.object({features:O.array(DG)}).parse(r),EG.parse(t)}l($P,"validatePath");var Yu,Uv=class Uv{constructor(t,e){d(this,"type","path");d(this,"mesh",new zr);d(this,"material");d(this,"geometry");d(this,"outline");d(this,"feature");d(this,"options");d(this,"nearRadius",.2);d(this,"farRadius",.4);d(this,"nearZoomLevel");d(this,"farZoomLevel");d(this,"nearZoomAltitude");d(this,"farZoomAltitude");d(this,"accentColor","blue");d(this,"completeFraction",1);d(this,"altitudeAdjustment",1);d(this,"displayArrowsOnPath",!1);d(this,"animateArrowsOnPath",!1);d(this,"isVertical",!1);d(this,"dirty",!0);d(this,"materialDirty",!0);d(this,"position",new Q);T(this,Yu,0);var i,n,o,a,p;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(n=e==null?void 0:e.nearRadius)!=null?n:this.nearRadius,this.farRadius=(o=e==null?void 0:e.farRadius)!=null?o:this.farRadius,this.nearZoomLevel=e==null?void 0:e.nearZoomLevel,this.farZoomLevel=e==null?void 0:e.farZoomLevel,this.displayArrowsOnPath=(a=e==null?void 0:e.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(p=e==null?void 0:e.animateArrowsOnPath)!=null?p:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return s(this,Yu)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Yu,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Yu=new WeakMap,l(Uv,"PathComponent");var Go=Uv;g();var Hv=class Hv{constructor(t){d(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Me&&t.components[0]){let i=t.components[0];if(i.dirty){for(let n of t.children)(n instanceof Lt||n instanceof Me)&&(n.userData.entityId!==t.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};l(Hv,"StackSystem");var Km=Hv;g();g();g();var rt=Object.freeze({Linear:Object.freeze({None:l(function(r){return r},"None"),In:l(function(r){return r},"In"),Out:l(function(r){return r},"Out"),InOut:l(function(r){return r},"InOut")}),Quadratic:Object.freeze({In:l(function(r){return r*r},"In"),Out:l(function(r){return r*(2-r)},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},"InOut")}),Cubic:Object.freeze({In:l(function(r){return r*r*r},"In"),Out:l(function(r){return--r*r*r+1},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},"InOut")}),Quartic:Object.freeze({In:l(function(r){return r*r*r*r},"In"),Out:l(function(r){return 1- --r*r*r*r},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},"InOut")}),Quintic:Object.freeze({In:l(function(r){return r*r*r*r*r},"In"),Out:l(function(r){return--r*r*r*r*r+1},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},"InOut")}),Sinusoidal:Object.freeze({In:l(function(r){return 1-Math.sin((1-r)*Math.PI/2)},"In"),Out:l(function(r){return Math.sin(r*Math.PI/2)},"Out"),InOut:l(function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))},"InOut")}),Exponential:Object.freeze({In:l(function(r){return r===0?0:Math.pow(1024,r-1)},"In"),Out:l(function(r){return r===1?1:1-Math.pow(2,-10*r)},"Out"),InOut:l(function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},"InOut")}),Circular:Object.freeze({In:l(function(r){return 1-Math.sqrt(1-r*r)},"In"),Out:l(function(r){return Math.sqrt(1- --r*r)},"Out"),InOut:l(function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},"InOut")}),Elastic:Object.freeze({In:l(function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},"In"),Out:l(function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},"Out"),InOut:l(function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:l(function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},"In"),Out:l(function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},"Out"),InOut:l(function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},"InOut")}),Bounce:Object.freeze({In:l(function(r){return 1-rt.Bounce.Out(1-r)},"In"),Out:l(function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},"Out"),InOut:l(function(r){return r<.5?rt.Bounce.In(r*2)*.5:rt.Bounce.Out(r*2-1)*.5+.5},"InOut")}),generatePow:l(function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:l(function(t){return Math.pow(t,r)},"In"),Out:l(function(t){return 1-Math.pow(1-t,r)},"Out"),InOut:l(function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5},"InOut")}},"generatePow")}),qu=l(function(){return performance.now()},"now"),zv=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return l(r,"Group"),r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,o=e;n<o.length;n++){var a=o[n];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var o=n[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=qu()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var o=this._tweens[i[n]],a=!e;o&&o.update(t,a)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),fc={Linear:l(function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=fc.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)},"Linear"),Bezier:l(function(r,t){for(var e=0,i=r.length-1,n=Math.pow,o=fc.Utils.Bernstein,a=0;a<=i;a++)e+=n(1-t,i-a)*n(t,a)*r[a]*o(i,a);return e},"Bezier"),CatmullRom:l(function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=fc.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)},"CatmullRom"),Utils:{Linear:l(function(r,t,e){return(t-r)*e+r},"Linear"),Bernstein:l(function(r,t){var e=fc.Utils.Factorial;return e(r)/e(t)/e(r-t)},"Bernstein"),Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:l(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},"CatmullRom")}},JP=function(){function r(){}return l(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),Wv=new zv,ar=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=rt.Linear.None,this._interpolationFunction=fc.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=JP.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=Wv,Wv.add(this))}return l(r,"Tween"),r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=qu()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var o in this._valuesEnd)n[o]=this._valuesEnd[o];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,n,o){for(var a in i){var p=t[a],c=Array.isArray(p),u=c?"array":typeof p,h=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(h){var m=i[a];if(m.length===0)continue;for(var y=[p],b=0,x=m.length;b<x;b+=1){var C=this._handleRelativeValue(p,m[b]);if(isNaN(C)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(C)}h&&(i[a]=y)}if((u==="object"||c)&&p&&!h){e[a]=c?[]:{};var v=p;for(var S in v)e[a][S]=v[S];n[a]=c?[]:{};var m=i[a];if(!this._isDynamic){var I={};for(var S in m)I[S]=m[S];i[a]=m=I}this._setupProperties(v,e[a],m,n[a],o)}else(typeof e[a]>"u"||o)&&(e[a]=p),c||(e[a]*=1),h?n[a]=i[a].slice().reverse():n[a]=e[a]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=qu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=qu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=rt.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=fc.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,n;if(t===void 0&&(t=qu()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,p=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),c=this._duration+this._repeat*p,u=l(function(){if(i._duration===0||a>c)return 1;var C=Math.trunc(a/p),v=a-C*p,S=Math.min(v/i._duration,1);return S===0&&a===i._duration?1:S},"calculateElapsedPortion"),h=u(),m=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||a>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((a-this._duration)/p)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=p*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,x=this._chainedTweens.length;b<x;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,n){for(var o in i)if(e[o]!==void 0){var a=e[o]||0,p=i[o],c=Array.isArray(t[o]),u=Array.isArray(p),h=!c&&u;h?t[o]=this._interpolationFunction(p,n):typeof p=="object"&&p?this._updateProperties(t[o],a,p,n):(p=this._handleRelativeValue(a,p),typeof p=="number"&&(t[o]=a+(p-a)*n))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var Wie=JP.nextId,zi=Wv,zie=zi.getAll.bind(zi),Xie=zi.removeAll.bind(zi),Zie=zi.add.bind(zi),Yie=zi.remove.bind(zi),qie=zi.update.bind(zi);g();g();g();var KP=l((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),QP=l((r,t)=>new ne(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),Xv=l((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),$u=l((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),Zv=l((r,t)=>new ne((r.x+t.x)/2,(r.y+t.y)/2),"average"),Yv=l(r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t},"getScrollDelta");var qv=class qv{constructor(t,e){d(this,"input1");d(this,"input2");d(this,"lastAngle");d(this,"lastDistance");d(this,"totalDistance");d(this,"first");d(this,"second");this.input1=t,this.input2=e,this.lastAngle=Xv(t,e),this.lastDistance=$u(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=$u(t,e);this.input1=t,this.input2=e;let n=Xv(t,e);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=($u(this.first,t)+$u(this.second,e))/2,this.first=Zv(this.first,t),this.second=Zv(this.second,e)}};l(qv,"InputSet");var Qm=qv;g();var $v=class $v{constructor(t,e,i){d(this,"touch");d(this,"camera");d(this,"cameraPlane");d(this,"viewCoordinate");d(this,"snapHolderMatrix");d(this,"snapCamera");d(this,"cameraPosition");d(this,"raycaster");d(this,"worldCoordinate");d(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=i,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new ne(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Ci,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 ne(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}};l($v,"TouchAnchor");var Ju=$v;var Br={};ux(Br,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>_G,CLIPPING_RADIUS:()=>Ku,CONTROL_OPTIONS:()=>OG,DEFAULT_ANIMATION_DURATION:()=>t2,DEFAULT_BEARING:()=>BG,DEFAULT_MAX_ZOOM_LEVEL:()=>AG,DEFAULT_MIN_ZOOM_LEVEL:()=>r2,DEFAULT_PITCH:()=>FG,DEFAULT_ZOOM_LEVEL:()=>kG,EVENTS:()=>ig,MAPLIBRE_TILE_SIZE:()=>eg,MAX_LAT:()=>Kv,MAX_MERCATOR_ZOOM_LEVEL:()=>rg,MIN_LAT:()=>Jv,MIN_MERCATOR_ZOOM_LEVEL:()=>tg,ROOM_MERCATOR_ZOOM_LEVEL:()=>LG,TWO_PI:()=>Qv,WHEEL_ZOOM_MULTIPLIER:()=>e2,ZRANGE:()=>mc});g();var eg=512,Jv=-85.051129,Kv=85.051129,Ku=1e4,OG={chain:"chain",cancel:"cancel"},Qv=Math.PI*2,mc=100,e2=1e4,tg=0,rg=24,_G=17,LG=20,t2=200,ig=["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"],kG=18,r2=12,AG=22,FG=0,BG=0;g();function e6(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}l(e6,"scrubMaterial");function ze(r){for(let t=r.children.length-1;t>=0;t--)ze(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){e6(t)}):"material"in r&&typeof r.material<"u"&&e6(r.material)}l(ze,"destroyObject3D");var ng=!1,RG=!1;var og,ag=class ag extends ae{constructor(e,i,n,o,a){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);d(this,"rotationDirty",!1);d(this,"panDirty",!1);T(this,og,r2);d(this,"zoomSpeed",5);d(this,"rotateSpeed",100);d(this,"enabled",!0);d(this,"enableZoom",!0);d(this,"enablePan",!0);d(this,"enablePedestal",!1);d(this,"maxPedestal",1/0);d(this,"minPedestal",0);d(this,"enableRotate",!0);d(this,"minZoomAltitude",0);d(this,"maxZoomAltitude",1/0);d(this,"ignoreZoomLimits",!1);d(this,"zoomFactor",1);d(this,"panBounds",{min:new Q(1/0,1/0),max:new Q(-1/0,-1/0),center:new Q(0,0,0),radius:1/0});d(this,"minTilt",0);d(this,"maxTilt",1.2);d(this,"MOUSE_BUTTONS",{ORBIT:Th.RIGHT,ZOOM:Th.MIDDLE,PAN:Th.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new Ci);d(this,"rendererState");d(this,"options");d(this,"state",-1);d(this,"intersection");d(this,"viewState",null);d(this,"tweens",new Map);d(this,"clock",new kx(!0));d(this,"coords",{mouse:new ne,rotateStart:new ne,rotateEnd:new ne,rotateDelta:new ne,panStart:new Q,panCameraStart:new Q,panEnd:new Q,panDelta:new Q,initialShiftPos:new ne,initialPedestal:0,floorAnchor:new Q});d(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});d(this,"scrollTimer",null);d(this,"lastWheelTime",0);d(this,"resetZoom",!1);d(this,"zoomStart");d(this,"pedestalScaleFactor",1);d(this,"isUserZooming",!1);d(this,"stayInsideBounds",!0);d(this,"userInteracting",!1);d(this,"cameraMoving",!1);d(this,"lastCameraMoveTime",Date.now());d(this,"raycastToFloor",l(e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new Q},"raycastToFloor"));d(this,"isUserInteracting",l(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",l(()=>new Q(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));d(this,"getPedestal",l(()=>this.orbit.position.z,"getPedestal"));d(this,"pan",l((e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));d(this,"postRender",l(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));d(this,"isCameraMoving",l(()=>this.cameraMoving,"isCameraMoving"));d(this,"lastCameraStoppedMovingTime",l(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));d(this,"setPosition",l((e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));d(this,"updateCameraPosition",l((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"));d(this,"tilt",l(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));d(this,"zoomIn",l((e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},e,i,n)},"zoomIn"));d(this,"zoomOut",l((e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},e,i,n)},"zoomOut"));d(this,"getRotation",l(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));d(this,"cancelAnimation",l(()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));d(this,"animateCamera",l((e,i,n,o,a,p)=>{let c={interruptible:!0,...p},u={},h={},m=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(u.x=m.x,h.x=e.position.x),e.position.y!==void 0&&(u.y=m.y,h.y=e.position.y),e.position.z!==void 0&&(u.z=m.z,h.z=e.position.z)),e.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.zoom=e.zoom:h.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:w,end:E}=Lh(this.getRotation(),e.rotation);u.rotation=w,h.rotation=E}e.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.tilt=e.tilt:h.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let y=u.zoom!==h.zoom,b=u.rotation!==h.rotation,x=u.tilt!==h.tilt,C=new ar(u).to(h,M.env.TESTING?0:i).onUpdate(w=>{this.setMulti({x:w.x,y:w.y,z:w.z},w.zoom,w.rotation,w.tilt)}).onComplete(()=>{this.completeTween(C),this.publish("multi-end",{zooming:y,rotating:b,tilting:x}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,C.state=7,this.publish("multi-start",{zooming:y,rotating:b,tilting:x})),this.publish("change")});this.rendererState.tweenGroup.add(C);let v=Array.from(this.tweens.entries()),S=v[v.length-1],I=!1;return S!=null&&(S[1].interruptible?(typeof S[1].cancelledCallback=="function"&&S[1].cancelledCallback(),this.completeTween(S[0])):(I=!0,S[0].chain(C))),this.tweens.set(C,{cancelledCallback:a,interruptible:c.interruptible}),n?C.easing(n):C.easing(rt.Quadratic.In),!e.doNotAutoStart&&!I&&(C.start(),this.publish("change")),C.cameraAnimation=!0,C},"animateCamera"));d(this,"setMulti",l((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>Ku&&(this.camera.near=i-Ku,this.camera.far=i+Ku):(this.camera.near=i/mc,this.camera.far=i*mc),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(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"));d(this,"getZoomScaledMin",l(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));d(this,"getZoomScaledMax",l(()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)},"getZoomScaledMax"));d(this,"setRotation",l((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=-(e%Qv);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,this.rotationDirty=!0},"setRotation"));d(this,"setZoomAltitude",l(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/mc,this.camera.far=i*mc,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));d(this,"setZoomLevel",l(e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))},"setZoomLevel"));d(this,"getZoomAltitude",l(()=>this.camera.position.z,"getZoomAltitude"));d(this,"getZoomLevel",l(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));d(this,"setTilt",l((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"));d(this,"getTilt",l(()=>this.elevation.rotation.x,"getTilt"));d(this,"setCameraPlaneElevation",l(e=>{this.cameraPlane.position.z=e},"setCameraPlaneElevation"));d(this,"zoom",l(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));d(this,"getProjectionScaleFactor",l((e,i,n)=>py(e,i,n),"getProjectionScaleFactor"));d(this,"update",l(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));d(this,"setPedestal",l((e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)},"setPedestal"));d(this,"dispose",l(()=>{for(let e of ig)e.endsWith("start")?(this.off(e,this.setCameraMoving),e.startsWith("user")&&this.off(e,this.setUserInteracting)):(e.endsWith("end")||e.endsWith("cancel"))&&(this.off(e,this.unsetCameraMoving),e.startsWith("user")&&this.off(e,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));d(this,"createCameraPlane",l(()=>{let e=ng?2e3:1e10,i=ng?100:1,n=new Hr(e,e,i,i),o=new ct({color:0,wireframe:ng,visible:ng}),a=new de(n,o);return this.scene.add(a),a},"createCameraPlane"));d(this,"addEventListeners",l(()=>{let{domElement:e}=this.renderer;for(let i of ig)i.endsWith("start")?(this.on(i,this.setCameraMoving),i.startsWith("user")&&this.on(i,this.setUserInteracting)):(i.endsWith("end")||i.endsWith("cancel"))&&(this.on(i,this.unsetCameraMoving),i.startsWith("user")&&this.on(i,this.unsetUserInteracting));e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));d(this,"addMouseEventListeners",l(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));d(this,"addMouseMoveEventListeners",l(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));d(this,"removeMouseMoveEventListeners",l(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));d(this,"removeEventListeners",l(()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));d(this,"removeMouseUpEventListeners",l(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));d(this,"onContextMenu",l(e=>{e.preventDefault()},"onContextMenu"));d(this,"onMouseUp",l(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}},"onMouseUp"));d(this,"onMouseMove",l(e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)},"onMouseMove"));d(this,"onTouchStart",l(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 Qm(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));d(this,"onTouchMove",l(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 ne(this.touch.touches[0].x,this.touch.touches[0].y),a=new ne(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"));d(this,"onTouchEnd",l(e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}},"onTouchEnd"));d(this,"handleTouchMovePan",l(e=>{let i=Object.hasOwn(e,"x")?new ne(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"),this.panDirty=!0},"handleTouchMovePan"));d(this,"handleTouchStartDolly",l(()=>{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 ne(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 Ju(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Ju(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));d(this,"handleMouseMovePan",l(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));d(this,"handleTouchStartTilt",l(e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));d(this,"handleTouchMovePedestal",l(e=>{this.handleMouseMovePedestal(e.touches[0])},"handleTouchMovePedestal"));d(this,"handleTouchMoveTilt",l(e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));d(this,"handleTouchMoveDolly",l(()=>{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"));d(this,"handleTouchEnd",l(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));d(this,"handleTouchStartPan",l(e=>{let i=Object.hasOwn(e,"x")?new ne(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"));d(this,"handleTouchStartPedestal",l(e=>{this.handleMouseDownPedestal(e.touches[0])},"handleTouchStartPedestal"));d(this,"onMouseDown",l(e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));d(this,"onMouseWheel",l(e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))},"onMouseWheel"));d(this,"handleMouseWheel",l(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-Yv(e)*i/e2*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"));d(this,"setCameraFromTransformMatrix",l(e=>{this.orbit.updateMatrixWorld();let i=new sn;i.setFromRotationMatrix(e,"ZYX");let n=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new Q(0,0,1);a.applyEuler(i),a.setLength(n);let p=new Q;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"));d(this,"makeTransformFromTouchAnchors",l((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,h=i.viewCoordinate,m=a.x-o.x,y=a.y-o.y,b=Math.atan2(y,m),x=c.x-p.x,C=c.y-p.y,v=Math.atan2(C,x),S=KP(b,v),I=new jr;I.makeRotationZ(-S);let w=I.clone();w.multiply(e.snapHolderMatrix);let E=l((t8,r8,i8)=>t8.elements[(r8-1)*4+i8-1],"m"),D=E(n,1,1)*E(w,1,1)-u.x*E(n,3,4)*E(w,3,1),R=E(n,1,1)*E(w,1,2)-u.x*E(n,3,4)*E(w,3,2),_=E(n,1,1)*E(w,1,3)-u.x*E(n,3,4)*E(w,3,3),F=o.x*D+o.y*R+o.z*_,B=E(n,2,2)*E(w,2,1)-u.y*E(n,3,4)*E(w,3,1),V=E(n,2,2)*E(w,2,2)-u.y*E(n,3,4)*E(w,3,2),N=E(n,2,2)*E(w,2,3)-u.y*E(n,3,4)*E(w,3,3),X=o.x*B+o.y*V+o.z*N,z=E(n,1,1)*E(w,1,1)-h.x*E(n,3,4)*E(w,3,1),U=E(n,1,1)*E(w,1,2)-h.x*E(n,3,4)*E(w,3,2),te=E(n,1,1)*E(w,1,3)-h.x*E(n,3,4)*E(w,3,3),Z=a.x*z+a.y*U+a.z*te,Ce=E(n,2,2)*E(w,2,1)-h.y*E(n,3,4)*E(w,3,1),me=E(n,2,2)*E(w,2,2)-h.y*E(n,3,4)*E(w,3,2),Pe=E(n,2,2)*E(w,2,3)-h.y*E(n,3,4)*E(w,3,3),_e=a.x*Ce+a.y*me+a.z*Pe,dr=Math.abs(z-D),_t=Math.abs(U-R),st=Math.abs(te-_),et=Math.abs(z-B),hr=Math.abs(U-V),Vr=Math.abs(te-N),ge=Math.abs(Ce-D),ve=Math.abs(me-R),$e=Math.abs(Pe-_),vt=Math.abs(Ce-B),lt=Math.abs(me-V),nn=Math.abs(Pe-N),gi=Math.min(dr+_t+st,et+hr+Vr),yi=Math.min(ge+ve+$e,vt+lt+nn);gi<yi&&(z=Ce,U=me,te=Pe,Z=_e);let jt=B*_-D*N,no=V*_-R*N,sp=X*_-F*N,lp=z*N-B*te,cp=U*N-V*te,sx=Z*N-X*te,$9=(sx*no-sp*cp)/(lp*no-jt*cp),J9=(sx*jt-sp*lp)/(cp*jt-no*lp),lx=V*D-R*B,K9=N*D-_*B,Q9=X*D-F*B,cx=U*B-V*z,e8=te*B-N*z,px=((Z*B-X*z)*lx-Q9*cx)/(e8*lx-K9*cx),Sh=w.clone();return Sh.elements[12]=$9,Sh.elements[13]=J9,Sh.elements[14]=px,px>0?Sh:null},"makeTransformFromTouchAnchors"));d(this,"updateTouchOrigin",l(()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top},"updateTouchOrigin"));d(this,"touchToScene",l(e=>{this.touch.touches=[];for(let i=0,n=e.touches.length;i<n;i++){let o=e.touches[i],a=QP(o,this.touch.origin);this.touch.touches.push(new ne(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"));d(this,"canScrollZoom",l(e=>{let i=Yv(e),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())},"canScrollZoom"));d(this,"mouseToScene",l(e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));d(this,"getMousePos",l(e=>({x:e.offsetX,y:e.offsetY}),"getMousePos"));d(this,"handleMouseDownRotate",l(e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));d(this,"handleMouseDownPan",l(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));d(this,"handleMouseDownPedestal",l(e=>{let i=new ne(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=py(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));d(this,"handleMouseMovePedestal",l(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"));d(this,"handleMouseMoveRotate",l(e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));d(this,"publishUserZoomDebounced",qs(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));d(this,"publishUserZoomEvent",l(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));d(this,"setCameraMoving",l(()=>{this.cameraMoving=!0},"setCameraMoving"));d(this,"unsetCameraMoving",l(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));d(this,"setUserInteracting",l(()=>{this.userInteracting=!0},"setUserInteracting"));d(this,"unsetUserInteracting",l(()=>{this.userInteracting=!1},"unsetUserInteracting"));d(this,"publishPedestalChangeEvent",l(e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));d(this,"convertAltitudeToZoomLevel",l(e=>{let[,i]=this.center,o=e*2*Math.tan(ye.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ye.degToRad(i))*2*Math.PI*Qg/o;return ye.clamp(Math.log2(a/512),tg,rg)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",l(e=>{let[,i]=this.center,n=ye.clamp(e,tg,rg),o=Math.pow(2,n),a=ye.clamp(i,Jv,Kv),p=o*512;return Math.cos(ye.degToRad(a))*Math.PI*2*Qg/p*this.options.canvasHeight/2/Math.tan(ye.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));d(this,"completeTween",l(e=>{e.isPlaying()&&e.stop(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)},"completeTween"));d(this,"debugContainer",new ln);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 s(this,og)}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}=Fh((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}=Bh((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)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}getCameraFrameForCoordinates(e,i){let n=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,o=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,a=this.options.canvasWidth,p=this.options.canvasHeight,c=this.getRotation(),u=this.getTilt(),h=this.getPosition();this.setRotation(i.rotation||c,!0),this.setTilt(i.tilt||u,!0);let m=t6(e,{canvasWidth:a,canvasHeight:p,paddingOption:i.padding,verticalPadding:i.verticalPadding,minZoom:n,maxZoom:o,position:h,camera:this.camera,orbit:this.orbit});return this.setRotation(c,!0),this.setTilt(u,!0),{center:m.position,zoomLevel:this.convertAltitudeToZoomLevel(m.zoom)}}focusOn(e,i){if(RG){this.debugContainer&&ze(this.debugContainer);let v=new Ur(4,4,4),S=new ct({color:65280,depthTest:!1}),I=new ao(v,S,e.length),w=new jr;e.forEach((E,D)=>{w.setPosition(E),I.setMatrixAt(D,w)}),I.instanceMatrix.needsUpdate=!0,this.debugContainer.add(I),this.scene.add(this.debugContainer)}let n=i.curve,o=i.callback,a=i.cancelledCallback,p=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,c=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,h=this.options.canvasHeight,m;i.duration!==void 0?m=i.duration:M.env.TESTING==="true"?m=0:m=t2;let y=i.padding,b=this.getRotation(),x=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let C=t6(e,{canvasHeight:h,paddingOption:y,canvasWidth:u,minZoom:p,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:i.verticalPadding});this.setRotation(b),this.setTilt(x),this.animateCamera({position:C.position,tilt:i.tilt,rotation:i.rotation,zoom:C.zoom},m,n,o,a,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};og=new WeakMap,l(ag,"CameraSystem"),d(ag,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var gc=ag;function t6(r,{canvasWidth:t,orbit:e,paddingOption:i,verticalPadding:n=0,canvasHeight:o,minZoom:a,maxZoom:p,camera:c,position:u}){let h={zoom:a,position:u};if(r.length===0)return h;for(let jt of gc.CAMERA_FRAME_PADDING_SIDES)typeof i[jt]!="number"&&(i[jt]=0);let m=i.type==="portion"?{top:i.top*o,bottom:i.bottom*o,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(m.left+m.right>=t||m.top+m.bottom>=o)return h;e.updateMatrixWorld();let y=c.matrixWorldInverse,b=c.fov*(Math.PI/180)/2,x=b,v=Math.atan(Math.tan(b)*(t/o)),S=new Q(1/0,1/0,1/0),I=new Q(-1/0,-1/0,-1/0),w=new xt,E=new Q;for(let jt=0,no=r.length;jt<no;jt++)E.copy(r[jt]),w.expandByPoint(E),E.applyMatrix4(y),S.min(E),I.max(E),E.copy(r[jt]),E.z-=n,E.applyMatrix4(y),S.min(E),I.max(E),E.copy(r[jt]),E.z+=n,E.applyMatrix4(y),S.min(E),I.max(E);let D=I.x-S.x,R=I.y-S.y,_=t-m.left-m.right,F=o-m.top-m.bottom,B=(I.x+S.x)/2,V=(I.y+S.y)/2,N=D/_,X=R/F,z=a,U=p,te=z*Math.tan(v)*2,Z=U*Math.tan(v)*2,Ce=te/t,me=Z/t,Pe=Math.max(N,X);Pe=ye.clamp(Pe,Ce,me);let _e=_*Pe,dr=F*Pe,_t={min:{x:B-_e/2-m.left*Pe,y:V-dr/2-m.bottom*Pe},max:{x:B+_e/2+m.right*Pe,y:V+dr/2+m.top*Pe}},st=(_t.min.x+_t.max.x)/2,et=(_t.min.y+_t.max.y)/2,hr=w.getCenter(new Q),Vr=Math.abs(st-_t.min.x),ge=Math.abs(et-_t.min.y),ve=Vr/Math.tan(v),$e=ge/Math.tan(x),vt=new Q;vt.set(st,et,I.z+Math.max(ve,$e)),vt.applyMatrix4(c.matrixWorld);let lt=new Q;lt.set(st,et,I.z),lt.applyMatrix4(c.matrixWorld);let nn=new Q().subVectors(lt,vt),gi=(hr.z-vt.z)/nn.z,yi=new Q().copy(vt).add(nn.clone().multiplyScalar(gi));return lt.set(yi.x,yi.y,yi.z),vt.sub(lt),{position:yi,zoom:vt.length()}}l(t6,"getCameraFrameForPoints");g();var NG=300,Qu,ed,i2=class i2{constructor(t){d(this,"state");T(this,Qu,new Q);T(this,ed,new Q);this.state=t}update(t){var n;let e,i;this.state.cameraObject.getWorldPosition(s(this,ed));for(let o of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i&&"containerEl"in i&&i.markerContainer!=null)){if(i.visibilityNeedsUpdate!==!1&&(i.visibilityNeedsUpdate==="show"?i.canShow=!0:i.canShow=!1),(i.canShow&&i.visible===!0||((n=i.animation)==null?void 0:n.pending)===!0)&&!i.offscreen)if(i.options.zIndex!=null)i.markerContainer.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.options.zIndex,"px)");else{e.object3d.getWorldPosition(s(this,Qu));let a=s(this,ed).distanceTo(s(this,Qu));i.markerContainer.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-a,"px)")}if(i.canShow===!0&&i.visible===!0?i.markerContainer.style.pointerEvents=t?"none":i.pointerEvents:i.markerContainer.style.pointerEvents="none",i.currentStrategyIndex===-1&&i.visible&&i.visibilityNeedsUpdate==="show")continue;i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.visibilityNeedsUpdate==="show"&&(i.markerContainer.style.opacity="0"),i.animation&&i.animation.cancel(),i.animation=i.markerContainer.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:NG,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};Qu=new WeakMap,ed=new WeakMap,l(i2,"DOMDrawSystem");var sg=i2;g();var n2=class n2{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};l(n2,"StackComponent");var lg=n2;g();var o2=class o2 extends ae{constructor(e,i){super();d(this,"state");d(this,"dirty",!0);d(this,"domTree");d(this,"observers",new Map);d(this,"updateDimensions",l(e=>{e.forEach(i=>{var a;let o=(a=i.target.parentElement)==null?void 0:a.getAttribute("data-marker-id");if(o){let p=this.state.geometry2DMap.get(o),c=p==null?void 0:p.components[0];p&&c instanceof ji&&(c.updateDimensions(i.contentRect.width,i.contentRect.height),c.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=e,this.domTree=i}setupObserver(){var n;if(this.observers){for(let o of this.observers.values())o.disconnect();this.observers.clear()}let e,i;for(let o of this.domTree.children){let a=o.getAttribute("data-marker-id");if(a!=null&&(e=this.state.geometry2DMap.get(a),i=e.components[0],(n=i.options)!=null&&n.dynamicResize)){let p=new ResizeObserver(this.updateDimensions);p.observe(i.containerEl),this.observers.set(o.userData.entityId,p)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};l(o2,"DOMResizeSystem");var cg=o2;g();var GG=0,VG=90,jG=(M.env.NODE_ENV==="test",!1),Rn={linear:rt.Linear.None,"ease-in":rt.Quadratic.In,"ease-out":rt.Quadratic.Out,"ease-in-out":rt.Quadratic.InOut},UG=-50,ee,ce,Vo,td,rd,s2,l2=class l2{constructor(t,e,i){T(this,rd);T(this,ee);T(this,ce);T(this,Vo);T(this,td);P(this,ee,t),P(this,ce,e),P(this,Vo,i),s(this,ce).cameraSystem.on("pedestal-change",({pedestal:n})=>{s(this,ee).map&&(s(this,ee).map.transform.elevation=n,s(this,ee).map.transform.minElevationForCurrentTile=UG,s(this,ee).map.triggerRepaint()),s(this,ce).cameraSystem.setCameraPlaneElevation(n)})}get center(){return s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?s(this,ee).map.getCenter().toArray():s(this,ce).cameraSystem.center}setCenter(t){var e;if(s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map){(e=s(this,ee).map)==null||e.setCenter(t),s(this,ce).interactionSystem.handleHover();return}s(this,ce).cameraSystem.setCenter(t[0],t[1]),s(this,ce).interactionSystem.handleHover()}get zoomLevel(){var t;return s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?(t=s(this,ee).map)==null?void 0:t.getZoom():s(this,ce).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map&&((e=s(this,ee).map)==null||e.setZoom(t)),s(this,ce).cameraSystem.setZoomLevel(Si(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return s(this,ce).cameraSystem.isAnimating}cancelAnimation(){s(this,ce).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,ce).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,ce).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){s(this,ce).panBoundsSystem.autoMinZoomLevel=t,t&&(s(this,ce).panBoundsSystem.dirty=!0,s(this,ce).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,ce).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var n;e&&this.setAutoMinZoomLevel(!1);let i=Si(t,Br.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Br.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));s(this,ce).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=s(this,ee).map)==null||n.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=Si(t,this.minZoomLevel,Br.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Br.MAX_MERCATOR_ZOOM_LEVEL,"."));s(this,ce).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=s(this,ee).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?(t=s(this,ee).map)==null?void 0:t.getMaxPitch():ye.radToDeg(s(this,ce).cameraSystem.maxTilt)}get minPitch(){var t;return s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?(t=s(this,ee).map)==null?void 0:t.getMinPitch():ye.radToDeg(s(this,ce).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(GG,t);(i=s(this,ee).map)==null||i.setMinPitch(e),s(this,ce).cameraSystem.minTilt=ye.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(VG,t);(i=s(this,ee).map)==null||i.setMaxPitch(e),s(this,ce).cameraSystem.maxTilt=ye.degToRad(e)}get bearing(){var t;return s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?(t=s(this,ee).map)==null?void 0:t.getBearing():ye.radToDeg(s(this,ce).cameraSystem.getRotation())}setBearing(t){var e;if(s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map){(e=s(this,ee).map)==null||e.setBearing(t);return}s(this,ce).cameraSystem.setRotation(ye.degToRad(t))}get pitch(){var t;return s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?(t=s(this,ee).map)==null?void 0:t.getPitch():ye.radToDeg(s(this,ce).cameraSystem.getTilt())}setPitch(t){var e;if(s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map){(e=s(this,ee).map)==null||e.setPitch(t);return}s(this,ce).cameraSystem.setTilt(ye.degToRad(Si(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return s(this,ce).cameraSystem.getPedestal()}setElevation(t){s(this,ce).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return s(this,td)&&s(this,td).stop(),new Promise(i=>{var o;let n=s(this,ce).cameraSystem.getPosition();n.z=t,s(this,ce).cameraSystem.animateCamera({position:n},(e==null?void 0:e.duration)||300,Rn[(e==null?void 0:e.easing)||"ease-in-out"],i,i,{interruptible:(o=e==null?void 0:e.interruptible)!=null?o:!0})})}get insetsPadding(){return s(this,Vo).insetsPadding}get panMode(){return s(this,ce).cameraSystem.enablePan===!1&&s(this,ce).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(s(this,ce).cameraSystem.enablePan=!0,s(this,ce).cameraSystem.enablePedestal=!1):(s(this,ce).cameraSystem.enablePan=!1,s(this,ce).cameraSystem.enablePedestal=!0))}setInsetPadding(t){s(this,Vo).insetsPadding=Object.assign({},dp,t)}animateTo(t){var a,p,c,u,h,m;if(s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map)return(m=s(this,ee).map)==null||m.flyTo({center:(a=t.center)!=null?a:this.center,zoom:(p=t.zoomLevel)!=null?p:this.zoomLevel,bearing:(c=t.bearing)!=null?c:this.bearing,pitch:(u=t.pitch)!=null?u:this.pitch,duration:(h=t.duration)!=null?h:600}),Promise.resolve();let e=t.center?s(this,ee).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?s(this,ce).cameraSystem.convertZoomLevelToAltitude(Si(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,n=t.bearing!==void 0?ye.degToRad(t.bearing):void 0,o=t.pitch!==void 0?ye.degToRad(Si(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(y=>{var b;s(this,ce).cameraSystem.animateCamera({position:e,zoom:i,rotation:n,tilt:o},t.duration||0,Rn[t.easing||"ease-in-out"],()=>{s(this,ce).interactionSystem.handleHover(),y()},y,{interruptible:(b=t==null?void 0:t.interruptible)!=null?b:!0})})}getCameraFrameForCoordinates(t,e){let i=G(this,rd,s2).call(this,e||{},()=>Promise.resolve()),{pointCloud:n}=r6(t,s(this,ee),s(this,Vo).geometry3DMap);if(n.length===0)return L.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:o,zoomLevel:a}=s(this,ce).cameraSystem.getCameraFrameForCoordinates(n,i);return{center:s(this,ee).convert3DMapPositionToCoordinate(o),zoomLevel:a}}focusOn(t,e){var a,p,c,u;let{pointCloud:i,geoBounds:n,firstPosition:o}=r6(t,s(this,ee),s(this,Vo).geometry3DMap);return i.length===0?(L.error("No valid coordinates found in targets:",t),Promise.resolve()):s(this,ee).mode==="outdoors-overlay"&&s(this,ee).map?(i.length===1&&o?(a=s(this,ee).map)==null||a.flyTo({center:[o[0],o[1]],duration:(e==null?void 0:e.duration)||s(this,ee).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?s(this,ee).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,ee).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||s(this,ee).map.getMaxZoom()}):(jG&&HG(s(this,ee),n),(u=s(this,ee).map)==null||u.fitBounds(n,{duration:(p=e==null?void 0:e.duration)!=null?p:Br.DEFAULT_ANIMATION_DURATION,bearing:(e==null?void 0:e.bearing)===void 0?s(this,ee).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,ee).map.getPitch():e==null?void 0:e.pitch,maxZoom:(c=e==null?void 0:e.maxZoomLevel)!=null?c:s(this,ee).map.getMaxZoom()})),s(this,ce).interactionSystem.handleHover(),Promise.resolve()):new Promise(h=>{s(this,ce).cameraSystem.focusOn(i,G(this,rd,s2).call(this,e||{},h))})}};ee=new WeakMap,ce=new WeakMap,Vo=new WeakMap,td=new WeakMap,rd=new WeakSet,s2=l(function(t,e){var i;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:s(this,ce).cameraSystem.convertZoomLevelToAltitude(Si(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:s(this,ce).cameraSystem.convertZoomLevelToAltitude(Si(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},dp,t==null?void 0:t.padding):this.insetsPadding,curve:Rn[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ye.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ye.degToRad(Si(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:l(()=>{s(this,ce).interactionSystem.handleHover(),e()},"callback"),cancelledCallback:e,interruptible:(i=t==null?void 0:t.interruptible)!=null?i:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),l(l2,"Camera");var pg=l2;function a2(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}l(a2,"updateBounds");function r6(r,t,e){var p;let i=[],n=[1/0,1/0,-1/0,-1/0],o=null;if(!r||!Array.isArray(r)||r.length===0)return{pointCloud:i,geoBounds:n,firstPosition:o};let a=t.getSystems().renderSystem;(a.threeDdirty||a.twoDdirty)&&t.renderSync();for(let c of r)if(typeof c=="string"){let u=e.get(c);if(!u){L.error("Entity not found with id:",c);continue}let h=new xt;Qx(t,"userData"in u&&(p=u.userData.entityId)!=null?p:u.id,i,h,u instanceof Me?u.position.z:void 0);let m=t.convert3DMapPositionToCoordinate(h.min),y=t.convert3DMapPositionToCoordinate(h.max);a2(n,m),a2(n,y),o||(o=t.convert3DMapPositionToCoordinate(h.getCenter(new Q)))}else i.push(t.convertTo3DMapPosition(c[1],c[0],c[2]||0)),a2(n,c),o||(o=c);return{pointCloud:i,geoBounds:n,firstPosition:o}}l(r6,"processTargets");function HG(r,t){var i,n,o,a;let e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(i=r.map)!=null&&i.getLayer("bounds-outline")&&r.map.removeLayer("bounds-outline"),(n=r.map)!=null&&n.getSource("bounds-source")&&r.map.removeSource("bounds-source"),(o=r.map)==null||o.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}}),(a=r.map)==null||a.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}l(HG,"drawBounds");g();var i6="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 n6="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}";g();var o6=4.291666666666667,a6=15,s6=25,l6=43/60;g();var c6=["horizontal","icon"],XG=new Map([[c6[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>'],[c6[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>']]),ZG=/<svg([^>]*)>/g;function p6(r,t,e,i){let n=XG.get(r);return n?n.replace(ZG,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}l(p6,"getLogoIcon");var u6=!1,Fe,Nn,yc,Rt,Yt,ms,oi,Xi,c2=class c2 extends ae{constructor(e,i,n){super();T(this,Fe,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:l(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});T(this,Nn);T(this,yc);T(this,Rt);T(this,Yt);T(this,ms);T(this,oi,0);T(this,Xi,0);d(this,"dirty",!0);d(this,"getPositionAlignedCanvasCoordinates",l((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}})[s(this,Fe).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",l(()=>{var n,o,a,p;let e=s(this,Fe).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}}[s(this,Fe).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"));n&&Object.entries(n).forEach(([o,a])=>{a!==void 0&&(s(this,Fe)[o]=a)}),P(this,yc,e),P(this,Nn,i)}get color(){return s(this,Fe).color==="light"?"white":"#293136"}get iconName(){return s(this,Fe).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,Fe).iconOnly?a6:75}get defaultWidth(){return s(this,Fe).iconOnly?s6:150}get aspectRatio(){return s(this,Fe).iconOnly?l6:o6}get options(){return{...s(this,Fe)}}set options(e){var i;P(this,Fe,{padding:e.padding||s(this,Fe).padding,position:e.position||s(this,Fe).position,iconOnly:e.iconOnly||s(this,Fe).iconOnly,color:e.color||s(this,Fe).color,scale:e.scale||s(this,Fe).scale,onClick:s(this,Fe).onClick,interactive:(i=e.interactive)!=null?i:s(this,Fe).interactive,visible:e.visible||s(this,Fe).visible})}get icon(){return p6(this.iconName,this.color,s(this,oi)*s(this,Nn).pixelRatio,s(this,Xi)*s(this,Nn).pixelRatio)}setSize(e,i){s(this,Yt)&&(s(this,Yt).uniforms.uSize.value.x=e,s(this,Yt).uniforms.uSize.value.y=i)}setXY(e,i){s(this,Yt)&&(s(this,Yt).uniforms.uSize.value.w=e,s(this,Yt).uniforms.uSize.value.z=i)}get width(){return s(this,oi)}get height(){return s(this,Xi)}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)}}[s(this,Fe).position]}insertIntoQuadTree(e){s(this,ms)!=null&&typeof s(this,Fe).onClick=="function"&&s(this,Fe).interactive&&e.insert(s(this,ms))}resize(e,i){if(s(this,Fe).visible!==!0)return;let n=this.getPositionAlignedCanvasCoordinates(e,i),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,oi),s(this,Xi)),p=Math.min(e-s(this,oi),Math.max(0,n.x+o.x+a.x)),c=Math.min(i-s(this,Xi),Math.max(0,n.y+o.y+a.y));this.setSize(s(this,oi)/e,s(this,Xi)/i),this.setXY(p/e,c/i),P(this,ms,new ft(p,c,s(this,oi),s(this,Xi),{entityId:"watermark"}))}update(){this.dirty&&s(this,Fe).visible===!0&&(P(this,oi,Math.min(s(this,Nn).canvasWidth,Math.max(this.minWidth,this.defaultWidth*s(this,Fe).scale))),P(this,Xi,s(this,oi)/this.aspectRatio),No.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(P(this,Yt,new ca({uniforms:{uTexture:{value:e},uSize:{value:new Sx(0,0,0,0)},uOpacity:{value:.7}},vertexShader:i6,fragmentShader:n6,depthWrite:!1,depthTest:!1,defines:{debug:u6},wireframe:u6,transparent:!0,visible:!0})),s(this,Rt))s(this,Rt).material=s(this,Yt),s(this,Rt).material.needsUpdate=!0;else{let i=new Hr(2,2,1,1);P(this,Rt,new de(i,s(this,Yt))),s(this,Rt).position.set(0,0,-1),s(this,Rt).frustumCulled=!1,s(this,Rt).renderOrder=999;let n=new Ur(1,1,1),o=new de(n,new ct({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.frustumCulled=!1,o.layers.set(1),s(this,Rt).add(o),s(this,yc).add(s(this,Rt))}this.resize(s(this,Nn).canvasWidth,s(this,Nn).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){s(this,Rt)&&(s(this,yc).remove(s(this,Rt)),ze(s(this,Rt))),P(this,Rt,void 0),s(this,Yt)&&s(this,Yt).dispose(),P(this,Yt,void 0),P(this,ms,void 0)}};Fe=new WeakMap,Nn=new WeakMap,yc=new WeakMap,Rt=new WeakMap,Yt=new WeakMap,ms=new WeakMap,oi=new WeakMap,Xi=new WeakMap,l(c2,"WatermarkSystem");var ug=c2;g();var dg=100,$G=!1,p2=class p2 extends ae{constructor(e,i){super();d(this,"currentTotalBoundingBox");d(this,"state");d(this,"cameraSystem");d(this,"debugMesh",null);d(this,"dirty",!0);d(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new xt,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new Q(0,0,0),new Q(dg*2,dg*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(dg)));let e=new xt().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(e);let i=e.getSize(new Q),n=Math.max(i.x,i.y,i.z);for(let a of this.state.geometry2DMap.values())a.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(a.position),a.positionDirty=!1);let o=hg.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(n,dg)).getBoundingSphere(JG).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new Q),min:hg.min,max:hg.max,radius:o},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,$G&&this.state.entityScene.parent instanceof oo){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new ln,this.debugMesh.add(new de(new Eh(this.cameraSystem.panBounds.radius),new ct({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let a=new Q;hg.getSize(a);let p=new Ur(a.x,a.y,a.z),c=new ct({color:65280,wireframe:!0,transparent:!0,opacity:.5}),u=new de(p,c);u.position.copy(this.currentTotalBoundingBox.getCenter(new Q)),this.debugMesh.add(u)}}}};l(p2,"PanBoundsSystem");var fg=p2,hg=new xt,JG=new Mx;g();var d6="\xA9 Mappedin",KG="https://info.mappedin.com/feedback",d2=["top-left","top-right","bottom-left","bottom-right"],QG=640,eV=l(()=>"<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"),u2={custom:[],position:"bottom-right",feedback:!0},h2=class h2{constructor(t){d(this,"controlContainerEl");d(this,"controlPositions");d(this,"compact");d(this,"attribContainerEl");d(this,"attribInnerEl");d(this,"attribButtonEl");d(this,"feedbackLinkEl");d(this,"attribHTML",d6);d(this,"customAttributions",[]);d(this,"toggleAttribution",l(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=d2.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=u2){var n;let e=t.position&&d2.includes(t.position)?t.position:u2.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=eV(),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),((n=t.feedback)!=null?n:u2.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=KG,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let e=[d6],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<=QG||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}};l(h2,"HTMLControlsSystem");var mg=h2;g();var id,f2=class f2{constructor(t,e){d(this,"mesh");d(this,"type","custom-geometry");d(this,"dirty",!0);d(this,"feature");d(this,"builder");d(this,"outline");d(this,"color",new Le);T(this,id,0);this.mesh=new zr,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){L.warn("TODO: implement custom geometry opacity")}get opacity(){return L.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return s(this,id)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,id,t))}get renderOrder(){return L.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){L.warn("TODO: implement custom geometry render order")}};id=new WeakMap,l(f2,"CustomGeometryComponent");var bc=f2;g();var m2=class m2{constructor(t,e){d(this,"state");d(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let 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.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),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))}}};l(m2,"CustomGeometrySystem");var gg=m2;g();g();function h6(r){return r.children.some(t=>t.userData.isOutline)}l(h6,"hasOutline");var iV=80,gs,vc,bg,vg,g2=class g2{constructor(t){d(this,"rendererState");d(this,"outlineOpacitiesDirty",!0);T(this,gs,!0);T(this,vc,-1/0);T(this,bg,new Map);T(this,vg,new ty({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:Mh}));this.rendererState=t}get geometries3DDirty(){return s(this,gs)}set geometries3DDirty(t){P(this,gs,t)}update(t,e=!0){let i;if(this.geometries3DDirty){for(let o of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(o),i instanceof Lt&&i.components[0].outline&&i.visible&&!h6(i)&&i.userData.entities3D.size>0)for(let a of i.userData.entities3D.values()){let p=this.rendererState.geometry3DMap.get(a),c=[];if(p instanceof Ee&&p.type==="geometry"&&p.components[3]&&p.components[3].dirty===!0&&p.components[0].geometry!=null&&p.components[0].material!=null){let C=p.components[0].geometry;if(!C)return null;c.push([p.components[3],new ry(C,iV)])}let u=Ir(c.map(C=>C[1]),!1);if(u==null)continue;let h=u.getAttribute("position"),m=new Float32Array(h.count*4),y=new cn(m,4);u.setAttribute("color",y);let b=0;for(let C=0;C<c.length;C++){let[v,S]=c[C],I=S.getAttribute("position").count;v.edgeColors=y,v.geometry=u,v.ranges={count:I,start:b},b+=I,S.dispose()}let x=new Ws(u,s(this,vg));x.userData.isOutline=!0,i.add(x)}P(this,gs,!1),this.outlineOpacitiesDirty=!0}for(let o of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(o);if(a instanceof Ee&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].geometry!=null&&a.components[0].material!=null&&a.parentObject3D instanceof Lt){let p=a.components[3].geometry;if(!p)continue;let c=a.components[3];if(!c)continue;let u=c.edgeColors;if(!u)continue;let h=new Le(c.color);for(let C=0;C<c.ranges.count;C++){let v=c.ranges.start+C;u.setXYZ(v,h.r,h.g,h.b)}let m=a.components[1].height,b=p.getAttribute("position").array,x=-1/0;for(let C=0;C<c.ranges.count;C++){let S=(c.ranges.start+C)*3,I=b[S+2];x=Math.max(x,I)}for(let C=0;C<c.ranges.count;C++){let S=(c.ranges.start+C)*3,I=b[S+2];Math.abs(I-x)<1e-4&&(b[S+2]=Math.max(m,2e-4))}p.attributes.color.needsUpdate=!0,p.attributes.position.needsUpdate=!0,c.dirty=!1}}let n=e?Pi(t,16,19,0,1):s(this,vc);if((n!==s(this,vc)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let o of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(o),(i==null?void 0:i.type)==="geometry"&&i.components[0]instanceof Ze){let a=i.components[3];if(a&&a.edgeColors&&a.geometry){let p=a.visible,c=Math.min(n,p?i.components[1].opacity*fa(i):0);if(a.currentOpacity!==c){for(let u=0;u<a.ranges.count;u++){let h=a.ranges.start+u;a.edgeColors.setW(h,c)}a.geometry.attributes.color.needsUpdate=!0}}}}P(this,vc,n),P(this,gs,!1),this.outlineOpacitiesDirty=!1}destroy(){s(this,bg).clear()}};gs=new WeakMap,vc=new WeakMap,bg=new WeakMap,vg=new WeakMap,l(g2,"OutlineInterpolationSystem");var yg=g2;g();g();var y2=class y2 extends de{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};l(y2,"EntityMesh");var xg=y2,nV=O.object({flipImageToFaceCamera:O.boolean().optional(),url:O.string()}),oV=O.object({type:O.enum(["Feature"]),properties:O.object({width:O.number(),height:O.number(),rotation:O.number().min(0).max(360).optional(),verticalOffset:O.number().optional()}),geometry:hc});function f6(r,t,e){O.union([O.number(),O.string()]).parse(r),oV.parse(t),nV.parse(e)}l(f6,"validateImage");var b2=class b2{constructor(t){d(this,"mesh",new zr);d(this,"imageMesh");d(this,"outline");d(this,"type","image");d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"position",new Q);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};l(b2,"ImageComponent");var Cg=b2;g();function v2(r,t){return{x:r.x*Math.cos(t)-r.y*Math.sin(t),y:r.x*Math.sin(t)+r.y*Math.cos(t)}}l(v2,"rotatePoint");function aV(r,t){return r.map(e=>v2(e,t))}l(aV,"rotatePoints");function sV(r){let t=1/0,e=1/0,i=-1/0,n=-1/0;for(let o of r)t=Math.min(t,o.x),e=Math.min(e,o.y),i=Math.max(i,o.x),n=Math.max(n,o.y);return{minX:t,minY:e,maxX:i,maxY:n}}l(sV,"getBounds");function lV(r,t){let e=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let o=t[i].x,a=t[i].y,p=t[n].x,c=t[n].y;a>r.y!=c>r.y&&r.x<(p-o)*(r.y-a)/(c-a)+o&&(e=!e)}return e}l(lV,"pointInPolygon");function m6(r,t,e,i,n){for(let o=0;o<n;o++)for(let a=0;a<i;a++)if(r[e+o][t+a]!==1)return!1;return!0}l(m6,"isValidRectangle");function cV(r,t,e){let i=r.maxX-r.minX,n=r.maxY-r.minY,o,a,p={...r};return i/n>t?(a=n/e,o=a*t,p.minX+=(i-o*e)/2):(o=i/e,a=o/t,p.minY+=(n-a*e)/2),{dx:o,dy:a,gridBounds:p}}l(cV,"calculateGridDimensions");function pV(r,t,e,i,n){let o=Array(e).fill(0).map(()=>Array(e).fill(0));for(let a=0;a<e;a++)for(let p=0;p<e;p++){let c={x:t.minX+p*i,y:t.minY+a*n};lV(c,r)&&(o[a][p]=1)}return o}l(pV,"createAndFillGrid");function uV(r,t){let e=Array(t).fill(0).map(()=>Array(t).fill(0));for(let i=0;i<t;i++)for(let n=0;n<t;n++)if(r[i][n]===1){let o=0;for(let a=1;a<=Math.min(t-n,t-i)&&m6(r,n,i,a,a);a++)o=a;e[i][n]=o}return e}l(uV,"calculateRectSizes");function dV(r,t,e,i,n,o){let a=0,p=0,c=0;for(let u=0;u<i;u++)for(let h=0;h<i;h++)if(r[u][h]===1){let m=Math.pow(t[u][h],2),y=e.minX+h*n,b=e.minY+u*o;a+=m,p+=y*m,c+=b*m}return{x:p/a,y:c/a}}l(dV,"calculatePolygonCenter");function hV(r,t,e,i,n,o,a){let p=-1/0,c=null,u=r.length,h=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let m=0;m<u;m++)for(let y=0;y<u;y++)if(r[m][y]===1)for(let b=1;b<=u-y;b++){let x=b;if(!(x>u-m)&&m6(r,y,m,b,x)){let C=b*x,v=t.minX+(y+b/2)*e,S=t.minY+(m+x/2)*i,I={x:v,y:S},E=Math.sqrt(Math.pow(I.x-n.x,2)+Math.pow(I.y-n.y,2))/h,D=C*(1-o)-E*o*C;D>p&&(p=D,c={center:I,width:b*e*a,height:b*i*a})}}return c}l(hV,"findBestRectangle");function x2(r,t,e,i={}){let{scaleFactor:n=.9,centerPriority:o=.5,resolution:a=100,minimumSizeRatio:p=.5}=i,c=Rx(e),u=r.width/r.height,h=aV(t,c),m=sV(h),{dx:y,dy:b,gridBounds:x}=cV(m,u,a),C=pV(h,x,a,y,b),v=uV(C,a),S=dV(C,v,x,a,y,b),I=hV(C,x,y,b,S,o,n);return!I||I.width<r.width*p||I.height<r.height*p?r:{...I,center:v2(I.center,-c),rotation:e,polygonCenter:v2(S,-c)}}l(x2,"findLargestInteriorRectangle");var nd=Math.PI*2,fV=Math.PI/2,mV=Math.PI*1.5,gV=Xs(fV,2),yV=Xs(mV,2),bV=.01,g6=!1,C2=class C2 extends ae{constructor(e,i,n=0,o=0,a={}){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"initialBearing",0);d(this,"naturalBearing",0);d(this,"imagePlacementOptions");d(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i,this.initialBearing=n,this.naturalBearing=o,this.imagePlacementOptions=a}createImageMesh(e,i,n,o=0,a,p){var x,C,v;let c={width:n.width,height:n.height,center:this.convertTo3DMapPosition(a),rotation:(x=n.rotation)!=null?x:0},u=(C=this.imagePlacementOptions.mode)!=null?C:"default",h=(()=>{switch(u){case"fit-nearest-90":let S=(this.initialBearing-this.naturalBearing+360)%180;return S>=45&&S<=135?x2(c,p,c.rotation+90,this.imagePlacementOptions):c;case"fit-initial-bearing":return x2(c,p,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return c}})();if(g6&&h.polygonCenter){let S=new de(new Eh(1),new Wr({color:65280}));S.position.set(h.polygonCenter.x,h.polygonCenter.y,o),this.rendererState.entityScene.add(S)}let m=new Wr({transparent:!0,depthWrite:!1,side:on}),y=new Hr(h.width,h.height),b=new xg(y);if(b.visible=!1,(v=this.getOrDownloadImage(i))==null||v.then(S=>{m.map=S,m.needsUpdate=!0,m.map.colorSpace=an,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=e,b.material=m,g6){let S=new de(new Hr(n.width,n.height),new Wr({color:"gray"}));b.add(S);let I=new Fx;b.add(I),I.scale.set(10,10,10)}return b.position.set(h.center.x,h.center.y,o+bV),b.rotation.z=(-ye.degToRad(h.rotation)+nd)%nd,b}getOrDownloadImage(e){var i;if(this.imageLoadingCache.has(e))return(i=this.imageLoadingCache.get(e))==null?void 0:i.promise;{let n=new Promise(o=>{No.getLoader().load(e,a=>{let p=this.imageLoadingCache.get(e);p&&!p.loaded&&(p.loaded=!0),o(a)})});return this.imageLoadingCache.set(e,{loaded:!1,promise:n}),n}}flipIfNeeded(e,i){if(e.imageMesh==null)return;let n=-i,o=e.imageMesh.rotation.z,a=Xs((o-n+nd)%nd,2);a>gV&&a<yV&&(e.imageMesh.rotation.z=(o+Math.PI)%nd)}update(e){var a,p,c,u,h;let i,n,o;for(let m of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(m),(i==null?void 0:i.type)==="image"){if(n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null){let y=this.convertTo3DMapPosition(n.feature.geometry.coordinates),b={x:y.x,y:y.y};n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates,[b]),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.visible&&n.mesh!=null&&n.mesh.parent!=null&&((p=n.feature.properties)==null?void 0:p.image.position)!=null&&n.feature.geometry.coordinates!=null&&n.feature.geometry.coordinates.length>0){let y=n.feature.geometry.coordinates[0].map(x=>{let C=this.convertTo3DMapPosition(x);return{x:C.x,y:C.y}}),b=this.createImageMesh(m,(c=n.feature.properties)==null?void 0:c.image.path,(u=n.feature.properties)==null?void 0:u.image,o.height,(h=n.feature.properties)==null?void 0:h.image.position,y);n.mesh.parent.add(b),n.imageMesh=b}if(n.imageMesh){if(!n.visible)n.imageMesh.visible=!1;else if(o.showImage&&!n.imageMesh.visible)if(o.url){let y=this.imageLoadingCache.get(o.url);y&&y.loaded&&(n.imageMesh.visible=!0)}else n.imageMesh.visible=!0;else!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1);o.flipImageToFaceCamera&&this.flipIfNeeded(n,e)}}}};l(C2,"ImageSystem");var Sg=C2;g();var vV=250,jo,S2=class S2 extends ae{constructor(e,i){super();d(this,"cameraDirty",!0);d(this,"focusablesDirty",!0);d(this,"state");d(this,"camera");d(this,"debugEl",null);d(this,"raycasters",[]);d(this,"collisions",new Map);d(this,"focusableEntities",new Set);d(this,"debugRaycasters",!1);T(this,jo);d(this,"update",l((e=!1,i=Date.now())=>{e||Date.now()-i>vV||(s(this,jo)&&cancelAnimationFrame(s(this,jo)),P(this,jo,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new ne(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new ne(e.x/1.2,e.y/1.2),n=new ne(e.x+(e.x-i.x),i.y),o=new ne(i.x,e.y+(e.y-i.y)),a=new ne(n.x,o.y),p=new ne(e.x,e.y/1.5),c=new ne(e.x,e.y+(e.y-p.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,p,c,i,n,o,a].map((u,h)=>{if(this.debugRaycasters){let C=document.createElement("div");C.style.position="absolute",C.style.top=u.y+"px",C.style.left=u.x+"px",C.style.width="10px",C.style.height="10px",C.style.backgroundColor="red",this.debugEl.append(C)}let m=u.x/this.state.canvasWidth*2-1,y=-(u.y/this.state.canvasHeight)*2+1,b=new ne(m,y),x=new Ci;return x.setFromCamera(b,this.camera),[x,b,h===0?10:h<7?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){if(i.type==="group-container"&&i.components[2]!==void 0&&i.components[2]instanceof pc){let o=i.components[2];if(o.dirty===!0||o.focusMesh==null){o.focusMesh&&ze(o.focusMesh);let a=new xt;a.setFromObject(i);let p=new Ur(a.max.x-a.min.x,a.max.y-a.min.y,a.max.z-a.min.z),c=new ct({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),u=new de(p,c);u.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,(a.min.z+a.max.z)/2),u.userData={entityId:i.userData.entityId},o.focusMesh=u,i.add(u),i.components[2].dirty=!1}this.focusableEntities.add(o.focusMesh)}else if(i.components[0]&&i.components[0]instanceof Ze&&i.components[0].focusable&&i.components[0].geometry!=null&&(e=i.components[0],e instanceof Ze&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let o=new de(e.geometry);o.userData={entityId:i.id},e.focusMesh=o}this.focusableEntities.add(e.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[i,n]of this.raycasters)i.setFromCamera(n,this.camera);for(let[i,n,o]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(p=>{var c;if((p==null?void 0:p.object)!=null&&"isMesh"in p.object&&(p!=null&&p.object.isMesh)){let u=p.object.userData.entityId,h=(c=this.collisions.get(u))!=null?c:0;this.collisions.set(u,h+o)}});let e=Array.from(this.collisions,([i,n])=>({entityId:i,weight:n})).sort((i,n)=>n.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){s(this,jo)&&cancelAnimationFrame(s(this,jo)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};jo=new WeakMap,l(S2,"GeometryInFocusSystem");var Tg=S2;g();g();g();g();function od(r,t){t===void 0&&(t={});var e=wl(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return xV(e,t);case"MultiPolygon":return CV(e,t);default:throw new Error("invalid poly")}}l(od,"default");function xV(r,t){t===void 0&&(t={});var e=wl(r),i=e.coordinates,n=t.properties?t.properties:r.type==="Feature"?r.properties:{};return y6(i,n)}l(xV,"polygonToLine");function CV(r,t){t===void 0&&(t={});var e=wl(r),i=e.coordinates,n=t.properties?t.properties:r.type==="Feature"?r.properties:{},o=[];return i.forEach(function(a){o.push(y6(a,n))}),da(o)}l(CV,"multiPolygonToLine");function y6(r,t){return r.length>1?jx(r,t):pn(r[0],t)}l(y6,"coordsToLine");function SV(r,t){var e=!0;return Mi(r,function(i){Mi(t,function(n){if(e===!1)return!1;e=TV(i.geometry,n.geometry)})}),e}l(SV,"booleanDisjoint");function TV(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!wV(r.coordinates,t.coordinates);case"LineString":return!b6(t,r);case"Polygon":return!Sn(r,t)}break;case"LineString":switch(t.type){case"Point":return!b6(r,t);case"LineString":return!MV(r,t);case"Polygon":return!v6(t,r)}break;case"Polygon":switch(t.type){case"Point":return!Sn(t,r);case"LineString":return!v6(r,t);case"Polygon":return!IV(t,r)}}return!1}l(TV,"disjoint");function b6(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(PV(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}l(b6,"isPointOnLine");function MV(r,t){var e=jl(r,t);return e.features.length>0}l(MV,"isLineOnLine");function v6(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var n=i[e];if(Sn(n,r))return!0}var o=jl(t,od(r));return o.features.length>0}l(v6,"isLineInPoly");function IV(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var n=i[e];if(Sn(n,t))return!0}for(var o=0,a=t.coordinates[0];o<a.length;o++){var p=a[o];if(Sn(p,r))return!0}var c=jl(od(r),od(t));return c.features.length>0}l(IV,"isPolyInPoly");function PV(r,t,e){var i=e[0]-r[0],n=e[1]-r[1],o=t[0]-r[0],a=t[1]-r[1],p=i*a-n*o;return p!==0?!1:Math.abs(o)>=Math.abs(a)?o>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:a>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}l(PV,"isPointOnLineSegment");function wV(r,t){return r[0]===t[0]&&r[1]===t[1]}l(wV,"compareCoords");var x6=SV;function T2(r,t){var e=!1;return Mi(r,function(i){Mi(t,function(n){if(e===!0)return!0;e=!x6(i.geometry,n.geometry)})}),e}l(T2,"booleanIntersects");var C6=20,Uo,ys,bs,Ig,ad,M2=class M2{constructor(t){d(this,"dirty",!0);d(this,"map");d(this,"stylesheetId","");d(this,"userHiddenLayers",new Set);d(this,"hiddenLayersInStyle",new Set);d(this,"centerPoint");d(this,"bbox");d(this,"polygons");d(this,"handleRender",l(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(s(this,Uo)&&(s(this,Ig).call(this),P(this,Uo,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),e=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(e.length>0){for(let i of e)this.expr.push(["!=",["id"],i.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(i=>{this.map.setFilter(i,["all",...this.expr])}),this.expr=[],P(this,Uo,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){P(this,Uo,!0);for(let e=0;e<t.length;e+=C6){let i=t.slice(e,e+C6);s(this,ys).push(()=>{for(let n of i)if(n.geometry!=null&&"coordinates"in n.geometry){if(this.polygons==null)return;let o;if(n.geometry.type==="Polygon"?o=kh(n.geometry.coordinates):n.geometry.type==="MultiPolygon"&&(o=Ux(n.geometry.coordinates)),!o)continue;for(let a of this.polygons)if(T2(a,o)){this.expr.push(["!=",["id"],n.id]);continue}}})}s(this,ad).call(this)}}}},"handleRender"));d(this,"expr",[]);T(this,Uo,!1);T(this,ys,[]);T(this,bs,null);T(this,Ig,l(()=>{s(this,bs)&&(globalThis.cancelAnimationFrame(s(this,bs)),P(this,bs,null)),P(this,ys,[])},"#cancelJobs"));T(this,ad,l(()=>{let t=s(this,ys).pop();typeof t=="function"&&(t(),s(this,ys).length>0&&P(this,bs,globalThis.requestAnimationFrame(s(this,ad)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(e=>{this.map.setFilter(e,["all",...this.expr])}),this.dirty=!1),this.expr=[],P(this,Uo,!1)},"#runJobs"));d(this,"handleStyleChange",l(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()}hideLayersIntersectingPolygons(t,e,i){this.bbox=t,this.polygons=e.reduce((n,o)=>{if(o.geometry.type==="Polygon"){let a=kh(o.geometry.coordinates);n.push(a)}else o.geometry.type==="MultiPolygon"&&n.push(...o.geometry.coordinates.map(a=>kh(a)));return n},[]);for(let n of i)this.userHiddenLayers.add(n);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))}};Uo=new WeakMap,ys=new WeakMap,bs=new WeakMap,Ig=new WeakMap,ad=new WeakMap,l(M2,"OutdoorLayers");var Mg=M2;g();g();g();var I2="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 P2='#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 S6="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 _V=new zs;function T6(r,t,e){let{nearRadius:i,farRadius:n,accentColor:o,completeFraction:a,isVertical:p}=t,{color:c}=e,u=!0,h=0,m=1/0,y=t.displayArrowsOnPath,b=!p,x=!0,C=y,v=i/2+LV,S=0;r[0].z+=v;for(let ge=1;ge<r.length;++ge){r[ge].z+=v;let ve=r[ge].x-r[ge-1].x,$e=r[ge].z-r[ge-1].z;if(p)S+=Math.sqrt(ve*ve+$e*$e);else{let vt=r[ge].y-r[ge-1].y;S+=Math.sqrt(ve*ve+vt*vt+$e*$e)}}if(!p){let ge=r[0],ve=r[r.length-1];r.push(ve.clone().setZ(ve.z-.01)),r.unshift(ge.clone().setZ(ge.z-.01))}let I=new Cx;C&&(I=_V.load(S6),I.colorSpace=an);let w=new Le(c),E=new Le(o),D={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new ne(1,1)},cameraParameters:{type:"v2",value:new ne(h,0)},complete:{type:"f",value:u?0:1},color:{type:"c",value:w},pathLength:{type:"f",value:S},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:n},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:E},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:p},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:I},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:b?.05:1},showPulse:{type:"b",value:x},opacityMultiplier:{type:"f",value:1}},R=new Dx(r);R.curveType="catmullrom",R.tension=0;let _=30,F=8,B=_*r.length,V=new Ox(R,B,i,F,!1),N=new Float32Array(V.attributes.position.count);for(let ge=r.length;ge<N.length;ge++)N[ge]=ge;V.setAttribute("vertexIndex",new cn(N,1));let X=new Float32Array(V.attributes.position.count),z=new cn(X,1);for(let ge=0;ge<=B;ge++)for(let ve=0;ve<=F;++ve)z.setX(ge*(F+1)+ve,ge/B);V.setAttribute("pathDistance",z);let U=new Float32Array(V.attributes.normal.count*3),te=new cn(U,3);for(let ge=0;ge<B;ge++){let ve=V.tangents[ge];for(let $e=0;$e<=F;++$e)te.setXYZ(ge*(F+1)+$e,ve.x,ve.y,ve.z)}V.setAttribute("pathTangent",te);let Z=new Float32Array(V.attributes.normal.count*3),Ce=new cn(Z,3);for(let ge=0;ge<B;ge++){let ve=V.tangents[ge];var me,Pe,_e;p?(me=ve.x*ve.y,Pe=-1+ve.y*ve.y,_e=ve.z*ve.y):(me=-ve.x*ve.z,Pe=-ve.y*ve.z,_e=1-ve.z*ve.z);let $e=Math.sqrt(me*me+Pe*Pe+_e*_e);$e===0&&($e=1);let vt=me/$e,lt=Pe/$e,nn=_e/$e;for(let gi=0;gi<=F;++gi)Ce.setXYZ(ge*(F+1)+gi,vt,lt,nn)}V.setAttribute("pathNormal",Ce);let dr=new ca({uniforms:D,vertexShader:I2,fragmentShader:P2});dr.transparent=!0,dr.alphaTest=.5,D.resolution.value.x=1,D.resolution.value.y=1,D.vertexes.value=N.length,D.arrowTexture.value.wrapS=bi,D.arrowTexture.value.wrapT=bi,D.arrowTexture.value.anisotropy=16,D.complete.value=a;let _t=new de(V,dr),st=_t.clone(),et={...D,opacityMultiplier:{type:"f",value:.25}};et.complete.value=1,st.material=new ca({uniforms:et,vertexShader:I2,fragmentShader:P2}),st.material.transparent=!0,st.material.alphaTest=.5,st.material.depthWrite=!1,st.material.depthTest=!1,st.renderOrder=1,et.resolution.value.x=1,et.resolution.value.y=1,et.vertexes.value=N.length,et.arrowTexture.value.wrapS=bi,et.arrowTexture.value.wrapT=bi,et.arrowTexture.value.anisotropy=16,et.complete.value=a,_t.userData=st.userData=t.mesh.userData;let hr=t.mesh;hr.add(_t),hr.add(st),V.computeBoundingBox();let Vr=new Q;return V.boundingBox.getCenter(Vr),{mesh:hr,material:dr,center:Vr}}l(T6,"buildPath");var LV=.15;var w2=class w2 extends ae{constructor(e,i,n,o){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");d(this,"convertZoomLevelToAltitude");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=n,this.convertZoomLevelToAltitude=o}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=o.components[1],h=c.isVertical&&this.altitudeDirty;if(!(c instanceof Go))continue;if(c.dirty||h){if(c.mesh.parent!=null)for(let y=c.mesh.children.length-1;y>=0;y--)ze(c.mesh.children[0]);let m=[];if(c.feature.features.forEach(y=>{let b=y.geometry.coordinates[2]||0,x;if(y.properties.parentId&&(x=this.getParentContainer(y.properties.parentId,!0),x!=null&&x.altitude!=null&&(b+=x.altitude,c.isVertical=!0)),!y.properties.parentId||x!=null&&x.visible){let C=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],b);m.push(C)}}),m.length>1){let{mesh:y,material:b,center:x}=T6(m,c,{color:u.color});c.mesh=y,c.material=b,c.position=x}c.dirty&&(c.nearZoomLevel!=null&&(c.nearZoomAltitude=this.convertZoomLevelToAltitude(c.nearZoomLevel)),c.farZoomLevel!=null&&(c.farZoomAltitude=this.convertZoomLevelToAltitude(c.farZoomLevel))),c.dirty=!1}u.dirty&&(c.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(u.color),m.material.needsUpdate=!0}),c.mesh.position.z=u.altitude,u.dirty=!1),c.material&&(c.mesh.children.forEach(m=>{var b,x;let y=m.material.uniforms;y.nearZoom.value=(b=c.nearZoomAltitude)!=null?b:e,y.farZoom.value=(x=c.farZoomAltitude)!=null?x:i,y.cameraParameters.value.x=n,c.materialDirty&&(y.nearRadius.value=c.nearRadius,y.displayArrowsOnPath.value=c.displayArrowsOnPath,y.farRadius.value=c.farRadius,y.pulseColor.value.set(c.accentColor),y.complete.value=c.completeFraction),m.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(m=>{m.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,m.material.needsUpdate=!0}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};l(w2,"PathSystem");var sd=w2;g();var yt,xc,Gn,E2=class E2{constructor(t){d(this,"rendererState");d(this,"dirty",!1);T(this,yt);T(this,xc);T(this,Gn);this.rendererState=t}updateOne(t){if(t instanceof Ee&&t.components[0]instanceof Ze&&t.components[1]instanceof Ii&&t.parentObject3D instanceof Lt&&(P(this,yt,t.components[0]),P(this,Gn,t.components[1]),s(this,yt).detached&&s(this,yt).dirty&&s(this,yt).geometry!=null&&s(this,yt).material!=null)){P(this,xc,t.parentObject3D),s(this,yt).visible=!1;let e=new Le(s(this,Gn).color),i=s(this,Gn).opacity*fa(t),n=new cs({color:e,side:on,opacity:i!=null?i:1,transparent:i!==void 0?i<1:!1},1,s(this,yt).material.repeatYFactor),o=new Ah(1,s(this,yt).geometry.attributes.position.count||0,0,n),a=o.addGeometry(s(this,yt).geometry);o.addInstance(a),o.userData={entities:{0:t.id},detached:!0},s(this,yt).instanceIndex=a,s(this,yt).material.setColor(s(this,yt).instanceIndex,e,s(this,Gn).topColor?new Le(s(this,Gn).topColor):e),s(this,yt).mesh=o,s(this,yt).material=n,s(this,xc).add(o),s(this,yt).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){P(this,yt,void 0),P(this,xc,void 0),P(this,Gn,void 0)}};yt=new WeakMap,xc=new WeakMap,Gn=new WeakMap,l(E2,"MeshDetachmentSystem");var Pg=E2;g();g();function M6(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}}l(M6,"updateHeight");var vs,Ho,D2=class D2{constructor(t){d(this,"rendererState");d(this,"dirty",!1);T(this,vs);T(this,Ho);this.rendererState=t}updateOne(t){var e;t instanceof Ee&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(P(this,vs,t.components[0]),P(this,Ho,t.components[1]),t.type==="geometry"&&s(this,Ho).height!==s(this,vs).currentHeight&&M6(s(this,vs),s(this,Ho).height,s(this,Ho).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){P(this,vs,void 0),P(this,Ho,void 0)}};vs=new WeakMap,Ho=new WeakMap,l(D2,"MeshModificationSystem");var wg=D2;g();var kV={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},O2=class O2{constructor(t){d(this,"state",kV);d(this,"core");this.core=t}update(t){let e={};for(let[i,n]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=n,e[i]=n);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};l(O2,"Debug");var Eg=O2;g();var ld=9,AV=!1,I6=.1;function FV(r,t,e){for(let i=0;i<t;i++){let n=(e&16711680)>>16,o=(e&65280)>>8,a=e&255;r[i*3]=n/255,r[i*3+1]=o/255,r[i*3+2]=a/255}}l(FV,"fillArrayWithColor");var _2=class _2{constructor(t,e,i){d(this,"state");d(this,"renderer");d(this,"renderService");d(this,"pickingTexture");d(this,"pickingMaterial");d(this,"pixelBuffer");d(this,"width",0);d(this,"height",0);d(this,"scale",1/2);d(this,"color",1);d(this,"convertTo3DMapPosition");d(this,"destroyed",!1);d(this,"enabled",!1);d(this,"backgroundId",16777215);d(this,"resize",l(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new Tx(this.width,this.height,{format:Ih,type:yx,internalFormat:"RGBA"})},"resize"));d(this,"shouldShowByXY",l((t,e,i)=>{if(this.pixelBuffer==null)return!1;let n=t+(this.height-e-1)*this.width,o=this.pixelBuffer[n*4],a=this.pixelBuffer[n*4+1],p=this.pixelBuffer[n*4+2],c=o<<16|a<<8|p;return c===i||c===this.backgroundId},"shouldShowByXY"));d(this,"activeOccluders",new Set);d(this,"update",l(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,e;for(let n of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(n);if(o&&o instanceof Me&&o.userData.occluderFeature!=null&&o.userData.occluderId!=null&&(this.activeOccluders.add(o.userData.occluderId),o.userData.occluderDirty)){if(t=o.userData.occluderFeature,t.geometry.type==="Polygon"){let a=Um(t,this.convertTo3DMapPosition,{color:"white",height:I6});e=this.createOccluderMesh(a,o.userData.occluderId),o.add(e)}else if(t.geometry.type==="MultiPolygon"){let a=Hm(t,this.convertTo3DMapPosition,{color:"white",height:I6});e=this.createOccluderMesh(a,o.userData.occluderId),o==null||o.add(e)}o.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let i=new Le(this.backgroundId);this.renderer.setClearColor(i),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(ld),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(ld),AV?this.renderService.enabledLayers.add(ld):this.renderService.enabledLayers.delete(ld),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let n of this.state.geometry2DIdsInScene){let o=this.state.geometry2DMap.get(n);if(o&&(o==null?void 0:o.occluderId)!=null&&this.activeOccluders.has(o==null?void 0:o.occluderId)){let a=o.components[0].projection,p=Math.floor(a.x*this.scale),c=Math.floor(a.y*this.scale),u=this.shouldShowByXY(p,c,o.occluderId);o.components[0].isOccluded=!u}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=e,(i==null?void 0:i.renderer)==null)throw new Error("No Renderer");this.renderService=i,this.renderer=i.renderer,this.resize(),this.pickingMaterial=new ca({glslVersion:xx,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,e){let i=t.attributes.position,n=new Float32Array(i.count*3);FV(n,i.count,e),t.setAttribute("color",new cn(n,3))}createOccluderMesh(t,e){let i=new de(t,this.pickingMaterial);return i.layers.set(ld),this.applyId(i.geometry,e),i.userData.occluderId=e,i}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};l(_2,"Occlusion2DSystem");var Dg=_2;var P6=new Ci;var{DEFAULT_PITCH:B2,DEFAULT_BEARING:R2,DEFAULT_ZOOM_LEVEL:N2,DEFAULT_MIN_ZOOM_LEVEL:BV,DEFAULT_MAX_ZOOM_LEVEL:RV}=Br,NV=ye.radToDeg(.6435011087932844),Ke,Ye,xs,cd,Cc,Wo,Cs,Sc,Et,k2,A,Ae,ai,qe,Zi,St,k,pd,ot,Be,w6,E6,D6,zo,ud,dd,hd,fd,Og,md,gd,yd,Tc,A2,Ss,bd,qt,$t,F2,Mc,vd,G2=class G2 extends ae{constructor(e,i={}){var y,b,x,C,v,S,I,w,E,D,R;super();T(this,Et);d(this,"options");d(this,"container");d(this,"Debug");T(this,Ke);T(this,Ye);T(this,xs);T(this,cd);T(this,Cc);T(this,Wo);T(this,Cs);T(this,Sc);d(this,"rendererDomElement");T(this,A,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Me("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:dp,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new zv,cameraObject:new ey,naturalBearing:0,containerOffset:[0,0]});d(this,"camera");T(this,Ae);T(this,ai);T(this,qe);T(this,Zi);T(this,St);T(this,k,{});T(this,pd,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");T(this,ot,l(()=>{s(this,k).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));T(this,Be,l(()=>{s(this,k).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));T(this,zo,"standalone");T(this,ud,l(e=>Math.trunc(e*10)/10,"#round10"));T(this,dd,l(()=>{s(this,k).twoDDrawSystem.dirty=!0,G(this,Et,k2).call(this,Ys()),s(this,k).watermarkSystem.dirty=!0,s(this,k).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));T(this,hd,l(()=>{s(this,fd).call(this)},"#handleWindowResizeWithEvent"));T(this,fd,l((e,i)=>{let n=e!=null?e:this.rendererDomElement.clientWidth,o=i!=null?i:this.rendererDomElement.clientHeight;if(n===0||o===0)return;s(this,A).canvasWidth=n,s(this,A).canvasHeight=o,G(this,Et,k2).call(this,Ys()),s(this,Tc).call(this),G(this,Et,D6).call(this),s(this,k).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,k).cameraSystem.dirty=!0,s(this,k).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,k).htmlControlsSystem.resize(this.canvasWidth),s(this,k).geometryInFocusSystem.resize(),s(this,k).occlusion2DSystem.resize();let{top:a,left:p}=this.container.getBoundingClientRect();s(this,A).containerOffset=[a,p],this.publish("resize"),this.render()},"#handleWindowResize"));T(this,Og,l(()=>{this.renderSync()},"#renderFull"));T(this,md,new Q);T(this,gd,l((e,i)=>{let n=this.mode==="standalone"?s(this,Ye):this.viewCamera;if(s(this,Ye).position.z+this.camera.elevation>i.z){s(this,md).copy(i);let o=s(this,md).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,p=(-o.y+1)/2*this.canvasHeight-0/2,c=s(this,ud).call(this,a),u=s(this,ud).call(this,p);e.x=c,e.y=u}else e.x=-1e3,e.y=-1e3},"#project"));T(this,yd,l((e,i)=>{s(this,St).setBufferSize(e,i),s(this,Ye).aspect=e/i,s(this,Ye).updateProjectionMatrix(),s(this,Ye).updateMatrixWorld(!0),s(this,Cc).x=e,s(this,Cc).y=i},"#setBufferSize"));T(this,Tc,l(()=>{var a;let e=s(this,A).canvasWidth=this.rendererDomElement.clientWidth,i=s(this,A).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(e*this.resolutionScale),o=Math.floor(i*this.resolutionScale);s(this,yd).call(this,n,o),(a=this.map)==null||a.resize(),s(this,A).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",l((e,i=!0)=>{if(!e)return i?s(this,A).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let n=s(this,A).geometry3DMap.get(e);return n instanceof Me?n:(L.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?s(this,A).entityScene:void 0)}else if(e.type==="group-container"){let n=s(this,A).geometry3DMap.get(e.id);if(n instanceof Me)return n}return i?s(this,A).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",l(()=>{s(this,k).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",l(()=>{s(this,k).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",l((e,i,n=!1)=>{var y,b;let o=s(this,A).containerOffset[0],a=s(this,A).containerOffset[1],p=(e-a)/s(this,A).canvasWidth*2-1,c=-((i-o)/s(this,A).canvasHeight)*2+1,u=new ne(p,c),h,m;if(n)P6.setFromCamera(u,s(this,Ye)),h=(y=P6.intersectObject(s(this,Wo),!1)[0])==null?void 0:y.point;else{let x=s(this,k).interactionSystem.getThreeDIntersectsFromXY(u);h=(b=x==null?void 0:x[0])==null?void 0:b.point,m=s(this,k).interactionSystem.getGroupContainerIntersectsFromXY(u)}if(h)return{coordinate:this.convert3DMapPositionToCoordinate(h),groupContainers:m}},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",l(e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n=new ne;return s(this,gd).call(this,n,i),{x:n.x,y:n.y}},"projectCoordinateToScreenXY"));d(this,"convert3DMapPositionToCoordinate",l(e=>{var o,a,p,c;let{lat:i,lon:n}=Fh((a=(o=s(this,A).center)==null?void 0:o[1])!=null?a:0,(c=(p=s(this,A).center)==null?void 0:p[0])!=null?c:0,e.x,e.y);return[n,i,e.z]},"convert3DMapPositionToCoordinate"));d(this,"setBackgroundColor",l((e,i)=>{s(this,St).setBackgroundColor(e,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",l(()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i,!0),o=this.projectScreenXYToCoordinate(e,i,!0);return n==null||o==null?void 0:_h(n.coordinate,o.coordinate)/e},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",l((e,i)=>{!this.map||(i==null?void 0:i.length)===0||(s(this,k).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())},"hideOutdoorLayersUnderPoint"));d(this,"hideOutdoorLayersIntersectingPolygons",l((e,i,n)=>{s(this,k).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,n),this.render()},"hideOutdoorLayersIntersectingPolygons"));T(this,Ss,new Ex);T(this,bd,new jr);d(this,"render",l(()=>{var e;if(((e=s(this,k))==null?void 0:e.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return s(this,k).renderSystem.update()},"render"));d(this,"renderSync",l(()=>s(this,k).renderSystem.update(!0),"renderSync"));T(this,qt,qs(()=>{this.publish("user-interaction-start",void 0)},0,!0));T(this,$t,qs(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));d(this,"on",l((e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&M.env.NODE_ENV!=="test"&&(L.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))},"on"));d(this,"off",l((e,i)=>{super.off(e,i)},"off"));d(this,"getCursor",l(()=>s(this,k).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",l(()=>{var e;s(this,k)&&(s(this,k).cameraSystem.off("user-dolly-start",s(this,qt)),s(this,k).cameraSystem.off("user-pan-start",s(this,qt)),s(this,k).cameraSystem.off("user-rotate-start",s(this,qt)),s(this,k).cameraSystem.off("user-zoom-start",s(this,qt)),s(this,k).cameraSystem.off("user-tilt-start",s(this,qt)),s(this,k).cameraSystem.off("user-pedestal-start",s(this,qt)),s(this,k).cameraSystem.off("user-dolly-end",s(this,$t)),s(this,k).cameraSystem.off("user-pan-end",s(this,$t)),s(this,k).cameraSystem.off("user-rotate-end",s(this,$t)),s(this,k).cameraSystem.off("user-zoom-end",s(this,$t)),s(this,k).cameraSystem.off("user-tilt-end",s(this,$t)),s(this,k).cameraSystem.off("user-pedestal-end",s(this,$t)),s(this,k).renderSystem.off("measure-canvas",s(this,Tc)),s(this,k).meshOptimizationSystem.off("geometry-2d-added",this.render),s(this,k).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),s(this,ot).call(this),s(this,Be).call(this),this.renderSync(),s(this,k).renderSystem.destroy(),s(this,k).cameraSystem.off("change",this.render),s(this,k).pathSystem.off("animate:path",this.render),s(this,k).cameraSystem.dispose(),s(this,k).exporterSystem.destroy(),s(this,k).outdoorLayersSystem.destroy(),s(this,k).drawSystem.destroy(),window.removeEventListener("resize",s(this,hd),!1),s(this,pd).removeEventListener("change",s(this,dd)),s(this,Cs)&&s(this,Cs).disconnect(),this._subscribers={},s(this,St).destroy(),(e=s(this,Ke))==null||e.traverse(i=>{ze(i),"dispose"in i&&typeof i.dispose=="function"&&i.dispose()}),P(this,Ke,void 0),s(this,k).htmlControlsSystem.destroy(),s(this,k).collisionSystem.destroy(),s(this,k).interactionSystem.destroy(),s(this,k).domMutationSystem.destroy(),s(this,k).geometryInFocusSystem.destroy(),P(this,k,void 0),s(this,zo)!=="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(s(this,Zi)),this.container.removeChild(s(this,Ae)),P(this,St,void 0))},"destroy"));T(this,Mc,new Q);T(this,vd,new Q);if(s(this,A).naturalBearing=(y=i.naturalBearing)!=null?y:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(P(this,zo,i.mode),this.map=i.map),s(this,A).entityScene.addEventListener("childadded",()=>{s(this,Be).call(this),s(this,ot).call(this)}),s(this,A).entityScene.addEventListener("childremoved",()=>{s(this,Be).call(this),s(this,ot).call(this)}),s(this,A).geometry3DMap.set(s(this,A).entityScene.userData.entityId,s(this,A).entityScene),i.center&&(s(this,A).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,G(this,Et,w6).call(this),G(this,Et,E6).call(this),s(this,k).htmlControlsSystem=new mg(this.container),s(this,zo)!=="outdoors-overlay"&&s(this,k).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),M.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),P(this,St,new Zf({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(b=i.gl)==null?void 0:b.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:l(_=>{var F;(F=i.onWebGLContextRestored)==null||F.call(i,_),s(this,ot).call(this),s(this,Be).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(x=i.backgroundAlpha)!=null?x:1})),P(this,Ke,new oo),s(this,Ke).add(s(this,A).entityScene);let n=window.__THREE_DEVTOOLS__;M.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Ke)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,St)}))),P(this,Ye,new ey(NV,this.aspect,50,1e5)),s(this,A).cameraObject=s(this,Ye),P(this,cd,new Px),s(this,Ye).renderOrder=999;let o=new ln;o.add(s(this,Ye)),P(this,Sc,new ln),s(this,Sc).add(o),s(this,Ke).add(s(this,Sc)),s(this,Ye).updateProjectionMatrix(),s(this,Ye).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:l(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=s(this,St).domElement(),P(this,Cc,new ne);let a=new Hr(1e6,1e6),p=new ct({color:0,visible:!1});P(this,Wo,new de(a,p)),s(this,Wo).name="worldPlane",s(this,Ke).add(s(this,Wo)),(C=i.gl)!=null&&C.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,hd),!1),s(this,pd).addEventListener("change",s(this,dd)),typeof ResizeObserver=="function"&&((v=M.env)==null?void 0:v.NODE_ENV)!=="test"&&(P(this,Cs,new ResizeObserver($x(_=>{s(this,fd).call(this,_[0].contentRect.width,_[0].contentRect.height)},50))),(S=s(this,Cs))==null||S.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(I=globalThis.MappedinDebug)!=null&&I.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1920px":"100%",M.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),s(this,A).canvasWidth=this.rendererDomElement.clientWidth,s(this,A).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,u=this.canvasHeight;s(this,k).watermarkSystem=new ug(s(this,Ye),s(this,A),i==null?void 0:i.watermark),s(this,k).watermarkSystem.on("texture-loaded",this.render),s(this,A).shouldMeasureCanvas=!0,s(this,A).pixelRatio=this.resolutionScale,s(this,yd).call(this,Math.floor(c*this.resolutionScale),Math.floor(u*this.resolutionScale));let h=new Dh(16777215,.3*Math.PI);h.position.set(-150,-150,350),s(this,Ke).add(h);let m=new Lx(16777215,.741*Math.PI);s(this,Ke).add(m),s(this,k).cameraSystem=new gc(s(this,Ye),s(this,Ke),s(this,St).renderer,s(this,A),{mode:this.mode,canvasHeight:u,canvasWidth:c}),s(this,k).cameraSystem.on("user-dolly-start",s(this,qt)),s(this,k).cameraSystem.on("user-pan-start",s(this,qt)),s(this,k).cameraSystem.on("user-rotate-start",s(this,qt)),s(this,k).cameraSystem.on("user-zoom-start",s(this,qt)),s(this,k).cameraSystem.on("user-tilt-start",s(this,qt)),s(this,k).cameraSystem.on("user-pedestal-start",s(this,qt)),s(this,k).cameraSystem.on("user-dolly-end",s(this,$t)),s(this,k).cameraSystem.on("user-pan-end",s(this,$t)),s(this,k).cameraSystem.on("user-rotate-end",s(this,$t)),s(this,k).cameraSystem.on("user-zoom-end",s(this,$t)),s(this,k).cameraSystem.on("user-tilt-end",s(this,$t)),s(this,k).cameraSystem.on("user-pedestal-end",s(this,$t)),s(this,k).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,k).geometryInFocusSystem&&(s(this,k).geometryInFocusSystem.cameraDirty=!0),this.render()}),s(this,k).pathSystem=new sd(s(this,A),this.convertTo3DMapPosition,this.getParentContainer,s(this,k).cameraSystem.convertZoomLevelToAltitude),s(this,k).pathSystem.on("animate:path",this.render),s(this,k).panBoundsSystem=new fg(s(this,A),s(this,k).cameraSystem),s(this,k).panBoundsSystem.on("update",()=>{let{panBounds:_,fov:F,convertAltitudeToZoomLevel:B}=s(this,k).cameraSystem;if(s(this,k).panBoundsSystem.autoMinZoomLevel){if(_.radius<=0)return;let V=Math.min(s(this,A).canvasWidth/s(this,A).canvasHeight,1),N=F*Math.PI/180*V,X=Math.tan(N/2),{radius:z,center:U}=s(this,k).cameraSystem.panBounds,te=z/X,Z=this.getThreeCamera().getWorldPosition(new Q),Ce=U.distanceTo(Z),me=Math.abs(Z.z-U.z),Pe=te*me/Ce,_e=B(Pe);uC(_e,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(_e)}}),this.camera=new pg(this,s(this,k),s(this,A)),this.camera.setZoomLevel((E=i.zoomLevel)!=null?E:N2),this.camera.setBearing((D=i.bearing)!=null?D:R2),this.camera.setPitch((R=i.pitch)!=null?R:B2),this.camera.setMaxZoomLevel(RV),this.camera.setMinZoomLevel(BV),s(this,k).domVisiblitySystem=new Xm(s(this,A),s(this,Zi)),s(this,k).domMutationSystem=new cg(s(this,A),s(this,Zi)),s(this,k).domMutationSystem.on("dimensions-update",()=>{s(this,k).collisionSystem.collidersDirty=!0,this.render()}),s(this,k).domDrawSystem=new sg(s(this,A)),s(this,k).collisionSystem=new Yf(s(this,ai),s(this,A)),s(this,k).twoDDrawSystem=new Ym(s(this,A),s(this,qe),i.transformImageRequest),s(this,k).twoDDrawSystem.on("img:loaded",this.render),s(this,k).interactionSystem=new uu(this.rendererDomElement,s(this,A),s(this,Ye),s(this,Wo),s(this,k).cameraSystem.isUserInteracting),s(this,k).interactionSystem.on("doubletap-with-onefinger",_=>{var F;this.camera.animateTo({center:(F=this.projectScreenXYToCoordinate(_.clientX,_.clientY))==null?void 0:F.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:ly,easing:"ease-out"})}),s(this,k).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:ly,easing:"ease-out"})}),s(this,k).interactionSystem.on("hover",this.render),s(this,k).interactionSystem.on("click",_=>{var F,B,V,N,X,z;if(((F=_.entity2D)==null?void 0:F.id)==="watermark"&&typeof s(this,k).watermarkSystem.options.onClick=="function"&&s(this,k).watermarkSystem.options.interactive){s(this,k).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(_.position),geometry:_.entity3D?[(B=_.entity3D)==null?void 0:B.id]:[],paths:((V=_.entity3D)==null?void 0:V.components[0])instanceof Go?[_.entity3D.id]:[],markers:((N=_.entity2D)==null?void 0:N.components[0])instanceof ji?[_.entity2D.id]:[],models:((X=_.entity3D)==null?void 0:X.components[0])instanceof Bo?[_.entity3D.id]:[],labels:((z=_.entity2D)==null?void 0:z.components[0])instanceof Ui?[_.entity2D.id]:[],containers:Array.isArray(_.groupContainers)?_.groupContainers.map(U=>U.userData.entityId):[],pointerEvent:_.pointerEvent})}),s(this,k).interactionSystem.on("hover",_=>{var F,B,V,N,X,z;_.position&&((F=_.entity2D)==null?void 0:F.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(_.position),geometry:_.entity3D?[(B=_.entity3D)==null?void 0:B.id]:[],paths:((V=_.entity3D)==null?void 0:V.components[0])instanceof Go?[_.entity3D.id]:[],markers:((N=_.entity2D)==null?void 0:N.components[0])instanceof ji?[_.entity2D.id]:[],models:((X=_.entity3D)==null?void 0:X.components[0])instanceof Bo?[_.entity3D.id]:[],labels:((z=_.entity2D)==null?void 0:z.components[0])instanceof Ui?[_.entity2D.id]:[],containers:Array.isArray(_.groupContainers)?_.groupContainers.map(U=>U.userData.entityId):[]})}),s(this,k).geometryInFocusSystem=new Tg(s(this,A),s(this,Ye)),s(this,k).geometryInFocusSystem.on("geometry-in-focus",_=>{this.publish("geometry-in-focus",_)}),s(this,k).twoDVisiblitySystem=new $m(s(this,A)),s(this,k).drawSystem=new qm(s(this,A),this.convertTo3DMapPosition),s(this,k).drawSystem.on("texture-loaded",this.render),s(this,k).stackSystem=new Km(s(this,A)),s(this,k).twoDProjectionSystem=new Zm(s(this,A),s(this,gd)),s(this,k).exporterSystem=new Bu(s(this,A)),s(this,k).meshOptimizationSystem=new zm(s(this,A),this.convertTo3DMapPosition),s(this,k).meshOptimizationSystem.on("model-loaded",this.render),s(this,k).meshOptimizationSystem.on("geometry-2d-added",this.render),s(this,k).meshDetachmentSystem=new Pg(s(this,A)),s(this,k).meshModificationSystem=new wg(s(this,A)),s(this,k).customGeometrySystem=new gg(s(this,A),this.convertTo3DMapPosition),s(this,k).outlineInterpolationSystem=new yg(s(this,A)),s(this,k).renderSystem=new Jm(s(this,St),s(this,A),this.mode,s(this,Ke),s(this,Ye),this.viewCamera,s(this,k)),s(this,k).imageSystem=new Sg(s(this,A),this.convertTo3DMapPosition,i.bearing,i.naturalBearing,i.imagePlacementOptions),s(this,k).text3DSystem=new wm(s(this,A),this.convertTo3DMapPosition),s(this,k).text3DSystem.on("render",this.render),s(this,k).imageSystem.on("image-loaded",this.render),s(this,k).renderSystem.on("pre-render",()=>this.publish("pre-render")),s(this,k).renderSystem.on("post-render",()=>this.publish("post-render")),s(this,k).renderSystem.on("measure-canvas",s(this,Tc)),s(this,k).outdoorLayersSystem=new Mg(this.map),s(this,k).occlusion2DSystem=new Dg(s(this,A),this.convertTo3DMapPosition,s(this,St)),i.occlusionEnabled&&s(this,k).occlusion2DSystem.enable(),this.Debug=new Eg(this),i.environment!==!1&&P(this,xs,G(this,Et,F2).call(this)),s(this,Og).call(this)}get viewCamera(){return s(this,cd)}get canvasWidth(){return s(this,A).canvasWidth}get canvasHeight(){return s(this,A).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:Ys()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,zo)}addGroupContainer(e,i,n){if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let o=new Me(e);o.addEventListener("childadded",()=>{s(this,Be).call(this),s(this,ot).call(this)}),o.addEventListener("childremoved",()=>{s(this,Be).call(this),s(this,ot).call(this)}),(i==null?void 0:i.visible)!==void 0&&(o.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&o.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&wt(o,i.interactive,s(this,A)),(i==null?void 0:i.focusable)!==void 0&&Iv(o,i.focusable),s(this,A).geometry3DMap.set(e,o);let a=this.getParentContainer(n);a instanceof Me&&a.addEntity(o),s(this,Be).call(this),this.render()}else L.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,n){if(s(this,A).geometry3DMap.has(e))L.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let o=new Me(e);o.addEventListener("childadded",()=>{s(this,Be).call(this),s(this,ot).call(this)}),o.addEventListener("childremoved",()=>{s(this,Be).call(this),s(this,ot).call(this)}),o.components[0]=new lg,(i==null?void 0:i.visible)!==void 0&&(o.visible=i.visible),s(this,A).geometry3DMap.set(e,o);let a=this.getParentContainer(n);a instanceof Me&&a.addEntity(o)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,n,o,a){if(s(this,A).geometry3DMap.has(e))L.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let p=new bc(i,n),c=new Ee(p,new Ii(o));(o==null?void 0:o.interactive)!==void 0&&wt(c,o.interactive,s(this,A)),c.id=e,p.mesh.userData={entityId:e,type:"custom-geometry"},s(this,A).geometry3DMap.set(c.id,c);let u=this.getParentContainer(a);u instanceof Me&&u.addEntity(c),s(this,Be).call(this),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,n,o){var a,p;if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let c=new Lt(e,new ay(n));c.addEventListener("childadded",()=>{s(this,Be).call(this),s(this,ot).call(this)}),c.addEventListener("childremoved",()=>{s(this,Be).call(this),s(this,ot).call(this)}),c.userData.dirty=!0,s(this,A).geometry3DMap.set(e,c);for(let h of i.features){if(h.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(h.geometry.type))continue;let m=(h==null?void 0:h.id)||((a=h==null?void 0:h.properties)==null?void 0:a.id)||De(),{visible:y,...b}=n||{color:Zx},x=s(this,k).meshOptimizationSystem.createEntityFromFeature(m,h,{...b,outline:!0});s(this,A).geometry3DMap.set(m,x),c.userData.entities3D.add(m)}c.setVisible((p=n==null?void 0:n.visible)!=null?p:!0),(n==null?void 0:n.altitude)!=null&&c.setAltitude(n.altitude);let u=this.getParentContainer(o);u instanceof Me&&u.addEntity(c),s(this,Be).call(this),this.render()}else L.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return s(this,k).outlineInterpolationSystem.geometries3DDirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,i){let n=this.getParentContainer(i),o=s(this,k).occlusion2DSystem.reserveOccluderId();return n==null||n.addOccluderFeature(e,o),o}addImage(e,i,n,o){try{f6(e,i,n)}catch(a){L.error(a);return}if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let a=new Cg(i),p=new Ee(a,new Ii(n));p.id=e||De(),a.mesh.userData={entityId:p.id,type:"path"},s(this,A).geometry3DMap.set(p.id,p);let c=this.getParentContainer(o);c instanceof Me&&c.addEntity(p),s(this,Be).call(this),this.render()}else L.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,n,{parent:o,onComplete:a}={}){var p,c;try{XP(e,i,n)}catch(u){L.error(u);return}if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let u=new Lt(e,new ay({...n,outline:!1}));u.addEventListener("childadded",()=>{s(this,Be).call(this),s(this,ot).call(this)}),u.addEventListener("childremoved",()=>{s(this,Be).call(this),s(this,ot).call(this)}),s(this,A).geometry3DMap.set(e,u),u.userData.dirty=!0,u.userData.modelURL=n.url;for(let m of i.features){let y=m.id||m.properties.id||De(),b=s(this,k).meshOptimizationSystem.createModelFromFeature(y,m,n);(m.properties.interactive!==void 0||n.interactive!=null)&&wt(b,(p=m.properties.interactive)!=null?p:n.interactive,s(this,A)),s(this,A).geometry3DMap.set(y,b),u.userData.entities3D.add(y)}let h=this.getParentContainer(o);h instanceof Me&&h.addEntity(u),s(this,Be).call(this),(c=this.render())==null||c.then(a)}else L.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,n,o){var p;let a=n==null?void 0:n.id;try{f7(e,i,n||{})}catch(c){L.error(c);return}if(a===void 0||!s(this,A).geometry2DMap.has(a)&&!s(this,A).geometry3DMap.has(a)){let c=G(this,Et,A2).call(this,e,new ji(i,n),n==null?void 0:n.occluderId,n==null?void 0:n.verticalOffset);c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&n.interactive!=="pointer-events-auto"&&wt(c,n==null?void 0:n.interactive,s(this,A));let u=typeof(n==null?void 0:n.attachTo)=="string"||typeof(n==null?void 0:n.attachTo)=="number"?s(this,A).geometry3DMap.get(n.attachTo):void 0;u instanceof Ee&&u.attach(c),(p=this.getParentContainer(o))==null||p.addEntity(c),this.render()}else L.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addText3D(e,i,n,o){if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let a=new Lo({...i,properties:{...i.properties,id:e,content:i.properties.text}}),p=new Ee(a,new fp(n==null?void 0:n.appearance));p.id=e,a.mesh.userData.entityId=e.toString(),a.mesh.userData.type="text3d",s(this,A).geometry3DMap.set(e,p);let c=this.getParentContainer(o);c instanceof Me&&c.addEntity(p),s(this,Be).call(this),this.render()}else L.error("Text3D with ID '".concat(e,"' already exists. The text3d cannot be added."));return{id:e,type:"text3d"}}labelText3D(e,i,n={}){var u,h;try{if(!i||!e)throw new Error("content and meshGeometryId are required");aP.parse(n)}catch(m){L.error(m);return}let o=s(this,A).geometry3DMap.get(e);if((o==null?void 0:o.type)!=="geometry"){L.error(".labelText3D failed: target incorrect");return}let a=o==null?void 0:o.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let m=s(this,A).geometry3DMap.get(a.textEntityId);if((m==null?void 0:m.type)!=="text3d"){L.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let p=new Lo({type:"Feature",geometry:{coordinates:(u=a.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:i,id:De()}});p.polygonEntityId=e;let c=new Ee(p,new fp(n==null?void 0:n.appearance));return a.textEntityId=c.id.toString(),p.mesh.userData.entityId=c.id.toString(),p.mesh.userData.type="text3d",s(this,A).geometry3DMap.set(c.id.toString(),c),n.parentId&&((h=this.getParentContainer(n.parentId))==null||h.addEntity(c)),this.render(),{id:c.id,type:"text3d"}}addLabel2D(e,i,n,o){var p;let a=n==null?void 0:n.id;try{rP(e,i,n||{})}catch(c){L.error(c);return}if(a===void 0||!s(this,A).geometry2DMap.has(a)&&!s(this,A).geometry3DMap.has(a)){let c=G(this,Et,A2).call(this,e,new Ui(i,n||{},s(this,A)),n==null?void 0:n.occluderId,n==null?void 0:n.verticalOffset);c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&wt(c,n==null?void 0:n.interactive,s(this,A));let u=typeof(n==null?void 0:n.attachTo)=="string"||typeof(n==null?void 0:n.attachTo)=="number"?s(this,A).geometry3DMap.get(n.attachTo):void 0;u instanceof Ee&&u.attach(c),(p=this.getParentContainer(o))==null||p.addEntity(c),s(this,ot).call(this),this.render()}else L.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(e,i={},n){var c;try{$P(e,i||{})}catch(u){L.error(u);return}let o=new Go(e,Pv(i)),a=new Ee(o,new Ii({color:(c=i==null?void 0:i.color)!=null?c:"#ff834c"}));a.id=(i==null?void 0:i.id)||De(),o.mesh.userData={entityId:a.id,type:"path"},s(this,A).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&wt(a,i==null?void 0:i.interactive,s(this,A));let p=this.getParentContainer(n);return p instanceof Me&&p.addEntity(a),s(this,Be).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(e){s(this,k).watermarkSystem.options=e,s(this,k).watermarkSystem.dirty=!0,s(this,k).collisionSystem.collidersDirty=!0,this.render()}remove(e){var n;let i;if(typeof e=="string"||typeof e=="number"?(i=s(this,A).geometry2DMap.get(e),i==null&&(i=s(this,A).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=s(this,A).geometry2DMap.get(e.id),i==null&&(i=s(this,A).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")s(this,A).geometry3DMap.delete(i.id),i.object3d&&ze(i.object3d);else if(i.type==="group-container"){s(this,A).geometry3DMap.delete(i.userData.entityId);for(let a of i.childrenIds.values())this.remove(a),i.userData.entities2D.delete(a);let o=i.components[2];o&&o.focusMesh&&ze(o.focusMesh),ze(i)}else if(i.type==="geometry-group"){s(this,A).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);ze(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let o=i.components[0];if(i.entities2D.size>0){for(let a of i.entities2D.values())this.remove(a);i.removeAllEntities()}if(i.object3d&&(((n=i.parentObject3D)==null?void 0:n.type)==="geometry-group"&&i.parentObject3D.userData.entities3D.delete(i.id),ze(i.object3d)),i.type==="geometry"){let a=i.components[3];a&&(a.visible=!1,a.dirty=!0)}"focusMesh"in o&&o.focusMesh!=null&&ze(o.focusMesh),"textMesh"in o&&o.textMesh!=null&&this.remove(o.textMesh.userData.entityId),s(this,A).geometry3DMap.delete(i.id)}else if(i.type==="marker"||i.type==="label"){let o=i.attachedTo;if(o){let a=s(this,A).geometry3DMap.get(o);a instanceof Ee&&a.detach(i)}i.object3d&&ze(i.object3d),i.type==="label"&&delete s(this,k).twoDDrawSystem.textCache[i.id],s(this,A).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&ze(i.object3d),s(this,A).geometry3DMap.delete(i.id);else if(i.type==="text3d"){ze(i.object3d);let{batchedText:o,textMesh:a,polygonEntityId:p}=i.components[0];if(a&&(o&&o.removeText(a),ze(a)),p){s(this,k).text3DSystem.remove(p);let c=s(this,A).geometry3DMap.get(p);(c==null?void 0:c.type)==="geometry"&&(c.components[0].textMesh=void 0,c.components[0].textEntityId=void 0)}s(this,A).geometry3DMap.delete(i.id)}s(this,Be).call(this),s(this,ot).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return s(this,Ke)}getThreeCamera(){return s(this,Ye)}async setEnvironment(e){if(s(this,Ke))if(e==="basic"){s(this,xs)||P(this,xs,G(this,Et,F2).call(this));let i=await s(this,xs);s(this,Ke).environment=i}else s(this,Ke).environment=null}getEnvironment(){var e;return(e=s(this,Ke))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return s(this,k).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(s(this,k).renderSystem.threeDdirty||s(this,k).renderSystem.twoDdirty)&&this.renderSync();let i=new xt;if(e==null)i.setFromObject(s(this,A).entityScene);else{let n=hp(s(this,A),e);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof Ze?o.geometry:void 0;o.mesh instanceof Ph&&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(pa(i))return Kx(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var n,o,a,p,c,u,h,m,y,b;if(e==null)return{type:"map-view",hoverColor:s(this,A).hoverColor,text3dHoverColor:s(this,A).text3dHoverColor};let i=hp(s(this,A),e);if((i==null?void 0:i.type)==="custom-geometry"){let x=i.components[0],C=i.components[1];return{id:i.id,type:"custom-geometry",visible:C.visible,altitude:C.altitude,parent:(n=i.parentObject3D)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(x.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let x=[];for(let v of i.userData.entities3D.values()){let S=this.getState(v);((S==null?void 0:S.type)==="geometry"||(S==null?void 0:S.type)==="model")&&x.push(S)}let C=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:C.opacity,color:C.color,initialColor:C.initialColor,height:C.height,altitude:i.altitude,topColor:C.topColor,outline:C.outline,shading:C.shading,texture:C.texture,topTexture:C.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(v=>s(this,A).geometry3DMap.get(v)).every(v=>v&&v.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(v=>this.getState(v)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,opacity:i.opacity,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(x=>this.getState(x)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let x=i.components[0],C=i.object3d.parent,v=C==null?void 0:C.userData.entityId;return{id:i.id,type:"label",text:x.text||"",parent:{id:v,type:C==null?void 0:C.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:x.enabled,visible:x.visible,initialRank:cu(x.initialRank),options:{rank:cu(x.rank),appearance:x.appearance,interactive:i.components[1]!=null,verticalOffset:i.verticalOffset,attachTo:i.attachedTo}}}else if((i==null?void 0:i.type)==="marker"){let x=i.components[0],C=i.object3d.parent,v=C==null?void 0:C.userData.entityId;return{id:i.id,type:"marker",enabled:x.enabled,visible:x.visible,anchor:x.options.anchor,dynamicResize:x.options.dynamicResize,parent:{id:v,type:C==null?void 0:C.type},position:this.convert3DMapPositionToCoordinate(i.position),element:x.containerEl,initialRank:cu(x.initialRank),options:{rank:cu(x.rank),interactive:i.components[1]!=null||!1,verticalOffset:i.verticalOffset,attachTo:i.attachedTo,lowPriorityPin:x.options.lowPriorityPin}}}else if((i==null?void 0:i.type)==="geometry"){let{color:x,hoverColor:C,initialColor:v,initialTopColor:S,topColor:I}=i.components[1],w=i.components[0],E=i.components[1],D=i.components[2],R=i.components[3],_=i.parentObject3D;return{id:i.id,type:"geometry",opacity:E.opacity,initialColor:v,color:x,focusable:w.focusable,initialTopColor:S,topColor:I,hoverColor:C,hovered:!!(D!=null&&D.hover),height:E.height,visible:E.visible,outline:R==null?void 0:R.visible,showImage:E.showImage,texture:E.texture,topTexture:E.topTexture,flipImageToFaceCamera:E.flipImageToFaceCamera,parent:{id:_==null?void 0:_.userData.entityId,type:_==null?void 0:_.type},position:this.convert3DMapPositionToCoordinate(w.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let x=i.components[0],C=i.components[1],v=i.components[2];return{id:i.id,type:"model",position:x.mesh?this.convert3DMapPositionToCoordinate((o=x.mesh)==null?void 0:o.getWorldPosition(new Q)):this.convert3DMapPositionToCoordinate(x.position),interactive:v!=null,material:C.material,parent:(a=i.parentObject3D)!=null&&a.parent?{id:i.parentObject3D.parent.userData.entityId,type:i.parentObject3D.parent.type}:void 0,visible:C.visible,verticalOffset:C.verticalOffset,color:C.color,opacity:C.opacity,rotation:(p=C.rotation)!=null?p:Ks,scale:(c=C.scale)!=null?c:Js}}else if((i==null?void 0:i.type)==="path"){let x=i.components[0],C=i.components[2],v=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(x.position),visible:v.visible,interactive:C!=null,completeFraction:x.completeFraction,color:v.color,accentColor:x.accentColor,nearRadius:x.nearRadius,farRadius:x.farRadius,animateArrowsOnPath:x.animateArrowsOnPath,displayArrowsOnPath:x.displayArrowsOnPath,nearZoomLevel:x.nearZoomLevel,farZoomLevel:x.farZoomLevel}}else if((i==null?void 0:i.type)==="image"){let x=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(x.position),visible:i.components[1].visible,verticalOffset:(u=x.feature.properties.verticalOffset)!=null?u:0,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"&&i.components[0]instanceof Lo&&"textArea"in i.components[0].feature.properties){PP(i);let x=i.components[0],C=i.components[1],{textMesh:v}=x,S=(h=x.mesh)==null?void 0:h.parent;S instanceof Me&&((m=S.children.find(E=>E.type==="batchedtext"))==null||m.getWorldPosition(s(this,vd))),s(this,Mc).set(0,0,0);let I=v?v.getWorldPosition(s(this,Mc)):s(this,Mc);return Object.assign({},$s,C.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(I.add(s(this,vd))),visible:(y=x.visible)!=null?y:!1,content:(b=x.feature.properties.content)!=null?b:""})}else return}}setState(e,i){var o,a;if(typeof e=="object"&&i==null){"hoverColor"in e&&(s(this,A).hoverColor=(o=e.hoverColor)!=null?o:s(this,A).hoverColor),"text3dHoverColor"in e&&(s(this,A).text3dHoverColor=(a=e.text3dHoverColor)!=null?a:s(this,A).text3dHoverColor);return}let n=hp(s(this,A),e);if(n!=null){if(n.type==="custom-geometry"){let p=s(this,A).geometry3DMap.get(n.id);if(p instanceof Ee&&p.components[0]instanceof bc){let c=i;Hi(n,s(this,A),c.visible),Om(n,c.altitude),Cv(n,c.position,this.convertTo3DMapPosition),Sv(n,this.getParentContainer(c.parent,!1))}}else if(n.type==="path"){let p=i;wt(n,p.interactive,s(this,A))&&s(this,Be).call(this),Om(n,p.altitude),IP(n,s(this,A),p)}else if(n.type==="model"){let p=i;wt(n,p.interactive,s(this,A))&&s(this,Be).call(this),Hi(n,s(this,A),p.visible),EP(n,p)}else if(n.type==="group-container"){let p=i;Hi(n,s(this,A),p.visible)&&(s(this,k).outlineInterpolationSystem.outlineOpacitiesDirty=!0,s(this,k).pathSystem.altitudeDirty=!0),Om(n,p.altitude)&&(s(this,k).pathSystem.altitudeDirty=!0),wt(n,p.interactive,s(this,A))&&s(this,Be).call(this),Mv(n,s(this,A),p.opacity)&&(s(this,k).outlineInterpolationSystem.outlineOpacitiesDirty=!0)}else if(n.type==="geometry-group"){let p=i;Hi(n,s(this,A),p.visible)&&(s(this,k).outlineInterpolationSystem.outlineOpacitiesDirty=!0),uP(n,s(this,A),p),_m(n,s(this,A),p.outline),p.height!=null&&vv(n,s(this,A),p.height),p.altitude!=null&&n.setAltitude(p.altitude),CP(n,p),dP(n,p.shading),Mv(n,s(this,A),p.opacity)&&(s(this,k).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wt(n,p.interactive,s(this,A))&&(s(this,Be).call(this),s(this,ot).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Ze){let p=i;Hi(n,s(this,A),p.visible)&&(s(this,k).outlineInterpolationSystem.outlineOpacitiesDirty=!0),_m(n,s(this,A),p.outline),hP(n,p),Iv(n,p.focusable)&&(s(this,k).geometryInFocusSystem.focusablesDirty=!0),MP(n,p.renderOrder)&&(s(this,k).meshDetachmentSystem.dirty=!0),TP(n,p.opacity)&&(s(this,k).meshDetachmentSystem.dirty=!0,s(this,k).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Tv(n,p.flipImageToFaceCamera),p.height!=null&&vv(n,s(this,A),p.height),SP(n,p)&&(s(this,k).meshDetachmentSystem.dirty=!0),xv(n,p),bP(n,p.hoverColor),wt(n,p.interactive,s(this,A)),vP(n,p.hovered)}s(this,Be).call(this)}else if(n.type==="label"||n.type==="marker"){let p=i;yP(n,i,s(this,A)),mP(n,i,s(this,A))&&(s(this,ot).call(this),s(this,k).domMutationSystem.dirty=!0),Cv(n,p.position,this.convertTo3DMapPosition),Sv(n,this.getParentContainer(p.parent,!1))&&(s(this,ot).call(this),s(this,k).panBoundsSystem.dirty=!0),fP(n,p.enabled),Hi(n,s(this,A),p.visible)}else if(n.type==="image"){let p=i;Hi(n,s(this,A),p.visible),Tv(n,p.flipImageToFaceCamera)}else if(n.type==="text3d"){let p=i;wP(n,s(this,A),p)}this.render()}}convertTo3DMapPosition(e,i,n=0,o){var c,u,h,m,y;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}=Bh((h=(u=s(this,A).center)==null?void 0:u[1])!=null?h:0,(y=(m=s(this,A).center)==null?void 0:m[0])!=null?y:0,e,i);return o?(o.set(a,p,n),o):new Q(a,p,n)}get backgroundColor(){return typeof s(this,St).backgroundColor=="string"?s(this,St).backgroundColor:"#".concat(s(this,St).backgroundColor.getHexString())}get backgroundAlpha(){return s(this,St).backgroundAlpha}getThreeRenderer(){return s(this,St)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?pC(i):void 0}isInView(e){let i=hp(s(this,A),e);if(s(this,bd).identity().multiply(s(this,Ye).projectionMatrix).multiply(s(this,Ye).matrixWorldInverse),s(this,Ss).setFromProjectionMatrix(s(this,bd)),i instanceof ha)return s(this,Ss).containsPoint(i.position);if(i instanceof Ee){let n=i==null?void 0:i.components[0];if(n instanceof bc||n instanceof Bo)return s(this,Ss).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Ze){let o=new xt(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,Ss).intersectsBox(o)}}return!1}getSystems(){return s(this,k)}getInternalState(){return s(this,A)}getTweenGroup(){return s(this,A).tweenGroup}};Ke=new WeakMap,Ye=new WeakMap,xs=new WeakMap,cd=new WeakMap,Cc=new WeakMap,Wo=new WeakMap,Cs=new WeakMap,Sc=new WeakMap,Et=new WeakSet,k2=l(function(e){var i;s(this,zo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),s(this,A).pixelRatio=this.resolutionScale},"#setResolutionScale"),A=new WeakMap,Ae=new WeakMap,ai=new WeakMap,qe=new WeakMap,Zi=new WeakMap,St=new WeakMap,k=new WeakMap,pd=new WeakMap,ot=new WeakMap,Be=new WeakMap,w6=l(function(){P(this,Ae,document.createElement("div")),s(this,Ae).classList.add("mappedin__smart-collision-engine__container"),P(this,ai,document.createElement("canvas")),s(this,ai).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,Ae)),P(this,qe,document.createElement("canvas")),s(this,qe).classList.add("mappedin__smart-collision-engine__container"),s(this,qe).width=s(this,Ae).clientWidth*this.resolutionScale,s(this,qe).height=s(this,Ae).clientHeight*this.resolutionScale,s(this,qe).style.width=s(this,Ae).clientWidth+"px",s(this,qe).style.height=s(this,Ae).clientHeight+"px",s(this,Ae).appendChild(s(this,ai)),s(this,Ae).appendChild(s(this,qe)),s(this,ai).width=s(this,Ae).clientWidth,s(this,ai).height=s(this,Ae).clientHeight,s(this,qe).width=s(this,Ae).clientWidth*this.resolutionScale,s(this,qe).height=s(this,Ae).clientHeight*this.resolutionScale,s(this,qe).style.width=s(this,Ae).clientWidth+"px",s(this,qe).style.height=s(this,Ae).clientHeight+"px"},"#renderEntity2DContainer"),E6=l(function(){P(this,Zi,document.createElement("div")),s(this,Zi).classList.add("mappedin-2d-entities"),Object.assign(s(this,Zi).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,Zi))},"#renderEntityDOMContainer"),D6=l(function(){s(this,qe).width=s(this,Ae).clientWidth*this.resolutionScale,s(this,qe).height=s(this,Ae).clientHeight*this.resolutionScale,s(this,qe).style.width=s(this,Ae).clientWidth+"px",s(this,qe).style.height=s(this,Ae).clientHeight+"px",s(this,ai).width=s(this,Ae).clientWidth,s(this,ai).height=s(this,Ae).clientHeight,s(this,qe).width=s(this,Ae).clientWidth*this.resolutionScale,s(this,qe).height=s(this,Ae).clientHeight*this.resolutionScale,s(this,qe).style.width=s(this,Ae).clientWidth+"px",s(this,qe).style.height=s(this,Ae).clientHeight+"px",s(this,k).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),zo=new WeakMap,ud=new WeakMap,dd=new WeakMap,hd=new WeakMap,fd=new WeakMap,Og=new WeakMap,md=new WeakMap,gd=new WeakMap,yd=new WeakMap,Tc=new WeakMap,A2=l(function(e,i,n,o){let a=new ha(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o);return a.occluderId=n!=null?n:s(this,k).occlusion2DSystem.backgroundId,s(this,A).geometry2DMap.set(a.id,a),a},"#createEntity2D"),Ss=new WeakMap,bd=new WeakMap,qt=new WeakMap,$t=new WeakMap,F2=l(async function(){return No.load(dI).then(e=>{var i;return s(this,Ke)&&((i=s(this,Ke).environment)==null||i.dispose(),e.mapping=gx,s(this,Ke).environment=e,this.render()),e})},"#loadEnvMap"),Mc=new WeakMap,vd=new WeakMap,l(G2,"Core");var L2=G2,xd=L2;g();function GV(r,t){VV(r,t)(r.getScene(),t),jV(r,t),t.addFolder("Export").add({export:l(async()=>{let a=await r.getCurrentSceneGLTF({binary:!0}),p=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let u=window.URL.createObjectURL(p);c.href=u,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(u)},"export")},"export");let n=t.addFolder("Camera"),o={get bearing(){return r.camera.bearing},set bearing(a){r.camera.setBearing(a)},get pitch(){return r.camera.pitch},set pitch(a){r.camera.setPitch(a)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(a){r.camera.setZoomLevel(a)}};n.add(o,"bearing",-359,359,1),n.add(o,"pitch",r.camera.minPitch,r.camera.maxPitch,1),n.add(o,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}l(GV,"mountSceneGraphVisualizer");function VV(r,t){let e=t;return l(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 opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.opacity:1},set opacity(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{opacity:c})},get color(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"&&c.color?K(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(h=>h.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:l(()=>{},"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"),a.add(p,"opacity",0,1,.1))}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(h=>h.updateDisplay()))},focus:l(()=>{},"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(h=>h.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,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(h=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:h.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,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(h=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:h.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,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(h=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:h.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,h,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(h=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:h.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(c){var h,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{foregroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var u,h,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(h=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:h.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(c){var h,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{foregroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var u,h,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(h=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:h.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(c){var h,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{backgroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var u,h,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(h=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:h.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(c){var h,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{backgroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.backgroundColor,inactive:c}}}}})},focus:l(()=>{},"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(h=>h.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,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(h=(u=c.shading)==null?void 0:u.start)!=null?h: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,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(h=(u=c.shading)==null?void 0:u.end)!=null?h: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,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(h=(u=c.shading)==null?void 0:u.intensity)!=null?h: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(h=>h.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")}l(VV,"createParseChild");function jV(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)})}l(jV,"createWatermarkChild");var O6="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",UV="https://auth.mappedin.com/oauth2/token";async function _6(r,t){var e,i,n,o,a;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled){let{Map:p,MercatorCoordinate:c}=await import("./outdoor-context-v4-XU2K4KTH.js"),u=t.outdoorView.headers;u==null&&(u=await aC(UV));let h=t.center||[0,0],m=new p({container:r,style:t.outdoorView.style||O6,center:h,attributionControl:!1,zoom:(i=t.zoomLevel)!=null?i:N2,pitch:(n=t.pitch)!=null?n:B2,bearing:(o=t.bearing)!=null?o:R2,transformRequest:rC(u),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Ys(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),y=m.painter.context.gl,b=new xd(r,{center:h,zoomLevel:m.getZoom(),pitch:m.getPitch(),bearing:m.getBearing(),gl:y,map:m,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(a=t.naturalBearing)!=null?a:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError}),x={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(b.camera.minZoomLevel),m.setMaxZoom(b.camera.maxZoomLevel),b.on("camera-change",E=>{x.center=E.center,x.zoom=E.zoomLevel,x.bearing=E.bearing,x.pitch=E.pitch,m.jumpTo(x)});let C=c.fromLngLat(h,0),v=Rh(C,b.viewCamera,b.camera,()=>{b.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(v),b.renderSync())});let S=!1,I=!1;m.on("idle",()=>{m&&(S||(b.publish("outdoor-view-loaded"),S=!0),I||(I=!0,b.publish("outdoor-style-loaded")))});let w=l(E=>{E&&(E.sourceDataType==="metadata"||E.sourceDataType==="visibility"||E.dataType==="style"||E.type==="terrain")&&b.getSystems().htmlControlsSystem.updateData(m)},"updateData");return m.on("styledata",E=>{m&&E&&E.dataType==="style"&&E.type==="styledata"&&(I=!1),w(E)}),m.on("sourcedata",w),m.on("terrain",w),m.on("error",E=>{var D;if(((D=E.error)==null?void 0:D.url)===O6){L.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}L.warn(E)}),b}else return new xd(r,t)}l(_6,"createRenderer");g();g();g();var Cd=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Cd||{}),Sd=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(Sd||{});g();g();var Ic=class Ic{constructor(t,e,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",Ic.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===Ic.__type}get focusTarget(){return this.target.anchorTarget}};l(Ic,"Label"),d(Ic,"__type","Label");var Xo=Ic;g();var Ts,Pc=class Pc{constructor(t,e,i){d(this,"id");T(this,Ts);d(this,"__type",Pc.__type);d(this,"contentEl");this.id=t,this.contentEl=e,P(this,Ts,i)}get target(){return s(this,Ts)}get coordinate(){return s(this,Ts).anchorTarget}static is(t){return t.__type===Pc.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){P(this,Ts,t)}};Ts=new WeakMap,l(Pc,"Marker"),d(Pc,"__type","Marker");var Vn=Pc;g();var Md,Id,wc=class wc{constructor(t,e,i){T(this,Md);T(this,Id);d(this,"target");d(this,"__type",wc.__type);P(this,Md,t),P(this,Id,e),this.target=i}static is(t){return t.__type===wc.__type}get id(){return s(this,Md)}get url(){return s(this,Id)}};Md=new WeakMap,Id=new WeakMap,l(wc,"Image"),d(wc,"__type","Image");var Td=wc;g();var Dc,Ec=class Ec{constructor(t,e,i){d(this,"id");d(this,"groupId");d(this,"__type",Ec.__type);T(this,Dc);this.id=t,this.groupId=e,P(this,Dc,i)}get target(){return s(this,Dc)}static is(t){return t.__type===Ec.__type}updateTarget(t){P(this,Dc,t)}};Dc=new WeakMap,l(Ec,"Model"),d(Ec,"__type","Model");var Ms=Ec;g();var Oc=class Oc{constructor(t,e){d(this,"id");d(this,"coordinates");d(this,"__type",Oc.__type);this.id=t,this.coordinates=e}static is(t){return t.__type===Oc.__type}get focusTarget(){return this.coordinates}};l(Oc,"PathSegment"),d(Oc,"__type","PathSegment");var Lc=Oc,_c=class _c{constructor(t,e,i,n){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"segments");d(this,"__type",_c.__type);this.id=t,this.animation=e,this.coordinates=i,this.segments=n.map(({id:o,coordinates:a})=>new Lc(o.toString(),a))}static is(t){return t.__type===_c.__type}get focusTarget(){return this.coordinates}};l(_c,"Path"),d(_c,"__type","Path");var si=_c;g();var Zo,V2=class V2{constructor(t){T(this,Zo);P(this,Zo,t)}get center(){return s(this,Zo).center}get bearing(){return s(this,Zo).bearing}get pitch(){return s(this,Zo).pitch}get zoomLevel(){return s(this,Zo).zoomLevel}};Zo=new WeakMap,l(V2,"CameraTransform");var Pd=V2;g();var kc=class kc{constructor(t){d(this,"id");d(this,"__type",kc.__type);this.id=t}static is(t){return t.__type===kc.__type}get focusTarget(){return this}};l(kc,"Shape"),d(kc,"__type","Shape");var Yo=kc;g();var wd=class wd{constructor(t,e){d(this,"id");d(this,"target");d(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===wd.__type}};l(wd,"Text3D"),d(wd,"__type","Text3D");var qo=wd;g();g();g();var HV=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>']]),WV=/<svg([^>]*)>/g;function L6(r,t,e){let i=HV.get(r);return i?i.replace(WV,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}l(L6,"getStyledIcon");var zV=l(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"),XV=l(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"),j2="#722ED1",U2="#1890FF",k6=l(({type:r="departure",color:t=U2})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?zV(t):XV(t),"\n </div>"),"DroppedPin"),ZV=l(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),A6=l(({type:r="stairs",color:t=j2,direction:e="up"})=>{let i=ZV("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(L6("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");g();var F6=l(async r=>new Promise(t=>setTimeout(t,r)),"ms");var YV={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},qV={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},$o={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:YV,inactivePathOptions:qV,markerOptions:{departureColor:U2,destinationColor:j2},animatePathDrawing:!0},jn,li,Un,Te,Dd,Hn,Is,at,ci,sr,pi,Jo,Qe,B6,R6,H2,_g,Ac,W2,Fc,z2=class z2{constructor(t,e,i){T(this,Qe);T(this,jn,new Map);T(this,li);T(this,Un);T(this,Te,$o);T(this,Dd);T(this,Hn);T(this,Is);T(this,at,[]);T(this,ci);T(this,sr,new Map);T(this,pi,new Map);T(this,Jo,new Map);T(this,Fc,l(t=>{var e;if((e=s(this,Te).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=s(this,jn).get(t.markers[0]);i!=null&&i.action.toFloor&&(s(this,Te).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}},"#handleClick"));P(this,li,t),P(this,Dd,i),P(this,Un,e)}get currentMap(){return s(this,Dd).call(this)}get isMultiFloor(){if(!s(this,at).length)return!1;let t=new Set;for(let e of s(this,at))for(let i of e.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return s(this,sr).get(t)}getMarkerById(t){return s(this,jn).get(t)}get paths(){let t=new Set;return s(this,sr).forEach(({path:e})=>t.add(e)),Array.from(t)}get activeDirections(){return s(this,Jo).get(s(this,ci))}get activePath(){var t;if(s(this,ci))return(t=s(this,sr).get(s(this,ci).id))==null?void 0:t.path}get floorStacks(){let t=s(this,Un).getMapData();if(!s(this,at).length||!t)return[];let e=new Set;for(let i of s(this,at))for(let n of i.coordinates)if(n.floorId){let o=t.getById("floor",n.floorId);o&&e.add(o.floorStack)}return Array.from(e)}get floors(){let t=s(this,Un).getMapData();if(!s(this,at).length||!t)return[];let e=new Set;for(let i of s(this,at))for(let n of i.coordinates)if(n.floorId){let o=t.getById("floor",n.floorId);o&&e.add(o)}return Array.from(e)}setActivePathByIndex(t){let e=s(this,at)[t];if(!s(this,at).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,at)[t]){L.warn("Direction #".concat(t," does not exist"));return}let i=s(this,pi).get(e);if(!i){L.warn("The direction is not a part of muli-direcional path");return}G(this,Qe,_g).call(this,i)}setActivePath(t){if(!s(this,at).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,Jo).get(t)){L.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}G(this,Qe,_g).call(this,t)}setActivePathByDirections(t){if(!s(this,at).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=s(this,pi).get(t);if(!e){L.warn("The direction is not a part of muli-direcional path");return}G(this,Qe,_g).call(this,e)}drawSync(t,e={}){var p,c,u;s(this,Is)&&this.clear(),P(this,Is,!0),G(this,Qe,H2).call(this,e);let i=Array.isArray(t)?t:[t],n=i[0],o=i[i.length-1],a=n.coordinates[0];P(this,at,i),a.floorId&&s(this,Te).setMapToDeparture&&this.currentMap.setFloor(a.floorId),(p=s(this,Te).createMarkers)!=null&&p.departure&&G(this,Qe,Ac).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let h=0;h<i.length;h++){let m=i[h],y=h?{...s(this,Te).inactivePathOptions}:{...s(this,Te).pathOptions};if(m.coordinates.length<2){L.warn("Directions must have at least 2 coordinates");return}let b=this.currentMap.Paths.add(m.coordinates,{...y,animateDrawing:s(this,Te).animatePathDrawing}),x=b.paths.map(v=>v.id.toString()),C=new si(De(),b.animation,m.coordinates,b.paths);for(let v of x){s(this,sr).set(v,{path:C,entityIds:x});let S=h?{...s(this,Te).inactivePathOptions,altitude:0}:{...s(this,Te).pathOptions,altitude:.05};s(this,li).setState(v,S)}s(this,sr).set(C.id,{path:C,entityIds:x}),s(this,pi).set(m,C),s(this,Jo).set(C,m),(c=s(this,Te).createMarkers)!=null&&c.connection&&G(this,Qe,W2).call(this,m.instructions,"connection"),h===0&&(P(this,ci,s(this,pi).get(s(this,at)[0])),s(this,li).on("click",s(this,Fc)))}(u=s(this,Te).createMarkers)!=null&&u.destination&&G(this,Qe,Ac).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),s(this,Un).mapObjects.forEach(h=>{h.processFloorChange(h.currentFloorId)})}async draw(t,e={}){s(this,Hn)&&this.clear(),G(this,Qe,H2).call(this,e);let i=Array.isArray(t)?t:[t],o=i[0].coordinates[0];return P(this,at,i),o.floorId&&s(this,Te).setMapToDeparture&&this.currentMap.setFloor(o.floorId),G(this,Qe,R6).call(this,i)}clear(){s(this,jn).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),s(this,jn).clear(),s(this,sr).forEach(({path:t,entityIds:e})=>{s(this,sr).delete(t.id),e.forEach(i=>s(this,sr).delete(i)),this.currentMap.Paths.remove(e)}),s(this,Hn)&&(s(this,Hn).cancel(),P(this,Hn,void 0)),s(this,Is)&&P(this,Is,!1),P(this,at,[]),s(this,pi).clear(),s(this,Jo).clear(),P(this,ci,void 0),s(this,li).off("click",s(this,Fc)),s(this,Un).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};jn=new WeakMap,li=new WeakMap,Un=new WeakMap,Te=new WeakMap,Dd=new WeakMap,Hn=new WeakMap,Is=new WeakMap,at=new WeakMap,ci=new WeakMap,sr=new WeakMap,pi=new WeakMap,Jo=new WeakMap,Qe=new WeakSet,B6=l(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),R6=l(function(t){let e=t[0],i=t[t.length-1],n=!1;return P(this,Hn,{promise:new Promise(async o=>{var a,p,c;if(M.env.NODE_ENV!=="test"&&await F6(500),n||!t.length){o();return}(a=s(this,Te).createMarkers)!=null&&a.departure&&G(this,Qe,Ac).call(this,e.coordinates[0],"departure",e.instructions[0]);for(let u=0;u<t.length;u++){let h=t[u],m=u?{...s(this,Te).inactivePathOptions}:{...s(this,Te).pathOptions};if(h.coordinates.length<2){L.warn("Directions must have at least 2 coordinates"),o();return}let y=this.currentMap.Paths.add(h.coordinates,{...m,animateDrawing:s(this,Te).animatePathDrawing}),b=y.paths.map(C=>C.id.toString()),x=new si(De(),y.animation,h.coordinates,y.paths);for(let C of b){s(this,sr).set(C,{path:x,entityIds:b});let v=u?{...s(this,Te).inactivePathOptions,altitude:0}:{...s(this,Te).pathOptions,altitude:.05};s(this,li).setState(C,v)}if(s(this,sr).set(x.id,{path:x,entityIds:b}),s(this,pi).set(h,x),s(this,Jo).set(x,h),M.env.NODE_ENV!=="test"&&await y.animation,n){o();return}(p=s(this,Te).createMarkers)!=null&&p.connection&&G(this,Qe,W2).call(this,h.instructions,"connection"),u===0&&(P(this,ci,s(this,pi).get(s(this,at)[0])),s(this,li).on("click",s(this,Fc)))}if((c=s(this,Te).createMarkers)!=null&&c.destination&&G(this,Qe,Ac).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),n){o();return}s(this,Un).mapObjects.forEach(u=>{u.processFloorChange(u.currentFloorId)}),o()}),cancel:l(()=>{n=!0},"cancel")}),s(this,Hn).promise},"#drawAsync"),H2=l(function(t){var e,i,n;P(this,Te,{setMapOnConnectionClick:(e=t.setMapOnConnectionClick)!=null?e:$o.setMapOnConnectionClick,setMapToDeparture:(i=t.setMapToDeparture)!=null?i:$o.setMapToDeparture,pathOptions:{...$o.pathOptions,...t.pathOptions},inactivePathOptions:{...$o.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...$o.createMarkers,...t.createMarkers},markerOptions:{...$o.markerOptions,...t.markerOptions},animatePathDrawing:(n=t.animatePathDrawing)!=null?n:$o.animatePathDrawing})},"#setupOptions"),_g=l(function(t){P(this,ci,t),s(this,at).forEach(e=>{let i=s(this,pi).get(e);if(i){let n=s(this,sr).get(i.id),o=n.path.id===s(this,ci).id?{...s(this,Te).pathOptions,altitude:.05}:{...s(this,Te).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,li).setState(a,o)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),Ac=l(function(t,e,i){var n,o,a,p,c;if(e==="connection"&&i){let u=i.action.type==="ExitConnection"?s(this,Te).markerOptions.departureColor:s(this,Te).markerOptions.destinationColor,h;if(typeof((n=s(this,Te).createMarkers)==null?void 0:n.connection)=="function"){let y=s(this,Te).createMarkers.connection(i);s(this,li).setState(y.id.toString(),{options:{interactive:!0}}),h={id:y.id,type:"marker"}}else h=this.currentMap.Markers.add(i.coordinate,A6({type:(a=(o=i.action.connection)==null?void 0:o.type)!=null?a:i.action.connectionType,color:u,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(h.id.toString());if(!m)throw new Error("marker component should exist");s(this,jn).set(h.id,{instruction:i,marker:new Vn(h.id.toString(),m,i.coordinate)})}else{let u=e==="departure"?s(this,Te).markerOptions.departureColor:s(this,Te).markerOptions.destinationColor,h;typeof((p=s(this,Te).createMarkers)==null?void 0:p.departure)=="function"&&e==="departure"?h={id:s(this,Te).createMarkers.departure(i).id,type:"marker"}:typeof((c=s(this,Te).createMarkers)==null?void 0:c.destination)=="function"&&e==="destination"?h={id:s(this,Te).createMarkers.destination(i).id,type:"marker"}:h=this.currentMap.Markers.add(t,k6({type:e,color:u}),{anchor:"top",rank:"always-visible"}),s(this,jn).set(h.id,void 0)}},"#addMarker"),W2=l(function(t,e){t.filter(n=>G(this,Qe,B6).call(this,n.action)).forEach(n=>{G(this,Qe,Ac).call(this,n.coordinate,e,n)})},"#addMarkers"),Fc=new WeakMap,l(z2,"Navigation");var Ed=z2;g();g();g();var $V=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>']]),JV=/<svg([^>]*)>/g;function N6(r,t,e){let i=$V.get(r);return i?i.replace(JV,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}l(N6,"getStyledIcon");var Ps,Bc,lr,X2,G6,V6,Z2,j6,Y2=class Y2{constructor(t,e){T(this,lr);T(this,Ps);T(this,Bc);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});P(this,Ps,t),P(this,Bc,e)}auto(){let t=[],e=s(this,Bc)[Object.keys(s(this,Bc))[0]];return[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(i=>{if(i.__type==="connection")i.coordinates.forEach(n=>{let o=i.name||i.externalId;if(o){let a=s(this,Ps).Labels.add(n,o,G(this,lr,X2).call(this,i));t.push(a)}});else{i.__type==="space"&&i.name!==""&&s(this,Ps).updateState(i,{interactive:!0,hoverColor:"#F0F0F0"});let n=i.name;if(n){let o=s(this,Ps).Labels.add(i,n,G(this,lr,X2).call(this,i));t.push(o)}}}),{labels:t}}};Ps=new WeakMap,Bc=new WeakMap,lr=new WeakSet,X2=l(function(t){let e=N6(G(this,lr,G6).call(this,t),"white",12);return{appearance:{text:{foregroundColor:G(this,lr,Z2).call(this,t)},marker:{foregroundColor:{active:G(this,lr,Z2).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:G(this,lr,j6).call(this,t)}},"#generatLabelAppearance"),G6=l(function(t){return t.__type==="connection"?G(this,lr,V6).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),V6=l(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"),Z2=l(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"),j6=l(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),l(Y2,"Labels");var Lg=Y2;var q2=class q2{constructor(t,e){d(this,"Labels");d(this,"auto",l(()=>this.Labels.auto(),"auto"));this.Labels=new Lg(t,e)}};l(q2,"DefaultTheme");var kg=q2;g();var ue,_d,Wn,Ag,$2,J2=class J2{constructor(t){T(this,Wn);T(this,ue);T(this,_d);d(this,"interactions",{set:l(t=>{(t==null?void 0:t.pan)!=null&&(s(this,ue).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(s(this,ue).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(s(this,ue).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:l(()=>{s(this,ue).getSystems().cameraSystem.enablePan=!0,s(this,ue).getSystems().cameraSystem.enableZoom=!0,s(this,ue).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:l(()=>{s(this,ue).getSystems().cameraSystem.enablePan=!1,s(this,ue).getSystems().cameraSystem.enableZoom=!1,s(this,ue).getSystems().cameraSystem.enableRotate=!1},"disable")});d(this,"setMinPitch",l(t=>{s(this,ue).camera.setMinPitch(t)},"setMinPitch"));d(this,"setMaxPitch",l(t=>{s(this,ue).camera.setMaxPitch(t)},"setMaxPitch"));d(this,"setMinZoomLevel",l(t=>{s(this,ue).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",l(t=>{s(this,ue).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));P(this,_d,t),P(this,ue,t.core)}setScreenOffsets(t){s(this,ue).camera.setInsetPadding(t)}get screenOffsets(){return s(this,ue).camera.insetsPadding}get panMode(){return s(this,ue).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&s(this,ue).camera.setPanMode(t)}getFocusOnTransform(t,e){var n;let i=s(this,ue).camera.getCameraFrameForCoordinates(G(this,Wn,$2).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,verticalPadding:(n=e==null?void 0:e.axisAlignedPadding)==null?void 0:n.vertical,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing});return{center:new se(i.center[1],i.center[0]),zoomLevel:i.zoomLevel}}focusOn(t,e){var i;return s(this,ue).camera.focusOn(G(this,Wn,$2).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,verticalPadding:(i=e==null?void 0:e.axisAlignedPadding)==null?void 0:i.vertical,easing:e==null?void 0:e.easing})}animateTo(t,e){var c;let{center:i,zoomLevel:n,bearing:o,pitch:a}=t,p=i!=null?i:this.center;return s(this,ue).camera.animateTo({center:i!=null?[p.longitude,p.latitude,s(this,ue).camera.elevation]:void 0,zoomLevel:n,bearing:o,pitch:a,duration:(c=e==null?void 0:e.duration)!=null?c: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];s(this,ue).camera.setCenter(a),s(this,ue).camera.setZoomLevel(i),s(this,ue).camera.setBearing(n),s(this,ue).camera.setPitch(o)}get center(){let t=s(this,ue).camera.center;return new se(t[1],t[0],void 0)}setAutoMinZoomLevel(t){s(this,ue).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return s(this,ue).camera.autoMinZoomLevel}get zoomLevel(){return s(this,ue).camera.zoomLevel}get pitch(){return s(this,ue).camera.pitch}get minPitch(){return s(this,ue).camera.minPitch}get maxPitch(){return s(this,ue).camera.maxPitch}get bearing(){let t=s(this,ue).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return s(this,ue).camera.minZoomLevel}get maxZoomLevel(){return s(this,ue).camera.maxZoomLevel}setElevation(t){s(this,ue).camera.setElevation(t)}get elevation(){return s(this,ue).camera.elevation}animateElevation(t,e){return s(this,ue).camera.animateElevation(t,e)}updateFacadesInView(){s(this,ue).getSystems().geometryInFocusSystem.raycast()}};ue=new WeakMap,_d=new WeakMap,Wn=new WeakSet,Ag=l(function(t){var i,n,o,a,p,c;let e=s(this,ue).camera.elevation;return se.is(t)&&t.floorId!=null?(n=(i=s(this,ue).getState(t.floorId))==null?void 0:i.altitude)!=null?n:e:er.is(t)?(a=(o=s(this,ue).getState(t.id))==null?void 0:o.altitude)!=null?a:e:"floor"in t&&er.is(t.floor)&&(c=(p=s(this,ue).getState(t.floor.id))==null?void 0:p.altitude)!=null?c:e},"#getFloorAltitude"),$2=l(function(t){var o;let e=[],n=(Array.isArray(t)?t:[t]).flatMap(a=>{var p;return(p=a==null?void 0:a.focusTarget)!=null?p:[a]});for(let a of n)if(a!=null)if(se.is(a)){let p=G(this,Wn,Ag).call(this,a);e.push([a.longitude,a.latitude,p])}else if((a==null?void 0:a.id)!=null){let p=G(this,Wn,Ag).call(this,a);if(er.is(a)&&((o=s(this,_d).getMapDataInternal())!=null&&o.enterpriseMode)){e.push(a.id);continue}else if("geoJSON"in a&&a.geoJSON.geometry.coordinates.length>0){zx(a.geoJSON,u=>{e.push([u[0],u[1],p])});continue}let c=s(this,ue).getBoundingArea(a.id);if(c)e.push(...c.map(u=>[u[0],u[1],p]));else if("geoJSONBoundingBox"in a){let u=G(this,Wn,Ag).call(this,a);if(a.geoJSONBoundingBox!=null){let h=[[a.geoJSONBoundingBox[0],a.geoJSONBoundingBox[1],u],[a.geoJSONBoundingBox[2],a.geoJSONBoundingBox[3],u]];e.push(...h)}}}else vy(a)&&e.push(a);return e},"#computeCoordinateCloud"),l(J2,"Camera");var Od=J2;g();var Rc,K2=class K2{constructor({currentMapGetter:t}){T(this,Rc);P(this,Rc,t)}get currentMap(){return s(this,Rc).call(this)}async getCurrentSceneGLTF(t){let e=s(this,Rc).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(L.error("There is no map to export. Please load a map first."),new Blob)}};Rc=new WeakMap,l(K2,"Exporter");var Ld=K2;g();var Yi,Ad,Q2=class Q2{constructor({currentMapGetter:t}){T(this,Yi,new Map);T(this,Ad);P(this,Ad,t)}get currentMap(){return s(this,Ad).call(this)}getById(t){return s(this,Yi).get(t)}add(t,e,i){let n=t.anchorTarget,o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Labels.add(n,e,{...i,attachTo:Nc(t),rank:(i==null?void 0:i.rank)==null||(i==null?void 0:i.rank)==="initial"?"medium":i.rank}),p=new Xo(a.id.toString(),e,t);return s(this,Yi).set(p.id,{label:p,entityId:p.id}),p}all(t){var i;let e=[];return(i=this.currentMap)==null||i.Labels.all({onCreate:l((n,o,a)=>{let p=new Xo(n.toString(),o,a);s(this,Yi).set(p.id,{label:p,entityId:p.id}),e.push(p)},"onCreate"),labelOptions:t}),e}remove(t){var i;let e=s(this,Yi).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),s(this,Yi).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Yi).forEach(({label:e})=>{this.remove(e),t.push(e),s(this,Yi).delete(e.id.toString())}),t}};Yi=new WeakMap,Ad=new WeakMap,l(Q2,"Labels");var kd=Q2;g();g();var e3={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},U6={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},H6=.5,i3=class i3{constructor(t,e,i=new Map){d(this,"containerId");d(this,"layers");d(this,"renderer");this.containerId=e,this.layers=i,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};l(i3,"Layer");var zn=i3,ws,n3=class n3{constructor(t,e,i,n,o,a,p,c){d(this,"id");d(this,"name");d(this,"elevation");d(this,"containerId");d(this,"externalId");d(this,"metadata");d(this,"shortName");d(this,"subtitle");d(this,"occluderId");d(this,"loaded",!1);d(this,"styleMap",{});d(this,"obstructions");d(this,"entrances");d(this,"spaces");d(this,"floorImages");d(this,"floorText");d(this,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"footprint");d(this,"floorStackId");d(this,"multiFloorView");d(this,"mapDataInternal");d(this,"facadesByStyleId",new Map);T(this,ws);d(this,"load",l(()=>{var n,o,a,p,c,u,h,m,y,b,x,C,v,S;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(bn,"-").concat(this.id),{},this.id);this.layers.set(bn,new zn(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(Li,"-").concat(this.id),{},this.id);this.layers.set(Li,new zn(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(tt,"-").concat(this.id),{},this.id);if(this.layers.set(tt,new zn(this.renderer,i.id.toString())),((n=this.footprint)==null?void 0:n.geometry)!=null&&((o=this.footprint)==null?void 0:o.geometry.coordinates.length)!==0){let I=e3;if(this.obstructions!=null&&this.obstructions.features.length>0){let D=this.obstructions.features.filter(R=>R.geometry.type==="LineString"&&R.properties.kind==="Wall"&&R.properties.footprintComponent===!0);D!=null&&D.length>0&&(I=this.styleMap[(a=D[0].properties)==null?void 0:a.id])}let w=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...I,height:(c=(p=this.multiFloorView)==null?void 0:p.floorHeight)!=null?c:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":I.color,renderOrder:2},this.id);this.layers.set(Pp,new zn(this.renderer,w.id.toString()));let E=this.renderer.addGroupContainer("".concat(hl,"-").concat(this.id),{},this.id);this.layers.set(hl,new zn(this.renderer,E.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,E.id)}if(this.spaces!=null&&this.spaces.features.length>0){let I=[],w=new Map;this.spaces.features.filter(_=>{var F;return _.geometry.type==="Polygon"&&((F=_.properties.kind)==null?void 0:F.toLowerCase())!=="void"}).forEach(_=>{var B;let F=(B=this.mapDataInternal)==null?void 0:B.facadesBySpaceId[_.properties.id];if(F){let V=w.get(F.id)||[];w.set(F.id,[...V,_])}else I.push(_)});let E=Fg(I,this.styleMap),D=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),R=0;for(let[_,F]of E){let B=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(R),{features:F},Gc(_,this.options),D);R++;let V=D.id.toString();this.layers.get(tt).layers.set(_.id||V,B.id.toString())}if(w.size>0){let _=this.renderer.addGroupContainer("".concat(Ta,"-").concat(this.id),{},this.id);this.layers.set(Ta,new zn(this.renderer,_.id.toString()));for(let[F,B]of w){let V=this.renderer.addGroupContainer(F,{focusable:!0},_),N=this.renderer.addGroupContainer("".concat(F,"-geometry"),{},V),X=Fg(B,this.styleMap),z=0;for(let[U,te]of X){let Z=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(F,"-").concat(z),{features:te},{...Gc(U,this.options),renderOrder:3},N);z++;let Ce=U.id||Z.id.toString();this.layers.get(Ta).layers.set("".concat(F,"-").concat(Ce),Z.id.toString()),this.facadesByStyleId.has(Ce)?(u=this.facadesByStyleId.get(Ce))==null||u.push(F):this.facadesByStyleId.set(Ce,[F])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let I=this.obstructions.features.filter(N=>N.geometry.type==="Polygon"&&N.properties.kind==="object"),w=Fg(I,this.styleMap),E=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),D=0;for(let[N,X]of w){let z=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(D),{features:X},Gc(N,this.options),E);D++;let U=E.id.toString();this.layers.get(tt).layers.set(N.id||U,z.id.toString())}let R=this.obstructions.features.filter(N=>N.geometry.type==="LineString"&&N.properties.kind==="Wall"&&N.properties.footprintComponent===!1),_=this.obstructions.features.filter(N=>N.geometry.type==="LineString"&&N.properties.kind==="Wall"&&N.properties.footprintComponent===!0),F=this.entrances,B=e3,V=e3;if(R!=null&&R.length>0){let N=this.styleMap[(h=R[0].properties)==null?void 0:h.id];N!=null&&(B={...N}),V=B;let{walls:X,entrances:z}=t3(R,(F==null?void 0:F.features)||[]),U=Math.max(B.height-.11,H6),te={...U6,height:U},Z=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),z,te,i);this.layers.get(tt).layers.set(ul,Z.id.toString());let Ce=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[X]},Gc(B,this.options),i);this.layers.get(tt).layers.set(mo,Ce.id.toString())}if(_!=null&&_.length>0){let N=this.styleMap[(m=_[0].properties)==null?void 0:m.id];N!=null&&(V={...N,id:_i});let{walls:X,entrances:z}=t3(_,(F==null?void 0:F.features)||[]),U=Math.max(V.height-.11,H6),te={...U6,height:U},Z=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),z,te,i);this.layers.get(tt).layers.set(dl,Z.id.toString());let Ce=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[X]},Gc(V,this.options),i);this.layers.get(tt).layers.set(_i,Ce.id.toString())}}if(this.floorImages!=null){let I=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let w of this.floorImages.features||[])"anchorId"in w.properties||"anchorId"in w.properties&&((y=w.properties)==null?void 0:y.anchorId)==null||this.renderer.addImage(De(),w,{url:w.properties.path,flipImageToFaceCamera:(b=this.options.flipImagesToFaceCamera)!=null?b:!0},I);this.layers.set(hC,new zn(this.renderer,I.id.toString()))}if(this.floorText!=null)for(let I of this.floorText.features||[]){let w=0;"geometryId"in I.properties?w=(C=(x=this.renderer.getState(I.properties.geometryId))==null?void 0:x.height)!=null?C:0:w=(v=I.properties.verticalOffset)!=null?v:0,this.renderer.addText3D(De(),{...I,properties:{...I.properties,verticalOffset:w}},{},this.id)}return(S=this.multiFloorView)!=null&&S.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var h,m,y,b;this.id=e.id,this.options=o;let u=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=u.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,a!=null&&p!=null&&(this.styleMap=p,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(h=a.floorImages)==null?void 0:h[this.id],this.floorText=(y=(m=a.enterprise)==null?void 0:m.floorText)==null?void 0:y[this.id],this.footprint=(b=a["floor.geojson"])==null?void 0:b.features.find(x=>x.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=n,this.mapDataInternal=c}get geoJSONBoundingBox(){if(s(this,ws))return s(this,ws);if(!this.footprint){L.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return P(this,ws,Bg(this.footprint)),s(this,ws)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};ws=new WeakMap,l(n3,"FloorObject");var Fd=n3;g();var o3=50,a3=!1,KV=1e3,Xe,Vc,qi,ui,Dt,Rd,Qo,jc,Es,cr,l3,Ds,Nd,Gd,Vd,jd,Xn,Z6,Ud,ea,c3,Y6,q6,Os,p3=class p3 extends ae{constructor({currentMapGetter:e}){super();T(this,cr);T(this,Xe);T(this,Vc,0);T(this,qi);T(this,ui,!1);T(this,Dt,[]);T(this,Rd,0);T(this,Qo,o3);T(this,jc,!1);T(this,Es,"collapsed");d(this,"expandedFactor",0);T(this,Ds,"all-floors");T(this,Nd,l(()=>{let e=s(this,Xe).call(this);if(s(this,Rd)===this.expandedFactor||e==null||!s(this,ui))return;P(this,Rd,this.expandedFactor);let i=Pi(this.expandedFactor,0,1,0,this.distanceBetweenFloors),o=Pi(this.expandedFactor,0,.1,0,1)===0;s(this,Dt).forEach((a,p)=>{e.api.updateState(a.containerId,{visible:o?a.id===e.currentFloorId:!0,altitude:i*p})}),this.expandedFactor===0?(P(this,ui,!1),e.renderer.camera.setPanMode("default"),s(this,ea)&&s(this,ea).call(this)):this.expandedFactor===1&&(P(this,ui,!1),s(this,ea)&&s(this,ea).call(this))},"#handlePreRender"));T(this,Gd,l(()=>{var e,i,n;this.expanded&&P(this,Vc,(i=(e=s(this,Xe).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(n=s(this,Xe).call(this))==null||n.renderer.on("user-interaction-end",s(this,jd))},"#handleUserInteractionStart"));T(this,Vd,l(()=>{var i;let e=s(this,Xe).call(this);if(e!=null&&this.expanded&&s(this,jc)&&!s(this,ui)){let n=e.currentFloorId,o=[1/0,e.currentFloorId];for(let a=0;a<s(this,Dt).length;a++){let p=s(this,Dt)[a],c=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-a*this.distanceBetweenFloors);c<this.distanceBetweenFloors/3&&(o[0]=c,o[1]=p.id)}o[1]!==e.currentFloorId&&(e.currentFloorId=o[1],s(this,Dt).forEach(a=>{e.api.updateState(a.containerId,{visible:s(this,Ds)==="all-floors"?!0:e.currentFloor.id===a.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId,previousFloorId:n}))}},"#determineCurrentMapBasedOnElevation"));T(this,jd,l(()=>{var i,n;let e=s(this,Xe).call(this);if(this.expanded&&e&&s(this,Vc)!==((i=e.renderer.camera.elevation)!=null?i:0)){let o=[1/0,e.currentFloorId,0];for(let a=0;a<s(this,Dt).length;a++){let p=s(this,Dt)[a],c=Math.abs(((n=e.renderer.camera.elevation)!=null?n:0)-a*this.distanceBetweenFloors);c<o[0]&&(o[0]=c,o[1]=p.id,o[2]=a*this.distanceBetweenFloors)}s(this,jc)&&G(this,cr,Z6).call(this,o[2]),P(this,Vc,0),e.renderer.off("user-interaction-end",s(this,jd))}},"#handleUserInteractionEnd"));T(this,Xn,null);T(this,Ud,null);T(this,ea);T(this,Os);P(this,Xe,e);let i=s(this,Xe).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",s(this,Gd)),i.renderer.on("camera-change",s(this,Vd)),i.renderer.on("pre-render",s(this,Nd)))}get state(){return s(this,Es)}get expanded(){return s(this,Es)!=="collapsed"}get distanceBetweenFloors(){if(s(this,Qo)==="auto"){if(s(this,Os)!=null)return s(this,Os);let e=G(this,cr,q6).call(this);if(e)return P(this,Os,e),e}return typeof s(this,Qo)=="number"?s(this,Qo):o3}clearCachedFloorSeparationDistance(){P(this,Os,void 0)}get includedFloors(){var e;return(e=s(this,cr,l3))!=null&&e.api.mapData?s(this,Dt).map(i=>{var n,o;return(o=(n=s(this,cr,l3))==null?void 0:n.api.mapData)==null?void 0:o.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return s(this,Ds)}setFloorVisiblityMode(e){P(this,Ds,e);let i=s(this,Xe).call(this);i!=null&&s(this,Dt).forEach(n=>{i.api.updateState(n.containerId,{visible:s(this,Ds)==="all-floors"?!0:i.currentFloor.id===n.id})})}changeFloorOnElevationChanges(e){P(this,jc,e)}async expand(e){var n,o,a;let i=s(this,Xe).call(this);if(i!=null)return(e==null?void 0:e.distanceBetweenFloors)==="auto"?P(this,Qo,"auto"):P(this,Qo,(n=e==null?void 0:e.distanceBetweenFloors)!=null?n:o3),P(this,Dt,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(p=>i.floorsById.get(p.id)).filter(Boolean):i.currentFloorStack.floorObjects),s(this,Dt).sort((p,c)=>p.elevation-c.elevation),s(this,Dt).length<=1||this.expanded===!0?Promise.resolve():(P(this,ui,!0),i.api.Camera.setPanMode((o=e==null?void 0:e.cameraPanMode)!=null?o:"elevation"),this.changeFloorOnElevationChanges((a=e==null?void 0:e.changeFloorOnElevationChanges)!=null?a:!0),G(this,cr,c3).call(this,"expand",e).then(()=>{P(this,Es,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{P(this,ui,!1)}))}async collapse(e){let i=s(this,Xe).call(this);if(i!=null)return this.expanded===!0?(P(this,ui,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),G(this,cr,c3).call(this,"collapse",e).then(()=>{P(this,Es,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{P(this,ui,!1)})):Promise.resolve()}destroy(){let e=s(this,Xe).call(this);e!=null&&(e.renderer.off("user-interaction-start",s(this,Gd)),e.renderer.off("camera-change",s(this,Vd)),e.renderer.off("pre-render",s(this,Nd)))}};Xe=new WeakMap,Vc=new WeakMap,qi=new WeakMap,ui=new WeakMap,Dt=new WeakMap,Rd=new WeakMap,Qo=new WeakMap,jc=new WeakMap,Es=new WeakMap,cr=new WeakSet,l3=l(function(){return s(this,Xe).call(this)},"#currentMap"),Ds=new WeakMap,Nd=new WeakMap,Gd=new WeakMap,Vd=new WeakMap,jd=new WeakMap,Xn=new WeakMap,Z6=l(function(e){var n,o,a;s(this,Xn)&&s(this,Xn).stop();let i=s(this,Xe).call(this);i!=null&&(P(this,Xn,new ar({elevation:(n=i.renderer.camera.elevation)!=null?n:0}).to({elevation:e},150).easing(rt.Quadratic.Out).onComplete(()=>{var p;s(this,Xn)&&((p=s(this,Xe).call(this))==null||p.renderer.getTweenGroup().remove(s(this,Xn)))}).onUpdate(({elevation:p})=>{i.renderer.camera.setElevation(p)}).start()),(o=s(this,Xe).call(this))==null||o.renderer.getTweenGroup().add(s(this,Xn)),(a=s(this,Xe).call(this))==null||a.renderer.render())},"#animateElevationTo"),Ud=new WeakMap,ea=new WeakMap,c3=l(function(e,i){var p,c,u,h;s(this,qi)&&s(this,qi).stop();let n=s(this,Xe).call(this);if(n==null)return Promise.reject(new Error("No current map"));let o=s(this,Dt).indexOf(n.currentFloor),a=(p=n.renderer.camera.elevation)!=null?p:0;return P(this,Ud,new Promise(m=>{P(this,ea,m)})),P(this,qi,new ar({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(c=i==null?void 0:i.duration)!=null?c:KV).easing(Rn[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m;let y=o*this.distanceBetweenFloors;n.renderer.camera.setElevation(e==="expand"?y*m:a*m)}).onComplete(()=>{var m;s(this,qi)&&((m=s(this,Xe).call(this))==null||m.renderer.getTweenGroup().remove(s(this,qi)))}).start()),s(this,qi).cameraAnimation=!0,(u=s(this,Xe).call(this))==null||u.renderer.getTweenGroup().add(s(this,qi)),(h=s(this,Xe).call(this))==null||h.renderer.render(),s(this,Ud)},"#animate"),Y6=l(function(e,i,n,o){let a=s3(e,n),p=i.clone(),c=s3(p,n);if(!pa(a)||!pa(c))return-1;let u=0,h;a3&&o.querySelectorAll(".debug-box").forEach(y=>y.remove());do{if(u>1e4)return-1;if(u+=20,p.position.z=u,p.updateMatrixWorld(),c.makeEmpty(),s3(p,n,c),h=a.intersectsBox(c),a3){let m=X6(a,"blue",o),y=X6(c,h?"red":"green",o);m.classList.add("debug-box"),y.classList.add("debug-box")}}while(h);return u},"#computeMinZOffsetToSeparateFirstTwoFloors"),q6=l(function(){let e=s(this,Xe).call(this);if(!e)return;let i=e.renderer,n=i.getThreeScene();if(!e.api.mapData||!n)return;let a=s(this,Dt).length>0?s(this,Dt):e.currentFloorStack.floorObjects;if(a.length<2)return;let p=i.getInternalState().geometry3DMap.get(a[0].id),c=i.getInternalState().geometry3DMap.get(a[1].id);if(!p||!c)return;if(iy(p,"group-container"),iy(c,"group-container"),a3){let h=new xt;h.setFromObject(p);let m=new xt;if(m.setFromObject(c),p.children.forEach(I=>{I instanceof de&&I.userData.debugBox&&ze(I)}),c.children.forEach(I=>{I instanceof de&&I.userData.debugBox&&ze(I)}),!pa(h)||!pa(m))return;let y=new Ur(h.max.x-h.min.x,h.max.y-h.min.y,h.max.z-h.min.z),b=new ct({color:255,transparent:!0,opacity:.5}),x=new de(y,b);x.position.set((h.min.x+h.max.x)/2,(h.min.y+h.max.y)/2,(h.min.z+h.max.z)/2),x.userData.debugBox=!0;let C=new Ur(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),v=new ct({color:"cyan",transparent:!0,opacity:.5}),S=new de(C,v);S.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),S.userData.debugBox=!0,p.add(x),c.add(S)}let u=G(this,cr,Y6).call(this,p,c,i.getThreeCamera(),i.container);if(u!==-1)return u},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),Os=new WeakMap,l(p3,"StackedMaps");var Bd=p3,Ko=new Q,W6=new ne;function s3(r,t,e=new Ax){return r.traverse(i=>{if(i instanceof de){let o=i.geometry.attributes.position;if(t.position.distanceTo(i.position)<t.near)return;for(let p=0;p<o.count;p++)Ko.fromBufferAttribute(o,p),Ko.applyMatrix4(i.matrixWorld),Ko.applyMatrix4(t.matrixWorldInverse),Ko.applyMatrix4(t.projectionMatrix),Ko.z<1&&Ko.z>0&&(W6.set(Ko.x,Ko.y),e.expandByPoint(W6))}}),e}l(s3,"projectToBox2D");function z6(r,t){let e=t.clientWidth,i=t.clientHeight;return new ne((r.x+1)*e/2,(1-r.y)*i/2)}l(z6,"ndcToScreen");function X6(r,t,e){let i=document.createElement("div");i.style.position="absolute",i.style.border="2px solid ".concat(t),i.style.pointerEvents="none";let n=z6(new ne(r.min.x,r.min.y),e),o=z6(new ne(r.max.x,r.max.y),e);i.style.left="".concat(n.x,"px"),i.style.top="".concat(o.y,"px");let a=Math.abs(o.x-n.x),p=Math.abs(o.y-n.y);return i.style.width="".concat(a,"px"),i.style.height="".concat(p,"px"),e.appendChild(i),i}l(X6,"drawProjectedBox");g();g();function QV(r,t){return"".concat(t," ").concat(r)}l(QV,"formatMessage");var u3=class u3 extends Error{constructor(t,e=dx){super(QV(t,e)),this.name="MappedinError"}};l(u3,"MappedinError");var Nt=u3;var Uc,d3=class d3{constructor(t,e,i,n){d(this,"id");d(this,"externalId");d(this,"name");d(this,"type");d(this,"floorIds");d(this,"defaultFloorId");d(this,"floorObjects",[]);d(this,"floorObjectsByElevation",new Map);d(this,"metadata");d(this,"containerId");d(this,"facade");d(this,"renderer");T(this,Uc);var a;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(a=t.floors)!=null?a:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=i;let o=i.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=o.id.toString(),this.facade=n}get defaultFloor(){if(s(this,Uc)==null){if(this.floorObjects.length===0)throw new Nt("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),P(this,Uc,t)}return s(this,Uc)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){L.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(n=>{this.renderer.setState(n.spaceId,{visible:t})})}};Uc=new WeakMap,l(d3,"FloorStackObject");var Hd=d3;g();function $6(r,t,e,i){let n={outdoorOpacity:1,floorStates:[]},o=r.sort((h,m)=>h.elevation-m.elevation),a=Math.min(0,o[0].elevation),p=o[o.length-1].elevation,c,u;for(let h=a;h<=p;h++){let m=o.find(v=>v.elevation===h);if(m==null){h>=0&&(c==null?c=h:u=h);continue}let y=0,b=h<0?Math.abs(m.elevation)*e:e,x=!1;if(c===0&&u!=null){let v=e*u;y=-v,b=v,x=!0}else if(c!=null&&u!=null){let v=c,S=r.find(w=>w.elevation===v-1),I=n.floorStates.find(w=>w.floor===S);if(I){let w=e*(u-c+2);I.state.footprint={...I.state.footprint,altitude:0,height:w,visible:!0}}}c=void 0,u=void 0;let C={floor:m,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};n.floorStates.push(C),m.id===t.id?(C.state.visible=!0,C.state.geometry.visible=!0,C.state.labels.enabled=!0,C.state.markers.enabled=!0,C.state.occlusion.enabled=!0,(m.elevation<0||x)&&(m.elevation<0&&(n.outdoorOpacity=.2),C.state.footprint.height=b,C.state.footprint.altitude=y,C.state.footprint.visible=!0)):i.includes(m.id)&&m.elevation<t.elevation?(C.state.visible=!0,C.state.geometry.visible=!0,C.state.markers.enabled=!0,C.state.occlusion.enabled=!0,C.state.footprint.visible=!0,m.elevation<0?(C.state.footprint.height=b,C.state.footprint.altitude=y,n.outdoorOpacity=.2):(C.state.footprint.height=b,C.state.footprint.altitude=y)):t.elevation>0&&m.elevation<t.elevation&&m.elevation>=0&&(C.state.visible=!0,C.state.footprint.visible=!0,C.state.footprint.height=e,C.state.footprint.altitude=y)}return n}l($6,"getVisiblityState");var ej={linear:rt.Linear.None,easeIn:rt.Quadratic.In,easeOut:rt.Quadratic.Out,easeInOut:rt.Quadratic.InOut},$i,m3=class m3 extends ae{constructor(e,i,n,o){var u,h,m,y;super();d(this,"floorStacksById",new Map);d(this,"floorsById",new Map);d(this,"currentFloorId","");d(this,"currentFloorStackId","");d(this,"outdoorFloorStacks",new Set);d(this,"id");d(this,"renderer");d(this,"api");d(this,"mvf");d(this,"options",{});d(this,"styleMap");d(this,"StackedMaps");d(this,"animations",new Map);d(this,"Models",{add:l((e,i,n)=>{let{floorId:o,scale:a,...p}=n,c=o?this.floorsById.get(o):this.currentFloor,u={...p};a!=null&&(u.scale=Array.isArray(n.scale)?n.scale:[n.scale,n.scale,n.scale]);let h=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(m=>{var y;return{type:"Feature",properties:{id:De(),rotation:n.rotation,scale:u.scale,interactive:n.interactive,verticalOffset:m.verticalOffset+((y=n.verticalOffset)!=null?y:0)},geometry:{type:"Point",coordinates:Rr(m)}}})},u,{parent:c.id});if(h==null)throw new Nt("error creating model");return this.renderer.getState(h).children},"add"),remove:l((e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)},"remove")});d(this,"Images",{add:l((e,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...p}=n,c=o?this.floorsById.get(o):this.currentFloor,u={type:"Feature",properties:p,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(De(),u,{url:i,flipImageToFaceCamera:a!=null?a:!1},c.id)},"add"),remove:l(e=>{this.renderer.remove(e)},"remove"),removeAll:l(()=>{},"removeAll")});d(this,"Markers",{add:l((e,i,n)=>{let o=f3(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:a,...p}=n,c=p;p.rank==="initial"&&(c.rank="medium");let u=o.layers.get(Li),h=this.renderer.addMarker2D(Rr(e),i,{...c,occluderId:o==null?void 0:o.occluderId,attachTo:a},u==null?void 0:u.containerId);if(!h)throw new Nt("Failed to create Marker");return h},"add"),remove:l(e=>{this.renderer.remove(e)},"remove"),getContentEl:l(e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},"getContentEl"),removeAll:l(()=>{},"removeAll"),setPosition:l((e,i,n)=>{var p;let o=this.renderer.getState(e),a=n?this.floorsById.get(n):this.currentFloor;if(!o){L.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(o.type!=="marker"){L.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:(p=a==null?void 0:a.layers.get(Li))==null?void 0:p.containerId})},"setPosition"),animateTo:l((e,i,n,o)=>{let a=this.renderer.getState(e),p=n?this.floorsById.get(n):this.currentFloor;if(!a)return L.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(a.type!=="marker")return L.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(e);let u=new ar({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},c.duration).easing(ej[c.easing]).onUpdate(({lon:h,lat:m})=>{var b;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let x=(b=p==null?void 0:p.layers.get(Li))==null?void 0:b.containerId;x&&this.Markers.setPosition(e,[h,m],x)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(e,u),h3(u).then(()=>{this.animations.delete(e)})},"animateTo")});d(this,"Exporter",{getCurrentSceneGLTF:l(async e=>this.renderer.getCurrentSceneGLTF(e),"getCurrentSceneGLTF")});d(this,"Shapes",{add:l((e,i,n)=>{let o=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,a=De();return this.renderer.addGeometryGroup(a,e,i,o.id),a},"add"),remove:l(e=>(this.renderer.remove(e.id),e.id),"remove")});d(this,"Text3D",{label:l((e,i,n)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){L.warn("Enterprise mode is not enabled, skipping label creation");return}let o=J6(this.renderer,e,i,n);if(o)return{textInfo:o,target:e}},"label"),labelAll:l((e={})=>{var o;if(!((o=this.api.getMapDataInternal())!=null&&o.enterpriseMode))return L.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let n=[];return i.getByType("space").forEach(a=>{var p,c;if(a.locations[0]){let u=J6(this.renderer,a,(c=(p=a.locations[0])==null?void 0:p.name)!=null?c:a.name,e);u&&n.push({textInfo:u,target:a})}}),n},"labelAll"),remove:l(e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){L.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e},"remove")});d(this,"Labels",{all:l(({onCreate:e,labelOptions:i={}})=>{for(let n of Object.entries(this.mvf.space)){let[o,a]=n;a&&a.features.forEach(p=>{var C,v,S,I,w;let c=(C=this.api.getMapData())==null?void 0:C.getById("space",p.properties.id);if(!c)return;let u=(v=this.styleMap[p.properties.id])==null?void 0:v.showImage,h=(S=p.properties.details)==null?void 0:S.images,y={marker:{...u&&((I=h==null?void 0:h[0])!=null&&I.url)?{icon:h[0].url}:{},...(w=i.appearance)==null?void 0:w.marker},...i.appearance},x=(o?this.floorsById.get(o):this.currentFloor).layers.get(bn);if(p.properties.center&&c.name!==""){let E=this.renderer.addLabel2D(p.properties.center,c.name,{id:p.properties.id+"-label",...i,appearance:y,rank:i.rank,attachTo:Nc(c)},ut.is(c)?c.id:x==null?void 0:x.containerId);E&&e(E.id,c.name,c)}})}},"all"),add:l((e,i,n={})=>{let{attachTo:o,...a}=n,p=f3(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=p.layers.get(bn),u=this.renderer.addLabel2D(Rr(e),i,{...a,occluderId:p.occluderId,attachTo:o},c==null?void 0:c.containerId);if(!u)throw new Nt("label creating failed");return u},"add"),remove:l(({entityId:e})=>{this.renderer.remove(e)},"remove"),removeAll:l(()=>{},"removeAll")});d(this,"Paths",{add:l((e,i)=>{var u;let n=(u=i==null?void 0:i.animateDrawing)!=null?u:!0,o=[],a=e[0].floorId||"root",p=0;for(let h of e){let{floorId:m="root",latitude:y,longitude:b}=h;m!==a&&(p++,a=m),o[p]==null&&o.push({floorId:m,coordinates:[]});let x=m===h.floorId?h:new se({longitude:b,latitude:y,floorId:m});o[p].coordinates.push(x)}let c=o.reduce((h,{floorId:m,coordinates:y},b)=>{if(b!==0){let C=o[b-1],v=C.coordinates[C.coordinates.length-1],S=y[0],I=Rr(v),w=Rr(S),E=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:C.floorId},geometry:{type:"Point",coordinates:I}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:w}}]},i,this.id);E&&(i!=null&&i.animateDrawing&&this.renderer.setState(E.id,{completeFraction:0}),h.push({...E,coordinates:[v,S]}))}let x=this.renderer.addPath({type:"FeatureCollection",features:y.map(C=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:Rr(C)}}))},i,m);return x&&(i!=null&&i.animateDrawing&&this.renderer.setState(x.id,{completeFraction:0}),h.push({...x,coordinates:y})),h},[]);if(n){let h=[],m=this.api.getMapData();return c.forEach(y=>{var x;let b=Q6(y,m,this.api);h.push(new ar({fraction:0}).to({fraction:1},b===!1?0:(x=i==null?void 0:i.drawDuration)!=null?x:1500).onUpdate(C=>{this.renderer.setState(y.id,{completeFraction:C.fraction})}))}),h.forEach((y,b)=>{b<h.length-1&&y.chain(h[b+1]),this.renderer.getTweenGroup().add(y)}),h[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),h[0]),{paths:c,animation:h3(h[h.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},"add"),remove:l(e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})},"remove")});T(this,$i,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=o.core,this.api=o,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=n!=null?n:{},this.StackedMaps=new Bd({currentMapGetter:l(()=>this,"currentMapGetter")}),this.mvf=(u=i==null?void 0:i.mvf)!=null?u:{};let a=K6(this.mvf["styles.json"]||{});if(this.styleMap=a,P(this,$i,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...n==null?void 0:n.multiFloorView}),!i){this.id!=="outdoors-container"&&L.warn("Map (".concat(this.id,") created with no data."));let b=new Hd({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(b.id,b),this.currentFloorStackId=b.id;let x=new Fd(b.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,s(this,$i),n!=null?n:{});b.addFloor(x),this.floorsById.set(x.id,x),this.setFloor(x.id);return}let p=i.getMVFFeatureByType("floor-stack");if(p==null||p.length===0)throw new Nt("MVF does not contain any Floor Stacks.");for(let b of p){let x=new Hd(b,this.id,this.renderer,(h=this.mvf.facade)==null?void 0:h[b.id]);if(x.floorIds.length!==0){for(let C of x.floorIds){let v=i.getMVFFeatureById("floor",C);if(v!=null){let S=this.mvf.space[v.id],I=this.mvf.obstruction[v.id];if((S==null||S.features.length===0)&&(I==null||I.features.length===0))continue;let w=new Fd(x.id,v,this.renderer,s(this,$i),n!=null?n:{},this.mvf,a,i);x.addFloor(w),this.floorsById.set(w.id,w)}}this.floorStacksById.set(b.id,x),this.currentFloorStackId||(this.currentFloorStackId=b.id)}}for(let[b]of Object.entries(i.facadesBySpaceId)){let x=i.getById("space",b);x&&(this.outdoorFloorStacks.add(x.floor.floorStack.id),(m=this.floorsById.get(x.floor.id))==null||m.setVisible(!0))}let c=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(n!=null&&n.initialFloor){let b=vp(n.initialFloor);b&&this.floorsById.has(b)?c=b:L.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.setFloor(c)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);if(!e)throw new Nt('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return e}setFloorStack(e,i){if(this.currentFloorStackId===e)return;let n=this.floorStacksById.get(e);if(n==null){L.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(n.floorObjects.length===0){L.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(n.defaultFloor.id,i)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);if(!e)throw new Nt('Floor with id "'.concat(this.currentFloorId,'" not found'));return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var o,a,p,c,u;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let i=this.floorsById.get(e),n=this.floorStacksById.get(this.currentFloorStackId);if(i&&n)if(!((o=s(this,$i))!=null&&o.enabled)||i.floorStackId!==(n==null?void 0:n.id))for(let h of this.floorStacksById.values())h.floorObjects.forEach(m=>{m.id!==e&&m.setVisible(!1)});else{let h=$6(this.currentFloorStack.floorObjects,i,s(this,$i).floorHeight,((p=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:p.map(m=>m.id))||[]);(u=(c=this.api)==null?void 0:c.Outdoor)==null||u.setOpacity(h.outdoorOpacity),h.floorStates.forEach(m=>{m.floor&&this.api.updateState(m.floor.id,m.state)}),s(this,$i).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*s(this,$i).floorHeight)}}setFloor(e,i){if(this.currentFloorId===e)return;if(!this.floorsById.get(e)){L.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let o=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:o,floorId:e,reason:i}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(e),this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id,previousFloorId:o})}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};$i=new WeakMap,l(m3,"GeojsonApiMapObject");var Wd=m3;function J6(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}l(J6,"labelSpace");g();var di,Xd,g3=class g3{constructor({currentMapGetter:t}){T(this,di,new Map);T(this,Xd);P(this,Xd,t)}get currentMap(){return s(this,Xd).call(this)}getById(t){return s(this,di).get(t)}add(t,e,i){let n=t.anchorTarget;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,attachTo:Nc(t)});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 Vn(a.id.toString(),p,t);return s(this,di).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var i;let e=s(this,di).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),s(this,di).delete(t.id.toString()))}removeAll(){let t=[];return s(this,di).forEach(({marker:e})=>{this.remove(e),t.push(e),s(this,di).delete(e.id.toString())}),t}setPosition(t,e){var a;let i=e.anchorTarget;if(!i){L.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){L.error("Cannot determine the current map.");return}let o=s(this,di).get(t.id);if(!o){L.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}n.Markers.setPosition(o.entityId,Rr(i),(a=i.floorId)!=null?a:n.currentFloorId),o.marker.updateTarget(e)}animateTo(t,e,i){var p;let n=e.anchorTarget;if(!n)return L.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return L.error("Cannot determine the current map."),Promise.resolve();let a=s(this,di).get(t.id);return a?(a.marker.updateTarget(e),o.Markers.animateTo(a.entityId,Rr(n),(p=n.floorId)!=null?p:o.currentFloorId,i)):(L.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};di=new WeakMap,Xd=new WeakMap,l(g3,"Markers");var zd=g3;g();var Zn,Yd,y3=class y3{constructor({currentMapGetter:t}){T(this,Zn,new Map);T(this,Yd);P(this,Yd,t)}get currentMap(){return s(this,Yd).call(this)}getById(t){return s(this,Zn).get(t)}add(t,e,i){var c;let n=t.anchorTarget;if(!n)throw new Error("Target does not implement IAnchorable.");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Images.add(Rr(n),e,{...i,floorId:n.floorId,verticalOffset:n.verticalOffset+((c=i.verticalOffset)!=null?c:0)});if(!a)throw new Error("image component should exist");let p=new Td(a.id.toString(),e,t);return s(this,Zn).set(p.id,{image:p,entityId:a.id.toString()}),p}remove(t){var i;let e=s(this,Zn).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),s(this,Zn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Zn).forEach(({image:e})=>{this.remove(e),t.push(e),s(this,Zn).delete(e.id.toString())}),t}};Zn=new WeakMap,Yd=new WeakMap,l(y3,"Images");var Zd=y3;g();var Ji,$d,b3=class b3{constructor({currentMapGetter:t}){T(this,Ji,new Map);T(this,$d);P(this,$d,t)}get currentMap(){return s(this,$d).call(this)}getById(t){return s(this,Ji).get(t)}add(t,e,i){let n=[t],o=n.reduce((c,u)=>{var h;return u?(c.has(u.floorId)||c.set(u.floorId,[]),(h=c.get(u.floorId))==null||h.push(u),c):(L.error("Cannot determine coordinate from options."),c)},new Map);if(!n.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let p=[];return o.forEach((c,u)=>{let h=De();a.Models.add(h,c,{...i,url:e,floorId:u}).forEach(({id:y})=>{let b=new Ms(y.toString(),h,c[0]);s(this,Ji).set(b.id,{model:b,entityId:y.toString(),groupId:h}),p.push(b)})}),p[0]}remove(t){var i;let e=s(this,Ji).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),s(this,Ji).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Ji).forEach(({model:e})=>{var n;let i=s(this,Ji).get(e.id);i&&(t.push(e),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),s(this,Ji).delete(e.id.toString()))}),t}};Ji=new WeakMap,$d=new WeakMap,l(b3,"Models");var qd=b3;g();var Ki,Kd,v3=class v3{constructor({currentMapGetter:t}){T(this,Ki,new Map);T(this,Kd);P(this,Kd,t)}get currentMap(){return s(this,Kd).call(this)}getById(t){return s(this,Ki).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=n.paths.map(p=>p.id.toString()),a=new si(De(),n.animation,t,n.paths);for(let p of o)s(this,Ki).set(p,{path:a,entityIds:o});return s(this,Ki).set(a.id,{path:a,entityIds:o}),a}remove(t){var i;let e=s(this,Ki).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),s(this,Ki).delete(t.id),e.entityIds.forEach(n=>s(this,Ki).delete(n)))}removeAll(){let t=[];return s(this,Ki).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Ki=new WeakMap,Kd=new WeakMap,l(v3,"Paths");var Jd=v3;g();var u9=la(iv(),1);g();var x3="#2266ff",tj="#808080",e9="#f5f5f5";var t9={radius:10,color:x3,inactiveColor:tj,heading:{color:x3,opacity:.7},accuracyRing:{color:x3,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};g();var r9="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";g();var i9=l((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 vi;p.moveTo(-n*Math.sin(r/2),n*Math.cos(r/2)-i);for(let c=0;c<a;c++)p.lineTo(-(o*Math.sin(r/2-r/a*c)),o*Math.cos(r/2-r/a*c)-i);for(let c=0;c<a;c++)p.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/a*c)),e*Math.cos(Math.PI/-2+Math.PI/a*c));return new xi(p,{depth:.1,bevelEnabled:!1,UVGenerator:ij(t)})},"createSectorGeometry"),C3=l((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 ne(0,n)},"generateRadialUV"),ij=l(r=>({generateTopUV:l((t,e,i,n,o)=>{let a=e[i*3],p=e[i*3+1],c=e[n*3],u=e[n*3+1],h=e[o*3],m=e[o*3+1];return[C3(a,p,r),C3(c,u,r),C3(h,m,r)]},"generateTopUV"),generateSideWallUV:l(()=>[new ne(0,1),new ne(0,1),new ne(0,1),new ne(0,1)],"generateSideWallUV")}),"radialUVGenerator");function n9(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}l(n9,"getPositionWithOverrides");function nj([r,t],[e,i],[n,o]){let a=e-r,p=i-t,c=a**2+p**2;if(c===0)return;let u=((n-r)*a+(o-t)*p)/c,h;u<=0?h=[r,t]:u>=1?h=[e,i]:h=[r+u*a,t+u*p];let m=_h([n,o],h);return{proportion:Math.max(0,Math.min(1,u)),intersection:h,distance:m}}l(nj,"getPointLineIntersection");function o9(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,i,n=0,o=0;for(let a=0;a<r.length-1;a++){let p=r[a],c=r[a+1],u=nj(p,c,t);u!=null&&u.distance<e&&(e=u.distance,i=u.intersection,n=a,o=u.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:n,proportion:o}}l(o9,"findBlueDotOnPath");function a9(r,t){let e=new Wr({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=i9(Math.PI/6,n,i);new zs().load(r9,p=>{e.alphaMap=p,e.needsUpdate=!0});let a=new de(o,e);return a.position.z=-.05,a.renderOrder=0,a}l(a9,"createHeadingCone");function s9(r,t){let e=new wh(1,1,.05,32),i=new Wr({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),n=new de(e,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}l(s9,"createAccuracyRing");function l9(r){let t=new wh(.35,.35,.07,32),e=new Wr({transparent:!0,color:e9,depthTest:!1,depthWrite:!1}),i=new de(t,e);i.renderOrder=2;let n=new wh(.35*.8,.35*.8,.01,32),o=new Wr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new de(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}}l(l9,"createBlueDot");var d9=la(c9(),1);var Vg="blue-dot",_s,Yn,Sr,Tr,qn,Ls,ks,As,it,pr,Qd,$n,eh,th,rh,ih,Ng,Qi,Jn,Gg,Fs,nh,en,S3=class S3 extends ae{constructor(e,i){super();this.core=e;this.geoJSONApi=i;T(this,_s,null);d(this,"geometry");T(this,Yn);T(this,Sr);T(this,Tr);T(this,qn);T(this,Ls);T(this,ks);T(this,As);T(this,it,t9);T(this,pr,1);T(this,Qd);T(this,$n);d(this,"state","disabled");d(this,"following",!1);T(this,eh,l(e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)},"#getFloorByFloorId"));T(this,th,l(e=>{var n;let i;if(e!=null){let o=(n=this.geoJSONApi.currentMap)==null?void 0:n.currentFloorStack.floorObjectsByElevation.get(e);i=o?s(this,eh).call(this,o.id):void 0}return i},"#getFloorByFloorLevel"));T(this,rh,l(e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,n,o,a]=e.children;if(s(this,Ng).call(this),n.scale.set(s(this,pr),s(this,pr),s(this,pr)),n.position.z=.07/2*s(this,pr),o.scale.set(s(this,pr),s(this,pr),s(this,pr)),o.position.z=.07*s(this,pr),this.state==="active"){o.material.color.set(s(this,it).color);let p=this.accuracy;p!=null?(i.visible=!0,s(this,ks)&&s(this,ks).stop(),P(this,ks,new ar({scale:i.scale.x}).to({scale:p/2},150).onUpdate(({scale:u})=>{i.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(s(this,ks))):i.visible=!1;let c=this.heading;if(c!=null){a.visible=!0,s(this,As)&&s(this,As).stop();let{start:u,end:h}=Lh(a.rotation.z,-ye.degToRad(c));P(this,As,new ar({rotation:u}).to({rotation:h},150).onUpdate(({rotation:m})=>{a.rotation.z=m}).start()),this.core.getTweenGroup().add(s(this,As)),a.scale.set(s(this,pr),s(this,pr),1)}else a.visible=!1}else this.state==="inactive"&&(o.material.color.set(s(this,it).inactiveColor),a.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));T(this,ih,l(e=>{var a,p;let i;try{i=cj.parse(n9(e,s(this,Sr)))}catch(c){s(this,Qi).call(this,"error"),L.error("BlueDot: Position parse failed",c instanceof O.ZodError?c.message:String(c)),this.publish("error");return}s(this,it).debug&&L.log("BlueDot: Parsed position",i),P(this,Tr,i),s(this,Qi).call(this,"position-update"),s(this,qn)&&clearTimeout(s(this,qn)),typeof s(this,it).timeout=="number"&&s(this,it).timeout<1/0&&P(this,qn,setTimeout(()=>{s(this,it).debug&&L.log("BlueDot: Position timed out after ".concat(s(this,it).timeout,"ms")),s(this,Qi).call(this,"timeout"),this.core.render()},s(this,it).timeout)),(p=this.geoJSONApi.getMapDataInternal())==null||p.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(a=i.floor)==null?void 0:a.elevation,accuracy:i.accuracy}});let n=i.floor!=null?i.floor.id:"outdoors-container",o=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(Vg,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:o}},{setup:l(c=>{let u=s9(s(this,it).accuracyRing.color,s(this,it).accuracyRing.opacity),{outerMesh:h,innerMesh:m}=l9(s(this,it).color),y=a9(s(this,it).heading.color,s(this,it).heading.opacity);c.add(u),u.visible=!1,c.add(h),c.add(m),c.add(y),y.visible=!1,s(this,rh).call(this,c)},"setup"),update:s(this,rh)},{visible:!0,interactive:!0},n);else{let c=this.core.getState(this.geometry);o=[c.position[0],c.position[1]]}s(this,Ls)&&s(this,Ls).stop(),P(this,Ls,new ar(o).to([i.longitude,i.latitude],1e3).easing(rt.Cubic.Out).onUpdate(c=>{if(this.geometry){let u={position:[c[0],c[1]]};u.parent=n,this.core.setState(this.geometry,u)}}).start()),this.core.getTweenGroup().add(s(this,Ls)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));d(this,"onPositionUpdate",l(e=>{var i,n,o,a,p;if(this.state!=="disabled"){try{lj.parse(e)}catch(c){s(this,Qi).call(this,"error"),L.error("BlueDot: Browser sent invalid position",c instanceof O.ZodError?c.message:String(c)),this.publish("error");return}P(this,Yn,{latitude:(i=e.coords)==null?void 0:i.latitude,longitude:(n=e.coords)==null?void 0:n.longitude,accuracy:(o=e.coords)==null?void 0:o.accuracy,heading:(a=e.coords)==null?void 0:a.heading,floor:s(this,th).call(this,(p=e.coords)==null?void 0:p.floorLevel)}),s(this,ih).call(this,s(this,Yn))}},"onPositionUpdate"));d(this,"onPositionError",l(e=>{var i;switch(s(this,Qi).call(this,"error"),e.code){case e.PERMISSION_DENIED:L.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:L.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:L.error("Geolocation request timed out.",e);break;default:L.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)},"onPositionError"));T(this,Ng,l(()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==s(this,Qd)){P(this,Qd,e);let n=(i=this.core.getMetresPerPixel())!=null?i:1;P(this,pr,Math.max(s(this,it).radius/(.35/n),1))}},"#updateScale"));T(this,Qi,l(e=>{let i=sj[this.state].actions[e];if(i){switch(s(this,it).debug&&L.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(e)),i){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==i&&(this.publish("state-change",{state:i,action:e}),this.state=i)}else L.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))},"#transitionAction"));T(this,Jn);T(this,Gg,l(()=>{if(s(this,Jn)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(n=>n.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(n=>n.floorId===this.geoJSONApi.currentFloor.id);P(this,Jn,(0,d9.default)(i.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,Jn)},"#getSimplifiedDirections"));T(this,Fs,l(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),s(this,en)&&(this.off("position-update",s(this,en)),P(this,en,void 0)),this.following=!1,P(this,Jn,void 0),this.core.off("user-interaction-start",s(this,Fs)),this.geoJSONApi.currentMap.off("navigation-active-path-change",s(this,nh)),this.publish("follow-change",{following:!1})},"#cancelFollow"));T(this,nh,l(()=>{P(this,Jn,void 0)},"#pathChangeHandler"));T(this,en);d(this,"follow",l((e,i)=>{var o,a,p,c;if(e===!1){s(this,Fs).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&L.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(o=i==null?void 0:i.zoomLevel)!=null?o:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(a=i==null?void 0:i.pitch)!=null?a:45,duration:(p=i==null?void 0:i.duration)!=null?p:1e3,easing:(c=i==null?void 0:i.easing)!=null?c:"ease-in-out"};this.following?s(this,en)&&this.off("position-update",s(this,en)):(this.following=!0,this.core.on("user-interaction-start",s(this,Fs)),this.geoJSONApi.currentMap.on("navigation-active-path-change",s(this,nh))),P(this,en,u=>{let{coordinate:h,heading:m,floor:y}=u;if(n.center=[h.longitude,h.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),P(this,Jn,void 0)),e==="position-and-heading")n.bearing=m!=null?m:void 0;else if(e==="position-and-path-direction"){let b=s(this,Gg).call(this);if(b!=null){let x=o9(b,[h.longitude,h.latitude]);if(x!=null){let C=b[x.segmentIndex],v=b[x.segmentIndex+1];n.bearing=Nx(C,v)}}}this.core.camera.animateTo(n)}),this.on("position-update",s(this,en)),this.publish("follow-change",{following:!0,mode:e})},"follow"))}get heading(){var e;return(e=s(this,Tr))==null?void 0:e.heading}get accuracy(){var e;return(e=s(this,Tr))==null?void 0:e.accuracy}get coordinate(){var e,i;if(s(this,Tr)!=null)return(s(this,$n)==null||((e=this.floor)==null?void 0:e.id)!==s(this,$n).floorId||s(this,Tr).latitude!==s(this,$n).latitude||s(this,Tr).longitude!==s(this,$n).longitude)&&P(this,$n,new se(s(this,Tr).latitude,s(this,Tr).longitude,(i=this.floor)==null?void 0:i.id)),s(this,$n)}get floor(){var e;return(e=s(this,Tr))==null?void 0:e.floor}enable(e){P(this,it,(0,u9.default)({},e,s(this,it))),s(this,Qi).call(this,"enable"),this.watchDevicePosition(s(this,it).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),s(this,qn)&&(clearTimeout(s(this,qn)),P(this,qn,void 0)),this.following&&s(this,Fs).call(this),this.watchDevicePosition(!1),P(this,Tr,void 0),P(this,Sr,void 0),s(this,Qi).call(this,"disable")}watchDevicePosition(e){if(s(this,_s)&&(navigator.geolocation.clearWatch(s(this,_s)),P(this,_s,null)),s(this,Yn)&&P(this,Yn,void 0),e){if(this.state==="disabled"){L.warn("BlueDot must be enabled before watching browser position.");return}P(this,_s,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var n,o;e==null?P(this,Sr,void 0):"coords"in e?P(this,Sr,Object.assign({},s(this,Sr),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:s(this,th).call(this,e.coords.floorLevel)})):(P(this,Sr,Object.assign({},s(this,Sr),e)),"floorOrFloorId"in e&&(s(this,Sr).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?s(this,eh).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((n=s(this,Sr))==null?void 0:n.latitude)!=null&&((o=s(this,Sr))==null?void 0:o.longitude)!=null||s(this,Yn)!=null)&&s(this,ih).call(this,s(this,Yn))}};_s=new WeakMap,Yn=new WeakMap,Sr=new WeakMap,Tr=new WeakMap,qn=new WeakMap,Ls=new WeakMap,ks=new WeakMap,As=new WeakMap,it=new WeakMap,pr=new WeakMap,Qd=new WeakMap,$n=new WeakMap,eh=new WeakMap,th=new WeakMap,rh=new WeakMap,ih=new WeakMap,Ng=new WeakMap,Qi=new WeakMap,Jn=new WeakMap,Gg=new WeakMap,Fs=new WeakMap,nh=new WeakMap,en=new WeakMap,l(S3,"BlueDot");var Wc=S3,sj={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},lj=O.object({coords:O.object({latitude:O.number(),longitude:O.number(),accuracy:O.number(),altitude:O.number().optional().nullable(),altitudeAccuracy:O.number().optional().nullable(),heading:O.number().optional().nullable(),speed:O.number().optional().nullable(),floorLevel:O.number().optional().nullable()}),timestamp:O.number()}),cj=O.object({latitude:O.number(),longitude:O.number(),floor:O.custom().optional(),accuracy:O.number().optional(),heading:O.number().optional().nullable()});g();var Kn,ah,T3=class T3{constructor({currentMapGetter:t}){T(this,Kn,new Map);T(this,ah);P(this,ah,t)}get currentMap(){return s(this,ah).call(this)}getById(t){return s(this,Kn).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 Yo(o);return s(this,Kn).set(a.id,a),a}remove(t){var i;s(this,Kn).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),s(this,Kn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Kn).forEach(e=>{this.remove(e),t.push(e.id),s(this,Kn).delete(e.id.toString())}),t}};Kn=new WeakMap,ah=new WeakMap,l(T3,"Shapes");var oh=T3;g();var lh,M3=class M3{constructor({currentMapGetter:t}){T(this,lh);P(this,lh,t)}get currentMap(){return s(this,lh).call(this)}setFromStyleCollection(t){var e,i,n,o;for(let a in t)for(let p of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[a]==null||!p.layers.has(tt))continue;let c=p.layers.get(tt);if(c!=null&&c.layers.has(a)&&"color"in t[a]){let m=c.layers.get(a);m&&((i=this.currentMap)==null||i.renderer.setState(m,{color:t[a].color}))}if(c&&a===mo&&!(_i in t)){let m=c.layers.get(_i);m&&"color"in t[a]&&((n=this.currentMap)==null||n.renderer.setState(m,{color:t[a].color}))}if(!p.layers.has(Ta))continue;let u=p.layers.get(Ta),h=p.facadesByStyleId.get(a);if(h&&h.length>0)for(let m of h){let y=u.layers.get("".concat(m,"-").concat(a));y&&"color"in t[a]&&((o=this.currentMap)==null||o.renderer.setState(y,{color:t[a].color}))}}}};lh=new WeakMap,l(M3,"Style");var sh=M3;g();var I3={opacity:1},Gt,ch,ph,ra,Qn,Bs,P3,h9,w3=class w3{constructor(t,e){T(this,Bs);T(this,Gt);T(this,ch,[]);T(this,ph,{opacity:"initial"});T(this,ra,{opacity:new Map});T(this,Qn,new Set);P(this,Gt,t),P(this,ch,e||[]);let i=s(this,Gt).map;i&&i.on("idle",()=>{s(this,ra).opacity.size||G(this,Bs,P3).call(this,i)})}setStyle(t){var e,i;if(s(this,Gt).map){(e=s(this,Gt).map)==null||e.setStyle(t),s(this,Qn).size&&(s(this,Qn).clear(),this.hide()),G(this,Bs,h9).call(this),G(this,Bs,P3).call(this,s(this,Gt).map),this.setOpacity(s(this,ph).opacity),(i=s(this,Gt).map)==null||i.moveLayer(sy);for(let[n,o,a]of s(this,ch)||[])s(this,Gt).hideOutdoorLayersIntersectingPolygons(n,o,a)}}get map(){return s(this,Gt).map}get enabled(){return!!s(this,Gt).map}get visible(){return s(this,Qn).size===0}show(){let t=s(this,Gt).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{s(this,Qn).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),s(this,Qn).clear())}hide(t=[]){let e=s(this,Gt).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"),s(this,Qn).add(n.id))})}setOpacity(t,e=[]){var o,a;let i=s(this,Gt).map;if(!i)return;let n=(a=(o=s(this,Gt).map)==null?void 0:o.getStyle())==null?void 0:a.layers;n&&i.once("idle",()=>{n.forEach(p=>{let c=i.getLayoutProperty(p.id,"visibility");if(!e.includes(p.id)&&c!=="none")try{let u=s(this,ra).opacity.get(p.id);u!==void 0&&(p.id==="background"||(p.type==="symbol"?(i.setPaintProperty(p.id,"icon-opacity",t==="initial"?u[0]:t),i.setPaintProperty(p.id,"text-opacity",t==="initial"?u[1]:t)):i.setPaintProperty(p.id,"".concat(p.type,"-opacity"),t==="initial"?u[0]:t)),s(this,ph).opacity=t)}catch(u){L.warn("Error setting opacity:",u)}})})}};Gt=new WeakMap,ch=new WeakMap,ph=new WeakMap,ra=new WeakMap,Qn=new WeakMap,Bs=new WeakSet,P3=l(function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var o,a,p;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?s(this,ra).opacity.set(i.id,[(o=t.getPaintProperty(i.id,"icon-opacity"))!=null?o:I3.opacity,(a=t.getPaintProperty(i.id,"text-opacity"))!=null?a:I3.opacity]):s(this,ra).opacity.set(i.id,[(p=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?p:I3.opacity,void 0])))})},"#setInitialStyle"),h9=l(function(){Object.values(s(this,ra)).forEach(t=>t.clear())},"#clearInitialStyle"),l(w3,"Outdoor");var zc=w3;g();function f9(){cv(!1)}l(f9,"disableText3DWorker");var eo,to,ia,E3=class E3{constructor({currentMapGetter:t}){T(this,eo);T(this,to,new Map);T(this,ia,new Map);P(this,eo,t)}labelAll(t={}){var n,o;let e=[],i=new Set;return(o=(n=s(this,eo).call(this))==null?void 0:n.Text3D.labelAll(t))==null||o.forEach(({textInfo:a,target:p})=>{let c=a.id.toString(),u=s(this,ia).get(c);if(u){i.has(c)||e.push(u.text3DView),i.add(c);return}i.add(c);let h=new qo(c,p);s(this,to).set(h.id,{targetId:p.id,text3d:c,text3DView:h}),s(this,ia).set(c,{text3DView:h}),e.push(h)}),e}label(t,e,i={}){var o;if(s(this,eo).call(this))if(ut.is(t)){let a=(o=s(this,eo).call(this))==null?void 0:o.Text3D.label(t,e,i);if(!a)return;let p=a.textInfo.id.toString(),c=s(this,ia).get(p);if(c)return c.text3DView;let u=new qo(p,a.target);return s(this,to).set(u.id,{targetId:a.target.id,text3d:p,text3DView:u}),s(this,ia).set(p,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var n;let e=typeof t=="string"?t:t.id,i=s(this,to).get(e);i&&((n=s(this,eo).call(this))==null||n.Text3D.remove(i.text3d),s(this,to).delete(e),s(this,ia).delete(i.text3d))}removeAll(){s(this,to).forEach(t=>{var e;(e=s(this,eo).call(this))==null||e.Text3D.remove(t.text3d)}),s(this,to).clear()}};eo=new WeakMap,to=new WeakMap,ia=new WeakMap,l(E3,"Text3D");var jg=E3;var Ug=.05,O3=class O3{constructor(t,e){d(this,"core");d(this,"mapObjects",[]);d(this,"id");d(this,"mapDataExternal",{});d(this,"mapsByFloorId",{});d(this,"mapData");d(this,"currentMap");d(this,"hiddenOutdoorGeometries",[]);d(this,"lastFacadeIntersected");d(this,"manualFloorVisibility",!1);d(this,"mapView");d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"Outdoor");d(this,"BlueDot");d(this,"Shapes");d(this,"Style");d(this,"Images");d(this,"update",l(()=>{this.core.render()},"update"));this.core=t,this.mapView=e,this.Camera=new Od(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new Wd("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",c=>{this.mapView.publish("facades-in-view-change",{facades:c.map(u=>{var h;return(h=this.getMapDataInternal())==null?void 0:h.facadesById[u]}).filter(u=>u!=null)})});let n=new Pd(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",n)});let o=l(c=>u=>{var R,_,F;let h=[],m=[],y=[],b=[];u.labels.forEach(B=>{let V=this.Labels.getById(B.toString());V&&h.push(V.label)}),u.markers.forEach(B=>{let V=this.Markers.getById(B.toString())||this.Navigation.getMarkerById(B.toString());V&&m.push(V.marker)}),u.models.forEach(B=>{let V=this.Models.getById(B.toString());V&&y.push(V.model)}),u.paths.forEach(B=>{let V=this.Paths.getById(B.toString())||this.Navigation.getPathById(B.toString());V&&b.push(V.path)});let x=u.geometry.includes(Vg),C=u.geometry.filter(B=>B!==Vg)[0],v;C&&(v=(R=this.getMapDataInternal())==null?void 0:R.getById("space",C)),v||(v=(_=this.getMapDataInternal())==null?void 0:_.getById("object",C));let S=u.containers.reduce((B,V)=>{var X;let N=(X=this.getMapDataInternal())==null?void 0:X.getById("floor",V);return N&&er.is(N)&&B.push(N),B},[]),I,w=0;if(S.length>0){I=S[0].id;let B=this.core.getState(I);w=u.coordinate[2]?u.coordinate[2]-B.altitude:w}let E;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(B=>{this.core.setState(B.id,{hovered:!1})}),v&&ut.is(v)&&(E=(F=this.getMapDataInternal())==null?void 0:F.facadesBySpaceId[C],E&&E.spaces.forEach(B=>{this.core.setState(B.id,{hovered:!0})})),this.lastFacadeIntersected=E;let D={coordinate:new se({latitude:u.coordinate[1],longitude:u.coordinate[0],floorId:I,verticalOffset:w}),spaces:v&&ut.is(v)?[v]:[],objects:v&&tr.is(v)?[v]:[],markers:m,labels:h,models:y,paths:b,blueDot:x,floors:S,facades:E?[E]:[]};"pointerEvent"in u&&(D.pointerEvent=u.pointerEvent),this.mapView.publish(c,D)},"createHandler");this.core.on("hover",o("hover")),this.core.on("click",o("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 a={currentMapGetter:l(()=>this.currentMap,"currentMapGetter")};this.Markers=new zd(a),this.Models=new qd(a),this.Labels=new kd(a),this.Text3D=new jg(a),this.Exporter=new Ld(a),this.Paths=new Jd(a),this.Navigation=new Ed(this.core,this,a.currentMapGetter),this.BlueDot=new Wc(this.core,this),this.BlueDot.on("position-update",c=>{this.mapView.publish("blue-dot-position-update",c)}),this.BlueDot.on("state-change",c=>{this.mapView.publish("blue-dot-state-change",c)}),this.BlueDot.on("error",c=>{this.mapView.publish("blue-dot-error",c)}),this.BlueDot.on("follow-change",c=>{this.mapView.publish("blue-dot-follow-change",c)}),this.Outdoor=new zc(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 Zd(a),this.Shapes=new oh(a),this.Style=new sh(a);let p=new kg(e,this.mapDataExternal);this.auto=p.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(tt);if(o){let a=o.layers.get(mo);a&&this.core.setState(a,D3(e,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(tt);if(o){let a=o.layers.get(_i);a&&this.core.setState(a,D3(e,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(tt);if(o){let a=o.layers.get(ul);a&&this.core.setState(a,Hg(e,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(tt);if(o){let a=o.layers.get(dl);a&&this.core.setState(a,Hg(e,this.core.getState(a)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(Xo.is(i))return this.core.setState(i.id,m9({...e,type:"label"},this.core.getState(i.id)));if(Vn.is(i))return this.core.setState(i.id,g9({...e,type:"marker"},this.core.getState(i.id)));if((ut.is(i)||tr.is(i))&&this.core.setState(i.id,y9({...e,type:"geometry"},this.core.getState(i.id))),qr.is(i)&&this.core.setState(i.id,Hg({...e,type:"doors"},this.core.getState(i.id))),Yo.is(i)&&this.core.setState(i.id,fr(e,["altitude","color","opacity"])),Ms.is(i)){let{position:n,scale:o,...a}=e,p=a;n&&(p.position=[n.longitude,n.latitude,n.verticalOffset]),o!=null&&(Array.isArray(o)?p.scale=o:p.scale=[o,o,o]),n&&i.updateTarget(n),this.core.setState(i.id,p)}if(er.is(i)){let n=this.currentMap.floorsById.get(i.id);if(n==null)return;this.core.setState(i.id,fr(e,["visible","altitude"]));let o=n.layers.get(tt);o!=null&&"geometry"in e&&this.core.setState(o.containerId,fr(e.geometry,["opacity","visible"]));let a=n.layers.get(bn);a!=null&&"labels"in e&&"enabled"in e.labels&&typeof e.labels.enabled=="boolean"&&a.setVisible(e.labels.enabled);let p=n.layers.get(Li);p!=null&&"markers"in e&&"enabled"in e.markers&&typeof e.markers.enabled=="boolean"&&p.setVisible(e.markers.enabled);let c=n.layers.get(Pp);c!=null&&"footprint"in e&&this.core.setState(c.containerId,fr(e.footprint,["visible","height","opacity","side","color","altitude"]));let u=n.layers.get(hl);u!=null&&"occlusion"in e&&"enabled"in e.occlusion&&typeof e.occlusion.enabled=="boolean"&&u.setVisible(e.occlusion.enabled)}if(Dr.is(i)){let n=this.core.getState(i.id);for(let o of n.children)o.type==="group-container"&&this.core.setState(o.id,fr(e,["opacity","visible"]))}if(qo.is(i)&&this.core.setState(i.id,fr(e,Lm)),si.is(i))for(let n of i.segments)this.core.setState(n.id,fr(e,["color","nearRadius","farRadius","visible","completeFraction"]));Lc.is(i)&&this.core.setState(i.id,fr(e,["color"]))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return zp(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var m,y,b,x;let n;try{n=zp(t)}catch(C){L.error("Error adding map",C),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 se(a[1],a[0])});let p=o["manifest.geojson"].features[0].properties.name,c=new Wd("mapObject-".concat(p),n,e,this),u=this.core.getBoundingArea(c.currentFloor.id);u==null&&L.error("Could not determine bounding box for map:",c.currentFloor.id);let h=(y=(m=e==null?void 0:e.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?y:[];if(h.length>0){let C,v=[];for(let S of c.floorStacksById.values())if(S.defaultFloor.footprint&&S.defaultFloor.footprint.geometry!=null&&((b=S.defaultFloor.footprint.geometry)==null?void 0:b.coordinates.length)>0){let I=S.defaultFloor.footprint,w=Bg(I);C==null?C=w:v9(C,w),v.push(I)}v.length>0&&C!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(C,v,h),this.hiddenOutdoorGeometries.push([C,v,h]))}if(this.mapObjects.push(c),n.getMVFFeatureByType("floor").forEach(C=>{this.mapsByFloorId[C.id]=c}),c.on("navigation-connection-click",C=>{this.mapView.publish("navigation-connection-click",C)}),c.on("navigation-active-path-change",C=>{this.mapView.publish("navigation-active-path-change",C)}),c.StackedMaps.on("stacked-maps-state-change",({state:C})=>{this.mapView.publish("stacked-maps-state-change",{state:C})}),c.on("floor-change-start",C=>{var v,S,I,w;this.mapView.publish("floor-change-start",{reason:C.reason,floor:(S=(v=this.getMapDataInternal())==null?void 0:v.getById("floor",C.floorId))!=null?S:this.currentFloor,previousFloor:(w=(I=this.getMapDataInternal())==null?void 0:I.getById("floor",C.previousFloorId))!=null?w:this.currentFloor})}),c.on("floor-change",C=>{var v,S;this.mapView.publish("floor-change",{reason:C.reason,floor:this.currentFloor,previousFloor:(S=(v=this.getMapDataInternal())==null?void 0:v.getById("floor",C.previousFloorId))!=null?S:this.currentFloor})}),this.currentMap=c,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null)this.core.camera.setZoomLevel(e.zoomLevel),i(t);else if(this.core.mode!=="outdoors-overlay"&&u){let C=(x=e==null?void 0:e.screenOffsets)!=null?x:{top:Ug*this.core.canvasHeight,left:Ug*this.core.canvasWidth,right:Ug*this.core.canvasWidth,bottom:Ug*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:dC,padding:C}).then(()=>{i(t)})}else i(t)})}setFloor(t,e){return this.currentMap.setFloor(vp(t),e)}setFloorStack(t,e){return this.currentMap.setFloorStack(vp(t),e)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Nt("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw new Nt("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw new Nt("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw new Nt("Missing currentFloor");return e}getState(t){var n,o,a,p,c,u,h,m,y,b,x,C,v,S,I,w,E,D,R,_;typeof t=="object"&&si.is(t)&&L.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let e=b9(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:F,topColor:B,texture:V,topTexture:N,visible:X,height:z,opacity:U}=i;return{type:"walls",visible:X,color:F,topColor:B,texture:V?{url:V}:void 0,topTexture:N?{url:N}:void 0,height:z,opacity:U}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:F,topColor:B,texture:V,topTexture:N,visible:X,opacity:z}=i;return{type:"doors",visible:X,color:F,topColor:B,opacity:z,texture:V?{url:V}:void 0,topTexture:N?{url:N}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0,flipImageToFaceCamera:i.flipImageToFaceCamera,topColor:i.topColor};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let F=typeof i.parent=="object"?i.parent.id:i.parent,B=this.Markers.getById(i.id.toString()),V=B!=null&&B.marker.target?B==null?void 0:B.marker.target.anchorTarget:void 0;return V==null&&(V=new se(i.position[1],i.position[0],F.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize,lowPriorityPin:i.options.lowPriorityPin}}else if(i.type==="model"){let F=i!=null&&typeof i.parent=="object"?i.parent.id.toString():(o=i.parent)==null?void 0:o.toString();return delete i.parent,{...i,position:new se({latitude:i.position[1],longitude:i.position[0],verticalOffset:i.position[2],floorId:F}),type:"model"}}else{if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&Yo.is(t)){let[F]=i.children;if(F.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(a=i.altitude)!=null?a:0,visible:i.visible,color:i.color,height:F.height,opacity:i.opacity}}else{if(i.type==="path")return{type:"path",color:i.color,visible:i.visible,nearRadius:i.nearRadius,farRadius:i.farRadius,completeFraction:i.completeFraction};if(i.type==="group-container"&&typeof t!="string"&&er.is(t)){let F=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(tt),B=F?this.core.getState(F.containerId):void 0,V=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(bn),N=(u=this.currentMap.floorsById.get(t.id))==null?void 0:u.layers.get(Li),X=(h=this.currentMap.floorsById.get(t.id))==null?void 0:h.layers.get(Pp),z=X?this.core.getState(X.containerId):void 0,U=(m=this.currentMap.floorsById.get(t.id))==null?void 0:m.layers.get(hl),te=U?this.core.getState(U.containerId):void 0;return{type:"floor",geometry:{opacity:(y=B==null?void 0:B.opacity)!=null?y:0,visible:(b=B==null?void 0:B.visible)!=null?b:!0},labels:{enabled:(x=V==null?void 0:V.visible)!=null?x:!1},markers:{enabled:(C=N==null?void 0:N.visible)!=null?C:!1},footprint:{altitude:(v=z==null?void 0:z.altitude)!=null?v:0,visible:(S=z==null?void 0:z.visible)!=null?S:!1,height:(I=z==null?void 0:z.height)!=null?I:0,opacity:(w=z==null?void 0:z.opacity)!=null?w:0,side:(E=z==null?void 0:z.side)!=null?E:"double",color:(D=z==null?void 0:z.color)!=null?D:"white"},occlusion:{enabled:(R=te==null?void 0:te.visible)!=null?R:!1},visible:i.visible,altitude:(_=i.altitude)!=null?_:0}}else if(i.type==="group-container"&&i.children.length>0&&typeof t!="string"&&Dr.is(t)){let F=this.core.getState(i.children[0].id);return{type:"facade",opacity:F.opacity,visible:F.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,e,i){var c;if(i!=null){let u=this.core.projectScreenXYToCoordinate(t,e,!0);return u?new se(u.coordinate[1],u.coordinate[0],i.id):void 0}let n=this.core.projectScreenXYToCoordinate(t,e);if(n==null||n.coordinate==null)return;let{coordinate:o,groupContainers:a}=n,p=(c=a==null?void 0:a.find(u=>{let h=u.userData.entityId.toString();return h.includes("f_")||h.includes("m_")}))==null?void 0:c.userData.entityId.toString();return new se(o[1],o[0],p)}getScreenCoordinateFromCoordinate(t){return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let e=new ar(t);return this.core.getTweenGroup().add(e),this.core.render(),e}removeTween(t){this.core.getTweenGroup().remove(t)}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};l(O3,"GeoJsonApi");var uh=O3;function x9(r){Jx("".concat(r,"/maplibre-worker.csp.js")),$b("".concat(r,"/collision-worker.csp.js"))}l(x9,"setWorkersUrl");g();g();var _3=class _3{constructor(t){d(this,"state");d(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};l(_3,"Debug");var zg=_3;g();var C9=O.object({environment:O.union([O.literal("basic"),O.literal(!1)]).optional(),text3d:O.object({hoverColor:O.string().optional()}).optional(),geometry:O.object({hoverColor:O.string().optional()}).optional(),backgroundColor:O.string().optional(),backgroundAlpha:O.number().optional()}).strict();g();var Xg=la(U0(),1);var S9=l(r=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(e=>r.startsWith(e)))return!0;let t=console.warn;return console.warn=()=>{},r==="white"||L3(r).some(e=>e<1)?!0:(console.warn=t,!1)},"isProbablyColor"),L3=l(r=>{let t=new Le(r);return[t.r,t.g,t.b]},"stringToRgbArray"),pj=l(r=>{let t=new Le;return t.setRGB(r[0],r[1],r[2],an),"#"+t.getHexString()},"rgbArrayToString"),T9=l((r,t)=>{let e=(0,Xg.default)({},r),i=(0,Xg.default)({},r,t),n=l((o,a,p)=>{for(let c in a){let u=o[c],h=a[c];if(typeof h=="number"&&typeof u=="number")o[c]=u+(h-u)*p;else if(typeof h=="string"&&typeof u=="string"){if(S9(u)&&S9(h)){let m=L3(u),y=L3(h);m&&y?o[c]=pj([m[0]+(y[0]-m[0])*p,m[1]+(y[1]-m[1])*p,m[2]+(y[2]-m[2])*p]):L.warn('Color "'.concat(c,'" could not be animated!'))}}else typeof h=="object"&&h!==null&&typeof u=="object"&&u!==null?n(u,h,p):L.warn('Value "'.concat(c,'" could not be animated!'))}},"interpolate");return o=>{if(o=Math.min(Math.max(o,0),1),o===0)return r;if(o===1)return i;let a=(0,Xg.default)({},e);return n(a,t,o),a}},"animationFactory");var dh,$,ro,k3=class k3 extends ae{constructor(e){super();T(this,dh,{});T(this,$);T(this,ro);d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Images");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"BlueDot");d(this,"Style");d(this,"Shapes");d(this,"Outdoor");d(this,"update",l(()=>{s(this,$).core.render()},"update"));d(this,"getDirections",l((e,i,n)=>{var o;return(o=s(this,$).getMapData())==null?void 0:o.getDirections(e,i,n)},"getDirections"));d(this,"getDirectionsMultiDestination",l((e,i,n)=>{var o;return(o=s(this,$).getMapData())==null?void 0:o.getDirectionsMultiDestination(e,i,n)},"getDirectionsMultiDestination"));d(this,"on",l((e,i)=>{super.on(e,i)},"on"));d(this,"off",l((e,i)=>{super.off(e,i)},"off"));d(this,"Debug");P(this,ro,e);let i=new uh(e,this);P(this,$,i),this.Camera=s(this,$).Camera,P(this,dh,s(this,$).mapDataExternal),this.Markers=s(this,$).Markers,this.Models=s(this,$).Models,this.Labels=s(this,$).Labels,this.Text3D=s(this,$).Text3D,this.Exporter=s(this,$).Exporter,this.Paths=s(this,$).Paths,this.Navigation=s(this,$).Navigation,this.BlueDot=s(this,$).BlueDot,this.Shapes=s(this,$).Shapes,this.Style=s(this,$).Style,this.auto=s(this,$).auto,this.Outdoor=s(this,$).Outdoor,this.Images=s(this,$).Images,s(this,ro).container.dataset.version=M.env.npm_package_version,this.Debug=new zg(s(this,$).core)}get StackedMaps(){return s(this,$).currentMap.StackedMaps}updateState(e,i){return s(this,$).updateState(e,i)}animateState(e,i,n){var u;let o=s(this,$).getState(e);if(o==null)return L.warn("Cannot animate state of ".concat(e,".")),new Promise(m=>m());let a=T9(o,i),p=s(this,$).tween({percent:0}).to({percent:1},(u=n==null?void 0:n.duration)!=null?u:1e3).onUpdate(({percent:h})=>{s(this,$).updateState(e,a(h))});n!=null&&n.easing&&n.easing in Rn&&p.easing(Rn[n.easing]);let c=new Promise(h=>{p.onComplete(()=>{s(this,$).removeTween(p),h()}).onStop(()=>{s(this,$).removeTween(p),h()}),p.start()});return c.cancel=()=>{p.stop(),s(this,$).updateState(e,a(0))},c}updateGlobalState(e){var i,n,o,a;try{C9.parse(e)}catch(p){L.error("updateGlobalState",p);return}if(typeof e=="object"){let p={};if((i=e.text3d)!=null&&i.hoverColor&&(p.text3dHoverColor=e.text3d.hoverColor),(n=e.geometry)!=null&&n.hoverColor&&(p.hoverColor=e.geometry.hoverColor),e.backgroundColor||e.backgroundAlpha!==void 0){let c=(o=e.backgroundColor)!=null?o:s(this,$).core.backgroundColor,u=(a=e.backgroundAlpha)!=null?a:s(this,$).core.backgroundAlpha;s(this,$).core.setBackgroundColor(c,u)}e.environment!=null&&s(this,$).core.setEnvironment(e.environment),s(this,$).core.setState(p)}}getGlobalState(){let e=s(this,$).core.getState();return{backgroundColor:s(this,$).core.backgroundColor,backgroundAlpha:s(this,$).core.backgroundAlpha,environment:s(this,$).core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return s(this,dh)}getDimensions(){return{width:s(this,ro).canvasWidth,height:s(this,ro).canvasHeight}}expand(e){var i;return(i=s(this,$).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=s(this,$).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return s(this,$).addMap(e,i)}setFloor(e,i){return s(this,$).setFloor(e,i==null?void 0:i.context)}setFloorStack(e,i){return s(this,$).setFloorStack(e,i==null?void 0:i.context)}tween(e){return s(this,$).tween(e)}removeTween(e){s(this,$).removeTween(e)}get currentFloorStack(){return s(this,$).currentFloorStack}get currentFloor(){return s(this,$).currentFloor}updateWatermark(e){s(this,$).updateWatermark(e)}getState(e){return s(this,$).getState(e)}setHoverColor(e){s(this,$).setHoverColor(e)}getHoverColor(){return s(this,$).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return s(this,$).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return s(this,$).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return s(this,$).isInView(e)}getDistance(e,i){var n;return(n=s(this,$).getMapData())==null?void 0:n.getDistance(e,i)}createCoordinate(e,i,n){return typeof e=="object"?new se(e):new se(e,i,n==null?void 0:n.id)}createCoordinateFromScreenCoordinate(e,i,n){return s(this,$).createCoordinateFromScreenCoordinate(e,i,n)}getScreenCoordinateFromCoordinate(e){return s(this,$).getScreenCoordinateFromCoordinate(e)}auto(){return{labels:this.Labels.all()}}get __core(){if(M.env.INTERNAL==="true")return s(this,$).core;throw new Error("__core is not available.")}clear(){s(this,$).clear()}destroy(){s(this,$).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-I2YHDXM6.js");await new i(this,s(this,$)).enable(e)}async takeScreenshot(){return await s(this,ro).renderSync(),s(this,ro).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return s(this,$).manualFloorVisibility}set manualFloorVisibility(e){s(this,$).manualFloorVisibility=e}};dh=new WeakMap,$=new WeakMap,ro=new WeakMap,l(k3,"MapView");var Xc=k3;g();g();var A3=class A3 extends ae{constructor(e){super();d(this,"gl");d(this,"el",document.createElement("div"));d(this,"core");d(this,"origin");d(this,"map");d(this,"layer");d(this,"handleStyleChange",l(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));d(this,"handleMove",l(()=>{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(ye.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ye.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",l(e=>{L.warn(e)},"handleError"));this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new xd(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=qx.fromLngLat(this.origin,0);return this.layer=Rh(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}};l(A3,"MapLibreOverlay");var Zg=A3;var Rs,Zc,na,Ns,hh=class hh extends ae{constructor(e,i,n){super();T(this,Rs);T(this,Zc);T(this,na);T(this,Ns);d(this,"on",l((e,i)=>{super.on(e,i)},"on"));d(this,"off",l((e,i)=>{super.off(e,i)},"off"));P(this,Ns,new Zg(e)),P(this,Rs,i),P(this,Zc,n)}onAdd(e){var o,a;let i=s(this,Ns).onAdd(e),n={...Sa,...(o=s(this,Zc))!=null?o:{},outdoorView:{token:s(this,Rs).outdoorViewToken,...(a=s(this,Zc))==null?void 0:a.outdoorView}};return P(this,na,new Xc(s(this,Ns).core)),s(this,na).addMap(s(this,Rs),n).then(()=>{this.publish("loaded",{mapView:s(this,na),mapData:s(this,Rs)})}),i}onRemove(){s(this,na)&&s(this,na).clear(),hh.instance=null,s(this,Ns).onRemove()}};Rs=new WeakMap,Zc=new WeakMap,na=new WeakMap,Ns=new WeakMap,l(hh,"MappedinMapLibreOverlay"),d(hh,"instance");var Yc=hh;g();var uj=1e3*60*60*2,oa,$c,Ge,hi,fi,Nr,mi,Jc,Kc,mh,Ue,M9,I9,qc,Yg,F3,B3,R3,N3=class N3{constructor(t,e){T(this,Ue);T(this,oa,new ae);T(this,$c);T(this,Ge);T(this,hi);T(this,fi);T(this,Nr);T(this,mi);T(this,Jc);T(this,Kc);T(this,mh,l(()=>{"key"in s(this,Ge)&&"secret"in s(this,Ge)&&G(this,Ue,qc).call(this),G(this,Ue,Yg).call(this)},"#handleWindowFocus"));d(this,"on",l((t,e)=>s(this,oa).on(t,e),"on"));d(this,"off",l((t,e)=>s(this,oa).off(t,e),"off"));P(this,$c,t),P(this,Ge,e)}setMapIds(t){P(this,$c,t)}setEnterprise(t){s(this,Ge).enterprise=t}async readySync(){if((!("key"in s(this,Ge))||!("secret"in s(this,Ge)))&&!("accessToken"in s(this,Ge))){L.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[G(this,Ue,qc).call(this),null];s(this,Ge).enterprise||(t[1]=this.getSasTokensAsync());let[e,i]=await Promise.all(t);G(this,Ue,R3).call(this),G(this,Ue,F3).call(this,e),i!=null&&G(this,Ue,B3).call(this,i),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",s(this,mh))}async refreshing(){let t=[];return s(this,hi)!=null&&t.push(s(this,hi)),s(this,fi)!=null&&t.push(s(this,fi)),Promise.all(t)}getAccessTokenAsync(){return G(this,Ue,qc).call(this)}getSasTokensAsync(){return G(this,Ue,Yg).call(this)}getAccessToken(){return s(this,Nr)==null?(L.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):s(this,Nr)}getSasToken(t){return this.isEnterpriseMode()?(L.error("SAS tokens are not available in the enterprise mode!"),{token:""}):s(this,mi)==null?(L.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in s(this,mi).tokens?s(this,mi).tokens[t]:(L.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=s(this,Ge).enterprise)!=null?t:!1}destroy(){G(this,Ue,R3).call(this),s(this,oa).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",s(this,mh))}};oa=new WeakMap,$c=new WeakMap,Ge=new WeakMap,hi=new WeakMap,fi=new WeakMap,Nr=new WeakMap,mi=new WeakMap,Jc=new WeakMap,Kc=new WeakMap,mh=new WeakMap,Ue=new WeakSet,M9=l(function(t){var i;let e=t.token!==((i=s(this,Nr))==null?void 0:i.token);P(this,Nr,t),e&&s(this,oa).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),I9=l(function(t){var i;let e=JSON.stringify(t.tokens)!==JSON.stringify((i=s(this,mi))==null?void 0:i.tokens);P(this,mi,t),e&&s(this,oa).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),qc=l(async function(t=!1){var e;if("accessToken"in s(this,Ge)&&typeof s(this,Ge).accessToken=="string"){let i={token:s(this,Ge).accessToken,expires:Date.now()+72e5};return P(this,Nr,i),i}if(!("key"in s(this,Ge))||!("secret"in s(this,Ge))||typeof s(this,Ge).key!="string"||typeof s(this,Ge).secret!="string")throw new Error("No API keys or access token provided!");return s(this,hi)!=null?s(this,hi):s(this,Nr)!=null&&s(this,Nr).expires!=null&&s(this,Nr).expires>Date.now()&&!t?s(this,Nr):(P(this,hi,Rp({...s(this,Ge),key:s(this,Ge).key,secret:s(this,Ge).secret},(e=s(this,Ge).enterprise)!=null?e:!1).then(i=>{let n={token:i.accessToken,expires:i.expiresTimestamp*1e3};return G(this,Ue,M9).call(this,n),n})),s(this,hi).finally(()=>{P(this,hi,void 0)}),s(this,hi))},"#refreshAccessToken"),Yg=l(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:s(this,fi)!=null?s(this,fi):s(this,mi)!=null&&s(this,mi).expires>Date.now()&&!t?s(this,mi):(P(this,fi,new Promise((e,i)=>{G(this,Ue,qc).call(this).then(n=>{let o={},a=s(this,$c).map(p=>Vy({...s(this,Ge),mapId:p},n.token).then(c=>{o[p]={token:c.token,expires:c.expires}}).catch(c=>{L.error("Error getting SAS token for map ".concat(p,":"),c)}));Promise.all(a).then(()=>{let p={tokens:o,expires:Math.min(...Object.values(o).map(c=>{var u;return(u=c.expires)!=null?u:1/0}))};G(this,Ue,I9).call(this,p),e(p)})}).catch(n=>{i(n)})})),s(this,fi).catch(e=>{throw e}).finally(()=>{P(this,fi,void 0)}),s(this,fi))},"#refreshSasTokens"),F3=l(function(t){if(!("key"in s(this,Ge))||!("secret"in s(this,Ge)))return;let e=t.expires!=null?t.expires-Date.now():uj;isFinite(e)&&P(this,Jc,setTimeout(()=>{G(this,Ue,qc).call(this,!0).then(i=>{G(this,Ue,F3).call(this,i)})},e-kC))},"#setAccessTokenRefresh"),B3=l(function(t){let e=t.expires-Date.now();isFinite(e)&&P(this,Kc,setTimeout(()=>{G(this,Ue,Yg).call(this,!0).then(i=>{G(this,Ue,B3).call(this,i)})},e-BC))},"#setSasTokensRefresh"),R3=l(function(){s(this,Jc)!=null&&clearTimeout(s(this,Jc)),s(this,Kc)!=null&&clearTimeout(s(this,Kc))},"#stopRefreshing"),l(N3,"TokenManager");var fh=N3;g();var P9=l((r,{id:t}={})=>{let e=Array.isArray(r)?r:[r];if(!e.every(o=>typeof o=="string"))return;let i=e.join(""),n=null;if(t){let o=document.getElementById(t);o instanceof HTMLStyleElement&&(n=o)}n==null&&(n=document.createElement("style")),t&&t!==""&&(n.id=t),n.textContent=i,document.head.appendChild(n)},"injectCSS");var w9=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var E9='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var D9=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var O9=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var _9=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var L9='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var bj=[w9,E9,D9,O9,_9,L9],k9;function vj(r){k9=r}l(vj,"__setWatermarkOnClickFn");var xj=l(async(r,t)=>{let e,i=_a();t&&i.updateByUserOption(t);try{t&&(e=(await Rp({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(a){L.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new Qc(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new Xh(n)},"hydrateMapDataFromMVF"),A9=!1;function Cj(r){A9=r}l(Cj,"setUseEnterpriseAPI");var Sj=l(async(r,t)=>{var y,b,x,C;let e={...t||{}},i,n=_a();n.updateByUserOption(e);let o={};if("type"in r&&typeof r.type=="string"){if(o.enterprise=(y=r.options)==null?void 0:y.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let v=await Vp(r.main);i=Gp(v),o.languagePacks=[];for(let S of(b=r.languagePacks)!=null?b:[])S.localePack instanceof Uint8Array&&o.languagePacks.push({language:S.language,localePack:await Pl(S.localePack)})}else if(r.type==="json")i=r.main,o.languagePacks=(x=r.languagePacks)!=null?x:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(o.binaryBundle=r.main)}else i=r,o.enterprise=i.enterprise!=null;let a=zy(i),p=a.length>0?a:[e.mapId],c=new fh(p,{...e,enterprise:o.enterprise}),u;if("accessToken"in e)u=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=n.getBaseAuthUri(o.enterprise);let v=await c.getAccessTokenAsync();u=(v==null?void 0:v.token)||""}o.outdoorViewToken=u,o.env=n,o.getMapDataOptions=e;try{await c.readySync()}catch(v){L.error("Failed to ready token manager!",v)}let h=new Qc(i,o);u&&h.Analytics.init({accessToken:u,mapId:e.mapId,key:"key"in e?e.key:void 0,secret:"secret"in e?e.secret:void 0,...e.analytics,baseUri:n.getAnalyticsBaseUri(),context:(C=e.analytics)==null?void 0:C.context});let m=new Xh(h);if("language"in e)try{await m.changeLanguage(e.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),m},"hydrateMapData"),F9=l(async r=>{var v;let t=A9,e,i=_a();i.updateByUserOption(r);let n={...r},o=new fh([n.mapId],n);if("accessToken"in n){e=n.accessToken;let{aud:S,sub:I}=Oh(e);(fC.some(w=>S.includes(w))||I&&I.startsWith("client"))&&(t=!0,o.setEnterprise(t))}else if("key"in n&&"secret"in n)n.key.startsWith("mik_")||(t=!0,o.setEnterprise(t)),n.baseAuthUri=i.getBaseAuthUri(t),e=(await o.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");n.layoutId!=null&&(t?n.layoutId!=="draft"&&L.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):L.warn("layoutId is currently unsupported!")),n.baseUri=i.getBaseUri(t);let a=performance.now(),p,c;if(t){let S={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"},I=await Hy(S);p=I.compressed,c=I.localePacks}else p=await Wy(n,e);let u=performance.now(),h=await Vp(p),m=Gp(h),y=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(m);let b=zy(m);b.length>0?o.setMapIds(b):o.setMapIds([n.mapId]);try{await o.readySync()}catch(S){L.error("Failed to ready token manager!",S)}let x=new Qc(m,{env:i,outdoorViewToken:e,tokenManager:o,enterprise:t,localePacksUrls:c,binaryBundle:p,getMapDataOptions:n}),C=new Xh(x,{search:r.search});if(x.Analytics.init({accessToken:e,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(v=n.analytics)==null?void 0:v.context}),x.Analytics.sendGetMapDataEvent({parseDuration:y-u,downloadDuration:u-a,viewId:n.viewId}),"language"in n)try{await C.changeLanguage(n.language)}catch{}return C},"getMapData"),Tj=F9,Mj=l((r,t)=>{Yc.instance!=null&&L.warn("Only a single map venue is supported at this time.");let e=new Yc([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Yc.instance=e,e},"createMapLibreOverlay"),B9=l(async(r,t,e)=>{var u,h,m,y,b,x,C,v,S,I,w,E,D;let i=performance.now(),n=Ey(e,t);n&&wy(n),((u=n.injectStyles)==null||u)&&P9(bj,{id:"mappedin__styles"});let o=gC((h=t.outdoorViewToken)!=null?h:""),a=zp(t);(m=n.outdoorView)!=null&&m.style&&a.envControl.updateTileServerBaseUrl((y=n.outdoorView)==null?void 0:y.style);let p=await _6(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(b=n.style)==null?void 0:b.backgroundAlpha,backgroundColor:(x=n.style)==null?void 0:x.backgroundColor,outdoorView:(C=n.outdoorView)!=null&&C.token?{headers:{"x-mappedin-tiles-key":(v=n.outdoorView)==null?void 0:v.token},style:t.getEnv().tileServerUri,enabled:!!((S=n.outdoorView)!=null&&S.enabled),lowDpi:(I=n.outdoorView)==null?void 0:I.lowDpi}:void 0,watermark:{...n.watermark,visible:((w=n.watermark)==null?void 0:w.visible)||!a.enterpriseMode&&!o.remove_watermark,onClick:k9||void 0},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((E=n.antialiasing)!=null&&E.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(D=n.occlusion)==null?void 0:D.enabled,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:n.imagePlacementOptions,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:n.onWebGLContextRestored,onWebGLRendererError:n.onWebGLRendererError}),c=new Xc(p);return await c.addMap(t,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:c.getDimensions()}),c},"show3dMap"),Ij=B9;function Rr(r){return r.verticalOffset===0?[r.longitude,r.latitude]:[r.longitude,r.latitude,r.verticalOffset]}l(Rr,"convertCoordinateToPosition");function wj(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}l(wj,"getEntranceMap");var t3=l((r,t)=>{let e=wj(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}=zb(n,a);o=c.map(u=>u.geometry.coordinates),i.entrances.features.push(...p)}i.walls.geometry.coordinates.push(...o)}return i},"cutEntrancesFromLineStrings");function m9(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}l(m9,"translateLabelStateToGeojsonCore");function g9(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}l(g9,"translateMarkerStateToGeojsonCore");function Hg(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&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}l(Hg,"translateDoorsStateToGeojsonCore");function D3(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&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}l(D3,"translateWallsStateToGeojsonCore");function y9(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&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((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),r.flipImageToFaceCamera!==void 0&&(e.flipImageToFaceCamera=r.flipImageToFaceCamera)),e}l(y9,"translateSpaceStateToGeojsonCore");function R9(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}l(R9,"differenceBetweenAngles");function N9(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}l(N9,"getRelativeBearing");function K6(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}l(K6,"extractStyleMap");function Fg(r,t){return r.reduce((e,i)=>{let n=t[i.properties.id];if(n==null)return e;if("textures"in i.properties&&Array.isArray(i.properties.textures)&&i.properties.textures.length>0){let o={...n,id:n.id+"-textures"};e.set(o,[i])}else e.has(n)||e.set(n,[]),e.get(n).push(i);return e},new Map)}l(Fg,"groupGeometryByStyle");function Gc(r,t={}){var n,o,a,p,c,u,h;let e={...r,flipImageToFaceCamera:(n=t==null?void 0:t.flipImagesToFaceCamera)!=null?n:!0},i=(a=(o=t==null?void 0:t.style)==null?void 0:o.shading)!=null?a:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(c=(p=t==null?void 0:t.style)==null?void 0:p.outlines)!=null?c:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let m=(h=(u=t==null?void 0:t.style)==null?void 0:u.wallTopColor)!=null?h:t==null?void 0:t.wallTopColor;m!=null&&(e.topColor=m)}return e}l(Gc,"translateToCoreStyle");var b9=l((r,t)=>{var n;let i=((n=t.currentMap)==null?void 0:n.currentFloor).layers.get(tt);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(mo);case"exterior-walls":return i==null?void 0:i.layers.get(_i);case"interior-doors":return i==null?void 0:i.layers.get(ul);case"exterior-doors":return i==null?void 0:i.layers.get(dl);default:return typeof r=="string"?r:r.id}},"getTargetID");function h3(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}l(h3,"tweenToPromise");function Bg(r){return r.bbox?r.bbox:Zs(r)}l(Bg,"getBoundingBox");function v9(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1]),Math.max(r[2],t[2]),Math.max(r[3],t[3])]}l(v9,"expandBbox");function G9(r){return[...new Set(r)]}l(G9,"unique");function f3(r,t,e){return r.floorId&&t.has(r.floorId)?t.get(r.floorId):e}l(f3,"getTargetFloorObject");function Nc(r){if(ut.is(r)||tr.is(r))return r.id}l(Nc,"getAttachableGeometryId");function Q6(r,t,e){var o,a,p,c,u,h;let i=r.coordinates.length===2,n=!0;if(i&&r.coordinates[0].floorId!=null&&r.coordinates[1].floorId!=null){let m=t==null?void 0:t.getById("floor",r.coordinates[0].floorId),y=t==null?void 0:t.getById("floor",r.coordinates[1].floorId);m&&y&&(n=((a=(o=e.getState(m))==null?void 0:o.visible)!=null?a:!0)&&((c=(p=e.getState(y))==null?void 0:p.visible)!=null?c:!0))}else{let m=r.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",r.coordinates[0].floorId):void 0;n=m&&(h=(u=e.getState(m))==null?void 0:u.visible)!=null?h:!0}return n}l(Q6,"determineFloorVisibleBasedOnPath");var V9=Math.PI*.1,nt,Vt,Jt,Gs,Vs,io,js,tp,Gr,j9,ep,U9,G3=class G3{constructor(t,e,i,n){T(this,Gr);T(this,nt,{});T(this,Vt);T(this,Jt);T(this,Gs);T(this,Vs);T(this,io);T(this,js);T(this,tp);P(this,Vt,e),P(this,Jt,t.features),P(this,Gs,i),P(this,Vs,n)}get path(){return s(this,Jt).map(t=>s(this,Vt).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(s(this,nt).departure)return s(this,nt).departure;let t=s(this,Jt)[0].properties.id,e=s(this,Gs)[0];if(s(this,Gs).length>1){for(let i of s(this,Gs))if(gh(i,s(this,Vt)).includes(t)){e=i;break}}return s(this,nt).departure=e,e}get destination(){if(s(this,nt).destination)return s(this,nt).destination;let t=s(this,Jt)[s(this,Jt).length-1].properties.id,e=s(this,Vs)[0];if(s(this,Vs).length>1){for(let i of s(this,Vs))if(gh(i,s(this,Vt)).includes(t)){e=i;break}}return s(this,nt).destination=e,e}get coordinates(){return s(this,nt).coordinates?s(this,nt).coordinates:(s(this,nt).coordinates=s(this,Jt).map(t=>new se(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),s(this,nt).coordinates)}get distance(){return s(this,nt).distance?s(this,nt).distance:(s(this,nt).distance=s(this,Jt).reduce((t,e)=>t+(e.properties.distance||0),0),s(this,nt).distance)}get instructions(){if(s(this,Jt).length<2)return[];if(s(this,nt).instructions)return s(this,nt).instructions;let t=[],e=0;for(let i=0;i<s(this,Jt).length;i++){let n=s(this,Jt)[i],o=s(this,Jt)[i-1],a=s(this,Jt)[i+1],p=new se(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=G(this,Gr,j9).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,node:s(this,Vt).getById("node",n.properties.id)}),e=0)}return s(this,nt).instructions=t,s(this,nt).instructions}};nt=new WeakMap,Vt=new WeakMap,Jt=new WeakMap,Gs=new WeakMap,Vs=new WeakMap,io=new WeakMap,js=new WeakMap,tp=new WeakMap,Gr=new WeakSet,j9=l(function(t){var x,C;let{prevDirection:e,direction:i,nextDirection:n}=t,o=e&&s(this,Vt).getById("floor",e.properties.groupBy),a=s(this,Vt).getById("floor",i.properties.groupBy),p=n&&s(this,Vt).getById("floor",n.properties.groupBy),c=[];e||c.push({type:"Departure"});let u=s(this,Vt).getMVFFeatureByNodeId("connection",i.properties.id),h=u?s(this,Vt).getById("connection",u.id):void 0,m=u&&u.nodes.length>1,y=s(this,Vt).enterpriseMode&&(!i.properties.destination||!(u!=null&&u.nodes.includes(i.properties.destination))||!(u!=null&&u.nodes.includes(i.properties.id)));if(u&&!(!m||y))if(!s(this,io)||s(this,io)==="exit")c.push(G(this,Gr,ep).call(this,"TakeConnection",a,p,h,u)),P(this,io,"take"),P(this,js,h),P(this,tp,u);else{let v=s(this,Vt).getMVFFeatureByNodeId("connection",(x=e==null?void 0:e.properties.id)!=null?x:""),S=s(this,Vt).getById("connection",(C=v==null?void 0:v.id)!=null?C:"");c.push(G(this,Gr,ep).call(this,"ExitConnection",a,o,S,v)),P(this,io,"exit"),P(this,js,h),P(this,tp,u)}else s(this,io)==="take"?(c.push(G(this,Gr,ep).call(this,"ExitConnection",a,o,s(this,js),s(this,tp))),P(this,io,"exit"),P(this,js,h)):p&&a.id!==p.id?c.push(G(this,Gr,ep).call(this,"TakeConnection",a,p,h)):o&&o.id!==a.id?c.push(G(this,Gr,ep).call(this,"ExitConnection",a,o,h)):c.push(G(this,Gr,U9).call(this,e,i));return n||c.push({type:"Arrival"}),c},"#getActions"),ep=l(function(t,e,i,n,o){var c,u;let a="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let h=e.elevation-i.elevation;h>0?a="down":h<0&&(a="up")}let p=(u=(c=n==null?void 0:n.type)!=null?c:o==null?void 0:o.type)!=null?u:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:a,connection:n,connectionType:p}},"#createConnectionAction"),U9=l(function(t,e){let i=e.properties.edges;if(!i||i.filter(a=>a.destination.properties.id!==(t==null?void 0:t.properties.id)&&a.destination.properties.id!==e.properties.destination).length===0)return null;let o=t?-R9(t.properties.angle,e.properties.angle):0;return Math.abs(o)>=V9?{type:"Turn",bearing:N9(o,V9),referencePosition:"At"}:null},"#createTurnAction"),l(G3,"Directions");var Wg=G3,V3=class V3{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:n,multiplicativeDistanceWeightScaling:o}){d(this,"navigator");d(this,"connections");d(this,"getDirections",l((t,e,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:p}}=i,c=t.flatMap(x=>gh(x,n)),u=e.flatMap(x=>gh(x,n)),h=this.getExcludedNodeIds(i.excludedConnections).filter(x=>!c.includes(x)&&!u.includes(x)),m=this.getDisabledConnectionNodeIds(o).filter(x=>!c.includes(x)&&!u.includes(x)),y=this.navigator.getDirections({zones:i.zones.map(x=>{var C;return{geometry:x.geometry,cost:x.cost,map:(C=x.floor)==null?void 0:C.id}}),originIds:c,destinationNodeIds:u,excludedNodeIds:h,disabledConnectionNodeIds:m,simplify:{enabled:a,bufferRadius:p},multiplicativeDistanceWeightScaling:!n.enterpriseMode});this.addCoordinateDirections(y,t,e);let b=new Wg(y,n,t,e);if(!(b.distance===0&&new Set([...c,...u]).size===c.length+u.length))return b},"getDirections"));d(this,"getExcludedNodeIds",l(t=>{if(t.length===0)return[];let e=new Set(t.map(i=>i.id));return this.connections.reduce((i,n)=>e.has(n.id)?i.concat(n.nodes):i,[])},"getExcludedNodeIds"));d(this,"getDisabledConnectionNodeIds",l(t=>t===!1?[]:this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]),"getDisabledConnectionNodeIds"));d(this,"addCoordinateDirections",l((t,[e],[i])=>{if(t.features.length){if(se.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(se.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"));d(this,"createDirectionFeature",l((t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i,edges:[]}}),"createDirectionFeature"));this.navigator=new El({nodes:t,geojsonCollection:this.createCollection(e),groupBy:n,multiplicativeDistanceWeightScaling:o}),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))),[])}}};l(V3,"DirectionsInternal");var qg=V3;function gh(r,t){var e,i,n,o;if(Da.is(r))return r.navigationTarget.flatMap(a=>gh(a,t));if(yn.is(r)){let a=t.Query.nearest(r,{types:["node"]});return(e=a==null?void 0:a[0])!=null&&e.feature.id?[a[0].feature.id]:[]}else if(se.is(r)){let a=t.Query.nearest(r,{types:["node"]});return(i=a==null?void 0:a[0])!=null&&i.feature.id?[a[0].feature.id]:[]}else if(gn.is(r)){let a=t.Query.nearest(r,{types:["node"]});return(n=a==null?void 0:a[0])!=null&&n.feature.id?[a[0].feature.id]:[]}else if(qr.is(r)){let a=t==null?void 0:t.getMVFFeatureById("entrance",r.id);return a!=null&&a.properties.node?[a==null?void 0:a.properties.node]:[]}else if(fn.is(r)){let a=t==null?void 0:t.getMVFFeatureById("area",r.id);return(o=a==null?void 0:a.properties.destinationNodes)!=null?o:[]}else if(ut.is(r)){let a=t==null?void 0:t.getMVFFeatureById("space",r.id);return a==null?[]:a.properties.destinationNodes}else{if(yo.is(r))return r.coordinates.reduce((a,p)=>{var u;let c=t.Query.nearest(p,{types:["node"]});return(u=c==null?void 0:c[0])!=null&&u.feature.id&&a.push(c[0].feature.id),a},[]);if(tr.is(r)){let a=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return a!=null?a:[]}else return Dr.is(r)?r.spaces.flatMap(a=>{var p,c;return(c=(p=t==null?void 0:t.getMVFFeatureById("space",a.id))==null?void 0:p.properties.destinationNodes)!=null?c:[]}).filter(a=>typeof a=="string"):Oi.is(r)?r.nodes.map(a=>a.id):un.is(r)?[r.id]:[]}}l(gh,"getNodesFromTarget");g();g();g();g();g();g();function j3(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return H9(this.cover(t,e),t,e,r)}l(j3,"default");function H9(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,h=r._y1,m,y,b,x,C,v,S,I;if(!o)return r._root=a,r;for(;o.length;)if((C=t>=(m=(p+u)/2))?p=m:u=m,(v=e>=(y=(c+h)/2))?c=y:h=y,n=o,!(o=o[S=v<<1|C]))return n[S]=a,r;if(b=+r._x.call(null,o.data),x=+r._y.call(null,o.data),t===b&&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),(C=t>=(m=(p+u)/2))?p=m:u=m,(v=e>=(y=(c+h)/2))?c=y:h=y;while((S=v<<1|C)===(I=(x>=y)<<1|b>=m));return n[I]=o,n[S]=a,r}l(H9,"add");function W9(r){var t,e,i=r.length,n,o,a=new Array(i),p=new Array(i),c=1/0,u=1/0,h=-1/0,m=-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>h&&(h=n),o<u&&(u=o),o>m&&(m=o));if(c>h||u>m)return this;for(this.cover(c,u).cover(h,m),e=0;e<i;++e)H9(this,a[e],p[e],r[e]);return this}l(W9,"addAll");g();function U3(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}l(U3,"default");g();function H3(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}l(H3,"default");g();function W3(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]]}l(W3,"default");g();g();function bt(r,t,e,i,n){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=n}l(bt,"default");function z3(r,t,e){var i,n=this._x0,o=this._y0,a,p,c,u,h=this._x1,m=this._y1,y=[],b=this._root,x,C;for(b&&y.push(new bt(b,n,o,h,m)),e==null?e=1/0:(n=r-e,o=t-e,h=r+e,m=t+e,e*=e);x=y.pop();)if(!(!(b=x.node)||(a=x.x0)>h||(p=x.y0)>m||(c=x.x1)<n||(u=x.y1)<o))if(b.length){var v=(a+c)/2,S=(p+u)/2;y.push(new bt(b[3],v,S,c,u),new bt(b[2],a,S,v,u),new bt(b[1],v,p,c,S),new bt(b[0],a,p,v,S)),(C=(t>=S)<<1|r>=v)&&(x=y[y.length-1],y[y.length-1]=y[y.length-1-C],y[y.length-1-C]=x)}else{var I=r-+this._x.call(null,b.data),w=t-+this._y.call(null,b.data),E=I*I+w*w;if(E<e){var D=Math.sqrt(e=E);n=r-D,o=t-D,h=r+D,m=t+D,i=b.data}}return i}l(z3,"default");g();function X3(r){if(isNaN(h=+this._x.call(null,r))||isNaN(m=+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,h,m,y,b,x,C,v,S;if(!e)return this;if(e.length)for(;;){if((x=h>=(y=(a+c)/2))?a=y:c=y,(C=m>=(b=(p+u)/2))?p=b:u=b,t=e,!(e=e[v=C<<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)}l(X3,"default");function z9(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}l(z9,"removeAll");g();function Z3(){return this._root}l(Z3,"default");g();function Y3(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}l(Y3,"default");g();function q3(r){var t=[],e,i=this._root,n,o,a,p,c;for(i&&t.push(new bt(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,h=(a+c)/2;(n=i[3])&&t.push(new bt(n,u,h,p,c)),(n=i[2])&&t.push(new bt(n,o,h,u,c)),(n=i[1])&&t.push(new bt(n,u,a,p,h)),(n=i[0])&&t.push(new bt(n,o,a,u,h))}return this}l(q3,"default");g();function $3(r){var t=[],e=[],i;for(this._root&&t.push(new bt(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,h=(a+c)/2,m=(p+u)/2;(o=n[0])&&t.push(new bt(o,a,p,h,m)),(o=n[1])&&t.push(new bt(o,h,p,c,m)),(o=n[2])&&t.push(new bt(o,a,m,h,u)),(o=n[3])&&t.push(new bt(o,h,m,c,u))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}l($3,"default");g();function X9(r){return r[0]}l(X9,"defaultX");function J3(r){return arguments.length?(this._x=r,this):this._x}l(J3,"default");g();function Z9(r){return r[1]}l(Z9,"defaultY");function K3(r){return arguments.length?(this._y=r,this):this._y}l(K3,"default");function yh(r,t,e){var i=new Q3(t==null?X9:t,e==null?Z9:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}l(yh,"quadtree");function Q3(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}l(Q3,"Quadtree");function Y9(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}l(Y9,"leaf_copy");var Kt=yh.prototype=Q3.prototype;Kt.copy=function(){var r=new Q3(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=Y9(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]=Y9(i));return r};Kt.add=j3;Kt.addAll=W9;Kt.cover=U3;Kt.data=H3;Kt.extent=W3;Kt.find=z3;Kt.remove=X3;Kt.removeAll=z9;Kt.root=Z3;Kt.size=Y3;Kt.visit=q3;Kt.visitAfter=$3;Kt.x=J3;Kt.y=K3;var Mr,aa,ex=class ex{constructor(t){T(this,Mr,{});T(this,aa);P(this,aa,t)}getTreeByType(t,e,i){var a;if(s(this,Mr)[t]||(s(this,Mr)[t]={}),s(this,Mr)[t][e]&&s(this,Mr)[t][e][i])return s(this,Mr)[t][e][i];s(this,Mr)[t][e]||(s(this,Mr)[t][e]={}),s(this,Mr)[t][e][i]||(s(this,Mr)[t][e][i]=yh());let n=s(this,Mr)[t][e][i];n.x(p=>p.geometry.coordinates[1]),n.y(p=>p.geometry.coordinates[0]);let o=[];switch(t){case"node":o=((a=s(this,aa).directions.navigator.graph.nodesByGroup.get(i))==null?void 0:a.filter(p=>p.properties.neighbors.length>0))||[];break;case"point-of-interest":o=s(this,aa).mvfPoisByFloorId[i]||[];break;case"door":o=s(this,aa).mvfEntrancesByFloorId[i]||[];break;case"annotation":o=s(this,aa).mvfAnnotationsByFloorId[i]||[];break}return(o==null?void 0:o.length)>0&&n.addAll(o),n}};Mr=new WeakMap,aa=new WeakMap,l(ex,"QueryCache");var $g=ex;var Ej=O.object({limit:O.enum(["same-floor","same-elevation"]).optional(),radius:O.number().optional(),types:O.array(O.enum(["node","point-of-interest"])).min(1)}),tn,vh,tx=class tx{constructor(t){T(this,tn);T(this,vh);P(this,tn,t),P(this,vh,new $g(s(this,tn)))}nearest(t,e){try{Ej.parse(e)}catch(a){L.error(a);return}let i=Ip(t);if(!i)return;let n=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let a of s(this,tn).getByType("floor-stack")){let p=a.defaultFloor;p&&n.push(p.id)}else if(e.limit==="same-elevation"){let a=s(this,tn).floorsById[i.floorId];if(a){let p=a==null?void 0:a.elevation;p&&(n=s(this,tn).getByType("floor-stack").map(c=>{var u;return(u=c.floors.find(h=>h.elevation===p))==null?void 0:u.id}).filter(Boolean))}}let o=[];for(let a of G9(e.types))for(let p of n){let c=s(this,vh).getTreeByType(a,s(this,tn).mapName,p).find(i.latitude,i.longitude,e.radius);if(c){let u=s(this,tn).getById(a,c==null?void 0:c.properties.id);u&&o.push({distance:Qr([i.longitude,i.latitude],c.geometry.coordinates),feature:u})}}return o.sort((a,p)=>a.distance-p.distance)}};tn=new WeakMap,vh=new WeakMap,l(tx,"Query");var bh=tx;g();g();var xh,rx=class rx{constructor(t){T(this,xh);P(this,xh,t||[])}get raw(){return s(this,xh)}};xh=new WeakMap,l(rx,"OpeningHours");var Jg=rx;var Ot,J,Re,rp=class rp extends pt{constructor(e,i){super(i.mvfData.id);d(this,"__type",rp.__type);d(this,"id","loc_");d(this,"name","");d(this,"externalId");d(this,"description");d(this,"logo");d(this,"phone");d(this,"social",[]);d(this,"images",[]);d(this,"links",[]);d(this,"website");d(this,"icon");T(this,Ot);T(this,J,{});T(this,Re);P(this,Ot,e),P(this,Re,i.mvfData);for(let n in i.mvfData)n==="links"?this.links=i.mvfData.links.map(o=>new po({mvfData:o})):n==="pictures"?this.images=i.mvfData.pictures.map(o=>{var a;return o.url?new ho({mvfData:{...o,url:(a=o.url)!=null?a:""},mapData:s(this,Ot)}):void 0}).filter(o=>o!=null):n==="website"?i.mvfData.website&&(this.website=new po({mvfData:i.mvfData.website})):n==="icon"?i.mvfData.icon&&(this.icon=new ho({mvfData:{url:i.mvfData.icon},mapData:s(this,Ot)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Re)[n]}})}static is(e){return e.__type===rp.__type}get spaces(){if(s(this,J).spaces)return s(this,J).spaces;if(s(this,Re).spaces==null)return s(this,J).spaces=[],s(this,J).spaces;s(this,J).spaces=[];for(let e=0;e<s(this,Re).spaces.length;e++){let i=s(this,Ot).getById("space",s(this,Re).spaces[e].id);i&&s(this,J).spaces.push(i)}return s(this,J).spaces}get points(){if(s(this,J).points)return s(this,J).points;if(s(this,Re).spaces==null)return s(this,J).points=[],s(this,J).points;s(this,J).points=[];for(let e=0;e<s(this,Re).spaces.length;e++){let i=s(this,Ot).getById("point-of-interest",s(this,Re).spaces[e].id);i&&s(this,J).points.push(i)}return s(this,J).points}get doors(){if(s(this,J).doors)return s(this,J).doors;if(s(this,Re).entrances==null)return s(this,J).doors=[],s(this,J).doors;s(this,J).doors=[];for(let e=0;e<s(this,Re).entrances.length;e++){let i=s(this,Ot).getById("door",s(this,Re).entrances[e].id);i&&s(this,J).doors.push(i)}return s(this,J).doors}get connections(){var i;if(s(this,J).connections)return s(this,J).connections;if(s(this,Re).connections==null)return s(this,J).connections=[],s(this,J).connections;let e=new Set;for(let n=0;n<s(this,Re).connections.length;n++){let o=s(this,Re).connections[n],a=s(this,Ot).mvfConnectionsById[o],c=(a==null?[]:a.nodes).map(u=>s(this,Ot).getById("node",u)).filter(Boolean);for(let u of c){if(u==null)continue;let h=Ei([u.coordinate.longitude,u.coordinate.latitude]),y=((i=s(this,Ot).connectionSpaceIdsByLatLon[h])!=null?i:[]).map(b=>s(this,Ot).connectionsById[b]).filter(b=>b!=null);for(let b of y)e.add(b)}}return s(this,J).connections=Array.from(e),s(this,J).connections}get annotations(){if(s(this,J).annotations)return s(this,J).annotations;if(s(this,Re).annotations==null)return s(this,J).annotations=[],s(this,J).annotations;s(this,J).annotations=[];for(let e=0;e<s(this,Re).annotations.length;e++){let i=s(this,Ot).getById("annotation",s(this,Re).annotations[e].id);i&&s(this,J).annotations.push(i)}return s(this,J).annotations}get categories(){return s(this,J).categories?s(this,J).categories:s(this,Re).categories==null?(s(this,J).categories=[],s(this,J).categories):(s(this,J).categories=s(this,Re).categories.map(e=>s(this,Ot).getById("location-category",e)).filter(e=>e!=null),s(this,J).categories)}get mapObjects(){return s(this,J).mapObjects?s(this,J).mapObjects:s(this,Re).obstructions==null?(s(this,J).mapObjects=[],s(this,J).mapObjects):(s(this,J).mapObjects=s(this,Re).obstructions.map(e=>s(this,Ot).getById("object",e.id)).filter(e=>e!=null),s(this,J).mapObjects)}get areas(){return s(this,J).areas?s(this,J).areas:s(this,Re).areas==null?(s(this,J).areas=[],s(this,J).areas):(s(this,J).areas=s(this,Re).areas.map(e=>s(this,Ot).getById("area",e.id)).filter(e=>e!=null),s(this,J).areas)}get focusTarget(){if(s(this,J).focusTarget)return s(this,J).focusTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);return s(this,J).focusTarget=e,e}get openingHours(){var e;return s(this,J).openingHours?s(this,J).openingHours:(s(this,J).openingHours=new Jg((e=s(this,Re).openingHoursSpecification)!=null?e:[]),s(this,J).openingHours)}get navigationTarget(){if(s(this,J).navigationTarget)return s(this,J).navigationTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);for(let i of this.points)e.push(i.focusTarget);return s(this,J).navigationTarget=e,e}toJSON(){return{id:this.id,name:this.name}}};Ot=new WeakMap,J=new WeakMap,Re=new WeakMap,l(rp,"LocationProfile"),d(rp,"__type","location-profile");var ix=rp,Da=ix;g();var sa,ur,Us,ip=class ip extends pt{constructor(e,i){super(i.mvfData.id);d(this,"__type",ip.__type);d(this,"id","cat_");d(this,"name","");d(this,"icon","");T(this,sa);T(this,ur,{});T(this,Us);P(this,sa,e),P(this,Us,i.mvfData);for(let n in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Us)[n]}})}static is(e){return e.__type===ip.__type}get parent(){return s(this,ur).parent?s(this,ur).parent:(s(this,ur).parent=s(this,Us).parent?s(this,sa).getById("location-category",s(this,Us).parent):void 0,s(this,ur).parent)}get children(){return s(this,ur).children?s(this,ur).children:(s(this,ur).children=s(this,sa).locationCategoriesByParentId[this.id]||[],s(this,ur).children)}get locationProfiles(){if(s(this,ur).locationProfiles)return s(this,ur).locationProfiles;let e=[];for(let i of s(this,sa).locationProfilesByCategoryId[this.id]||[]){let n=s(this,sa).getById("location-profile",i.id);n&&e.push(n)}return s(this,ur).locationProfiles=e,e}toJSON(){return{id:this.id,name:this.name}}};sa=new WeakMap,ur=new WeakMap,Us=new WeakMap,l(ip,"LocationCategory"),d(ip,"__type","location-category");var nx=ip,Lp=nx;var ie,Kg,q9,np,ox=class ox extends ae{constructor(e,i){var p,c,u,h,m;super();T(this,Kg);d(this,"Analytics");T(this,ie,{});d(this,"Query");d(this,"mvf");d(this,"outdoorViewToken");d(this,"spaceIdsByDestinationNodeId");d(this,"objectEntranceNodeIdsByObstructionId");d(this,"obstructionIdByEntranceId");d(this,"venue");d(this,"tokenManager");d(this,"directions");d(this,"enterpriseMode",!1);d(this,"nodesById");d(this,"spacesById");d(this,"floorsById");d(this,"floorStacksById");d(this,"facadesById");d(this,"facadesBySpaceId");d(this,"connectionsById");d(this,"objectsById");d(this,"doorsById");d(this,"pointsOfInterestById");d(this,"annotationsById");d(this,"areasById");d(this,"locationProfilesById");d(this,"locationCategoriesById");d(this,"locationProfilesByExternalId");d(this,"locationsById");d(this,"locationProfilesByCategoryId");d(this,"locationCategoriesByParentId");d(this,"categoriesById");d(this,"doorsByNodeId");d(this,"mvfLocationsBySpaceId");d(this,"locationIdsByNodeId");d(this,"spaceIdsByNodeId");d(this,"mvfAnnotationsById");d(this,"mvfConnectionsById");d(this,"mvfConnectionsByNodeId");d(this,"mvfConnectionIdsByLatLon");d(this,"mvfEntrancesById");d(this,"mvfNodesById");d(this,"mvfObstructionById");d(this,"mvfSpacesById");d(this,"mvfFloorsById");d(this,"mvfFloorStacksById");d(this,"mvfAreasById");d(this,"connectionSpaceIdsByLatLon");d(this,"locationProfilesByAttachedFeatureId");d(this,"spacesByExternalId");d(this,"nodesByExternalId");d(this,"objectsByExternalId");d(this,"poisByExternalId");d(this,"floorsByExternalId");d(this,"floorStacksByExternalId");d(this,"doorsByExternalId");d(this,"areasByExternalId");d(this,"connectionsByExternalId");d(this,"locationsByExternalId");d(this,"categoriesByExternalId");d(this,"mvfNodesByFloorId");d(this,"mvfSpacesByFloorId");d(this,"mvfPoisByFloorId");d(this,"mvfEntrancesByFloorId");d(this,"mvfAnnotationsByFloorId");d(this,"localePacksUrls");d(this,"currentLanguage");d(this,"languagePacks",{});d(this,"tilesets",{});d(this,"binaryBundle");d(this,"envControl");d(this,"getMapDataOptions");T(this,np);d(this,"getDirectionsMultiDestination",l((e,i,n)=>this.getDirections(e,i,{...n,multiDestination:!0}),"getDirectionsMultiDestination"));d(this,"getDirections",l((e,i,n)=>{let{accessible:o=!1,smoothing:a=!0,multiDestination:p=!1}=n||{},c=typeof a=="object"?a.enabled:a,u=typeof a=="object"?a.radius:void 0,h=(n==null?void 0:n.zones)||[],m={accessible:o,zones:h,smoothing:{enabled:c!=null?c:!0,radius:u!=null?u:.75},excludedConnections:(n==null?void 0:n.excludedConnections)||[]};if(p&&Array.isArray(i)){let y=Array.isArray(e)?e:[e],b=[];for(let x of i){let C=Array.isArray(x)?x:[x],v=this.directions.getDirections(y,C,m,this);if(!v){L.error("getDirections failed due to missing directions for one of the segments");return}y=C,b.push(v)}return b}else{let y=Array.isArray(e)?e:[e],b=Array.isArray(i)?i:[i];if(Array.isArray(b[0])){L.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&b[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,b[0].id),this.directions.getDirections(y,b,m,this)}},"getDirections"));d(this,"transformImageRequest",l(async e=>{var n;if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!HC(e))return{url:e};if(WC(e))return{url:e};let i=Gh(e);if(!i)return{url:e};try{let o=await((n=this.tokenManager)==null?void 0:n.getSasTokensAsync()),a=o==null?void 0:o[i.mapId];if(a==null)throw new Error("SAS token not found");let[p]=e.split("?");return{url:"".concat(p,"?").concat(a.token)}}catch(o){return L.error("Failed to append SAS token to image request. Requests for private images may fail.",o),{url:e}}},"transformImageRequest"));let n=(p=i==null?void 0:i.env)!=null?p:_a();if(this.envControl=n,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new xl,this.localePacksUrls=(c=i==null?void 0:i.localePacksUrls)!=null?c:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.getMapDataOptions=i==null?void 0:i.getMapDataOptions,((u=e["tileset.json"])==null?void 0:u.default)!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,n.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let y of e["tileset.json"].others)this.tilesets[y.key]=y;this.enterpriseMode=(h=i==null?void 0:i.enterprise)!=null?h:!1,this.tokenManager=i==null?void 0:i.tokenManager;let o=bC(e,this);this.nodesById=o.nodesById,this.spacesById=o.spacesById,this.floorsById=o.floorsById,this.floorStacksById=o.floorStacksById,this.facadesById=o.facadesById,this.facadesBySpaceId=o.facadesBySpaceId,this.connectionsById=o.connectionsById,this.objectsById=o.objectsById,this.doorsById=o.doorsById,this.pointsOfInterestById=o.poisById,this.annotationsById=o.annotationsById,this.areasById=o.areasById,this.locationProfilesById=o.locationProfilesById,this.locationCategoriesById=o.locationCategoriesById,this.locationProfilesByCategoryId=o.locationProfilesByCategoryId,this.locationCategoriesByParentId=o.locationCategoriesByParentId,this.spacesByExternalId=o.spacesByExternalId,this.nodesByExternalId=o.nodesByExternalId,this.objectsByExternalId=o.objectsByExternalId,this.floorsByExternalId=o.floorsByExternalId,this.locationProfilesByExternalId=o.locationProfilesByExternalId,this.floorStacksByExternalId=o.floorStacksByExternalId,this.poisByExternalId=o.poisByExternalId,this.doorsByExternalId=o.doorsByExternalId,this.areasByExternalId=o.areasByExternalId,this.mvfAnnotationsById=o.mvfAnnotationsById,this.mvfConnectionsById=o.mvfConnectionsById,this.mvfConnectionsByNodeId=o.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=o.mvfConnectionIdsByLatLon,this.mvfEntrancesById=o.mvfEntrancesById,this.mvfNodesById=o.mvfNodesById,this.mvfObstructionById=o.mvfObstructionById,this.mvfSpacesById=o.mvfSpacesById,this.mvfFloorsById=o.mvfFloorsById,this.mvfFloorStacksById=o.mvfFloorStacksById,this.mvfNodesByFloorId=o.mvfNodesByFloorId,this.mvfSpacesByFloorId=o.mvfSpacesByFloorId,this.mvfPoisByFloorId=o.mvfPoisByFloorId,this.mvfEntrancesByFloorId=o.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=o.mvfAnnotationsByFloorId,this.mvfAreasById=o.mvfAreasById,this.doorsByNodeId=o.doorsByNodeId,this.spaceIdsByDestinationNodeId=o.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=o.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=o.obstructionIdByEntranceId;let a=yC(e,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.mvfLocationsBySpaceId=a.mvfLocationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=o.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=o.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.connectionsByExternalId=a.connectionsByExternalId,this.locationsByExternalId=a.locationsByExternalId,this.categoriesByExternalId=a.categoriesByExternalId,a.venue.name!=null){this.venue=new jh(this,{mvfData:a.venue});let y={};for(let b in a.mvfLocationsById)y[b]=a.mvfLocationsById[b];for(let b in a.locationInstancesById)y[b]=a.locationInstancesById[b];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":y,"enterprise-category":a.mvfCategoriesById,"floor-stack":o.mvfFloorStacksById,floor:o.mvfFloorsById}},(m=i==null?void 0:i.languagePacks)==null||m.forEach(({language:b,localePack:x})=>{this.languagePacks[b.code]=Xy(x)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new bh(this),this.directions=new qg({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let e=this;return{get baseUri(){var i;return e.envControl.getBaseUri((i=e.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new se(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?e:0}get spaces(){return s(this,ie).spaces==null&&(s(this,ie).spaces=globalThis.Object.values(this.spacesById)),s(this,ie).spaces}get objects(){return s(this,ie).objects==null&&(s(this,ie).objects=globalThis.Object.values(this.objectsById)),s(this,ie).objects}get connections(){return s(this,ie).connections==null&&(s(this,ie).connections=globalThis.Object.values(this.connectionsById)),s(this,ie).connections}get floors(){return s(this,ie).floors==null&&(s(this,ie).floors=globalThis.Object.values(this.floorsById)),s(this,ie).floors}get floorStacks(){return s(this,ie).floorStacks==null&&(s(this,ie).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,ie).floorStacks}get facades(){return s(this,ie).facades==null&&(s(this,ie).facades=globalThis.Object.values(this.facadesById)),s(this,ie).facades}get doors(){return s(this,ie).doors==null&&(s(this,ie).doors=globalThis.Object.values(this.doorsById)),s(this,ie).doors}get pointsOfInterest(){return s(this,ie).pointsOfInterest==null&&(s(this,ie).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,ie).pointsOfInterest}get annotations(){return s(this,ie).annotations==null&&(s(this,ie).annotations=globalThis.Object.values(this.annotationsById)),s(this,ie).annotations}get areas(){return s(this,ie).areas==null&&(s(this,ie).areas=globalThis.Object.values(this.areasById)),s(this,ie).areas}get nodes(){return s(this,ie).nodes==null&&(s(this,ie).nodes=globalThis.Object.values(this.nodesById)),s(this,ie).nodes}get locations(){return s(this,ie).locations==null&&(s(this,ie).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,ie).categories==null&&(s(this,ie).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return s(this,ie).locationProfiles==null&&(s(this,ie).locationProfiles=globalThis.Object.values(this.locationProfilesById)),s(this,ie).locationProfiles}get locationCategories(){return s(this,ie).locationCategories==null&&(s(this,ie).locationCategories=globalThis.Object.values(this.locationCategoriesById)),s(this,ie).locationCategories}get mvfFloors(){return s(this,ie).mvfFloors==null&&(s(this,ie).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,ie).mvfFloors}get mvfFloorStacks(){return s(this,ie).mvfFloorStacks==null&&(s(this,ie).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,ie).mvfFloorStacks}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(e,i){switch(e){case"location-profile":return this.locationProfilesById[i];case"location-category":return this.locationCategoriesById[i];case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":let n=this.connectionsById[i];return n==null&&(n=G(this,Kg,q9).call(this,this.mvfConnectionsById[i])),n;case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:return}}getByExternalId(e,i){var n,o,a,p,c,u,h,m,y,b,x,C;switch(e){case"location-profile":return(n=this.locationProfilesByExternalId[i])!=null?n:[];case"location-category":return[];case"space":return(o=this.spacesByExternalId[i])!=null?o:[];case"floor":return(a=this.floorsByExternalId[i])!=null?a:[];case"floor-stack":return(p=this.floorStacksByExternalId[i])!=null?p:[];case"node":return(c=this.nodesByExternalId[i])!=null?c:[];case"door":return(u=this.doorsByExternalId[i])!=null?u:[];case"connection":return(h=this.connectionsByExternalId[i])!=null?h:[];case"object":return(m=this.objectsByExternalId[i])!=null?m:[];case"point-of-interest":return(y=this.poisByExternalId[i])!=null?y:[];case"area":return(b=this.areasByExternalId[i])!=null?b:[];case"enterprise-location":return(x=this.locationsByExternalId[i])!=null?x:[];case"enterprise-category":return(C=this.categoriesByExternalId[i])!=null?C:[];default:return[]}}getMapDataById(e){var i,n,o,a,p,c,u,h,m,y;return(y=(m=(h=(u=(c=(p=(a=(o=(n=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?n:this.floorStacksById[e])!=null?o:this.facadesById[e])!=null?a:this.nodesById[e])!=null?p:this.doorsById[e])!=null?c:this.connectionsById[e])!=null?u:this.objectsById[e])!=null?h:this.pointsOfInterestById[e])!=null?m:this.annotationsById[e])!=null?y:this.areasById[e]}getMVFFeatureById(e,i){switch(e){case"space":return this.mvfSpacesById[i];case"node":return this.mvfNodesById[i];case"obstruction":return this.mvfObstructionById[i];case"floor":return this.mvfFloorsById[i];case"floor-stack":return this.mvfFloorStacksById[i];case"connection":return this.mvfConnectionsById[i];case"entrance":return this.mvfEntrancesById[i];case"annotation":return this.mvfAnnotationsById[i];case"area":return this.mvfAreasById[i];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,i){switch(e){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,i,n,o){var c,u;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,p=(u=(c=this.languagePacks[a])==null?void 0:c.optimized)==null?void 0:u[e];if(p){let h=p[n];if(h!=null&&h[i]!==void 0)return h[i]}return o}async changeLanguage(e){var p;let i=e.toLowerCase();if(!i){L.error("language code must be defined");return}if(!this.currentLanguage){L.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(p=this.venue)==null?void 0:p.languages.find(({code:c})=>c.toLowerCase()===i.toLowerCase());if(!o){L.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){L.error("locale packs url not found for ".concat(o.code));return}s(this,np)&&s(this,np).abort();let u=new AbortController;P(this,np,u);let h;try{h=await jC(c,{signal:u.signal})}catch(m){L.error("failed downloading language pack",m);return}if(!h||u.signal.aborted)return;a=Xy(h),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let n=Ip(e),o=Ip(i);return Qr([n.longitude,n.latitude],[o.longitude,o.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var n;let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let p=await Uy(this.localePacksUrls[a.code],{signal:o.signal}),c=await Pl(p);c&&i.push({language:{code:a.code,name:a.name},localePack:c})}}catch(p){L.warn("failed downloading language pack",p)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var n;if(!this.binaryBundle){L.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let p=await Uy(this.localePacksUrls[a.code],{signal:o.signal});p&&i.push({language:{code:a.code,name:a.name},localePack:p})}}catch(p){L.warn("failed downloading language pack",p)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(s(this,ie)))s(this,ie)[e]=null}};ie=new WeakMap,Kg=new WeakSet,q9=l(function(e){var p;let i=(p=e==null?void 0:e.nodes)==null?void 0:p[0],n=this.getById("node",i);if(n==null)return;let o=Ei([n.coordinate.longitude,n.coordinate.latitude]),a=this.connectionSpaceIdsByLatLon[o];return a==null?void 0:a.map(c=>this.connectionsById[c]).find(c=>c!=null)},"#getConnectionFromMVFConnection"),np=new WeakMap,l(ox,"MapDataInternal");var Qc=ox;var ap,Hs,Ch,rn,op=class op extends Xr{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",op.__type);T(this,ap);T(this,Hs);T(this,Ch);T(this,rn,{});P(this,ap,i.mvfData),P(this,Hs,e),P(this,Ch,i.floorStackId)}static is(e){return e.__type===op.__type}get floorStack(){return s(this,Hs).getById("floor-stack",s(this,Ch))}get spaces(){if(!s(this,rn).spaces){s(this,rn).spaces=[];for(let e of s(this,ap).spaces){let i=s(this,Hs).getById("space",e.spaceId);i&&s(this,rn).spaces.push(i)}}return s(this,rn).spaces}get center(){if(!s(this,rn).center){let e={type:"FeatureCollection",features:[]};for(let n of this.spaces){let o=s(this,Hs).mvfSpacesById[n.id];o&&e.features.push(o)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=Zh(e);s(this,rn).center=new se(i.geometry.coordinates[1],i.geometry.coordinates[0],s(this,ap).spaces[0].floorId)}return s(this,rn).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};ap=new WeakMap,Hs=new WeakMap,Ch=new WeakMap,rn=new WeakMap,l(op,"Facade"),d(op,"__type","facade");var ax=op,Dr=ax;export{se as a,un as b,ut as c,gp as d,Dr as e,Oi as f,_p as g,O as h,iv as i,GV as j,F9 as k,B9 as l,Pj as m};