@mappedin/react-sdk 6.0.1-beta.32 → 6.0.1-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-PEUUASSN.js → GLTFExporter-3O56CTC5.js} +1 -1
- package/lib/esm/{GLTFLoader-UA5TMSMR.js → GLTFLoader-IPW4ONXP.js} +1 -1
- package/lib/esm/{browser-U3652NS6.js → browser-TRO2DXIJ.js} +1 -1
- package/lib/esm/chunk-2H2MJQTW.js +1 -0
- package/lib/esm/chunk-4WFJOZ2C.js +1 -0
- package/lib/esm/chunk-JM4RLHNY.js +1 -0
- package/lib/esm/{chunk-IXJQWNR3.js → chunk-LMOTNLG3.js} +1 -1
- package/lib/esm/{chunk-7VUIGM34.js → chunk-TAKD33OA.js} +1 -1
- package/lib/esm/{chunk-4F56JD4R.js → chunk-UD5B527D.js} +1 -1
- package/lib/esm/index.d.ts +285 -41
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-C26L2DR5.js +1 -0
- package/lib/esm/{internal-UZLA3JGN.js → internal-FI6IK6XE.js} +1 -1
- package/lib/esm/{outdoor-context-v4-HMS4RMHS.js → outdoor-context-v4-LHQD3F3W.js} +1 -1
- package/lib/esm/{text3d-WBCJXJV3.js → text3d-F5BO2HE3.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-2UISP3K7.js +0 -1
- package/lib/esm/chunk-IFBLXLIM.js +0 -1
- package/lib/esm/chunk-NSQIJRR4.js +0 -1
- package/lib/esm/inspector-2SK3WH2F.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as n2,$a as Ie,A as _,Aa as C2,B as o6,Ba as S2,C as q0,Ca as x2,D as Dr,Da as I2,E as $0,Ea as M2,F as ct,Fa as rf,G as Zh,Ga as zi,H as J0,Ha as P2,I as Gs,Ia as T2,J as Q0,Ja as w2,K as Xi,Ka as E2,L as zh,La as Jp,M as Wi,Ma as of,N as Oe,Na as D2,O as qh,Oa as O2,P as e2,Pa as L2,Q as qn,Qa as A2,R as Wo,Ra as F2,S as t2,Sa as nf,T as $h,Ta as B2,U as r2,Ua as k2,Va as _2,W as Yp,Wa as R2,X as Zp,Xa as N2,Y as i2,Ya as ze,Z as o2,Za as G2,_ as zp,_a as Kt,a as C0,aa as a2,b as S0,ba as s2,c as L,ca as l2,d as Hh,da as Yi,e as kp,ea as Jh,f as _p,fa as Vs,g as x0,ga as c2,h as Rp,ha as p2,i as I0,ia as u2,j as z,ja as d2,k as ge,ka as Zi,l as Xn,la as qp,m as Uh,ma as $n,n as Mr,na as $p,o as Np,oa as h2,p as Kr,pa as Qh,q as jo,qa as f2,r as M0,ra as m2,s as P0,sa as Qt,t as T0,ta as y2,u as _s,ua as g2,v as It,va as v2,w as Xh,wa as Kh,x as Pr,xa as b2,y as w0,ya as ef,z as Gp,za as tf}from"./chunk-IFBLXLIM.js";import{j as K0}from"./chunk-4F56JD4R.js";import{a as qi}from"./chunk-IXJQWNR3.js";import{$ as N0,Aa as ti,Ba as H0,C as L0,Ca as U0,D as le,Da as X0,E as Q,Fa as Ui,I as A0,J as F0,K as B0,L as k0,M as q,N as ei,O as _0,P as Wn,Pa as zn,Q as Yn,R as Ns,S as Ze,Ta as Wp,U as Jt,Ua as W0,V as Uo,W as R0,X as ce,Y as Hp,Ya as Y0,_ as Xo,_a as Er,aa as Wh,ab as Z0,b as Vp,ca as ji,cb as z0,e as Ho,f as E0,g as Rs,ka as Zn,la as G0,ma as Up,na as V0,p as D0,pa as Yh,r as O0,ua as j0,va as Hi,wa as Xp,ya as Tr,z as jp,za as wr}from"./chunk-2UISP3K7.js";import{a as m,b as M}from"./chunk-7VUIGM34.js";import{a as p,c as j,d as b0,e as Bp,f as d,g as a,h as C,i as P,j as V}from"./chunk-J5IUISYU.js";var Tv=j((zf,qf)=>{m();(function(r,t){typeof zf=="object"&&typeof qf<"u"?qf.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(zf,function(){"use strict";function r(b,S,w,T,E){p(function D(A,R,N,B,H){for(;B>N;){if(B-N>600){var G=B-N+1,$=R-N+1,J=Math.log(G),he=.5*Math.exp(2*J/3),Se=.5*Math.sqrt(J*he*(G-he)/G)*($-G/2<0?-1:1),Ge=Math.max(N,Math.floor(R-$*he/G+Se)),Lt=Math.min(B,Math.floor(R+(G-$)*he/G+Se));D(A,R,Ge,Lt,H)}var me=A[R],Fe=N,xe=B;for(t(A,N,R),H(A[B],me)>0&&t(A,N,B);Fe<xe;){for(t(A,Fe,xe),Fe++,xe--;H(A[Fe],me)<0;)Fe++;for(;H(A[xe],me)>0;)xe--}H(A[N],me)===0?t(A,N,xe):t(A,++xe,B),xe<=R&&(N=xe+1),R<=xe&&(B=xe-1)}},"t")(b,S,w||0,T||b.length-1,E||e)}p(r,"t");function t(b,S,w){var T=b[S];b[S]=b[w],b[w]=T}p(t,"i");function e(b,S){return b<S?-1:b>S?1:0}p(e,"n");var i=p(function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function o(b,S,w){if(!w)return S.indexOf(b);for(var T=0;T<S.length;T++)if(w(b,S[T]))return T;return-1}p(o,"e");function n(b,S){s(b,0,b.children.length,S,b)}p(n,"a");function s(b,S,w,T,E){E||(E=I(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var D=S;D<w;D++){var A=b.children[D];c(E,b.leaf?T(A):A)}return E}p(s,"h");function c(b,S){return b.minX=Math.min(b.minX,S.minX),b.minY=Math.min(b.minY,S.minY),b.maxX=Math.max(b.maxX,S.maxX),b.maxY=Math.max(b.maxY,S.maxY),b}p(c,"o");function l(b,S){return b.minX-S.minX}p(l,"s");function u(b,S){return b.minY-S.minY}p(u,"l");function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}p(f,"f");function y(b){return b.maxX-b.minX+(b.maxY-b.minY)}p(y,"u");function g(b,S){return b.minX<=S.minX&&b.minY<=S.minY&&S.maxX<=b.maxX&&S.maxY<=b.maxY}p(g,"m");function v(b,S){return S.minX<=b.maxX&&S.minY<=b.maxY&&S.maxX>=b.minX&&S.maxY>=b.minY}p(v,"c");function I(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}p(I,"p");function x(b,S,w,T,E){for(var D=[S,w];D.length;)if(!((w=D.pop())-(S=D.pop())<=T)){var A=S+Math.ceil((w-S)/T/2)*T;r(b,A,S,w,E),D.push(S,A,A,w)}}return p(x,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var S=this.data,w=[];if(!v(b,S))return w;for(var T=this.toBBox,E=[];S;){for(var D=0;D<S.children.length;D++){var A=S.children[D],R=S.leaf?T(A):A;v(b,R)&&(S.leaf?w.push(A):g(b,R)?this._all(A,w):E.push(A))}S=E.pop()}return w},i.prototype.collides=function(b){var S=this.data;if(!v(b,S))return!1;for(var w=[];S;){for(var T=0;T<S.children.length;T++){var E=S.children[T],D=S.leaf?this.toBBox(E):E;if(v(b,D)){if(S.leaf||g(b,D))return!0;w.push(E)}}S=w.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var S=0;S<b.length;S++)this.insert(b[S]);return this}var w=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===w.height)this._splitRoot(this.data,w);else{if(this.data.height<w.height){var T=this.data;this.data=w,w=T}this._insert(w,this.data.height-w.height-1,!0)}else this.data=w;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=I([]),this},i.prototype.remove=function(b,S){if(!b)return this;for(var w,T,E,D=this.data,A=this.toBBox(b),R=[],N=[];D||R.length;){if(D||(D=R.pop(),T=R[R.length-1],w=N.pop(),E=!0),D.leaf){var B=o(b,D.children,S);if(B!==-1)return D.children.splice(B,1),R.push(D),this._condense(R),this}E||D.leaf||!g(D,A)?T?(w++,D=T.children[w],E=!1):D=null:(R.push(D),N.push(w),w=0,T=D,D=D.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,S){return b.minX-S.minX},i.prototype.compareMinY=function(b,S){return b.minY-S.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,S){for(var w=[];b;)b.leaf?S.push.apply(S,b.children):w.push.apply(w,b.children),b=w.pop();return S},i.prototype._build=function(b,S,w,T){var E,D=w-S+1,A=this._maxEntries;if(D<=A)return n(E=I(b.slice(S,w+1)),this.toBBox),E;T||(T=Math.ceil(Math.log(D)/Math.log(A)),A=Math.ceil(D/Math.pow(A,T-1))),(E=I([])).leaf=!1,E.height=T;var R=Math.ceil(D/A),N=R*Math.ceil(Math.sqrt(A));x(b,S,w,N,this.compareMinX);for(var B=S;B<=w;B+=N){var H=Math.min(B+N-1,w);x(b,B,H,R,this.compareMinY);for(var G=B;G<=H;G+=R){var $=Math.min(G+R-1,H);E.children.push(this._build(b,G,$,T-1))}}return n(E,this.toBBox),E},i.prototype._chooseSubtree=function(b,S,w,T){for(;T.push(S),!S.leaf&&T.length-1!==w;){for(var E=1/0,D=1/0,A=void 0,R=0;R<S.children.length;R++){var N=S.children[R],B=f(N),H=(G=b,$=N,(Math.max($.maxX,G.maxX)-Math.min($.minX,G.minX))*(Math.max($.maxY,G.maxY)-Math.min($.minY,G.minY))-B);H<D?(D=H,E=B<E?B:E,A=N):H===D&&B<E&&(E=B,A=N)}S=A||S.children[0]}var G,$;return S},i.prototype._insert=function(b,S,w){var T=w?b:this.toBBox(b),E=[],D=this._chooseSubtree(T,this.data,S,E);for(D.children.push(b),c(D,T);S>=0&&E[S].children.length>this._maxEntries;)this._split(E,S),S--;this._adjustParentBBoxes(T,E,S)},i.prototype._split=function(b,S){var w=b[S],T=w.children.length,E=this._minEntries;this._chooseSplitAxis(w,E,T);var D=this._chooseSplitIndex(w,E,T),A=I(w.children.splice(D,w.children.length-D));A.height=w.height,A.leaf=w.leaf,n(w,this.toBBox),n(A,this.toBBox),S?b[S-1].children.push(A):this._splitRoot(w,A)},i.prototype._splitRoot=function(b,S){this.data=I([b,S]),this.data.height=b.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,S,w){for(var T,E,D,A,R,N,B,H=1/0,G=1/0,$=S;$<=w-S;$++){var J=s(b,0,$,this.toBBox),he=s(b,$,w,this.toBBox),Se=(E=J,D=he,A=void 0,R=void 0,N=void 0,B=void 0,A=Math.max(E.minX,D.minX),R=Math.max(E.minY,D.minY),N=Math.min(E.maxX,D.maxX),B=Math.min(E.maxY,D.maxY),Math.max(0,N-A)*Math.max(0,B-R)),Ge=f(J)+f(he);Se<H?(H=Se,T=$,G=Ge<G?Ge:G):Se===H&&Ge<G&&(G=Ge,T=$)}return T||w-S},i.prototype._chooseSplitAxis=function(b,S,w){var T=b.leaf?this.compareMinX:l,E=b.leaf?this.compareMinY:u;this._allDistMargin(b,S,w,T)<this._allDistMargin(b,S,w,E)&&b.children.sort(T)},i.prototype._allDistMargin=function(b,S,w,T){b.children.sort(T);for(var E=this.toBBox,D=s(b,0,S,E),A=s(b,w-S,w,E),R=y(D)+y(A),N=S;N<w-S;N++){var B=b.children[N];c(D,b.leaf?E(B):B),R+=y(D)}for(var H=w-S-1;H>=S;H--){var G=b.children[H];c(A,b.leaf?E(G):G),R+=y(A)}return R},i.prototype._adjustParentBBoxes=function(b,S,w){for(var T=w;T>=0;T--)c(S[T],b)},i.prototype._condense=function(b){for(var S=b.length-1,w=void 0;S>=0;S--)b[S].children.length===0?S>0?(w=b[S-1].children).splice(w.indexOf(b[S]),1):this.clear():n(b[S],this.toBBox)},i})});var em=j(Y=>{"use strict";m();Object.defineProperty(Y,"__esModule",{value:!0});Y.earthRadius=63710088e-1;Y.factors={centimeters:Y.earthRadius*100,centimetres:Y.earthRadius*100,degrees:Y.earthRadius/111325,feet:Y.earthRadius*3.28084,inches:Y.earthRadius*39.37,kilometers:Y.earthRadius/1e3,kilometres:Y.earthRadius/1e3,meters:Y.earthRadius,metres:Y.earthRadius,miles:Y.earthRadius/1609.344,millimeters:Y.earthRadius*1e3,millimetres:Y.earthRadius*1e3,nauticalmiles:Y.earthRadius/1852,radians:1,yards:Y.earthRadius*1.0936};Y.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/Y.earthRadius,yards:1.0936133};Y.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}p(so,"feature");Y.feature=so;function ex(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return $f(t).geometry;case"LineString":return Qf(t).geometry;case"Polygon":return Jf(t).geometry;case"MultiPoint":return Ev(t).geometry;case"MultiLineString":return wv(t).geometry;case"MultiPolygon":return Dv(t).geometry;default:throw new Error(r+" is invalid")}}p(ex,"geometry");Y.geometry=ex;function $f(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(!fu(r[0])||!fu(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return so(i,t,e)}p($f,"point");Y.point=$f;function tx(r,t,e){return e===void 0&&(e={}),mu(r.map(function(i){return $f(i,t)}),e)}p(tx,"points");Y.points=tx;function Jf(r,t,e){e===void 0&&(e={});for(var i=0,o=r;i<o.length;i++){var n=o[i];if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<n[n.length-1].length;s++)if(n[n.length-1][s]!==n[0][s])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return so(c,t,e)}p(Jf,"polygon");Y.polygon=Jf;function rx(r,t,e){return e===void 0&&(e={}),mu(r.map(function(i){return Jf(i,t)}),e)}p(rx,"polygons");Y.polygons=rx;function Qf(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)}p(Qf,"lineString");Y.lineString=Qf;function ix(r,t,e){return e===void 0&&(e={}),mu(r.map(function(i){return Qf(i,t)}),e)}p(ix,"lineStrings");Y.lineStrings=ix;function mu(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}p(mu,"featureCollection");Y.featureCollection=mu;function wv(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return so(i,t,e)}p(wv,"multiLineString");Y.multiLineString=wv;function Ev(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return so(i,t,e)}p(Ev,"multiPoint");Y.multiPoint=Ev;function Dv(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return so(i,t,e)}p(Dv,"multiPolygon");Y.multiPolygon=Dv;function ox(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return so(i,t,e)}p(ox,"geometryCollection");Y.geometryCollection=ox;function nx(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}p(nx,"round");Y.round=nx;function Ov(r,t){t===void 0&&(t="kilometers");var e=Y.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}p(Ov,"radiansToLength");Y.radiansToLength=Ov;function Kf(r,t){t===void 0&&(t="kilometers");var e=Y.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}p(Kf,"lengthToRadians");Y.lengthToRadians=Kf;function ax(r,t){return Lv(Kf(r,t))}p(ax,"lengthToDegrees");Y.lengthToDegrees=ax;function sx(r){var t=r%360;return t<0&&(t+=360),t}p(sx,"bearingToAzimuth");Y.bearingToAzimuth=sx;function Lv(r){var t=r%(2*Math.PI);return t*180/Math.PI}p(Lv,"radiansToDegrees");Y.radiansToDegrees=Lv;function lx(r){var t=r%360;return t*Math.PI/180}p(lx,"degreesToRadians");Y.degreesToRadians=lx;function cx(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 Ov(Kf(r,t),e)}p(cx,"convertLength");Y.convertLength=cx;function px(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=Y.areaFactors[t];if(!i)throw new Error("invalid original units");var o=Y.areaFactors[e];if(!o)throw new Error("invalid final units");return r/i*o}p(px,"convertArea");Y.convertArea=px;function fu(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}p(fu,"isNumber");Y.isNumber=fu;function ux(r){return!!r&&r.constructor===Object}p(ux,"isObject");Y.isObject=ux;function dx(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(!fu(t))throw new Error("bbox must only contain numbers")})}p(dx,"validateBBox");Y.validateBBox=dx;function hx(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}p(hx,"validateId");Y.validateId=hx});var _v=j(je=>{"use strict";m();Object.defineProperty(je,"__esModule",{value:!0});var tt=em();function gl(r,t,e){if(r!==null)for(var i,o,n,s,c,l,u,f=0,y=0,g,v=r.type,I=v==="FeatureCollection",x=v==="Feature",b=I?r.features.length:1,S=0;S<b;S++){u=I?r.features[S].geometry:x?r.geometry:r,g=u?u.type==="GeometryCollection":!1,c=g?u.geometries.length:1;for(var w=0;w<c;w++){var T=0,E=0;if(s=g?u.geometries[w]:u,s!==null){l=s.coordinates;var D=s.type;switch(f=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(l,y,S,T,E)===!1)return!1;y++,T++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],y,S,T,E)===!1)return!1;y++,D==="MultiPoint"&&T++}D==="LineString"&&T++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-f;o++){if(t(l[i][o],y,S,T,E)===!1)return!1;y++}D==="MultiLineString"&&T++,D==="Polygon"&&E++}D==="Polygon"&&T++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(E=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-f;n++){if(t(l[i][o][n],y,S,T,E)===!1)return!1;y++}E++}T++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(gl(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}p(gl,"coordEach");function fx(r,t,e,i){var o=e;return gl(r,function(n,s,c,l,u){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,u)},i),o}p(fx,"coordReduce");function Av(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}p(Av,"propEach");function mx(r,t,e){var i=e;return Av(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(mx,"propReduce");function Fv(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}p(Fv,"featureEach");function yx(r,t,e){var i=e;return Fv(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(yx,"featureReduce");function gx(r){var t=[];return gl(r,function(e){t.push(e)}),t}p(gx,"coordAll");function tm(r,t){var e,i,o,n,s,c,l,u,f,y,g=0,v=r.type==="FeatureCollection",I=r.type==="Feature",x=v?r.features.length:1;for(e=0;e<x;e++){for(c=v?r.features[e].geometry:I?r.geometry:r,u=v?r.features[e].properties:I?r.properties:{},f=v?r.features[e].bbox:I?r.bbox:void 0,y=v?r.features[e].id:I?r.id:void 0,l=c?c.type==="GeometryCollection":!1,s=l?c.geometries.length:1,o=0;o<s;o++){if(n=l?c.geometries[o]:c,n===null){if(t(null,g,u,f,y)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,g,u,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],g,u,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}p(tm,"geomEach");function vx(r,t,e){var i=e;return tm(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}p(vx,"geomReduce");function yu(r,t){tm(r,function(e,i,o,n,s){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(tt.feature(e,o,{bbox:n,id:s}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var f=e.coordinates[u],y={type:l,coordinates:f};if(t(tt.feature(y,o),i,u)===!1)return!1}})}p(yu,"flattenEach");function bx(r,t,e){var i=e;return yu(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}p(bx,"flattenReduce");function Bv(r,t){yu(r,function(e,i,o){var n=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var c,l=0,u=0,f=0;if(gl(e,function(y,g,v,I,x){if(c===void 0||i>l||I>u||x>f){c=y,l=i,u=I,f=x,n=0;return}var b=tt.lineString([c,y],e.properties);if(t(b,i,o,x,n)===!1)return!1;n++,c=y})===!1)return!1}}})}p(Bv,"segmentEach");function Cx(r,t,e){var i=e,o=!1;return Bv(r,function(n,s,c,l,u){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,u),o=!0}),i}p(Cx,"segmentReduce");function kv(r,t){if(!r)throw new Error("geojson is required");yu(r,function(e,i,o){if(e.geometry!==null){var n=e.geometry.type,s=e.geometry.coordinates;switch(n){case"LineString":if(t(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<s.length;c++)if(t(tt.lineString(s[c],e.properties),i,o,c)===!1)return!1;break}}})}p(kv,"lineEach");function Sx(r,t,e){var i=e;return kv(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}p(Sx,"lineReduce");function xx(r,t){if(t=t||{},!tt.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.segmentIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return n<0&&(n=l.length+n-1),tt.lineString([l[n],l[n+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n-1),tt.lineString([l[o][n],l[o][n+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n-1),tt.lineString([l[i][n],l[i][n+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n-1),tt.lineString([l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}p(xx,"findSegment");function Ix(r,t){if(t=t||{},!tt.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.coordIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return tt.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),tt.point(l[i],s,t);case"LineString":return n<0&&(n=l.length+n),tt.point(l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),tt.point(l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),tt.point(l[i][n],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n),tt.point(l[i][o][n],s,t)}throw new Error("geojson is invalid")}p(Ix,"findPoint");je.coordAll=gx;je.coordEach=gl;je.coordReduce=fx;je.featureEach=Fv;je.featureReduce=yx;je.findPoint=Ix;je.findSegment=xx;je.flattenEach=yu;je.flattenReduce=bx;je.geomEach=tm;je.geomReduce=vx;je.lineEach=kv;je.lineReduce=Sx;je.propEach=Av;je.propReduce=mx;je.segmentEach=Bv;je.segmentReduce=Cx});var rm=j((uF,Nv)=>{"use strict";m();var Rv=Object.prototype.toString;Nv.exports=p(function(t){var e=Rv.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Rv.call(t.callee)==="[object Function]"),i},"isArguments")});var Zv=j((fF,Yv)=>{"use strict";m();var Wv;Object.keys||(vl=Object.prototype.hasOwnProperty,im=Object.prototype.toString,Gv=rm(),om=Object.prototype.propertyIsEnumerable,Vv=!om.call({toString:null},"toString"),jv=om.call(function(){},"prototype"),bl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],gu=p(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),Hv={$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},Uv=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!Hv["$"+r]&&vl.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{gu(window[r])}catch{return!0}}catch{return!0}return!1}(),Xv=p(function(r){if(typeof window>"u"||!Uv)return gu(r);try{return gu(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),Wv=p(function(t){var e=t!==null&&typeof t=="object",i=im.call(t)==="[object Function]",o=Gv(t),n=e&&im.call(t)==="[object String]",s=[];if(!e&&!i&&!o)throw new TypeError("Object.keys called on a non-object");var c=jv&&i;if(n&&t.length>0&&!vl.call(t,0))for(var l=0;l<t.length;++l)s.push(String(l));if(o&&t.length>0)for(var u=0;u<t.length;++u)s.push(String(u));else for(var f in t)!(c&&f==="prototype")&&vl.call(t,f)&&s.push(String(f));if(Vv)for(var y=Xv(t),g=0;g<bl.length;++g)!(y&&bl[g]==="constructor")&&vl.call(t,bl[g])&&s.push(bl[g]);return s},"keys"));var vl,im,Gv,om,Vv,jv,bl,gu,Hv,Uv,Xv;Yv.exports=Wv});var bu=j((gF,$v)=>{"use strict";m();var Mx=Array.prototype.slice,Px=rm(),zv=Object.keys,vu=zv?p(function(t){return zv(t)},"keys"):Zv(),qv=Object.keys;vu.shim=p(function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=p(function(i){return Px(i)?qv(Mx.call(i)):qv(i)},"keys"))}else Object.keys=vu;return Object.keys||vu},"shimObjectKeys");$v.exports=vu});var Qv=j((CF,Jv)=>{"use strict";m();Jv.exports=Error});var eb=j((xF,Kv)=>{"use strict";m();Kv.exports=EvalError});var rb=j((MF,tb)=>{"use strict";m();tb.exports=RangeError});var ob=j((TF,ib)=>{"use strict";m();ib.exports=ReferenceError});var nm=j((EF,nb)=>{"use strict";m();nb.exports=SyntaxError});var yi=j((OF,ab)=>{"use strict";m();ab.exports=TypeError});var lb=j((AF,sb)=>{"use strict";m();sb.exports=URIError});var Cl=j((BF,cb)=>{"use strict";m();cb.exports=p(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;t[e]=o;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var n=Object.getOwnPropertySymbols(t);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},"hasSymbols")});var Cu=j((RF,ub)=>{"use strict";m();var pb=typeof Symbol<"u"&&Symbol,Tx=Cl();ub.exports=p(function(){return typeof pb!="function"||typeof Symbol!="function"||typeof pb("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Tx()},"hasNativeSymbols")});var hb=j((VF,db)=>{"use strict";m();var am={__proto__:null,foo:{}},wx=Object;db.exports=p(function(){return{__proto__:am}.foo===am.foo&&!(am instanceof wx)},"hasProto")});var yb=j((UF,mb)=>{"use strict";m();var Ex="Function.prototype.bind called on incompatible ",Dx=Object.prototype.toString,Ox=Math.max,Lx="[object Function]",fb=p(function(t,e){for(var i=[],o=0;o<t.length;o+=1)i[o]=t[o];for(var n=0;n<e.length;n+=1)i[n+t.length]=e[n];return i},"concatty"),Ax=p(function(t,e){for(var i=[],o=e||0,n=0;o<t.length;o+=1,n+=1)i[n]=t[o];return i},"slicy"),Fx=p(function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e},"joiny");mb.exports=p(function(t){var e=this;if(typeof e!="function"||Dx.apply(e)!==Lx)throw new TypeError(Ex+e);for(var i=Ax(arguments,1),o,n=p(function(){if(this instanceof o){var f=e.apply(this,fb(i,arguments));return Object(f)===f?f:this}return e.apply(t,fb(i,arguments))},"binder"),s=Ox(0,e.length-i.length),c=[],l=0;l<s;l++)c[l]="$"+l;if(o=Function("binder","return function ("+Fx(c,",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var u=p(function(){},"Empty");u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},"bind")});var Su=j((YF,gb)=>{"use strict";m();var Bx=yb();gb.exports=Function.prototype.bind||Bx});var sm=j((zF,vb)=>{"use strict";m();var kx=Function.prototype.call,_x=Object.prototype.hasOwnProperty,Rx=Su();vb.exports=Rx.call(kx,_x)});var pr=j(($F,Ib)=>{"use strict";m();var oe,Nx=Qv(),Gx=eb(),Vx=rb(),jx=ob(),wa=nm(),Ta=yi(),Hx=lb(),xb=Function,lm=p(function(r){try{return xb('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),ln=Object.getOwnPropertyDescriptor;if(ln)try{ln({},"")}catch{ln=null}var cm=p(function(){throw new Ta},"throwTypeError"),Ux=ln?function(){try{return arguments.callee,cm}catch{try{return ln(arguments,"callee").get}catch{return cm}}}():cm,Ma=Cu()(),Xx=hb()(),qe=Object.getPrototypeOf||(Xx?function(r){return r.__proto__}:null),Pa={},Wx=typeof Uint8Array>"u"||!qe?oe:qe(Uint8Array),cn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?oe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?oe:ArrayBuffer,"%ArrayIteratorPrototype%":Ma&&qe?qe([][Symbol.iterator]()):oe,"%AsyncFromSyncIteratorPrototype%":oe,"%AsyncFunction%":Pa,"%AsyncGenerator%":Pa,"%AsyncGeneratorFunction%":Pa,"%AsyncIteratorPrototype%":Pa,"%Atomics%":typeof Atomics>"u"?oe:Atomics,"%BigInt%":typeof BigInt>"u"?oe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?oe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?oe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?oe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Nx,"%eval%":eval,"%EvalError%":Gx,"%Float32Array%":typeof Float32Array>"u"?oe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?oe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?oe:FinalizationRegistry,"%Function%":xb,"%GeneratorFunction%":Pa,"%Int8Array%":typeof Int8Array>"u"?oe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?oe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?oe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ma&&qe?qe(qe([][Symbol.iterator]())):oe,"%JSON%":typeof JSON=="object"?JSON:oe,"%Map%":typeof Map>"u"?oe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ma||!qe?oe:qe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?oe:Promise,"%Proxy%":typeof Proxy>"u"?oe:Proxy,"%RangeError%":Vx,"%ReferenceError%":jx,"%Reflect%":typeof Reflect>"u"?oe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?oe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ma||!qe?oe:qe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?oe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ma&&qe?qe(""[Symbol.iterator]()):oe,"%Symbol%":Ma?Symbol:oe,"%SyntaxError%":wa,"%ThrowTypeError%":Ux,"%TypedArray%":Wx,"%TypeError%":Ta,"%Uint8Array%":typeof Uint8Array>"u"?oe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?oe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?oe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?oe:Uint32Array,"%URIError%":Hx,"%WeakMap%":typeof WeakMap>"u"?oe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?oe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?oe:WeakSet};if(qe)try{null.error}catch(r){bb=qe(qe(r)),cn["%Error.prototype%"]=bb}var bb,Yx=p(function r(t){var e;if(t==="%AsyncFunction%")e=lm("async function () {}");else if(t==="%GeneratorFunction%")e=lm("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=lm("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&qe&&(e=qe(o.prototype))}return cn[t]=e,e},"doEval"),Cb={__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"]},Sl=Su(),xu=sm(),Zx=Sl.call(Function.call,Array.prototype.concat),zx=Sl.call(Function.apply,Array.prototype.splice),Sb=Sl.call(Function.call,String.prototype.replace),Iu=Sl.call(Function.call,String.prototype.slice),qx=Sl.call(Function.call,RegExp.prototype.exec),$x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jx=/\\(\\)?/g,Qx=p(function(t){var e=Iu(t,0,1),i=Iu(t,-1);if(e==="%"&&i!=="%")throw new wa("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new wa("invalid intrinsic syntax, expected opening `%`");var o=[];return Sb(t,$x,function(n,s,c,l){o[o.length]=c?Sb(l,Jx,"$1"):s||n}),o},"stringToPath"),Kx=p(function(t,e){var i=t,o;if(xu(Cb,i)&&(o=Cb[i],i="%"+o[0]+"%"),xu(cn,i)){var n=cn[i];if(n===Pa&&(n=Yx(i)),typeof n>"u"&&!e)throw new Ta("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:n}}throw new wa("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ib.exports=p(function(t,e){if(typeof t!="string"||t.length===0)throw new Ta("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ta('"allowMissing" argument must be a boolean');if(qx(/^%?[^%]*%?$/,t)===null)throw new wa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Qx(t),o=i.length>0?i[0]:"",n=Kx("%"+o+"%",e),s=n.name,c=n.value,l=!1,u=n.alias;u&&(o=u[0],zx(i,Zx([0,1],u)));for(var f=1,y=!0;f<i.length;f+=1){var g=i[f],v=Iu(g,0,1),I=Iu(g,-1);if((v==='"'||v==="'"||v==="`"||I==='"'||I==="'"||I==="`")&&v!==I)throw new wa("property names with quotes must have matching quotes");if((g==="constructor"||!y)&&(l=!0),o+="."+g,s="%"+o+"%",xu(cn,s))c=cn[s];else if(c!=null){if(!(g in c)){if(!e)throw new Ta("base intrinsic for "+t+" exists, but the property is not available.");return}if(ln&&f+1>=i.length){var x=ln(c,g);y=!!x,y&&"get"in x&&!("originalValue"in x.get)?c=x.get:c=c[g]}else y=xu(c,g),c=c[g];y&&!l&&(cn[s]=c)}}return c},"GetIntrinsic")});var Pu=j((KF,Mb)=>{"use strict";m();var e9=pr(),Mu=e9("%Object.defineProperty%",!0)||!1;if(Mu)try{Mu({},"a",{value:1})}catch{Mu=!1}Mb.exports=Mu});var wu=j((tB,Pb)=>{"use strict";m();var t9=pr(),Tu=t9("%Object.getOwnPropertyDescriptor%",!0);if(Tu)try{Tu([],"length")}catch{Tu=null}Pb.exports=Tu});var Eu=j((iB,Eb)=>{"use strict";m();var Tb=Pu(),r9=nm(),Ea=yi(),wb=wu();Eb.exports=p(function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Ea("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ea("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ea("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ea("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ea("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ea("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!wb&&wb(t,e);if(Tb)Tb(t,e,{configurable:s===null&&l?l.configurable:!s,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:n===null&&l?l.writable:!n});else if(c||!o&&!n&&!s)t[e]=i;else throw new r9("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Du=j((aB,Ob)=>{"use strict";m();var pm=Pu(),Db=p(function(){return!!pm},"hasPropertyDescriptors");Db.hasArrayLengthDefineBug=p(function(){if(!pm)return null;try{return pm([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");Ob.exports=Db});var lo=j((cB,Bb)=>{"use strict";m();var i9=bu(),o9=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n9=Object.prototype.toString,a9=Array.prototype.concat,Lb=Eu(),s9=p(function(r){return typeof r=="function"&&n9.call(r)==="[object Function]"},"isFunction"),Ab=Du()(),l9=p(function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!s9(i)||!i())return}Ab?Lb(r,t,e,!0):Lb(r,t,e)},"defineProperty"),Fb=p(function(r,t){var e=arguments.length>2?arguments[2]:{},i=i9(t);o9&&(i=a9.call(i,Object.getOwnPropertySymbols(t)));for(var o=0;o<i.length;o+=1)l9(r,i[o],t[i[o]],e[i[o]])},"defineProperties");Fb.supportsDescriptors=!!Ab;Bb.exports=Fb});var Gb=j((dB,Nb)=>{"use strict";m();var c9=pr(),kb=Eu(),p9=Du()(),_b=wu(),Rb=yi(),u9=c9("%Math.floor%");Nb.exports=p(function(t,e){if(typeof t!="function")throw new Rb("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||u9(e)!==e)throw new Rb("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,n=!0;if("length"in t&&_b){var s=_b(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(n=!1)}return(o||n||!i)&&(p9?kb(t,"length",e,!0,!0):kb(t,"length",e)),t},"setFunctionLength")});var pn=j((mB,Ou)=>{"use strict";m();var um=Su(),Lu=pr(),d9=Gb(),h9=yi(),Hb=Lu("%Function.prototype.apply%"),Ub=Lu("%Function.prototype.call%"),Xb=Lu("%Reflect.apply%",!0)||um.call(Ub,Hb),Vb=Pu(),f9=Lu("%Math.max%");Ou.exports=p(function(t){if(typeof t!="function")throw new h9("a function is required");var e=Xb(um,Ub,arguments);return d9(e,1+f9(0,t.length-(arguments.length-1)),!0)},"callBind");var jb=p(function(){return Xb(um,Hb,arguments)},"applyBind");Vb?Vb(Ou.exports,"apply",{value:jb}):Ou.exports.apply=jb});var Bt=j((vB,Zb)=>{"use strict";m();var Wb=pr(),Yb=pn(),m9=Yb(Wb("String.prototype.indexOf"));Zb.exports=p(function(t,e){var i=Wb(t,!!e);return typeof i=="function"&&m9(t,".prototype.")>-1?Yb(i):i},"callBoundIntrinsic")});var dm=j((SB,Qb)=>{"use strict";m();var y9=bu(),$b=Cl()(),Jb=Bt(),zb=Object,g9=Jb("Array.prototype.push"),qb=Jb("Object.prototype.propertyIsEnumerable"),v9=$b?Object.getOwnPropertySymbols:null;Qb.exports=p(function(t,e){if(t==null)throw new TypeError("target must be an object");var i=zb(t);if(arguments.length===1)return i;for(var o=1;o<arguments.length;++o){var n=zb(arguments[o]),s=y9(n),c=$b&&(Object.getOwnPropertySymbols||v9);if(c)for(var l=c(n),u=0;u<l.length;++u){var f=l[u];qb(n,f)&&g9(s,f)}for(var y=0;y<s.length;++y){var g=s[y];if(qb(n,g)){var v=n[g];i[g]=v}}}return i},"assign")});var fm=j((MB,Kb)=>{"use strict";m();var hm=dm(),b9=p(function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},i=0;i<t.length;++i)e[t[i]]=t[i];var o=Object.assign({},e),n="";for(var s in o)n+=s;return r!==n},"lacksProperEnumerationOrder"),C9=p(function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1},"assignHasPendingExceptions");Kb.exports=p(function(){return!Object.assign||b9()||C9()?hm:Object.assign},"getPolyfill")});var t3=j((wB,e3)=>{"use strict";m();var S9=lo(),x9=fm();e3.exports=p(function(){var t=x9();return S9(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t},"shimAssign")});var n3=j((OB,o3)=>{"use strict";m();var I9=lo(),M9=pn(),P9=dm(),r3=fm(),T9=t3(),w9=M9.apply(r3()),i3=p(function(t,e){return w9(Object,arguments)},"assign");I9(i3,{getPolyfill:r3,implementation:P9,shim:T9});o3.exports=i3});var s3=j((FB,a3)=>{"use strict";m();var Il=p(function(){return typeof p(function(){},"f").name=="string"},"functionsHaveNames"),xl=Object.getOwnPropertyDescriptor;if(xl)try{xl([],"length")}catch{xl=null}Il.functionsHaveConfigurableNames=p(function(){if(!Il()||!xl)return!1;var t=xl(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var E9=Function.prototype.bind;Il.boundFunctionsHaveNames=p(function(){return Il()&&typeof E9=="function"&&p(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");a3.exports=Il});var p3=j((_B,c3)=>{"use strict";m();var l3=Eu(),D9=Du()(),O9=s3().functionsHaveConfigurableNames(),L9=yi();c3.exports=p(function(t,e){if(typeof t!="function")throw new L9("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||O9)&&(D9?l3(t,"name",e,!0,!0):l3(t,"name",e)),t},"setFunctionName")});var mm=j((GB,u3)=>{"use strict";m();var A9=p3(),F9=yi(),B9=Object;u3.exports=A9(p(function(){if(this==null||this!==B9(this))throw new F9("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 ym=j((HB,d3)=>{"use strict";m();var k9=mm(),_9=lo().supportsDescriptors,R9=Object.getOwnPropertyDescriptor;d3.exports=p(function(){if(_9&&/a/mig.flags==="gim"){var t=R9(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return k9},"getPolyfill")});var m3=j((WB,f3)=>{"use strict";m();var N9=lo().supportsDescriptors,G9=ym(),V9=Object.getOwnPropertyDescriptor,j9=Object.defineProperty,H9=TypeError,h3=Object.getPrototypeOf,U9=/a/;f3.exports=p(function(){if(!N9||!h3)throw new H9("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=G9(),e=h3(U9),i=V9(e,"flags");return(!i||i.get!==t)&&j9(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var b3=j((zB,v3)=>{"use strict";m();var X9=lo(),W9=pn(),Y9=mm(),y3=ym(),Z9=m3(),g3=W9(y3());X9(g3,{getPolyfill:y3,implementation:Y9,shim:Z9});v3.exports=g3});var co=j(($B,C3)=>{"use strict";m();var z9=Cl();C3.exports=p(function(){return z9()&&!!Symbol.toStringTag},"hasToStringTagShams")});var vm=j((KB,x3)=>{"use strict";m();var q9=co()(),$9=Bt(),gm=$9("Object.prototype.toString"),Au=p(function(t){return q9&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:gm(t)==="[object Arguments]"},"isArguments"),S3=p(function(t){return Au(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&gm(t)!=="[object Array]"&&gm(t.callee)==="[object Function]"},"isArguments"),J9=function(){return Au(arguments)}();Au.isLegacyArguments=S3;x3.exports=J9?Au:S3});var I3=j(()=>{m()});var U3=j((nk,H3)=>{m();var Em=typeof Map=="function"&&Map.prototype,bm=Object.getOwnPropertyDescriptor&&Em?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Bu=Em&&bm&&typeof bm.get=="function"?bm.get:null,M3=Em&&Map.prototype.forEach,Dm=typeof Set=="function"&&Set.prototype,Cm=Object.getOwnPropertyDescriptor&&Dm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ku=Dm&&Cm&&typeof Cm.get=="function"?Cm.get:null,P3=Dm&&Set.prototype.forEach,Q9=typeof WeakMap=="function"&&WeakMap.prototype,Pl=Q9?WeakMap.prototype.has:null,K9=typeof WeakSet=="function"&&WeakSet.prototype,Tl=K9?WeakSet.prototype.has:null,e8=typeof WeakRef=="function"&&WeakRef.prototype,T3=e8?WeakRef.prototype.deref:null,t8=Boolean.prototype.valueOf,r8=Object.prototype.toString,i8=Function.prototype.toString,o8=String.prototype.match,Om=String.prototype.slice,uo=String.prototype.replace,n8=String.prototype.toUpperCase,w3=String.prototype.toLowerCase,_3=RegExp.prototype.test,E3=Array.prototype.concat,Br=Array.prototype.join,a8=Array.prototype.slice,D3=Math.floor,Im=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Sm=Object.getOwnPropertySymbols,Mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Da=typeof Symbol=="function"&&typeof Symbol.iterator=="object",rt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Da||!0)?Symbol.toStringTag:null,R3=Object.prototype.propertyIsEnumerable,O3=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function L3(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||_3.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-D3(-r):D3(r);if(i!==r){var o=String(i),n=Om.call(t,o.length+1);return uo.call(o,e,"$&_")+"."+uo.call(uo.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return uo.call(t,e,"$&_")}p(L3,"addNumericSeparator");var Pm=I3(),A3=Pm.custom,F3=G3(A3)?A3:null;H3.exports=p(function r(t,e,i,o){var n=e||{};if(po(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(po(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=po(n,"customInspect")?n.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(po(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(po(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=n.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return j3(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return c?L3(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return c?L3(t,u):u}var f=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=f&&f>0&&typeof t=="object")return Tm(t)?"[Array]":"[Object]";var y=M8(n,i);if(typeof o>"u")o=[];else if(V3(o,t)>=0)return"[Circular]";function g(J,he,Se){if(he&&(o=a8.call(o),o.push(he)),Se){var Ge={depth:n.depth};return po(n,"quoteStyle")&&(Ge.quoteStyle=n.quoteStyle),r(J,Ge,i+1,o)}return r(J,n,i+1,o)}if(p(g,"inspect"),typeof t=="function"&&!B3(t)){var v=m8(t),I=Fu(t,g);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(I.length>0?" { "+Br.call(I,", ")+" }":"")}if(G3(t)){var x=Da?uo.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Mm.call(t);return typeof t=="object"&&!Da?Ml(x):x}if(S8(t)){for(var b="<"+w3.call(String(t.nodeName)),S=t.attributes||[],w=0;w<S.length;w++)b+=" "+S[w].name+"="+N3(s8(S[w].value),"double",n);return b+=">",t.childNodes&&t.childNodes.length&&(b+="..."),b+="</"+w3.call(String(t.nodeName))+">",b}if(Tm(t)){if(t.length===0)return"[]";var T=Fu(t,g);return y&&!I8(T)?"["+wm(T,y)+"]":"[ "+Br.call(T,", ")+" ]"}if(c8(t)){var E=Fu(t,g);return!("cause"in Error.prototype)&&"cause"in t&&!R3.call(t,"cause")?"{ ["+String(t)+"] "+Br.call(E3.call("[cause]: "+g(t.cause),E),", ")+" }":E.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Br.call(E,", ")+" }"}if(typeof t=="object"&&s){if(F3&&typeof t[F3]=="function"&&Pm)return Pm(t,{depth:f-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(y8(t)){var D=[];return M3&&M3.call(t,function(J,he){D.push(g(he,t,!0)+" => "+g(J,t))}),k3("Map",Bu.call(t),D,y)}if(b8(t)){var A=[];return P3&&P3.call(t,function(J){A.push(g(J,t))}),k3("Set",ku.call(t),A,y)}if(g8(t))return xm("WeakMap");if(C8(t))return xm("WeakSet");if(v8(t))return xm("WeakRef");if(u8(t))return Ml(g(Number(t)));if(h8(t))return Ml(g(Im.call(t)));if(d8(t))return Ml(t8.call(t));if(p8(t))return Ml(g(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!l8(t)&&!B3(t)){var R=Fu(t,g),N=O3?O3(t)===Object.prototype:t instanceof Object||t.constructor===Object,B=t instanceof Object?"":"null prototype",H=!N&&rt&&Object(t)===t&&rt in t?Om.call(ho(t),8,-1):B?"Object":"",G=N||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",$=G+(H||B?"["+Br.call(E3.call([],H||[],B||[]),": ")+"] ":"");return R.length===0?$+"{}":y?$+"{"+wm(R,y)+"}":$+"{ "+Br.call(R,", ")+" }"}return String(t)},"inspect_");function N3(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}p(N3,"wrapQuotes");function s8(r){return uo.call(String(r),/"/g,""")}p(s8,"quote");function Tm(r){return ho(r)==="[object Array]"&&(!rt||!(typeof r=="object"&&rt in r))}p(Tm,"isArray");function l8(r){return ho(r)==="[object Date]"&&(!rt||!(typeof r=="object"&&rt in r))}p(l8,"isDate");function B3(r){return ho(r)==="[object RegExp]"&&(!rt||!(typeof r=="object"&&rt in r))}p(B3,"isRegExp");function c8(r){return ho(r)==="[object Error]"&&(!rt||!(typeof r=="object"&&rt in r))}p(c8,"isError");function p8(r){return ho(r)==="[object String]"&&(!rt||!(typeof r=="object"&&rt in r))}p(p8,"isString");function u8(r){return ho(r)==="[object Number]"&&(!rt||!(typeof r=="object"&&rt in r))}p(u8,"isNumber");function d8(r){return ho(r)==="[object Boolean]"&&(!rt||!(typeof r=="object"&&rt in r))}p(d8,"isBoolean");function G3(r){if(Da)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Mm)return!1;try{return Mm.call(r),!0}catch{}return!1}p(G3,"isSymbol");function h8(r){if(!r||typeof r!="object"||!Im)return!1;try{return Im.call(r),!0}catch{}return!1}p(h8,"isBigInt");var f8=Object.prototype.hasOwnProperty||function(r){return r in this};function po(r,t){return f8.call(r,t)}p(po,"has");function ho(r){return r8.call(r)}p(ho,"toStr");function m8(r){if(r.name)return r.name;var t=o8.call(i8.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}p(m8,"nameOf");function V3(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}p(V3,"indexOf");function y8(r){if(!Bu||!r||typeof r!="object")return!1;try{Bu.call(r);try{ku.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}p(y8,"isMap");function g8(r){if(!Pl||!r||typeof r!="object")return!1;try{Pl.call(r,Pl);try{Tl.call(r,Tl)}catch{return!0}return r instanceof WeakMap}catch{}return!1}p(g8,"isWeakMap");function v8(r){if(!T3||!r||typeof r!="object")return!1;try{return T3.call(r),!0}catch{}return!1}p(v8,"isWeakRef");function b8(r){if(!ku||!r||typeof r!="object")return!1;try{ku.call(r);try{Bu.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}p(b8,"isSet");function C8(r){if(!Tl||!r||typeof r!="object")return!1;try{Tl.call(r,Tl);try{Pl.call(r,Pl)}catch{return!0}return r instanceof WeakSet}catch{}return!1}p(C8,"isWeakSet");function S8(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}p(S8,"isElement");function j3(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return j3(Om.call(r,0,t.maxStringLength),t)+i}var o=uo.call(uo.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,x8);return N3(o,"single",t)}p(j3,"inspectString");function x8(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":"")+n8.call(t.toString(16))}p(x8,"lowbyte");function Ml(r){return"Object("+r+")"}p(Ml,"markBoxed");function xm(r){return r+" { ? }"}p(xm,"weakCollectionOf");function k3(r,t,e,i){var o=i?wm(e,i):Br.call(e,", ");return r+" ("+t+") {"+o+"}"}p(k3,"collectionOf");function I8(r){for(var t=0;t<r.length;t++)if(V3(r[t],"\n")>=0)return!1;return!0}p(I8,"singleLineValues");function M8(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=Br.call(Array(r.indent+1)," ");else return null;return{base:e,prev:Br.call(Array(t+1),e)}}p(M8,"getIndent");function wm(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+Br.call(r,","+e)+"\n"+t.prev}p(wm,"indentedJoin");function Fu(r,t){var e=Tm(r),i=[];if(e){i.length=r.length;for(var o=0;o<r.length;o++)i[o]=po(r,o)?t(r[o],r):""}var n=typeof Sm=="function"?Sm(r):[],s;if(Da){s={};for(var c=0;c<n.length;c++)s["$"+n[c]]=n[c]}for(var l in r)po(r,l)&&(e&&String(Number(l))===l&&l<r.length||Da&&s["$"+l]instanceof Symbol||(_3.call(/[^\w$]/,l)?i.push(t(l,r)+": "+t(r[l],r)):i.push(l+": "+t(r[l],r))));if(typeof Sm=="function")for(var u=0;u<n.length;u++)R3.call(r,n[u])&&i.push("["+t(n[u])+"]: "+t(r[n[u]],r));return i}p(Fu,"arrObjKeys")});var Am=j((lk,W3)=>{"use strict";m();var X3=pr(),Oa=Bt(),P8=U3(),T8=yi(),_u=X3("%WeakMap%",!0),Ru=X3("%Map%",!0),w8=Oa("WeakMap.prototype.get",!0),E8=Oa("WeakMap.prototype.set",!0),D8=Oa("WeakMap.prototype.has",!0),O8=Oa("Map.prototype.get",!0),L8=Oa("Map.prototype.set",!0),A8=Oa("Map.prototype.has",!0),Lm=p(function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),F8=p(function(r,t){var e=Lm(r,t);return e&&e.value},"listGet"),B8=p(function(r,t,e){var i=Lm(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},"listSet"),k8=p(function(r,t){return!!Lm(r,t)},"listHas");W3.exports=p(function(){var t,e,i,o={assert:function(n){if(!o.has(n))throw new T8("Side channel does not contain "+P8(n))},get:function(n){if(_u&&n&&(typeof n=="object"||typeof n=="function")){if(t)return w8(t,n)}else if(Ru){if(e)return O8(e,n)}else if(i)return F8(i,n)},has:function(n){if(_u&&n&&(typeof n=="object"||typeof n=="function")){if(t)return D8(t,n)}else if(Ru){if(e)return A8(e,n)}else if(i)return k8(i,n);return!1},set:function(n,s){_u&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new _u),E8(t,n,s)):Ru?(e||(e=new Ru),L8(e,n,s)):(i||(i={key:{},next:null}),B8(i,n,s))}};return o},"getSideChannel")});var Z3=j((uk,Y3)=>{"use strict";m();var _8=sm(),wl=Am()(),gi=yi(),Fm={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new gi("`O` is not an object");if(typeof t!="string")throw new gi("`slot` must be a string");if(wl.assert(r),!Fm.has(r,t))throw new gi("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new gi("`O` is not an object");if(typeof t!="string")throw new gi("`slot` must be a string");var e=wl.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new gi("`O` is not an object");if(typeof t!="string")throw new gi("`slot` must be a string");var e=wl.get(r);return!!e&&_8(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new gi("`O` is not an object");if(typeof t!="string")throw new gi("`slot` must be a string");var i=wl.get(r);i||(i={},wl.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(Fm);Y3.exports=Fm});var $3=j((hk,q3)=>{"use strict";m();var El=Z3(),R8=SyntaxError,z3=typeof StopIteration=="object"?StopIteration:null;q3.exports=p(function(t){if(!z3)throw new R8("this environment lacks StopIteration");El.set(t,"[[Done]]",!1);var e={next:p(function(){var o=El.get(this,"[[Iterator]]"),n=El.get(o,"[[Done]]");try{return{done:n,value:n?void 0:o.next()}}catch(s){if(El.set(o,"[[Done]]",!0),s!==z3)throw s;return{done:!0,value:void 0}}},"next")};return El.set(e,"[[Iterator]]",t),e},"getStopIterationIterator")});var Bm=j((yk,J3)=>{m();var N8={}.toString;J3.exports=Array.isArray||function(r){return N8.call(r)=="[object Array]"}});var km=j((vk,Q3)=>{"use strict";m();var G8=String.prototype.valueOf,V8=p(function(t){try{return G8.call(t),!0}catch{return!1}},"tryStringObject"),j8=Object.prototype.toString,H8="[object String]",U8=co()();Q3.exports=p(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:U8?V8(t):j8.call(t)===H8},"isString")});var Rm=j((Sk,t4)=>{"use strict";m();var _m=typeof Map=="function"&&Map.prototype?Map:null,X8=typeof Set=="function"&&Set.prototype?Set:null,Nu;_m||(Nu=p(function(t){return!1},"isMap"));var e4=_m?Map.prototype.has:null,K3=X8?Set.prototype.has:null;!Nu&&!e4&&(Nu=p(function(t){return!1},"isMap"));t4.exports=Nu||p(function(t){if(!t||typeof t!="object")return!1;try{if(e4.call(t),K3)try{K3.call(t)}catch{return!0}return t instanceof _m}catch{}return!1},"isMap")});var Gm=j((Mk,o4)=>{"use strict";m();var W8=typeof Map=="function"&&Map.prototype?Map:null,Nm=typeof Set=="function"&&Set.prototype?Set:null,Gu;Nm||(Gu=p(function(t){return!1},"isSet"));var r4=W8?Map.prototype.has:null,i4=Nm?Set.prototype.has:null;!Gu&&!i4&&(Gu=p(function(t){return!1},"isSet"));o4.exports=Gu||p(function(t){if(!t||typeof t!="object")return!1;try{if(i4.call(t),r4)try{r4.call(t)}catch{return!0}return t instanceof Nm}catch{}return!1},"isSet")});var y4=j((wk,Hu)=>{"use strict";m();var n4=vm(),a4=$3();Cu()()||Cl()()?(Vu=Symbol.iterator,Hu.exports=p(function(t){if(t!=null&&typeof t[Vu]<"u")return t[Vu]();if(n4(t))return Array.prototype[Vu].call(t)},"getIterator")):(s4=Bm(),l4=km(),Vm=pr(),c4=Vm("%Map%",!0),p4=Vm("%Set%",!0),Yt=Bt(),jm=Yt("Array.prototype.push"),Hm=Yt("String.prototype.charCodeAt"),u4=Yt("String.prototype.slice"),d4=p(function(t,e){var i=t.length;if(e+1>=i)return e+1;var o=Hm(t,e);if(o<55296||o>56319)return e+1;var n=Hm(t,e+1);return n<56320||n>57343?e+1:e+2},"advanceStringIndex"),ju=p(function(t){var e=0;return{next:p(function(){var o=e>=t.length,n;return o||(n=t[e],e+=1),{done:o,value:n}},"next")}},"getArrayIterator"),Um=p(function(t,e){if(s4(t)||n4(t))return ju(t);if(l4(t)){var i=0;return{next:p(function(){var n=d4(t,i),s=u4(t,i,n);return i=n,{done:n>t.length,value:s}},"next")}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},"getNonCollectionIterator"),!c4&&!p4?Hu.exports=p(function(t){if(t!=null)return Um(t,!0)},"getIterator"):(h4=Rm(),f4=Gm(),Xm=Yt("Map.prototype.forEach",!0),Wm=Yt("Set.prototype.forEach",!0),(typeof M>"u"||!M.versions||!M.versions.node)&&(Ym=Yt("Map.prototype.iterator",!0),Zm=Yt("Set.prototype.iterator",!0)),zm=Yt("Map.prototype.@@iterator",!0)||Yt("Map.prototype._es6-shim iterator_",!0),qm=Yt("Set.prototype.@@iterator",!0)||Yt("Set.prototype._es6-shim iterator_",!0),m4=p(function(t){if(h4(t)){if(Ym)return a4(Ym(t));if(zm)return zm(t);if(Xm){var e=[];return Xm(t,function(o,n){jm(e,[n,o])}),ju(e)}}if(f4(t)){if(Zm)return a4(Zm(t));if(qm)return qm(t);if(Wm){var i=[];return Wm(t,function(o){jm(i,o)}),ju(i)}}},"getCollectionIterator"),Hu.exports=p(function(t){return m4(t)||Um(t)},"getIterator")));var Vu,s4,l4,Vm,c4,p4,Yt,jm,Hm,u4,d4,ju,Um,h4,f4,Xm,Wm,Ym,Zm,zm,qm,m4});var $m=j((Ok,v4)=>{"use strict";m();var g4=p(function(r){return r!==r},"numberIsNaN");v4.exports=p(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||g4(t)&&g4(e))},"is")});var Jm=j((Fk,b4)=>{"use strict";m();var Y8=$m();b4.exports=p(function(){return typeof Object.is=="function"?Object.is:Y8},"getPolyfill")});var S4=j((_k,C4)=>{"use strict";m();var Z8=Jm(),z8=lo();C4.exports=p(function(){var t=Z8();return z8(Object,{is:t},{is:p(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var P4=j((Gk,M4)=>{"use strict";m();var q8=lo(),$8=pn(),J8=$m(),x4=Jm(),Q8=S4(),I4=$8(x4(),Object);q8(I4,{getPolyfill:x4,implementation:J8,shim:Q8});M4.exports=I4});var Km=j((jk,D4)=>{"use strict";m();var K8=pn(),E4=Bt(),eI=pr(),Qm=eI("%ArrayBuffer%",!0),Uu=E4("ArrayBuffer.prototype.byteLength",!0),tI=E4("Object.prototype.toString"),T4=!!Qm&&!Uu&&new Qm(0).slice,w4=!!T4&&K8(T4);D4.exports=p(Uu||w4?function(t){if(!t||typeof t!="object")return!1;try{return Uu?Uu(t):w4(t,0),!0}catch{return!1}}:Qm?function(t){return tI(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var L4=j((Xk,O4)=>{"use strict";m();var rI=Date.prototype.getDay,iI=p(function(t){try{return rI.call(t),!0}catch{return!1}},"tryDateGetDayCall"),oI=Object.prototype.toString,nI="[object Date]",aI=co()();O4.exports=p(function(t){return typeof t!="object"||t===null?!1:aI?iI(t):oI.call(t)===nI},"isDateObject")});var _4=j((Zk,k4)=>{"use strict";m();var ey=Bt(),A4=co()(),F4,B4,ty,ry;A4&&(F4=ey("Object.prototype.hasOwnProperty"),B4=ey("RegExp.prototype.exec"),ty={},Xu=p(function(){throw ty},"throwRegexMarker"),ry={toString:Xu,valueOf:Xu},typeof Symbol.toPrimitive=="symbol"&&(ry[Symbol.toPrimitive]=Xu));var Xu,sI=ey("Object.prototype.toString"),lI=Object.getOwnPropertyDescriptor,cI="[object RegExp]";k4.exports=p(A4?function(t){if(!t||typeof t!="object")return!1;var e=lI(t,"lastIndex"),i=e&&F4(e,"value");if(!i)return!1;try{B4(t,ry)}catch(o){return o===ty}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:sI(t)===cI},"isRegex")});var G4=j(($k,N4)=>{"use strict";m();var pI=Bt(),R4=pI("SharedArrayBuffer.prototype.byteLength",!0);N4.exports=p(R4?function(t){if(!t||typeof t!="object")return!1;try{return R4(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var j4=j((Kk,V4)=>{"use strict";m();var uI=Number.prototype.toString,dI=p(function(t){try{return uI.call(t),!0}catch{return!1}},"tryNumberObject"),hI=Object.prototype.toString,fI="[object Number]",mI=co()();V4.exports=p(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:mI?dI(t):hI.call(t)===fI},"isNumberObject")});var X4=j((r_,U4)=>{"use strict";m();var H4=Bt(),yI=H4("Boolean.prototype.toString"),gI=H4("Object.prototype.toString"),vI=p(function(t){try{return yI(t),!0}catch{return!1}},"booleanBrandCheck"),bI="[object Boolean]",CI=co()();U4.exports=p(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:CI&&Symbol.toStringTag in t?vI(t):gI(t)===bI},"isBoolean")});var z4=j((n_,iy)=>{"use strict";m();var SI=Object.prototype.toString,xI=Cu()();xI?(W4=Symbol.prototype.toString,Y4=/^Symbol\(.*\)$/,Z4=p(function(t){return typeof t.valueOf()!="symbol"?!1:Y4.test(W4.call(t))},"isRealSymbolObject"),iy.exports=p(function(t){if(typeof t=="symbol")return!0;if(SI.call(t)!=="[object Symbol]")return!1;try{return Z4(t)}catch{return!1}},"isSymbol")):iy.exports=p(function(t){return!1},"isSymbol");var W4,Y4,Z4});var J4=j((l_,$4)=>{"use strict";m();var q4=typeof BigInt<"u"&&BigInt;$4.exports=p(function(){return typeof q4=="function"&&typeof BigInt=="function"&&typeof q4(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var e5=j((u_,oy)=>{"use strict";m();var II=J4()();II?(Q4=BigInt.prototype.valueOf,K4=p(function(t){try{return Q4.call(t),!0}catch{}return!1},"tryBigIntObject"),oy.exports=p(function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:K4(t)},"isBigInt")):oy.exports=p(function(t){return!1},"isBigInt");var Q4,K4});var r5=j((f_,t5)=>{"use strict";m();var MI=km(),PI=j4(),TI=X4(),wI=z4(),EI=e5();t5.exports=p(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(MI(t))return"String";if(PI(t))return"Number";if(TI(t))return"Boolean";if(wI(t))return"Symbol";if(EI(t))return"BigInt"},"whichBoxedPrimitive")});var n5=j((g_,o5)=>{"use strict";m();var Wu=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,i5=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Yu;Wu||(Yu=p(function(t){return!1},"isWeakMap"));var ay=Wu?Wu.prototype.has:null,ny=i5?i5.prototype.has:null;!Yu&&!ay&&(Yu=p(function(t){return!1},"isWeakMap"));o5.exports=Yu||p(function(t){if(!t||typeof t!="object")return!1;try{if(ay.call(t,ay),ny)try{ny.call(t,ny)}catch{return!0}return t instanceof Wu}catch{}return!1},"isWeakMap")});var s5=j((C_,ly)=>{"use strict";m();var DI=pr(),a5=Bt(),OI=DI("%WeakSet%",!0),sy=a5("WeakSet.prototype.has",!0);sy?(Zu=a5("WeakMap.prototype.has",!0),ly.exports=p(function(t){if(!t||typeof t!="object")return!1;try{if(sy(t,sy),Zu)try{Zu(t,Zu)}catch{return!0}return t instanceof OI}catch{}return!1},"isWeakSet")):ly.exports=p(function(t){return!1},"isWeakSet");var Zu});var c5=j((I_,l5)=>{"use strict";m();var LI=Rm(),AI=Gm(),FI=n5(),BI=s5();l5.exports=p(function(t){if(t&&typeof t=="object"){if(LI(t))return"Map";if(AI(t))return"Set";if(FI(t))return"WeakMap";if(BI(t))return"WeakSet"}return!1},"whichCollection")});var h5=j((T_,d5)=>{"use strict";m();var u5=Function.prototype.toString,La=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,py,zu;if(typeof La=="function"&&typeof Object.defineProperty=="function")try{py=Object.defineProperty({},"length",{get:function(){throw zu}}),zu={},La(function(){throw 42},null,py)}catch(r){r!==zu&&(La=null)}else La=null;var kI=/^\s*class\b/,uy=p(function(t){try{var e=u5.call(t);return kI.test(e)}catch{return!1}},"isES6ClassFunction"),cy=p(function(t){try{return uy(t)?!1:(u5.call(t),!0)}catch{return!1}},"tryFunctionToStr"),qu=Object.prototype.toString,_I="[object Object]",RI="[object Function]",NI="[object GeneratorFunction]",GI="[object HTMLAllCollection]",VI="[object HTML document.all class]",jI="[object HTMLCollection]",HI=typeof Symbol=="function"&&!!Symbol.toStringTag,UI=!(0 in[,]),dy=p(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(p5=document.all,qu.call(p5)===qu.call(document.all)&&(dy=p(function(t){if((UI||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=qu.call(t);return(e===GI||e===VI||e===jI||e===_I)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var p5;d5.exports=p(La?function(t){if(dy(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{La(t,null,py)}catch(e){if(e!==zu)return!1}return!uy(t)&&cy(t)}:function(t){if(dy(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(HI)return cy(t);if(uy(t))return!1;var e=qu.call(t);return e!==RI&&e!==NI&&!/^\[object HTML/.test(e)?!1:cy(t)},"isCallable")});var y5=j((D_,m5)=>{"use strict";m();var XI=h5(),WI=Object.prototype.toString,f5=Object.prototype.hasOwnProperty,YI=p(function(t,e,i){for(var o=0,n=t.length;o<n;o++)f5.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},"forEachArray"),ZI=p(function(t,e,i){for(var o=0,n=t.length;o<n;o++)i==null?e(t.charAt(o),o,t):e.call(i,t.charAt(o),o,t)},"forEachString"),zI=p(function(t,e,i){for(var o in t)f5.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},"forEachObject"),qI=p(function(t,e,i){if(!XI(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=i),WI.call(t)==="[object Array]"?YI(t,e,o):typeof t=="string"?ZI(t,e,o):zI(t,e,o)},"forEach");m5.exports=qI});var v5=j((A_,g5)=>{"use strict";m();g5.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var C5=j((B_,b5)=>{"use strict";m();var hy=v5(),$I=typeof globalThis>"u"?global:globalThis;b5.exports=p(function(){for(var t=[],e=0;e<hy.length;e++)typeof $I[hy[e]]=="function"&&(t[t.length]=hy[e]);return t},"availableTypedArrays")});var P5=j((R_,M5)=>{"use strict";m();var Ju=y5(),JI=C5(),S5=pn(),yy=Bt(),$u=wu(),QI=yy("Object.prototype.toString"),I5=co()(),x5=typeof globalThis>"u"?global:globalThis,my=JI(),gy=yy("String.prototype.slice"),fy=Object.getPrototypeOf,KI=yy("Array.prototype.indexOf",!0)||p(function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},"indexOf"),Qu={__proto__:null};I5&&$u&&fy?Ju(my,function(r){var t=new x5[r];if(Symbol.toStringTag in t){var e=fy(t),i=$u(e,Symbol.toStringTag);if(!i){var o=fy(e);i=$u(o,Symbol.toStringTag)}Qu["$"+r]=S5(i.get)}}):Ju(my,function(r){var t=new x5[r],e=t.slice||t.set;e&&(Qu["$"+r]=S5(e))});var eM=p(function(t){var e=!1;return Ju(Qu,function(i,o){if(!e)try{"$"+i(t)===o&&(e=gy(o,1))}catch{}}),e},"tryAllTypedArrays"),tM=p(function(t){var e=!1;return Ju(Qu,function(i,o){if(!e)try{i(t),e=gy(o,1)}catch{}}),e},"tryAllSlices");M5.exports=p(function(t){if(!t||typeof t!="object")return!1;if(!I5){var e=gy(QI(t),8,-1);return KI(my,e)>-1?e:e!=="Object"?!1:tM(t)}return $u?eM(t):null},"whichTypedArray")});var E5=j((V_,w5)=>{"use strict";m();var rM=Bt(),T5=rM("ArrayBuffer.prototype.byteLength",!0),iM=Km();w5.exports=p(function(t){return iM(t)?T5?T5(t):t.byteLength:NaN},"byteLength")});var K5=j((U_,Q5)=>{"use strict";m();var q5=n3(),kr=Bt(),D5=b3(),oM=pr(),Aa=y4(),nM=Am(),O5=P4(),L5=vm(),A5=Bm(),F5=Km(),B5=L4(),k5=_4(),_5=G4(),R5=bu(),N5=r5(),G5=c5(),V5=P5(),j5=E5(),H5=kr("SharedArrayBuffer.prototype.byteLength",!0),U5=kr("Date.prototype.getTime"),vy=Object.getPrototypeOf,X5=kr("Object.prototype.toString"),ed=oM("%Set%",!0),by=kr("Map.prototype.has",!0),td=kr("Map.prototype.get",!0),W5=kr("Map.prototype.size",!0),rd=kr("Set.prototype.add",!0),$5=kr("Set.prototype.delete",!0),id=kr("Set.prototype.has",!0),Ku=kr("Set.prototype.size",!0);function Y5(r,t,e,i){for(var o=Aa(r),n;(n=o.next())&&!n.done;)if(ur(t,n.value,e,i))return $5(r,n.value),!0;return!1}p(Y5,"setHasEqualElement");function J5(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}p(J5,"findLooseMatchingPrimitives");function aM(r,t,e,i,o,n){var s=J5(e);if(s!=null)return s;var c=td(t,s),l=q5({},o,{strict:!1});return typeof c>"u"&&!by(t,s)||!ur(i,c,l,n)?!1:!by(r,s)&&ur(i,c,l,n)}p(aM,"mapMightHaveLoosePrim");function sM(r,t,e){var i=J5(e);return i!=null?i:id(t,i)&&!id(r,i)}p(sM,"setMightHaveLoosePrim");function Z5(r,t,e,i,o,n){for(var s=Aa(r),c,l;(c=s.next())&&!c.done;)if(l=c.value,ur(e,l,o,n)&&ur(i,td(t,l),o,n))return $5(r,l),!0;return!1}p(Z5,"mapHasEqualEntry");function ur(r,t,e,i){var o=e||{};if(o.strict?O5(r,t):r===t)return!0;var n=N5(r),s=N5(t);if(n!==s)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return o.strict?O5(r,t):r==t;var c=i.has(r),l=i.has(t),u;if(c&&l){if(i.get(r)===i.get(t))return!0}else u={};return c||i.set(r,u),l||i.set(t,u),pM(r,t,o,i)}p(ur,"internalDeepEqual");function z5(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}p(z5,"isBuffer");function lM(r,t,e,i){if(Ku(r)!==Ku(t))return!1;for(var o=Aa(r),n=Aa(t),s,c,l;(s=o.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new ed),rd(l,s.value);else if(!id(t,s.value)){if(e.strict||!sM(r,t,s.value))return!1;l||(l=new ed),rd(l,s.value)}if(l){for(;(c=n.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!Y5(l,c.value,e.strict,i))return!1}else if(!e.strict&&!id(r,c.value)&&!Y5(l,c.value,e.strict,i))return!1;return Ku(l)===0}return!0}p(lM,"setEquiv");function cM(r,t,e,i){if(W5(r)!==W5(t))return!1;for(var o=Aa(r),n=Aa(t),s,c,l,u,f,y;(s=o.next())&&!s.done;)if(u=s.value[0],f=s.value[1],u&&typeof u=="object")l||(l=new ed),rd(l,u);else if(y=td(t,u),typeof y>"u"&&!by(t,u)||!ur(f,y,e,i)){if(e.strict||!aM(r,t,u,f,e,i))return!1;l||(l=new ed),rd(l,u)}if(l){for(;(c=n.next())&&!c.done;)if(u=c.value[0],y=c.value[1],u&&typeof u=="object"){if(!Z5(l,r,u,y,e,i))return!1}else if(!e.strict&&(!r.has(u)||!ur(td(r,u),y,e,i))&&!Z5(l,r,u,y,q5({},e,{strict:!1}),i))return!1;return Ku(l)===0}return!0}p(cM,"mapEquiv");function pM(r,t,e,i){var o,n;if(typeof r!=typeof t||r==null||t==null||X5(r)!==X5(t)||L5(r)!==L5(t))return!1;var s=A5(r),c=A5(t);if(s!==c)return!1;var l=r instanceof Error,u=t instanceof Error;if(l!==u||(l||u)&&(r.name!==t.name||r.message!==t.message))return!1;var f=k5(r),y=k5(t);if(f!==y||(f||y)&&(r.source!==t.source||D5(r)!==D5(t)))return!1;var g=B5(r),v=B5(t);if(g!==v||(g||v)&&U5(r)!==U5(t)||e.strict&&vy&&vy(r)!==vy(t))return!1;var I=V5(r),x=V5(t);if(I!==x)return!1;if(I||x){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var b=z5(r),S=z5(t);if(b!==S)return!1;if(b||S){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var w=F5(r),T=F5(t);if(w!==T)return!1;if(w||T)return j5(r)!==j5(t)?!1:typeof Uint8Array=="function"&&ur(new Uint8Array(r),new Uint8Array(t),e,i);var E=_5(r),D=_5(t);if(E!==D)return!1;if(E||D)return H5(r)!==H5(t)?!1:typeof Uint8Array=="function"&&ur(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var A=R5(r),R=R5(t);if(A.length!==R.length)return!1;for(A.sort(),R.sort(),o=A.length-1;o>=0;o--)if(A[o]!=R[o])return!1;for(o=A.length-1;o>=0;o--)if(n=A[o],!ur(r[n],t[n],e,i))return!1;var N=G5(r),B=G5(t);return N!==B?!1:N==="Set"||B==="Set"?lM(r,t,e,i):N==="Map"?cM(r,t,e,i):!0}p(pM,"objEquiv");Q5.exports=p(function(t,e,i){return ur(t,e,i,nM())},"deepEqual")});var mC=j(ae=>{"use strict";m();Object.defineProperty(ae,"__esModule",{value:!0});function uM(r){return r&&r.__esModule?r:{default:r}}p(uM,"_interopRequireDefault");var dM=Object.defineProperty,pe=p((r,t)=>dM(r,"name",{value:t,configurable:!0}),"__name"),hM=K5(),fM=uM(hM),Ll,eC=(Ll=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,i,o;this.precision=10**-((e=t==null?void 0:t.precision)!=null?e:17),this.direction=(i=t==null?void 0:t.direction)!=null?i:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,e){if(t.type!==e.type||!Dl(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=Cy(t),o=Cy(e);return i.every(n=>o.some(s=>this.compare(n,s)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((i,o)=>Math.abs(i-e[o])<this.precision)}compareLine(t,e,i=0,o=!1){if(!Dl(t,e))return!1;let n=t,s=e;if(o&&!this.compareCoord(n[0],s[0])){let l=this.fixStartIndex(s,n);if(l)s=l;else return!1}let c=this.compareCoord(n[i],s[i]);return this.direction||c?this.comparePath(n,s):this.compareCoord(n[i],s[s.length-(1+i)])?this.comparePath(n.slice().reverse(),s):!1}fixStartIndex(t,e){let i,o=-1;for(let n=0;n<t.length;n++)if(this.compareCoord(t[n],e[0])){o=n;break}return o>=0&&(i=[].concat(t.slice(o,t.length),t.slice(1,o+1))),i}comparePath(t,e){return t.every((i,o)=>this.compareCoord(i,e[o]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){let i=t.coordinates.slice(1,t.coordinates.length),o=e.coordinates.slice(1,e.coordinates.length);return i.every(n=>o.some(s=>this.compareLine(n,s,1,!0)))}return!1}compareGeometryCollection(t,e){return Dl(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((i,o)=>this.compare(i,e.geometries[o]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?fM.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Dl(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((i,o)=>this.compare(i,e.features[o]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}},p(Ll,"_GeojsonEquality"),Ll);pe(eC,"GeojsonEquality");var mM=eC;function Dl(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}p(Dl,"sameLength");pe(Dl,"sameLength");function Cy(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}p(Cy,"explode");pe(Cy,"explode");var Pt=63710088e-1,xy={centimeters:Pt*100,centimetres:Pt*100,degrees:360/(2*Math.PI),feet:Pt*3.28084,inches:Pt*39.37,kilometers:Pt/1e3,kilometres:Pt/1e3,meters:Pt,metres:Pt,miles:Pt/1609.344,millimeters:Pt*1e3,millimetres:Pt*1e3,nauticalmiles:Pt/1852,radians:1,yards:Pt*1.0936},Sy={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 vi(r,t,e={}){let i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}p(vi,"feature");pe(vi,"feature");function tC(r,t,e={}){switch(r){case"Point":return od(t).geometry;case"LineString":return ad(t).geometry;case"Polygon":return nd(t).geometry;case"MultiPoint":return My(t).geometry;case"MultiLineString":return Iy(t).geometry;case"MultiPolygon":return Py(t).geometry;default:throw new Error(r+" is invalid")}}p(tC,"geometry");pe(tC,"geometry");function od(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(!Ol(r[0])||!Ol(r[1]))throw new Error("coordinates must contain numbers");return vi({type:"Point",coordinates:r},t,e)}p(od,"point");pe(od,"point");function rC(r,t,e={}){return Al(r.map(i=>od(i,t)),e)}p(rC,"points");pe(rC,"points");function nd(r,t,e={}){for(let o of r){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let n=0;n<o[o.length-1].length;n++)if(o[o.length-1][n]!==o[0][n])throw new Error("First and last Position are not equivalent.")}return vi({type:"Polygon",coordinates:r},t,e)}p(nd,"polygon");pe(nd,"polygon");function iC(r,t,e={}){return Al(r.map(i=>nd(i,t)),e)}p(iC,"polygons");pe(iC,"polygons");function ad(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return vi({type:"LineString",coordinates:r},t,e)}p(ad,"lineString");pe(ad,"lineString");function oC(r,t,e={}){return Al(r.map(i=>ad(i,t)),e)}p(oC,"lineStrings");pe(oC,"lineStrings");function Al(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}p(Al,"featureCollection");pe(Al,"featureCollection");function Iy(r,t,e={}){return vi({type:"MultiLineString",coordinates:r},t,e)}p(Iy,"multiLineString");pe(Iy,"multiLineString");function My(r,t,e={}){return vi({type:"MultiPoint",coordinates:r},t,e)}p(My,"multiPoint");pe(My,"multiPoint");function Py(r,t,e={}){return vi({type:"MultiPolygon",coordinates:r},t,e)}p(Py,"multiPolygon");pe(Py,"multiPolygon");function nC(r,t,e={}){return vi({type:"GeometryCollection",geometries:r},t,e)}p(nC,"geometryCollection");pe(nC,"geometryCollection");function aC(r,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let e=Math.pow(10,t||0);return Math.round(r*e)/e}p(aC,"round");pe(aC,"round");function Ty(r,t="kilometers"){let e=xy[t];if(!e)throw new Error(t+" units is invalid");return r*e}p(Ty,"radiansToLength");pe(Ty,"radiansToLength");function sd(r,t="kilometers"){let e=xy[t];if(!e)throw new Error(t+" units is invalid");return r/e}p(sd,"lengthToRadians");pe(sd,"lengthToRadians");function sC(r,t){return wy(sd(r,t))}p(sC,"lengthToDegrees");pe(sC,"lengthToDegrees");function lC(r){let t=r%360;return t<0&&(t+=360),t}p(lC,"bearingToAzimuth");pe(lC,"bearingToAzimuth");function wy(r){return r%(2*Math.PI)*180/Math.PI}p(wy,"radiansToDegrees");pe(wy,"radiansToDegrees");function cC(r){return r%360*Math.PI/180}p(cC,"degreesToRadians");pe(cC,"degreesToRadians");function pC(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Ty(sd(r,t),e)}p(pC,"convertLength");pe(pC,"convertLength");function uC(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=Sy[t];if(!i)throw new Error("invalid original units");let o=Sy[e];if(!o)throw new Error("invalid final units");return r/i*o}p(uC,"convertArea");pe(uC,"convertArea");function Ol(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}p(Ol,"isNumber");pe(Ol,"isNumber");function dC(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}p(dC,"isObject");pe(dC,"isObject");function hC(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(!Ol(t))throw new Error("bbox must only contain numbers")})}p(hC,"validateBBox");pe(hC,"validateBBox");function fC(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}p(fC,"validateId");pe(fC,"validateId");ae.GeojsonEquality=mM;ae.areaFactors=Sy;ae.bearingToAzimuth=lC;ae.convertArea=uC;ae.convertLength=pC;ae.degreesToRadians=cC;ae.earthRadius=Pt;ae.factors=xy;ae.feature=vi;ae.featureCollection=Al;ae.geometry=tC;ae.geometryCollection=nC;ae.isNumber=Ol;ae.isObject=dC;ae.lengthToDegrees=sC;ae.lengthToRadians=sd;ae.lineString=ad;ae.lineStrings=oC;ae.multiLineString=Iy;ae.multiPoint=My;ae.multiPolygon=Py;ae.point=od;ae.points=rC;ae.polygon=nd;ae.polygons=iC;ae.radiansToDegrees=wy;ae.radiansToLength=Ty;ae.round=aC;ae.validateBBox=hC;ae.validateId=fC});var TC=j(He=>{"use strict";m();Object.defineProperty(He,"__esModule",{value:!0});var yM=Object.defineProperty,Qe=p((r,t)=>yM(r,"name",{value:t,configurable:!0}),"__name"),it=mC();function Fa(r,t,e){if(r!==null)for(var i,o,n,s,c,l,u,f=0,y=0,g,v=r.type,I=v==="FeatureCollection",x=v==="Feature",b=I?r.features.length:1,S=0;S<b;S++){u=I?r.features[S].geometry:x?r.geometry:r,g=u?u.type==="GeometryCollection":!1,c=g?u.geometries.length:1;for(var w=0;w<c;w++){var T=0,E=0;if(s=g?u.geometries[w]:u,s!==null){l=s.coordinates;var D=s.type;switch(f=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(l,y,S,T,E)===!1)return!1;y++,T++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],y,S,T,E)===!1)return!1;y++,D==="MultiPoint"&&T++}D==="LineString"&&T++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-f;o++){if(t(l[i][o],y,S,T,E)===!1)return!1;y++}D==="MultiLineString"&&T++,D==="Polygon"&&E++}D==="Polygon"&&T++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(E=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-f;n++){if(t(l[i][o][n],y,S,T,E)===!1)return!1;y++}E++}T++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(Fa(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}p(Fa,"coordEach");Qe(Fa,"coordEach");function yC(r,t,e,i){var o=e;return Fa(r,function(n,s,c,l,u){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,u)},i),o}p(yC,"coordReduce");Qe(yC,"coordReduce");function Ey(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}p(Ey,"propEach");Qe(Ey,"propEach");function gC(r,t,e){var i=e;return Ey(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(gC,"propReduce");Qe(gC,"propReduce");function Dy(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}p(Dy,"featureEach");Qe(Dy,"featureEach");function vC(r,t,e){var i=e;return Dy(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(vC,"featureReduce");Qe(vC,"featureReduce");function bC(r){var t=[];return Fa(r,function(e){t.push(e)}),t}p(bC,"coordAll");Qe(bC,"coordAll");function ld(r,t){var e,i,o,n,s,c,l,u,f,y,g=0,v=r.type==="FeatureCollection",I=r.type==="Feature",x=v?r.features.length:1;for(e=0;e<x;e++){for(c=v?r.features[e].geometry:I?r.geometry:r,u=v?r.features[e].properties:I?r.properties:{},f=v?r.features[e].bbox:I?r.bbox:void 0,y=v?r.features[e].id:I?r.id:void 0,l=c?c.type==="GeometryCollection":!1,s=l?c.geometries.length:1,o=0;o<s;o++){if(n=l?c.geometries[o]:c,n===null){if(t(null,g,u,f,y)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,g,u,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],g,u,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}p(ld,"geomEach");Qe(ld,"geomEach");function CC(r,t,e){var i=e;return ld(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}p(CC,"geomReduce");Qe(CC,"geomReduce");function Fl(r,t){ld(r,function(e,i,o,n,s){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(it.feature.call(void 0,e,o,{bbox:n,id:s}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var f=e.coordinates[u],y={type:l,coordinates:f};if(t(it.feature.call(void 0,y,o),i,u)===!1)return!1}})}p(Fl,"flattenEach");Qe(Fl,"flattenEach");function SC(r,t,e){var i=e;return Fl(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}p(SC,"flattenReduce");Qe(SC,"flattenReduce");function Oy(r,t){Fl(r,function(e,i,o){var n=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var c,l=0,u=0,f=0;if(Fa(e,function(y,g,v,I,x){if(c===void 0||i>l||I>u||x>f){c=y,l=i,u=I,f=x,n=0;return}var b=it.lineString.call(void 0,[c,y],e.properties);if(t(b,i,o,x,n)===!1)return!1;n++,c=y})===!1)return!1}}})}p(Oy,"segmentEach");Qe(Oy,"segmentEach");function xC(r,t,e){var i=e,o=!1;return Oy(r,function(n,s,c,l,u){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,u),o=!0}),i}p(xC,"segmentReduce");Qe(xC,"segmentReduce");function Ly(r,t){if(!r)throw new Error("geojson is required");Fl(r,function(e,i,o){if(e.geometry!==null){var n=e.geometry.type,s=e.geometry.coordinates;switch(n){case"LineString":if(t(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<s.length;c++)if(t(it.lineString.call(void 0,s[c],e.properties),i,o,c)===!1)return!1;break}}})}p(Ly,"lineEach");Qe(Ly,"lineEach");function IC(r,t,e){var i=e;return Ly(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}p(IC,"lineReduce");Qe(IC,"lineReduce");function MC(r,t){if(t=t||{},!it.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.segmentIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return n<0&&(n=l.length+n-1),it.lineString.call(void 0,[l[n],l[n+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n-1),it.lineString.call(void 0,[l[o][n],l[o][n+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n-1),it.lineString.call(void 0,[l[i][n],l[i][n+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n-1),it.lineString.call(void 0,[l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}p(MC,"findSegment");Qe(MC,"findSegment");function PC(r,t){if(t=t||{},!it.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.coordIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return it.point.call(void 0,l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),it.point.call(void 0,l[i],s,t);case"LineString":return n<0&&(n=l.length+n),it.point.call(void 0,l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),it.point.call(void 0,l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),it.point.call(void 0,l[i][n],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n),it.point.call(void 0,l[i][o][n],s,t)}throw new Error("geojson is invalid")}p(PC,"findPoint");Qe(PC,"findPoint");He.coordAll=bC;He.coordEach=Fa;He.coordReduce=yC;He.featureEach=Dy;He.featureReduce=vC;He.findPoint=PC;He.findSegment=MC;He.flattenEach=Fl;He.flattenReduce=SC;He.geomEach=ld;He.geomReduce=CC;He.lineEach=Ly;He.lineReduce=IC;He.propEach=Ey;He.propReduce=gC;He.segmentEach=Oy;He.segmentReduce=xC});var wC=j(cd=>{"use strict";m();Object.defineProperty(cd,"__esModule",{value:!0});var gM=Object.defineProperty,vM=p((r,t)=>gM(r,"name",{value:t,configurable:!0}),"__name"),bM=TC();function Ay(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return bM.coordEach.call(void 0,r,i=>{e[0]>i[0]&&(e[0]=i[0]),e[1]>i[1]&&(e[1]=i[1]),e[2]<i[0]&&(e[2]=i[0]),e[3]<i[1]&&(e[3]=i[1])}),e}p(Ay,"bbox");vM(Ay,"bbox");var CM=Ay;cd.bbox=Ay;cd.default=CM});var AC=j((iR,Fy)=>{m();var _r=Tv(),DC=em(),OC=_v(),Ba=wC().default,SM=OC.featureEach,tR=OC.coordEach,rR=DC.polygon,EC=DC.featureCollection;function LC(r){var t=new _r(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ba(e),_r.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ba(o),i.push(o)}):SM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ba(o),i.push(o)}),_r.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:Ba(e),_r.prototype.remove.call(this,e,i)},t.clear=function(){return _r.prototype.clear.call(this)},t.search=function(e){var i=_r.prototype.search.call(this,this.toBBox(e));return EC(i)},t.collides=function(e){return _r.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=_r.prototype.all.call(this);return EC(e)},t.toJSON=function(){return _r.prototype.toJSON.call(this)},t.fromJSON=function(e){return _r.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=Ba(e);else if(e.type==="FeatureCollection")i=Ba(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}p(LC,"geojsonRbush");Fy.exports=LC;Fy.exports.default=LC});var s7=j((iV,Hl)=>{"use strict";m();var NM=!1,fn=!1,e7=!0,t7=!1,h={},r7=!1;typeof Hl<"u"&&Hl.exports?(Hl.exports=h,r7=!0):typeof document<"u"?window.ClipperLib=h:self.ClipperLib=h;var Id;r7?(Xe="chrome",Id="Netscape"):(Xe=navigator.userAgent.toString().toLowerCase(),Id=navigator.appName);var Xe,ie={};Xe.indexOf("chrome")!=-1&&Xe.indexOf("chromium")==-1?ie.chrome=1:ie.chrome=0;Xe.indexOf("chromium")!=-1?ie.chromium=1:ie.chromium=0;Xe.indexOf("safari")!=-1&&Xe.indexOf("chrome")==-1&&Xe.indexOf("chromium")==-1?ie.safari=1:ie.safari=0;Xe.indexOf("firefox")!=-1?ie.firefox=1:ie.firefox=0;Xe.indexOf("firefox/17")!=-1?ie.firefox17=1:ie.firefox17=0;Xe.indexOf("firefox/15")!=-1?ie.firefox15=1:ie.firefox15=0;Xe.indexOf("firefox/3")!=-1?ie.firefox3=1:ie.firefox3=0;Xe.indexOf("opera")!=-1?ie.opera=1:ie.opera=0;Xe.indexOf("msie 10")!=-1?ie.msie10=1:ie.msie10=0;Xe.indexOf("msie 9")!=-1?ie.msie9=1:ie.msie9=0;Xe.indexOf("msie 8")!=-1?ie.msie8=1:ie.msie8=0;Xe.indexOf("msie 7")!=-1?ie.msie7=1:ie.msie7=0;Xe.indexOf("msie ")!=-1?ie.msie=1:ie.msie=0;h.biginteger_used=null;var yo,GM=0xdeadbeefcafe,QC=(GM&16777215)==15715070;function k(r,t,e){h.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}p(k,"BigInteger");function ne(){return new k(null)}p(ne,"nbi");function VM(r,t,e,i,o,n){for(;--n>=0;){var s=t*this[r++]+e[i]+o;o=Math.floor(s/67108864),e[i++]=s&67108863}return o}p(VM,"am1");function jM(r,t,e,i,o,n){for(var s=t&32767,c=t>>15;--n>=0;){var l=this[r]&32767,u=this[r++]>>15,f=c*l+u*s;l=s*l+((f&32767)<<15)+e[i]+(o&1073741823),o=(l>>>30)+(f>>>15)+c*u+(o>>>30),e[i++]=l&1073741823}return o}p(jM,"am2");function HM(r,t,e,i,o,n){for(var s=t&16383,c=t>>14;--n>=0;){var l=this[r]&16383,u=this[r++]>>14,f=c*l+u*s;l=s*l+((f&16383)<<14)+e[i]+o,o=(l>>28)+(f>>14)+c*u,e[i++]=l&268435455}return o}p(HM,"am3");QC&&Id=="Microsoft Internet Explorer"?(k.prototype.am=jM,yo=30):QC&&Id!="Netscape"?(k.prototype.am=VM,yo=26):(k.prototype.am=HM,yo=28);k.prototype.DB=yo;k.prototype.DM=(1<<yo)-1;k.prototype.DV=1<<yo;var Zy=52;k.prototype.FV=Math.pow(2,Zy);k.prototype.F1=Zy-yo;k.prototype.F2=2*yo-Zy;var UM="0123456789abcdefghijklmnopqrstuvwxyz",Pd=new Array,Ra,zt;Ra=48;for(zt=0;zt<=9;++zt)Pd[Ra++]=zt;Ra=97;for(zt=10;zt<36;++zt)Pd[Ra++]=zt;Ra=65;for(zt=10;zt<36;++zt)Pd[Ra++]=zt;function KC(r){return UM.charAt(r)}p(KC,"int2char");function i7(r,t){var e=Pd[r.charCodeAt(t)];return e==null?-1:e}p(i7,"intAt");function XM(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}p(XM,"bnpCopyTo");function WM(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}p(WM,"bnpFromInt");function mo(r){var t=ne();return t.fromInt(r),t}p(mo,"nbv");function YM(r,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(r,t);return}this.t=0,this.s=0;for(var i=r.length,o=!1,n=0;--i>=0;){var s=e==8?r[i]&255:i7(r,i);if(s<0){r.charAt(i)=="-"&&(o=!0);continue}o=!1,n==0?this[this.t++]=s:n+e>this.DB?(this[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this[this.t++]=s>>this.DB-n):this[this.t-1]|=s<<n,n+=e,n>=this.DB&&(n-=this.DB)}e==8&&r[0]&128&&(this.s=-1,n>0&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&k.ZERO.subTo(this,this)}p(YM,"bnpFromString");function ZM(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}p(ZM,"bnpClamp");function zM(r){if(this.s<0)return"-"+this.negate().toString(r);var t;if(r==16)t=4;else if(r==8)t=3;else if(r==2)t=1;else if(r==32)t=5;else if(r==4)t=2;else return this.toRadix(r);var e=(1<<t)-1,i,o=!1,n="",s=this.t,c=this.DB-s*this.DB%t;if(s-- >0)for(c<this.DB&&(i=this[s]>>c)>0&&(o=!0,n=KC(i));s>=0;)c<t?(i=(this[s]&(1<<c)-1)<<t-c,i|=this[--s]>>(c+=this.DB-t)):(i=this[s]>>(c-=t)&e,c<=0&&(c+=this.DB,--s)),i>0&&(o=!0),o&&(n+=KC(i));return o?n:"0"}p(zM,"bnToString");function qM(){var r=ne();return k.ZERO.subTo(this,r),r}p(qM,"bnNegate");function $M(){return this.s<0?this.negate():this}p($M,"bnAbs");function JM(r){var t=this.s-r.s;if(t!=0)return t;var e=this.t;if(t=e-r.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-r[e])!=0)return t;return 0}p(JM,"bnCompareTo");function Td(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}p(Td,"nbits");function QM(){return this.t<=0?0:this.DB*(this.t-1)+Td(this[this.t-1]^this.s&this.DM)}p(QM,"bnBitLength");function KM(r,t){var e;for(e=this.t-1;e>=0;--e)t[e+r]=this[e];for(e=r-1;e>=0;--e)t[e]=0;t.t=this.t+r,t.s=this.s}p(KM,"bnpDLShiftTo");function eP(r,t){for(var e=r;e<this.t;++e)t[e-r]=this[e];t.t=Math.max(this.t-r,0),t.s=this.s}p(eP,"bnpDRShiftTo");function tP(r,t){var e=r%this.DB,i=this.DB-e,o=(1<<i)-1,n=Math.floor(r/this.DB),s=this.s<<e&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+n+1]=this[c]>>i|s,s=(this[c]&o)<<e;for(c=n-1;c>=0;--c)t[c]=0;t[n]=s,t.t=this.t+n+1,t.s=this.s,t.clamp()}p(tP,"bnpLShiftTo");function rP(r,t){t.s=this.s;var e=Math.floor(r/this.DB);if(e>=this.t){t.t=0;return}var i=r%this.DB,o=this.DB-i,n=(1<<i)-1;t[0]=this[e]>>i;for(var s=e+1;s<this.t;++s)t[s-e-1]|=(this[s]&n)<<o,t[s-e]=this[s]>>i;i>0&&(t[this.t-e-1]|=(this.s&n)<<o),t.t=this.t-e,t.clamp()}p(rP,"bnpRShiftTo");function iP(r,t){for(var e=0,i=0,o=Math.min(r.t,this.t);e<o;)i+=this[e]-r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i-=r[e],t[e++]=i&this.DM,i>>=this.DB;i-=r.s}t.s=i<0?-1:0,i<-1?t[e++]=this.DV+i:i>0&&(t[e++]=i),t.t=e,t.clamp()}p(iP,"bnpSubTo");function oP(r,t){var e=this.abs(),i=r.abs(),o=e.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+e.t]=e.am(0,i[o],t,o,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&k.ZERO.subTo(t,t)}p(oP,"bnpMultiplyTo");function nP(r){for(var t=this.abs(),e=r.t=2*t.t;--e>=0;)r[e]=0;for(e=0;e<t.t-1;++e){var i=t.am(e,t[e],r,2*e,0,1);(r[e+t.t]+=t.am(e+1,2*t[e],r,2*e+1,i,t.t-e-1))>=t.DV&&(r[e+t.t]-=t.DV,r[e+t.t+1]=1)}r.t>0&&(r[r.t-1]+=t.am(e,t[e],r,2*e,0,1)),r.s=0,r.clamp()}p(nP,"bnpSquareTo");function aP(r,t,e){var i=r.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=ne());var n=ne(),s=this.s,c=r.s,l=this.DB-Td(i[i.t-1]);l>0?(i.lShiftTo(l,n),o.lShiftTo(l,e)):(i.copyTo(n),o.copyTo(e));var u=n.t,f=n[u-1];if(f!=0){var y=f*(1<<this.F1)+(u>1?n[u-2]>>this.F2:0),g=this.FV/y,v=(1<<this.F1)/y,I=1<<this.F2,x=e.t,b=x-u,S=t==null?ne():t;for(n.dlShiftTo(b,S),e.compareTo(S)>=0&&(e[e.t++]=1,e.subTo(S,e)),k.ONE.dlShiftTo(u,S),S.subTo(n,n);n.t<u;)n[n.t++]=0;for(;--b>=0;){var w=e[--x]==f?this.DM:Math.floor(e[x]*g+(e[x-1]+I)*v);if((e[x]+=n.am(0,w,e,b,0,u))<w)for(n.dlShiftTo(b,S),e.subTo(S,e);e[x]<--w;)e.subTo(S,e)}t!=null&&(e.drShiftTo(u,t),s!=c&&k.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),s<0&&k.ZERO.subTo(e,e)}}}p(aP,"bnpDivRemTo");function sP(r){var t=ne();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(k.ZERO)>0&&r.subTo(t,t),t}p(sP,"bnMod");function mn(r){this.m=r}p(mn,"Classic");function lP(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}p(lP,"cConvert");function cP(r){return r}p(cP,"cRevert");function pP(r){r.divRemTo(this.m,null,r)}p(pP,"cReduce");function uP(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(uP,"cMulTo");function dP(r,t){r.squareTo(t),this.reduce(t)}p(dP,"cSqrTo");mn.prototype.convert=lP;mn.prototype.revert=cP;mn.prototype.reduce=pP;mn.prototype.mulTo=uP;mn.prototype.sqrTo=dP;function hP(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}p(hP,"bnpInvDigit");function yn(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}p(yn,"Montgomery");function fP(r){var t=ne();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(k.ZERO)>0&&this.m.subTo(t,t),t}p(fP,"montConvert");function mP(r){var t=ne();return r.copyTo(t),this.reduce(t),t}p(mP,"montRevert");function yP(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var t=0;t<this.m.t;++t){var e=r[t]&32767,i=e*this.mpl+((e*this.mph+(r[t]>>15)*this.mpl&this.um)<<15)&r.DM;for(e=t+this.m.t,r[e]+=this.m.am(0,i,r,t,0,this.m.t);r[e]>=r.DV;)r[e]-=r.DV,r[++e]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}p(yP,"montReduce");function gP(r,t){r.squareTo(t),this.reduce(t)}p(gP,"montSqrTo");function vP(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(vP,"montMulTo");yn.prototype.convert=fP;yn.prototype.revert=mP;yn.prototype.reduce=yP;yn.prototype.mulTo=vP;yn.prototype.sqrTo=gP;function bP(){return(this.t>0?this[0]&1:this.s)==0}p(bP,"bnpIsEven");function CP(r,t){if(r>4294967295||r<1)return k.ONE;var e=ne(),i=ne(),o=t.convert(this),n=Td(r)-1;for(o.copyTo(e);--n>=0;)if(t.sqrTo(e,i),(r&1<<n)>0)t.mulTo(i,o,e);else{var s=e;e=i,i=s}return t.revert(e)}p(CP,"bnpExp");function SP(r,t){var e;return r<256||t.isEven()?e=new mn(t):e=new yn(t),this.exp(r,e)}p(SP,"bnModPowInt");k.prototype.copyTo=XM;k.prototype.fromInt=WM;k.prototype.fromString=YM;k.prototype.clamp=ZM;k.prototype.dlShiftTo=KM;k.prototype.drShiftTo=eP;k.prototype.lShiftTo=tP;k.prototype.rShiftTo=rP;k.prototype.subTo=iP;k.prototype.multiplyTo=oP;k.prototype.squareTo=nP;k.prototype.divRemTo=aP;k.prototype.invDigit=hP;k.prototype.isEven=bP;k.prototype.exp=CP;k.prototype.toString=zM;k.prototype.negate=qM;k.prototype.abs=$M;k.prototype.compareTo=JM;k.prototype.bitLength=QM;k.prototype.mod=sP;k.prototype.modPowInt=SP;k.ZERO=mo(0);k.ONE=mo(1);function xP(){var r=ne();return this.copyTo(r),r}p(xP,"bnClone");function IP(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}p(IP,"bnIntValue");function MP(){return this.t==0?this.s:this[0]<<24>>24}p(MP,"bnByteValue");function PP(){return this.t==0?this.s:this[0]<<16>>16}p(PP,"bnShortValue");function TP(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}p(TP,"bnpChunkSize");function wP(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}p(wP,"bnSigNum");function EP(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=mo(e),o=ne(),n=ne(),s="";for(this.divRemTo(i,o,n);o.signum()>0;)s=(e+n.intValue()).toString(r).substr(1)+s,o.divRemTo(i,o,n);return n.intValue().toString(r)+s}p(EP,"bnpToRadix");function DP(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),o=!1,n=0,s=0,c=0;c<r.length;++c){var l=i7(r,c);if(l<0){r.charAt(c)=="-"&&this.signum()==0&&(o=!0);continue}s=t*s+l,++n>=e&&(this.dMultiply(i),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),o&&k.ZERO.subTo(this,this)}p(DP,"bnpFromRadix");function OP(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(k.ONE.shiftLeft(r-1),zy,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(k.ONE.shiftLeft(r-1),this);else{var i=new Array,o=r&7;i.length=(r>>3)+1,t.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}}p(OP,"bnpFromNumber");function LP(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,o=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[o++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),i&128&&(i|=-256),o==0&&(this.s&128)!=(i&128)&&++o,(o>0||i!=this.s)&&(t[o++]=i);return t}p(LP,"bnToByteArray");function AP(r){return this.compareTo(r)==0}p(AP,"bnEquals");function FP(r){return this.compareTo(r)<0?this:r}p(FP,"bnMin");function BP(r){return this.compareTo(r)>0?this:r}p(BP,"bnMax");function kP(r,t,e){var i,o,n=Math.min(r.t,this.t);for(i=0;i<n;++i)e[i]=t(this[i],r[i]);if(r.t<this.t){for(o=r.s&this.DM,i=n;i<this.t;++i)e[i]=t(this[i],o);e.t=this.t}else{for(o=this.s&this.DM,i=n;i<r.t;++i)e[i]=t(o,r[i]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}p(kP,"bnpBitwiseTo");function _P(r,t){return r&t}p(_P,"op_and");function RP(r){var t=ne();return this.bitwiseTo(r,_P,t),t}p(RP,"bnAnd");function zy(r,t){return r|t}p(zy,"op_or");function NP(r){var t=ne();return this.bitwiseTo(r,zy,t),t}p(NP,"bnOr");function o7(r,t){return r^t}p(o7,"op_xor");function GP(r){var t=ne();return this.bitwiseTo(r,o7,t),t}p(GP,"bnXor");function n7(r,t){return r&~t}p(n7,"op_andnot");function VP(r){var t=ne();return this.bitwiseTo(r,n7,t),t}p(VP,"bnAndNot");function jP(){for(var r=ne(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}p(jP,"bnNot");function HP(r){var t=ne();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}p(HP,"bnShiftLeft");function UP(r){var t=ne();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}p(UP,"bnShiftRight");function XP(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}p(XP,"lbit");function WP(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+XP(this[r]);return this.s<0?this.t*this.DB:-1}p(WP,"bnGetLowestSetBit");function YP(r){for(var t=0;r!=0;)r&=r-1,++t;return t}p(YP,"cbit");function ZP(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=YP(this[e]^t);return r}p(ZP,"bnBitCount");function zP(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}p(zP,"bnTestBit");function qP(r,t){var e=k.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}p(qP,"bnpChangeBit");function $P(r){return this.changeBit(r,zy)}p($P,"bnSetBit");function JP(r){return this.changeBit(r,n7)}p(JP,"bnClearBit");function QP(r){return this.changeBit(r,o7)}p(QP,"bnFlipBit");function KP(r,t){for(var e=0,i=0,o=Math.min(r.t,this.t);e<o;)i+=this[e]+r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i+=r[e],t[e++]=i&this.DM,i>>=this.DB;i+=r.s}t.s=i<0?-1:0,i>0?t[e++]=i:i<-1&&(t[e++]=this.DV+i),t.t=e,t.clamp()}p(KP,"bnpAddTo");function eT(r){var t=ne();return this.addTo(r,t),t}p(eT,"bnAdd");function tT(r){var t=ne();return this.subTo(r,t),t}p(tT,"bnSubtract");function rT(r){var t=ne();return this.multiplyTo(r,t),t}p(rT,"bnMultiply");function iT(){var r=ne();return this.squareTo(r),r}p(iT,"bnSquare");function oT(r){var t=ne();return this.divRemTo(r,t,null),t}p(oT,"bnDivide");function nT(r){var t=ne();return this.divRemTo(r,null,t),t}p(nT,"bnRemainder");function aT(r){var t=ne(),e=ne();return this.divRemTo(r,t,e),new Array(t,e)}p(aT,"bnDivideAndRemainder");function sT(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}p(sT,"bnpDMultiply");function lT(r,t){if(r!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=r;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}p(lT,"bnpDAddOffset");function Ul(){}p(Ul,"NullExp");function a7(r){return r}p(a7,"nNop");function cT(r,t,e){r.multiplyTo(t,e)}p(cT,"nMulTo");function pT(r,t){r.squareTo(t)}p(pT,"nSqrTo");Ul.prototype.convert=a7;Ul.prototype.revert=a7;Ul.prototype.mulTo=cT;Ul.prototype.sqrTo=pT;function uT(r){return this.exp(r,new Ul)}p(uT,"bnPow");function dT(r,t,e){var i=Math.min(this.t+r.t,t);for(e.s=0,e.t=i;i>0;)e[--i]=0;var o;for(o=e.t-this.t;i<o;++i)e[i+this.t]=this.am(0,r[i],e,i,0,this.t);for(o=Math.min(r.t,t);i<o;++i)this.am(0,r[i],e,i,0,t-i);e.clamp()}p(dT,"bnpMultiplyLowerTo");function hT(r,t,e){--t;var i=e.t=this.t+r.t-t;for(e.s=0;--i>=0;)e[i]=0;for(i=Math.max(t-this.t,0);i<r.t;++i)e[this.t+i-t]=this.am(t-i,r[i],e,0,0,this.t+i-t);e.clamp(),e.drShiftTo(1,e)}p(hT,"bnpMultiplyUpperTo");function Na(r){this.r2=ne(),this.q3=ne(),k.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}p(Na,"Barrett");function fT(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=ne();return r.copyTo(t),this.reduce(t),t}p(fT,"barrettConvert");function mT(r){return r}p(mT,"barrettRevert");function yT(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}p(yT,"barrettReduce");function gT(r,t){r.squareTo(t),this.reduce(t)}p(gT,"barrettSqrTo");function vT(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(vT,"barrettMulTo");Na.prototype.convert=fT;Na.prototype.revert=mT;Na.prototype.reduce=yT;Na.prototype.mulTo=vT;Na.prototype.sqrTo=gT;function bT(r,t){var e=r.bitLength(),i,o=mo(1),n;if(e<=0)return o;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?n=new mn(t):t.isEven()?n=new Na(t):n=new yn(t);var s=new Array,c=3,l=i-1,u=(1<<i)-1;if(s[1]=n.convert(this),i>1){var f=ne();for(n.sqrTo(s[1],f);c<=u;)s[c]=ne(),n.mulTo(f,s[c-2],s[c]),c+=2}var y=r.t-1,g,v=!0,I=ne(),x;for(e=Td(r[y])-1;y>=0;){for(e>=l?g=r[y]>>e-l&u:(g=(r[y]&(1<<e+1)-1)<<l-e,y>0&&(g|=r[y-1]>>this.DB+e-l)),c=i;!(g&1);)g>>=1,--c;if((e-=c)<0&&(e+=this.DB,--y),v)s[g].copyTo(o),v=!1;else{for(;c>1;)n.sqrTo(o,I),n.sqrTo(I,o),c-=2;c>0?n.sqrTo(o,I):(x=o,o=I,I=x),n.mulTo(I,s[g],o)}for(;y>=0&&!(r[y]&1<<e);)n.sqrTo(o,I),x=o,o=I,I=x,--e<0&&(e=this.DB-1,--y)}return n.revert(o)}p(bT,"bnModPow");function CT(r){var t=this.s<0?this.negate():this.clone(),e=r.s<0?r.negate():r.clone();if(t.compareTo(e)<0){var i=t;t=e,e=i}var o=t.getLowestSetBit(),n=e.getLowestSetBit();if(n<0)return t;for(o<n&&(n=o),n>0&&(t.rShiftTo(n,t),e.rShiftTo(n,e));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return n>0&&e.lShiftTo(n,e),e}p(CT,"bnGCD");function ST(r){if(r<=0)return 0;var t=this.DV%r,e=this.s<0?r-1:0;if(this.t>0)if(t==0)e=this[0]%r;else for(var i=this.t-1;i>=0;--i)e=(t*e+this[i])%r;return e}p(ST,"bnpModInt");function xT(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return k.ZERO;for(var e=r.clone(),i=this.clone(),o=mo(1),n=mo(0),s=mo(0),c=mo(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!o.isEven()||!n.isEven())&&(o.addTo(this,o),n.subTo(r,n)),o.rShiftTo(1,o)):n.isEven()||n.subTo(r,n),n.rShiftTo(1,n);for(;i.isEven();)i.rShiftTo(1,i),t?((!s.isEven()||!c.isEven())&&(s.addTo(this,s),c.subTo(r,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(r,c),c.rShiftTo(1,c);e.compareTo(i)>=0?(e.subTo(i,e),t&&o.subTo(s,o),n.subTo(c,n)):(i.subTo(e,i),t&&s.subTo(o,s),c.subTo(n,c))}if(i.compareTo(k.ONE)!=0)return k.ZERO;if(c.compareTo(r)>=0)return c.subtract(r);if(c.signum()<0)c.addTo(r,c);else return c;return c.signum()<0?c.add(r):c}p(xT,"bnModInverse");var ht=[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],IT=(1<<26)/ht[ht.length-1];function MT(r){var t,e=this.abs();if(e.t==1&&e[0]<=ht[ht.length-1]){for(t=0;t<ht.length;++t)if(e[0]==ht[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<ht.length;){for(var i=ht[t],o=t+1;o<ht.length&&i<IT;)i*=ht[o++];for(i=e.modInt(i);t<o;)if(i%ht[t++]==0)return!1}return e.millerRabin(r)}p(MT,"bnIsProbablePrime");function PT(r){var t=this.subtract(k.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>ht.length&&(r=ht.length);for(var o=ne(),n=0;n<r;++n){o.fromInt(ht[Math.floor(Math.random()*ht.length)]);var s=o.modPow(i,this);if(s.compareTo(k.ONE)!=0&&s.compareTo(t)!=0){for(var c=1;c++<e&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(k.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}p(PT,"bnpMillerRabin");k.prototype.chunkSize=TP;k.prototype.toRadix=EP;k.prototype.fromRadix=DP;k.prototype.fromNumber=OP;k.prototype.bitwiseTo=kP;k.prototype.changeBit=qP;k.prototype.addTo=KP;k.prototype.dMultiply=sT;k.prototype.dAddOffset=lT;k.prototype.multiplyLowerTo=dT;k.prototype.multiplyUpperTo=hT;k.prototype.modInt=ST;k.prototype.millerRabin=PT;k.prototype.clone=xP;k.prototype.intValue=IP;k.prototype.byteValue=MP;k.prototype.shortValue=PP;k.prototype.signum=wP;k.prototype.toByteArray=LP;k.prototype.equals=AP;k.prototype.min=FP;k.prototype.max=BP;k.prototype.and=RP;k.prototype.or=NP;k.prototype.xor=GP;k.prototype.andNot=VP;k.prototype.not=jP;k.prototype.shiftLeft=HP;k.prototype.shiftRight=UP;k.prototype.getLowestSetBit=WP;k.prototype.bitCount=ZP;k.prototype.testBit=zP;k.prototype.setBit=$P;k.prototype.clearBit=JP;k.prototype.flipBit=QP;k.prototype.add=eT;k.prototype.subtract=tT;k.prototype.multiply=rT;k.prototype.divide=oT;k.prototype.remainder=nT;k.prototype.divideAndRemainder=aT;k.prototype.modPow=bT;k.prototype.modInverse=xT;k.prototype.pow=uT;k.prototype.gcd=CT;k.prototype.isProbablePrime=MT;k.prototype.square=iT;var te=k;te.prototype.IsNegative=function(){return this.compareTo(te.ZERO)==-1};te.op_Equality=function(r,t){return r.compareTo(t)==0};te.op_Inequality=function(r,t){return r.compareTo(t)!=0};te.op_GreaterThan=function(r,t){return r.compareTo(t)>0};te.op_LessThan=function(r,t){return r.compareTo(t)<0};te.op_Addition=function(r,t){return new te(r).add(new te(t))};te.op_Subtraction=function(r,t){return new te(r).subtract(new te(t))};te.Int128Mul=function(r,t){return new te(r).multiply(new te(t))};te.op_Division=function(r,t){return r.divide(t)};te.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Md>"u"&&(Md=p(function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var i=Object.getOwnPropertyNames(t.prototype),o=0;o<i.length;o++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[o])>"u"&&Object.defineProperty(r.prototype,i[o],Object.getOwnPropertyDescriptor(t.prototype,i[o]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}},"Inherit"));var Md;h.Path=function(){return[]};h.Paths=function(){return[]};h.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};h.DoublePoint0=function(){this.X=0,this.Y=0};h.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};h.DoublePoint2=function(r,t){this.X=r,this.Y=t};h.PolyNode=function(){this.m_Parent=null,this.m_polygon=new h.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};h.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};h.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};h.PolyNode.prototype.Contour=function(){return this.m_polygon};h.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};h.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};h.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};h.PolyNode.prototype.Childs=function(){return this.m_Childs};h.PolyNode.prototype.Parent=function(){return this.m_Parent};h.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};h.PolyTree=function(){this.m_AllPolys=[],h.PolyNode.call(this)};h.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};h.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};h.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};Md(h.PolyTree,h.PolyNode);h.Math_Abs_Int64=h.Math_Abs_Int32=h.Math_Abs_Double=function(r){return Math.abs(r)};h.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};ie.msie||ie.opera||ie.safari?h.Cast_Int32=function(r){return r|0}:h.Cast_Int32=function(r){return~~r};ie.chrome?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:ie.firefox&&typeof Number.toInteger=="function"?h.Cast_Int64=function(r){return Number.toInteger(r)}:ie.msie7||ie.msie8?h.Cast_Int64=function(r){return parseInt(r,10)}:ie.msie?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:h.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};h.Clear=function(r){r.length=0};h.PI=3.141592653589793;h.PI2=2*3.141592653589793;h.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,fn)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof h.DoublePoint){var e=r[0];this.X=h.Clipper.Round(e.X),this.Y=h.Clipper.Round(e.Y),this.Z=0}else{var i=r[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof h.DoublePoint){var e=r[0];this.X=h.Clipper.Round(e.X),this.Y=h.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};h.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};h.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};fn?(h.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},h.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},h.IntPoint1dp=function(r){this.X=h.Clipper.Round(r.X),this.Y=h.Clipper.Round(r.Y),this.Z=0},h.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},h.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(h.IntPoint0=function(){this.X=0,this.Y=0},h.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},h.IntPoint1dp=function(r){this.X=h.Clipper.Round(r.X),this.Y=h.Clipper.Round(r.Y)},h.IntPoint2=function(r,t){this.X=r,this.Y=t});h.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};h.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};h.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};h.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};h.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};h.PolyType={ptSubject:0,ptClip:1};h.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};h.JoinType={jtSquare:0,jtRound:1,jtMiter:2};h.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};t7&&(h.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});h.EdgeSide={esLeft:0,esRight:1};h.Direction={dRightToLeft:0,dLeftToRight:1};h.TEdge=function(){this.Bot=new h.IntPoint,this.Curr=new h.IntPoint,this.Top=new h.IntPoint,this.Delta=new h.IntPoint,this.Dx=0,this.PolyTyp=h.PolyType.ptSubject,this.Side=h.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};h.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new h.IntPoint};h.MyIntersectNodeSort=function(){};h.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};h.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};h.Scanbeam=function(){this.Y=0,this.Next=null};h.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};h.OutPt=function(){this.Idx=0,this.Pt=new h.IntPoint,this.Next=null,this.Prev=null};h.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new h.IntPoint};h.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};h.ClipperBase.horizontal=-9007199254740992;h.ClipperBase.Skip=-2;h.ClipperBase.Unassigned=-1;h.ClipperBase.tolerance=1e-20;NM?(h.ClipperBase.loRange=46340,h.ClipperBase.hiRange=46340):(h.ClipperBase.loRange=47453132,h.ClipperBase.hiRange=0xfffffffffffff);h.ClipperBase.near_zero=function(r){return r>-h.ClipperBase.tolerance&&r<h.ClipperBase.tolerance};h.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};h.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(h.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};h.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,i){return i?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&te.op_Equality(te.Int128Mul(r.X-t.X,e.Y-t.Y),te.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};h.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var i=t;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,e))return!0;if(i=i.Next,i==t)break}return!1};h.ClipperBase.prototype.SlopesEqual=h.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,o,n,s,c,l;return t==3?(e=r[0],i=r[1],l=r[2],l?te.op_Equality(te.Int128Mul(e.Delta.Y,i.Delta.X),te.Int128Mul(e.Delta.X,i.Delta.Y)):h.Cast_Int64(e.Delta.Y*i.Delta.X)==h.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(o=r[0],n=r[1],s=r[2],l=r[3],l?te.op_Equality(te.Int128Mul(o.Y-n.Y,n.X-s.X),te.Int128Mul(o.X-n.X,n.Y-s.Y)):h.Cast_Int64((o.Y-n.Y)*(n.X-s.X))-h.Cast_Int64((o.X-n.X)*(n.Y-s.Y))===0):(o=r[0],n=r[1],s=r[2],c=r[3],l=r[4],l?te.op_Equality(te.Int128Mul(o.Y-n.Y,s.X-c.X),te.Int128Mul(o.X-n.X,s.Y-c.Y)):h.Cast_Int64((o.Y-n.Y)*(s.X-c.X))-h.Cast_Int64((o.X-n.X)*(s.Y-c.Y))===0)};h.ClipperBase.SlopesEqual3=function(r,t,e){return e?te.op_Equality(te.Int128Mul(r.Delta.Y,t.Delta.X),te.Int128Mul(r.Delta.X,t.Delta.Y)):h.Cast_Int64(r.Delta.Y*t.Delta.X)==h.Cast_Int64(r.Delta.X*t.Delta.Y)};h.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?te.op_Equality(te.Int128Mul(r.Y-t.Y,t.X-e.X),te.Int128Mul(r.X-t.X,t.Y-e.Y)):h.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-h.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};h.ClipperBase.SlopesEqual5=function(r,t,e,i,o){return o?te.op_Equality(te.Int128Mul(r.Y-t.Y,e.X-i.X),te.Int128Mul(r.X-t.X,e.Y-i.Y)):h.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-h.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};h.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,i=this.m_edges[r].length;e<i;++e)this.m_edges[r][e]=null;h.Clear(this.m_edges[r])}h.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};h.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};h.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>h.ClipperBase.hiRange||r.Y>h.ClipperBase.hiRange||-r.X>h.ClipperBase.hiRange||-r.Y>h.ClipperBase.hiRange)&&h.Error("Coordinate outside allowed range in RangeTest()."):(r.X>h.ClipperBase.loRange||r.Y>h.ClipperBase.loRange||-r.X>h.ClipperBase.loRange||-r.Y>h.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};h.ClipperBase.prototype.InitEdge=function(r,t,e,i){r.Next=t,r.Prev=e,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};h.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};h.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;h.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||h.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=h.ClipperBase.horizontal&&r.Prev.Dx!=h.ClipperBase.horizontal)break;for(;r.Prev.Dx==h.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==h.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};h.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,o,n;if(r.Dx==h.ClipperBase.horizontal&&(t?n=r.Prev.Bot.X:n=r.Next.Bot.X,r.Bot.X!=n&&this.ReverseHorizontal(r)),i.OutIdx!=h.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=h.ClipperBase.Skip;)i=i.Next;if(i.Dx==h.ClipperBase.horizontal&&i.Next.OutIdx!=h.ClipperBase.Skip){for(o=i;o.Prev.Dx==h.ClipperBase.horizontal;)o=o.Prev;o.Prev.Top.X==i.Next.Top.X?t||(i=o.Prev):o.Prev.Top.X>i.Next.Top.X&&(i=o.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=h.ClipperBase.Skip;)i=i.Prev;if(i.Dx==h.ClipperBase.horizontal&&i.Prev.OutIdx!=h.ClipperBase.Skip){for(o=i;o.Next.Dx==h.ClipperBase.horizontal;)o=o.Next;o.Next.Top.X==i.Prev.Top.X?t||(i=o.Next):o.Next.Top.X>i.Prev.Top.X&&(i=o.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==h.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==h.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==h.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var s=new h.LocalMinima;s.Next=null,s.Y=r.Bot.Y,s.LeftBound=null,s.RightBound=r,s.RightBound.WindDelta=0,i=this.ProcessBound(s.RightBound,t),this.InsertLocalMinima(s)}}return i};h.ClipperBase.prototype.AddPath=function(r,t,e){e7?!e&&t==h.PolyType.ptClip&&h.Error("AddPath: Open paths must be subject."):e||h.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&h.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&h.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var o=new Array,n=0;n<=i;n++)o.push(new h.TEdge);var s=!0;o[1].Curr.X=r[1].X,o[1].Curr.Y=r[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(r[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(r[i],c),this.m_UseFullRange=c.Value,this.InitEdge(o[0],o[1],o[i],r[0]),this.InitEdge(o[i],o[0],o[i-1],r[i]);for(var n=i-1;n>=1;--n)c.Value=this.m_UseFullRange,this.RangeTest(r[n],c),this.m_UseFullRange=c.Value,this.InitEdge(o[n],o[n+1],o[n-1],r[n]);for(var l=o[0],u=l,f=l;;){if(h.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==l&&(l=u.Next),u=this.RemoveEdge(u),f=u;continue}if(u.Prev==u.Next)break;if(e&&h.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==l&&(l=u.Next),u=this.RemoveEdge(u),u=u.Prev,f=u;continue}if(u=u.Next,u==f)break}if(!e&&u==u.Next||e&&u.Prev==u.Next)return!1;e||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=h.ClipperBase.Skip);var y=l;u=l;do this.InitEdge2(u,t),u=u.Next,s&&u.Curr.Y!=l.Curr.Y&&(s=!1);while(u!=l);if(s){if(e)return!1;u.Prev.OutIdx=h.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var g=new h.LocalMinima;for(g.Next=null,g.Y=u.Bot.Y,g.LeftBound=null,g.RightBound=u,g.RightBound.Side=h.EdgeSide.esRight,g.RightBound.WindDelta=0;u.Next.OutIdx!=h.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(g),this.m_edges.push(o),!0}this.m_edges.push(o);for(var v,I=null;u=this.FindNextLocMin(u),u!=I;){I==null&&(I=u);var g=new h.LocalMinima;g.Next=null,g.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(g.LeftBound=u.Prev,g.RightBound=u,v=!1):(g.LeftBound=u,g.RightBound=u.Prev,v=!0),g.LeftBound.Side=h.EdgeSide.esLeft,g.RightBound.Side=h.EdgeSide.esRight,e?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,u=this.ProcessBound(g.LeftBound,v);var x=this.ProcessBound(g.RightBound,!v);g.LeftBound.OutIdx==h.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==h.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),v||(u=x)}return!0};h.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,o=0,n=r.length;o<n;++o)this.AddPath(r[o],t,e)&&(i=!0);return i};h.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return h.IntPoint.op_Equality(r,e)||h.IntPoint.op_Equality(r,t)||h.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};h.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};h.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=h.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};h.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};h.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};h.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,fn&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};h.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=h.EdgeSide.esLeft,t.OutIdx=h.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=h.EdgeSide.esRight,t.OutIdx=h.ClipperBase.Unassigned),r=r.Next}};h.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=h.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=h.PolyFillType.pftEvenOdd,this.m_SubjFillType=h.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,h.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=h.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,fn&&(this.ZFillFunction=null)};h.Clipper.ioReverseSolution=1;h.Clipper.ioStrictlySimple=2;h.Clipper.ioPreserveCollinear=4;h.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),h.ClipperBase.prototype.Clear.call(this))};h.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};h.Clipper.prototype.Reset=function(){h.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};h.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new h.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new h.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new h.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};h.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof h.PolyTree;if(t==4&&!e){var i=r[0],o=r[1],n=r[2],s=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&h.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,h.Clear(o),this.m_SubjFillType=n,this.m_ClipFillType=s,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&e){var i=r[0],l=r[1],n=r[2],s=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=n,this.m_ClipFillType=s,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==2&&!e){var i=r[0],o=r[1];return this.Execute(i,o,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],l=r[1];return this.Execute(i,l,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}};h.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};h.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),h.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts===null||o.IsOpen||(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts!==null&&!o.IsOpen&&this.FixupOutPolygon(o)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{h.Clear(this.m_Joins),h.Clear(this.m_GhostJoins)}};h.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};h.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);h.Clear(this.m_PolyOuts)};h.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};h.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};h.Clipper.prototype.AddJoin=function(r,t,e){var i=new h.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};h.Clipper.prototype.AddGhostJoin=function(r,t){var e=new h.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};fn&&(h.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});h.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(i=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(h.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&h.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var o=0,n=this.m_GhostJoins.length;o<n;o++){var s=this.m_GhostJoins[o];this.HorzSegmentsOverlap(s.OutPt1.Pt,s.OffPt,e.Bot,e.Top)&&this.AddJoin(s.OutPt1,i,s.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&h.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,c,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&h.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,c,e.Top)}var l=t.NextInAEL;if(l!==null)for(;l!=e;)this.IntersectEdges(e,l,t.Curr,!1),l=l.NextInAEL}}}};h.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};h.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<h.Clipper.TopX(r,t.Top.Y):r.Top.X>h.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};h.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==h.PolyType.ptSubject?this.m_SubjFillType==h.PolyFillType.pftEvenOdd:this.m_ClipFillType==h.PolyFillType.pftEvenOdd};h.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==h.PolyType.ptSubject?this.m_ClipFillType==h.PolyFillType.pftEvenOdd:this.m_SubjFillType==h.PolyFillType.pftEvenOdd};h.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==h.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case h.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case h.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case h.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case h.ClipType.ctIntersection:switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2!==0;case h.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case h.ClipType.ctUnion:switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case h.ClipType.ctDifference:if(r.PolyTyp==h.PolyType.ptSubject)switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2!==0;case h.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case h.ClipType.ctXor:if(r.WindDelta===0)switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};h.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=h.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,i=t.PrevInAEL;i!==null;)i.PolyTyp==t.PolyTyp&&i.WindDelta!==0&&(e=!e),i=i.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};h.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};h.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};h.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};h.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};h.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};h.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,o,n;if(h.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=h.EdgeSide.esLeft,t.Side=h.EdgeSide.esRight,o=r,o.PrevInAEL==t?n=t.PrevInAEL:n=o.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=h.EdgeSide.esRight,t.Side=h.EdgeSide.esLeft,o=t,o.PrevInAEL==r?n=r.PrevInAEL:n=o.PrevInAEL),n!==null&&n.OutIdx>=0&&h.Clipper.TopX(n,e.Y)==h.Clipper.TopX(o,e.Y)&&h.ClipperBase.SlopesEqual(o,n,this.m_UseFullRange)&&o.WindDelta!==0&&n.WindDelta!==0){var s=this.AddOutPt(n,e);this.AddJoin(i,s,o.Top)}return i};h.Clipper.prototype.CreateOutRec=function(){var r=new h.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};h.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==h.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var o=new h.OutPt;return i.Pts=o,o.Idx=i.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=o,o.Prev=o,i.IsOpen||this.SetHoleState(r,i),fn&&(h.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(t,r.Top)?(o.Pt.X=r.Top.X,o.Pt.Y=r.Top.Y,o.Pt.Z=r.Top.Z):this.SetZ(o.Pt,r)),r.OutIdx=i.Idx,o}else{var i=this.m_PolyOuts[r.OutIdx],n=i.Pts;if(e&&h.IntPoint.op_Equality(t,n.Pt))return n;if(!e&&h.IntPoint.op_Equality(t,n.Prev.Pt))return n.Prev;var o=new h.OutPt;return o.Idx=i.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=n,o.Prev=n.Prev,o.Prev.Next=o,n.Prev=o,e&&(i.Pts=o),fn&&(h.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(t,r.Top)?(o.Pt.X=r.Top.X,o.Pt.Y=r.Top.Y,o.Pt.Z=r.Top.Z):this.SetZ(o.Pt,r)),o}};h.Clipper.prototype.SwapPoints=function(r,t){var e=new h.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};h.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,i){return r.X>e.X==r.X<i.X||t.X>e.X==t.X<i.X||e.X>r.X==e.X<t.X||i.X>r.X==i.X<t.X||r.X==e.X&&t.X==i.X?!0:r.X==i.X&&t.X==e.X};h.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new h.OutPt;return i.Pt.X=e.X,i.Pt.Y=e.Y,t==r.Next?(r.Next=i,t.Prev=i,i.Next=t,i.Prev=r):(t.Next=i,r.Prev=i,i.Next=r,i.Prev=t),i};h.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;e&&(t.IsHole=!0)};h.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?h.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};h.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;h.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;h.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var o=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;h.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var n=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;h.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var s=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=n&&i>=s||o>=n&&o>=s};h.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;h.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};h.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,i=t.BottomPt;return e.Pt.Y>i.Pt.Y?r:e.Pt.Y<i.Pt.Y?t:e.Pt.X<i.Pt.X?r:e.Pt.X>i.Pt.X||e.Next==e?t:i.Next==i||this.FirstIsBottomPt(e,i)?r:t};h.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};h.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};h.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],o;this.Param1RightOfParam2(e,i)?o=i:this.Param1RightOfParam2(i,e)?o=e:o=this.GetLowermostRec(e,i);var n=e.Pts,s=n.Prev,c=i.Pts,l=c.Prev,u;r.Side==h.EdgeSide.esLeft?(t.Side==h.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=n,n.Prev=c,s.Next=l,l.Prev=s,e.Pts=l):(l.Next=n,n.Prev=l,c.Prev=s,s.Next=c,e.Pts=c),u=h.EdgeSide.esLeft):(t.Side==h.EdgeSide.esRight?(this.ReversePolyPtLinks(c),s.Next=l,l.Prev=s,c.Next=n,n.Prev=c):(s.Next=c,c.Prev=s,n.Prev=l,l.Next=n),u=h.EdgeSide.esRight),e.BottomPt=null,o==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var f=r.OutIdx,y=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==y){g.OutIdx=f,g.Side=u;break}g=g.NextInAEL}i.Idx=e.Idx};h.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};h.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};h.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};h.Clipper.prototype.IntersectEdges=function(r,t,e,i){var o=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,n=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,s=r.OutIdx>=0,c=t.OutIdx>=0;if(e7&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(o||n)&&s&&c&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==h.ClipType.ctUnion?r.WindDelta===0?c&&(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):s&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1))),o&&(r.OutIdx<0?this.DeleteFromAEL(r):h.Error("Error intersecting polylines")),n&&(t.OutIdx<0?this.DeleteFromAEL(t):h.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var l=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=l}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var u,f,y,g;r.PolyTyp==h.PolyType.ptSubject?(u=this.m_SubjFillType,y=this.m_ClipFillType):(u=this.m_ClipFillType,y=this.m_SubjFillType),t.PolyTyp==h.PolyType.ptSubject?(f=this.m_SubjFillType,g=this.m_ClipFillType):(f=this.m_ClipFillType,g=this.m_SubjFillType);var v,I;switch(u){case h.PolyFillType.pftPositive:v=r.WindCnt;break;case h.PolyFillType.pftNegative:v=-r.WindCnt;break;default:v=Math.abs(r.WindCnt);break}switch(f){case h.PolyFillType.pftPositive:I=t.WindCnt;break;case h.PolyFillType.pftNegative:I=-t.WindCnt;break;default:I=Math.abs(t.WindCnt);break}if(s&&c)o||n||v!==0&&v!=1||I!==0&&I!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=h.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(s)(I===0||I==1)&&(this.AddOutPt(r,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(c)(v===0||v==1)&&(this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if((v===0||v==1)&&(I===0||I==1)&&!o&&!n){var x,b;switch(y){case h.PolyFillType.pftPositive:x=r.WindCnt2;break;case h.PolyFillType.pftNegative:x=-r.WindCnt2;break;default:x=Math.abs(r.WindCnt2);break}switch(g){case h.PolyFillType.pftPositive:b=t.WindCnt2;break;case h.PolyFillType.pftNegative:b=-t.WindCnt2;break;default:b=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(v==1&&I==1)switch(this.m_ClipType){case h.ClipType.ctIntersection:x>0&&b>0&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctUnion:x<=0&&b<=0&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctDifference:(r.PolyTyp==h.PolyType.ptClip&&x>0&&b>0||r.PolyTyp==h.PolyType.ptSubject&&x<=0&&b<=0)&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else h.Clipper.SwapSides(r,t)}o!=n&&(o&&r.OutIdx>=0||n&&t.OutIdx>=0)&&(h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t)),o&&this.DeleteFromAEL(r),n&&this.DeleteFromAEL(t)};h.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};h.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};h.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&h.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,h.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};h.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};h.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=h.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=h.Direction.dRightToLeft)};h.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=h.EdgeSide.esLeft&&(e=e.Prev),t&&(h.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};h.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,o=e.Left,n=e.Right,s=r,c=null;s.NextInLML!==null&&h.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(c=this.GetMaximaPair(s));;){for(var l=r==s,u=this.GetNextInAEL(r,i);u!==null&&!(u.Curr.X==r.Top.X&&r.NextInLML!==null&&u.Dx<r.NextInLML.Dx);){var f=this.GetNextInAEL(u,i);if(i==h.Direction.dLeftToRight&&u.Curr.X<=n||i==h.Direction.dRightToLeft&&u.Curr.X>=o){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),u==c&&l){i==h.Direction.dLeftToRight?this.IntersectEdges(r,u,u.Top,!1):this.IntersectEdges(u,r,u.Top,!1),c.OutIdx>=0&&h.Error("ProcessHorizontal error");return}else if(i==h.Direction.dLeftToRight){var y=new h.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(r,u,y,!0)}else{var y=new h.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(u,r,y,!0)}this.SwapPositionsInAEL(r,u)}else if(i==h.Direction.dLeftToRight&&u.Curr.X>=n||i==h.Direction.dRightToLeft&&u.Curr.X<=o)break;u=f}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&h.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:o,Right:n};this.GetHorzDirection(r,e),i=e.Dir,o=e.Left,n=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var g=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var v=r.PrevInAEL,f=r.NextInAEL;if(v!==null&&v.Curr.X==r.Bot.X&&v.Curr.Y==r.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&h.ClipperBase.SlopesEqual(r,v,this.m_UseFullRange)){var I=this.AddOutPt(v,r.Bot);this.AddJoin(g,I,r.Top)}else if(f!==null&&f.Curr.X==r.Bot.X&&f.Curr.Y==r.Bot.Y&&f.WindDelta!==0&&f.OutIdx>=0&&f.Curr.Y>f.Top.Y&&h.ClipperBase.SlopesEqual(r,f,this.m_UseFullRange)){var I=this.AddOutPt(f,r.Bot);this.AddJoin(g,I,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else c!==null?c.OutIdx>=0?(i==h.Direction.dLeftToRight?this.IntersectEdges(r,c,r.Top,!1):this.IntersectEdges(c,r,r.Top,!1),c.OutIdx>=0&&h.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(c)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};h.Clipper.prototype.GetNextInAEL=function(r,t){return t==h.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};h.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};h.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};h.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};h.Clipper.prototype.GetMaximaPair=function(r){var t=null;return h.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:h.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!h.ClipperBase.IsHorizontal(t))?null:t};h.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,h.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};h.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=h.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var o=e.NextInSEL,n=new h.IntPoint;if(e.Curr.X>o.Curr.X){!this.IntersectPoint(e,o,n)&&e.Curr.X>o.Curr.X+1&&h.Error("Intersection error"),n.Y>r&&(n.Y=r,Math.abs(e.Dx)>Math.abs(o.Dx)?n.X=h.Clipper.TopX(o,r):n.X=h.Clipper.TopX(e,r));var s=new h.IntersectNode;s.Edge1=e,s.Edge2=o,s.Pt.X=n.X,s.Pt.Y=n.Y,this.m_IntersectList.push(s),this.SwapPositionsInSEL(e,o),i=!0}else e=o}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};h.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};h.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};h.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var i=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=i}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};h.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var TT=p(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),wT=p(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),ET=p(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),DT=p(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");ie.msie?h.Clipper.Round=TT:ie.chromium?h.Clipper.Round=ET:ie.safari?h.Clipper.Round=DT:h.Clipper.Round=wT;h.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+h.Clipper.Round(r.Dx*(t-r.Bot.Y))};h.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,o;if(h.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,h.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,e.Y=h.Clipper.Round(e.X/t.Dx+o));else if(t.Delta.X===0)e.X=t.Bot.X,h.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=h.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,o=t.Bot.X-t.Bot.Y*t.Dx;var n=(o-i)/(r.Dx-t.Dx);e.Y=h.Clipper.Round(n),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=h.Clipper.Round(r.Dx*n+i):e.X=h.Clipper.Round(t.Dx*n+o)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=h.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=h.Clipper.TopX(r,e.Y):e.X=h.Clipper.TopX(t,e.Y)}return!0};h.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var i=this.GetMaximaPair(t);e=i===null||!h.ClipperBase.IsHorizontal(i)}if(e){var o=t.PrevInAEL;this.DoMaxima(t),o===null?t=this.m_ActiveEdges:t=o.NextInAEL}else{if(this.IsIntermediate(t,r)&&h.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=h.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var o=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&o!==null&&o.OutIdx>=0&&o.Curr.X==t.Curr.X&&o.WindDelta!==0){var n=this.AddOutPt(o,t.Curr),s=this.AddOutPt(t,t.Curr);this.AddJoin(n,s,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var n=null;t.OutIdx>=0&&(n=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var o=t.PrevInAEL,c=t.NextInAEL;if(o!==null&&o.Curr.X==t.Bot.X&&o.Curr.Y==t.Bot.Y&&n!==null&&o.OutIdx>=0&&o.Curr.Y>o.Top.Y&&h.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var s=this.AddOutPt(o,t.Bot);this.AddJoin(n,s,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&n!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&h.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var s=this.AddOutPt(c,t.Bot);this.AddJoin(n,s,t.Top)}}t=t.NextInAEL}};h.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,i=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):h.Error("DoMaxima error")};h.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};h.Clipper.Orientation=function(r){return h.Clipper.Area(r)>=0};h.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};h.Clipper.prototype.BuildResult=function(r){h.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];if(i.Pts!==null){var o=i.Pts.Prev,n=this.PointCount(o);if(!(n<2)){for(var s=new Array(n),c=0;c<n;c++)s[c]=o.Pt,o=o.Prev;r.push(s)}}}};h.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t],o=this.PointCount(i.Pts);if(!(i.IsOpen&&o<2||!i.IsOpen&&o<3)){this.FixHoleLinkage(i);var n=new h.PolyNode;r.m_AllPolys.push(n),i.PolyNode=n,n.m_polygon.length=o;for(var s=i.Pts.Prev,c=0;c<o;c++)n.m_polygon[c]=s.Pt,s=s.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};h.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(h.IntPoint.op_Equality(e.Pt,e.Next.Pt)||h.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||h.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var i=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,i=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};h.Clipper.prototype.DupOutPt=function(r,t){var e=new h.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};h.Clipper.prototype.GetOverlap=function(r,t,e,i,o){return r<t?e<i?(o.Left=Math.max(r,e),o.Right=Math.min(t,i)):(o.Left=Math.max(r,i),o.Right=Math.min(t,e)):e<i?(o.Left=Math.max(t,e),o.Right=Math.min(r,i)):(o.Left=Math.max(t,i),o.Right=Math.min(r,e)),o.Left<o.Right};h.Clipper.prototype.JoinHorz=function(r,t,e,i,o,n){var s=r.Pt.X>t.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight,c=e.Pt.X>i.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight;if(s==c)return!1;if(s==h.Direction.dLeftToRight){for(;r.Next.Pt.X<=o.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;n&&r.Pt.X!=o.X&&(r=r.Next),t=this.DupOutPt(r,!n),h.IntPoint.op_Inequality(t.Pt,o)&&(r=t,r.Pt.X=o.X,r.Pt.Y=o.Y,t=this.DupOutPt(r,!n))}else{for(;r.Next.Pt.X>=o.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;!n&&r.Pt.X!=o.X&&(r=r.Next),t=this.DupOutPt(r,n),h.IntPoint.op_Inequality(t.Pt,o)&&(r=t,r.Pt.X=o.X,r.Pt.Y=o.Y,t=this.DupOutPt(r,n))}if(c==h.Direction.dLeftToRight){for(;e.Next.Pt.X<=o.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;n&&e.Pt.X!=o.X&&(e=e.Next),i=this.DupOutPt(e,!n),h.IntPoint.op_Inequality(i.Pt,o)&&(e=i,e.Pt.X=o.X,e.Pt.Y=o.Y,i=this.DupOutPt(e,!n))}else{for(;e.Next.Pt.X>=o.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;!n&&e.Pt.X!=o.X&&(e=e.Next),i=this.DupOutPt(e,n),h.IntPoint.op_Inequality(i.Pt,o)&&(e=i,e.Pt.X=o.X,e.Pt.Y=o.Y,i=this.DupOutPt(e,n))}return s==h.Direction.dLeftToRight==n?(r.Prev=e,e.Next=r,t.Next=i,i.Prev=t):(r.Next=e,e.Prev=r,t.Prev=i,i.Next=t),!0};h.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,o=new h.OutPt,n=r.OutPt2,s=new h.OutPt,c=r.OutPt1.Pt.Y==r.OffPt.Y;if(c&&h.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&h.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(o=r.OutPt1.Next;o!=i&&h.IntPoint.op_Equality(o.Pt,r.OffPt);)o=o.Next;var l=o.Pt.Y>r.OffPt.Y;for(s=r.OutPt2.Next;s!=n&&h.IntPoint.op_Equality(s.Pt,r.OffPt);)s=s.Next;var u=s.Pt.Y>r.OffPt.Y;return l==u?!1:l?(o=this.DupOutPt(i,!1),s=this.DupOutPt(n,!0),i.Prev=n,n.Next=i,o.Next=s,s.Prev=o,r.OutPt1=i,r.OutPt2=o,!0):(o=this.DupOutPt(i,!0),s=this.DupOutPt(n,!1),i.Next=n,n.Prev=i,o.Prev=s,s.Next=o,r.OutPt1=i,r.OutPt2=o,!0)}else if(c){for(o=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=o&&i.Prev!=n;)i=i.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=i&&o.Next!=n;)o=o.Next;if(o.Next==i||o.Next==n)return!1;for(s=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=s&&n.Prev!=o;)n=n.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=n&&s.Next!=i;)s=s.Next;if(s.Next==n||s.Next==i)return!1;var f={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,o.Pt.X,n.Pt.X,s.Pt.X,f))return!1;var y=f.Left,g=f.Right,v=new h.IntPoint,I;return i.Pt.X>=y&&i.Pt.X<=g?(v.X=i.Pt.X,v.Y=i.Pt.Y,I=i.Pt.X>o.Pt.X):n.Pt.X>=y&&n.Pt.X<=g?(v.X=n.Pt.X,v.Y=n.Pt.Y,I=n.Pt.X>s.Pt.X):o.Pt.X>=y&&o.Pt.X<=g?(v.X=o.Pt.X,v.Y=o.Pt.Y,I=o.Pt.X>i.Pt.X):(v.X=s.Pt.X,v.Y=s.Pt.Y,I=s.Pt.X>n.Pt.X),r.OutPt1=i,r.OutPt2=n,this.JoinHorz(i,o,n,s,v,I)}else{for(o=i.Next;h.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Next;var x=o.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange);if(x){for(o=i.Prev;h.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Prev;if(o.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange))return!1}for(s=n.Next;h.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Next;var b=s.Pt.Y>n.Pt.Y||!h.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange);if(b){for(s=n.Prev;h.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Prev;if(s.Pt.Y>n.Pt.Y||!h.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange))return!1}return o==i||s==n||o==s||t==e&&x==b?!1:x?(o=this.DupOutPt(i,!1),s=this.DupOutPt(n,!0),i.Prev=n,n.Next=i,o.Next=s,s.Prev=o,r.OutPt1=i,r.OutPt2=o,!0):(o=this.DupOutPt(i,!0),s=this.DupOutPt(n,!1),i.Next=n,n.Prev=i,o.Prev=s,s.Next=o,r.OutPt1=i,r.OutPt2=o,!0)}};h.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new h.IntRect(0,0,0,0);var i=new h.IntRect;for(i.left=r[t][0].X,i.right=i.left,i.top=r[t][0].Y,i.bottom=i.top;t<e;t++)for(var o=0,n=r[t].length;o<n;o++)r[t][o].X<i.left?i.left=r[t][o].X:r[t][o].X>i.right&&(i.right=r[t][o].X),r[t][o].Y<i.top?i.top=r[t][o].Y:r[t][o].Y>i.bottom&&(i.bottom=r[t][o].Y);return i};h.Clipper.prototype.GetBounds2=function(r){var t=r,e=new h.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};h.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var o=t[0],n=1;n<=i;++n){var s=n==i?t[0]:t[n];if(s.Y==r.Y&&(s.X==r.X||o.Y==r.Y&&s.X>r.X==o.X<r.X))return-1;if(o.Y<r.Y!=s.Y<r.Y){if(o.X>=r.X)if(s.X>r.X)e=1-e;else{var c=(o.X-r.X)*(s.Y-r.Y)-(s.X-r.X)*(o.Y-r.Y);if(c==0)return-1;c>0==s.Y>o.Y&&(e=1-e)}else if(s.X>r.X){var c=(o.X-r.X)*(s.Y-r.Y)-(s.X-r.X)*(o.Y-r.Y);if(c==0)return-1;c>0==s.Y>o.Y&&(e=1-e)}}o=s}return e};h.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var o=t.Pt.X,n=t.Pt.Y,s=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==r.Y&&(s==r.X||n==r.Y&&s>r.X==o<r.X))return-1;if(n<r.Y!=c<r.Y){if(o>=r.X)if(s>r.X)e=1-e;else{var l=(o-r.X)*(c-r.Y)-(s-r.X)*(n-r.Y);if(l==0)return-1;l>0==c>n&&(e=1-e)}else if(s>r.X){var l=(o-r.X)*(c-r.Y)-(s-r.X)*(n-r.Y);if(l==0)return-1;l>0==c>n&&(e=1-e)}}if(t=t.Next,i==t)break}return e};h.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var i=this.PointInPolygon(e.Pt,t);if(i>=0)return i!=0;e=e.Next}while(e!=r);return!0};h.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts!==null&&o.FirstLeft==r&&this.Poly2ContainsPoly1(o.Pts,t.Pts)&&(o.FirstLeft=t)}};h.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,o=i.length,n=i[e];e<o;e++,n=i[e])n.FirstLeft==r&&(n.FirstLeft=t)};h.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};h.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],i=this.GetOutRec(e.OutPt1.Idx),o=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||o.Pts==null)){var n;if(i==o?n=i:this.Param1RightOfParam2(i,o)?n=o:this.Param1RightOfParam2(o,i)?n=i:n=this.GetLowermostRec(i,o),!!this.JoinPoints(e,i,o))if(i==o){if(i.Pts=e.OutPt1,i.BottomPt=null,o=this.CreateOutRec(),o.Pts=e.OutPt2,this.UpdateOutPtIdxs(o),this.m_UsingPolyTree)for(var s=0,c=this.m_PolyOuts.length;s<c-1;s++){var l=this.m_PolyOuts[s];l.Pts==null||h.Clipper.ParseFirstLeft(l.FirstLeft)!=i||l.IsHole==i.IsHole||this.Poly2ContainsPoly1(l.Pts,e.OutPt2)&&(l.FirstLeft=o)}this.Poly2ContainsPoly1(o.Pts,i.Pts)?(o.IsHole=!i.IsHole,o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i),(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)):this.Poly2ContainsPoly1(i.Pts,o.Pts)?(o.IsHole=i.IsHole,i.IsHole=!o.IsHole,o.FirstLeft=i.FirstLeft,i.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,o),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(o.IsHole=i.IsHole,o.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,o))}else o.Pts=null,o.BottomPt=null,o.Idx=i.Idx,i.IsHole=n.IsHole,n==o&&(i.FirstLeft=o.FirstLeft),o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i)}}};h.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};h.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var i=e.Next;i!=t.Pts;){if(h.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var o=e.Prev,n=i.Prev;e.Prev=n,n.Next=e,i.Prev=o,o.Next=i,t.Pts=e;var s=this.CreateOutRec();s.Pts=i,this.UpdateOutPtIdxs(s),this.Poly2ContainsPoly1(s.Pts,t.Pts)?(s.IsHole=!t.IsHole,s.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,s.Pts)?(s.IsHole=t.IsHole,t.IsHole=!s.IsHole,s.FirstLeft=t.FirstLeft,t.FirstLeft=s):(s.IsHole=t.IsHole,s.FirstLeft=t.FirstLeft),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};h.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,o=t-1;i<t;++i)e+=(r[o].X+r[i].X)*(r[o].Y-r[i].Y),o=i;return-e*.5};h.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};t7&&(h.Clipper.OffsetPaths=function(r,t,e,i,o){var n=new h.Paths,s=new h.ClipperOffset(o,o);return s.AddPaths(r,e,i),s.Execute(n,t),n});h.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,e,t,t),e};h.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=h.PolyFillType.pftEvenOdd);var e=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,e,t,t),e};h.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};h.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,o=e.X-t.X,n=i*t.X+o*t.Y;return n=i*r.X+o*r.Y-n,n*n/(i*i+o*o)};h.Clipper.SlopesNearCollinear=function(r,t,e,i){return h.Clipper.DistanceFromLineSqrd(t,r,e)<i};h.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,o=r.Y-t.Y;return i*i+o*o<=e};h.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};h.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var i=new Array(e),o=0;o<e;++o)i[o]=new h.OutPt;for(var o=0;o<e;++o)i[o].Pt=r[o],i[o].Next=i[(o+1)%e],i[o].Next.Prev=i[o],i[o].Idx=0;for(var n=t*t,s=i[0];s.Idx==0&&s.Next!=s.Prev;)h.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,n)?(s=h.Clipper.ExcludeOp(s),e--):h.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,n)?(h.Clipper.ExcludeOp(s.Next),s=h.Clipper.ExcludeOp(s),e-=2):h.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,n)?(s=h.Clipper.ExcludeOp(s),e--):(s.Idx=1,s=s.Next);e<3&&(e=0);for(var c=new Array(e),o=0;o<e;++o)c[o]=new h.IntPoint(s.Pt),s=s.Next;return i=null,c};h.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,o=r.length;i<o;i++)e[i]=h.Clipper.CleanPolygon(r[i],t);return e};h.Clipper.Minkowski=function(r,t,e,i){var o=i?1:0,n=r.length,s=t.length,c=new Array;if(e)for(var l=0;l<s;l++){for(var u=new Array(n),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])u[f]=new h.IntPoint(t[l].X+g.X,t[l].Y+g.Y);c.push(u)}else for(var l=0;l<s;l++){for(var u=new Array(n),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])u[f]=new h.IntPoint(t[l].X-g.X,t[l].Y-g.Y);c.push(u)}for(var v=new Array,l=0;l<s-1+o;l++)for(var f=0;f<n;f++){var I=new Array;I.push(c[l%s][f%n]),I.push(c[(l+1)%s][f%n]),I.push(c[(l+1)%s][(f+1)%n]),I.push(c[l%s][(f+1)%n]),h.Clipper.Orientation(I)||I.reverse(),v.push(I)}var x=new h.Clipper(0);return x.AddPaths(v,h.PolyType.ptSubject,!0),x.Execute(h.ClipType.ctUnion,c,h.PolyFillType.pftNonZero,h.PolyFillType.pftNonZero),c};h.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],o=r[2];return h.Clipper.Minkowski(e,i,!0,o)}else if(t==4){for(var e=r[0],n=r[1],s=r[2],o=r[3],c=new h.Clipper,l,u=0,f=n.length;u<f;++u){var l=h.Clipper.Minkowski(e,n[u],!0,o);c.AddPaths(l,h.PolyType.ptSubject,!0)}o&&c.AddPaths(n,h.PolyType.ptClip,!0);var y=new h.Paths;return c.Execute(h.ClipType.ctUnion,y,s,s),y}};h.Clipper.MinkowskiDiff=function(r,t,e){return h.Clipper.Minkowski(r,t,!1,e)};h.Clipper.PolyTreeToPaths=function(r){var t=new Array;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntAny,t),t};h.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case h.Clipper.NodeType.ntOpen:return;case h.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var o=0,n=r.Childs(),s=n.length,c=n[o];o<s;o++,c=n[o])h.Clipper.AddPolyNodeToPaths(c,t,e)};h.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new h.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};h.Clipper.ClosedPathsFromPolyTree=function(r){var t=new h.Paths;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntClosed,t),t};Md(h.Clipper,h.ClipperBase);h.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};h.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=h.ClipperOffset.def_arc_tolerance),this.m_destPolys=new h.Paths,this.m_srcPoly=new h.Path,this.m_destPoly=new h.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new h.IntPoint,this.m_polyNodes=new h.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};h.ClipperOffset.two_pi=6.28318530717959;h.ClipperOffset.def_arc_tolerance=.25;h.ClipperOffset.prototype.Clear=function(){h.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};h.ClipperOffset.Round=h.Clipper.Round;h.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var o=new h.PolyNode;if(o.m_jointype=t,o.m_endtype=e,e==h.EndType.etClosedLine||e==h.EndType.etClosedPolygon)for(;i>0&&h.IntPoint.op_Equality(r[0],r[i]);)i--;o.m_polygon.push(r[0]);for(var n=0,s=0,c=1;c<=i;c++)h.IntPoint.op_Inequality(o.m_polygon[n],r[c])&&(n++,o.m_polygon.push(r[c]),(r[c].Y>o.m_polygon[s].Y||r[c].Y==o.m_polygon[s].Y&&r[c].X<o.m_polygon[s].X)&&(s=n));if(!(e==h.EndType.etClosedPolygon&&n<2||e!=h.EndType.etClosedPolygon&&n<0)&&(this.m_polyNodes.AddChild(o),e==h.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new h.IntPoint(0,s);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(o.m_polygon[s].Y>l.Y||o.m_polygon[s].Y==l.Y&&o.m_polygon[s].X<l.X)&&(this.m_lowest=new h.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};h.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,o=r.length;i<o;i++)this.AddPath(r[i],t,e)};h.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!h.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==h.EndType.etClosedPolygon||t.m_endtype==h.EndType.etClosedLine&&h.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==h.EndType.etClosedLine&&!h.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};h.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new h.DoublePoint(0,0);var o=1/Math.sqrt(e*e+i*i);return e*=o,i*=o,new h.DoublePoint(i,-e)};h.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,h.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==h.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=h.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*h.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*h.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(h.ClipperOffset.two_pi/o),this.m_cos=Math.cos(h.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/h.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var n=this.m_srcPoly.length;if(!(n==0||r<=0&&(n<3||e.m_endtype!=h.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,n==1){if(e.m_jointype==h.JoinType.jtRound)for(var s=1,c=0,l=1;l<=o;l++){this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r)));var u=s;s=s*this.m_cos-this.m_sin*c,c=u*this.m_sin+c*this.m_cos}else for(var s=-1,c=-1,l=0;l<4;++l)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r))),s<0?s=1:c<0?c=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<n-1;l++)this.m_normals.push(h.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(e.m_endtype==h.EndType.etClosedLine||e.m_endtype==h.EndType.etClosedPolygon?this.m_normals.push(h.ClipperOffset.GetUnitNormal(this.m_srcPoly[n-1],this.m_srcPoly[0])):this.m_normals.push(new h.DoublePoint(this.m_normals[n-2])),e.m_endtype==h.EndType.etClosedPolygon){for(var f=n-1,l=0;l<n;l++)f=this.OffsetPoint(l,f,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==h.EndType.etClosedLine){for(var f=n-1,l=0;l<n;l++)f=this.OffsetPoint(l,f,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var y=this.m_normals[n-1],l=n-1;l>0;l--)this.m_normals[l]=new h.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new h.DoublePoint(-y.X,-y.Y),f=0;for(var l=n-1;l>=0;l--)f=this.OffsetPoint(l,f,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var f=0,l=1;l<n-1;++l)f=this.OffsetPoint(l,f,e.m_jointype);var g;if(e.m_endtype==h.EndType.etOpenButt){var l=n-1;g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*r),h.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*r)),this.m_destPoly.push(g),g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*r),h.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*r)),this.m_destPoly.push(g)}else{var l=n-1;f=n-2,this.m_sinA=0,this.m_normals[l]=new h.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(l,f):this.DoRound(l,f)}for(var l=n-1;l>0;l--)this.m_normals[l]=new h.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new h.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),f=n-1;for(var l=f-1;l>0;--l)f=this.OffsetPoint(l,f,e.m_jointype);e.m_endtype==h.EndType.etOpenButt?(g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(f=1,this.m_sinA=0,e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};h.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof h.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var o=new h.Clipper(0);if(o.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var n=h.Clipper.GetBounds(this.m_destPolys),s=new h.Path;if(s.push(new h.IntPoint(n.left-10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.top-10)),s.push(new h.IntPoint(n.left-10,n.top-10)),o.AddPath(s,h.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var c=e.Childs()[0];e.Childs()[0]=c.Childs()[0];for(var l=1;l<c.ChildCount();l++)e.AddChild(c.Childs()[l])}else e.Clear()}}else{var e=r[0],i=r[1];h.Clear(e),this.FixOrientations(),this.DoOffset(i);var o=new h.Clipper(0);if(o.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var n=h.Clipper.GetBounds(this.m_destPolys),s=new h.Path;s.push(new h.IntPoint(n.left-10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.top-10)),s.push(new h.IntPoint(n.left-10,n.top-10)),o.AddPath(s,h.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};h.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new h.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case h.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);i>=this.m_miterLim?this.DoMiter(r,t,i):this.DoSquare(r,t);break}case h.JoinType.jtSquare:this.DoSquare(r,t);break;case h.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};h.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};h.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),h.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};h.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),i=h.Cast_Int32(h.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),o=this.m_normals[t].X,n=this.m_normals[t].Y,s,c=0;c<i;++c)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+o*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+n*this.m_delta))),s=o,o=o*this.m_cos-this.m_sin*n,n=s*this.m_sin+n*this.m_cos;this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};h.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};h.JS={};h.JS.AreaOfPolygon=function(r,t){return t||(t=1),h.Clipper.Area(r)/(t*t)};h.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=h.Clipper.Area(r[i]);return e/(t*t)};h.JS.BoundsOfPath=function(r,t){return h.JS.BoundsOfPaths([r],t)};h.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=h.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};h.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=h.JS.Clone(i);if(typeof t!="number"||t===null)return h.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||t<0)return i;e||(i=[i]);for(var o=i.length,n,s,c,l,u,f,y,g=[],v=0;v<o;v++)if(s=i[v],n=s.length,n!==0){if(n<3){c=s,g.push(c);continue}for(c=s,l=t*t,u=s[0],f=1,y=1;y<n;y++)(s[y].X-u.X)*(s[y].X-u.X)+(s[y].Y-u.Y)*(s[y].Y-u.Y)<=l||(c[f]=s[y],u=s[y],f++);u=s[f-1],(s[0].X-u.X)*(s[0].X-u.X)+(s[0].Y-u.Y)*(s[0].Y-u.Y)<=l&&f--,f<n&&c.splice(f,n-f),c.length&&g.push(c)}return!e&&g.length?g=g[0]:!e&&g.length===0?g=[]:e&&g.length===0&&(g=[[]]),g};h.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,o,n,s,c=new Array(e);for(o=0;o<e;o++){for(i=r[o].length,s=new Array(i),n=0;n<i;n++)s[n]={X:r[o][n].X,Y:r[o][n].Y};c[o]=s}return t||(c=c[0]),c};h.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return h.Error("Tolerance is not a number in Lighten()."),h.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return h.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,o,n,s,c,l,u,f,y,g,v,I,x,b,S,w,T=r.length,E=t*t,D=[];for(e=0;e<T;e++)if(o=r[e],c=o.length,c!=0){for(n=0;n<1e6;n++){for(s=[],c=o.length,o[c-1].X!=o[0].X||o[c-1].Y!=o[0].Y?(v=1,o.push({X:o[0].X,Y:o[0].Y}),c=o.length):v=0,g=[],i=0;i<c-2;i++)l=o[i],f=o[i+1],u=o[i+2],S=l.X,w=l.Y,I=u.X-S,x=u.Y-w,(I!==0||x!==0)&&(b=((f.X-S)*I+(f.Y-w)*x)/(I*I+x*x),b>1?(S=u.X,w=u.Y):b>0&&(S+=I*b,w+=x*b)),I=f.X-S,x=f.Y-w,y=I*I+x*x,y<=E&&(g[i+1]=1,i++);for(s.push({X:o[0].X,Y:o[0].Y}),i=1;i<c-1;i++)g[i]||s.push({X:o[i].X,Y:o[i].Y});if(s.push({X:o[c-1].X,Y:o[c-1].Y}),v&&o.pop(),g.length)o=s;else break}c=s.length,s[c-1].X==s[0].X&&s[c-1].Y==s[0].Y&&s.pop(),s.length>2&&D.push(s)}return!r[0]instanceof Array&&(D=D[0]),typeof D>"u"&&(D=[[]]),D};h.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,o=0,n,s,c=0,l=0,u=0,f=0,y=r.length;if(y<2)return 0;for(t&&(r[y]=r[0],y++);--y;)n=r[y],c=n.X,l=n.Y,s=r[y-1],u=s.X,f=s.Y,o+=i((c-u)*(c-u)+(l-f)*(l-f));return t&&r.pop(),o/e};h.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,o=0;o<r.length;o++)i+=h.JS.PerimeterOfPath(r[o],t,e);return i};h.JS.ScaleDownPath=function(r,t){var e,i;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=i.X/t,i.Y=i.Y/t};h.JS.ScaleDownPaths=function(r,t){var e,i,o,n=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)o=r[e][i],o.X=o.X/t,o.Y=o.Y/t};h.JS.ScaleUpPath=function(r,t){var e,i,o=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=o(i.X*t),i.Y=o(i.Y*t)};h.JS.ScaleUpPaths=function(r,t){var e,i,o,n=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)o=r[e][i],o.X=n(o.X*t),o.Y=n(o.Y*t)};h.ExPolygons=function(){return[]};h.ExPolygon=function(){this.outer=null,this.holes=null};h.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new h.ExPolygon;e.outer=r.Contour();var i=r.Childs(),o=i.length;e.holes=new Array(o);var n,s,c,l,u,f;for(c=0;c<o;c++)for(n=i[c],e.holes[c]=n.Contour(),l=0,u=n.Childs(),f=u.length;l<f;l++)s=u[l],h.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(e)};h.JS.ExPolygonsToPaths=function(r){var t,e,i,o,n=new h.Paths;for(t=0,i=r.length;t<i;t++)for(n.push(r[t].outer),e=0,o=r[t].holes.length;e<o;e++)n.push(r[t].holes[e]);return n};h.JS.PolyTreeToExPolygons=function(r){var t=new h.ExPolygons,e,i,o,n;for(i=0,o=r.Childs(),n=o.length;i<n;i++)e=o[i],h.JS.AddOuterPolyNodeToExPolygons(e,t);return t};Hl.exports=h});var MS=j((F$,Ph)=>{m();(function(){"use strict";function r(s,c){var l=s.x-c.x,u=s.y-c.y;return l*l+u*u}p(r,"getSqDist");function t(s,c,l){var u=c.x,f=c.y,y=l.x-u,g=l.y-f;if(y!==0||g!==0){var v=((s.x-u)*y+(s.y-f)*g)/(y*y+g*g);v>1?(u=l.x,f=l.y):v>0&&(u+=y*v,f+=g*v)}return y=s.x-u,g=s.y-f,y*y+g*g}p(t,"getSqSegDist");function e(s,c){for(var l=s[0],u=[l],f,y=1,g=s.length;y<g;y++)f=s[y],r(f,l)>c&&(u.push(f),l=f);return l!==f&&u.push(f),u}p(e,"simplifyRadialDist");function i(s,c,l,u,f){for(var y=u,g,v=c+1;v<l;v++){var I=t(s[v],s[c],s[l]);I>y&&(g=v,y=I)}y>u&&(g-c>1&&i(s,c,g,u,f),f.push(s[g]),l-g>1&&i(s,g,l,u,f))}p(i,"simplifyDPStep");function o(s,c){var l=s.length-1,u=[s[0]];return i(s,0,l,c,u),u.push(s[l]),u}p(o,"simplifyDouglasPeucker");function n(s,c,l){if(s.length<=2)return s;var u=c!==void 0?c*c:1;return s=l?s:e(s,u),s=o(s,u),s}p(n,"simplify"),typeof define=="function"&&define.amd?define(function(){return n}):typeof Ph<"u"?(Ph.exports=n,Ph.exports.default=n):typeof self<"u"?self.simplify=n:window.simplify=n})()});m();m();var Jn=class Jn{constructor(t,e,i){d(this,"__type",Jn.__type);d(this,"id",ge());d(this,"latitude");d(this,"longitude");d(this,"floorId");this.latitude=t,this.longitude=e,this.floorId=i}static is(t){return t.__type===Jn.__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}}destroy(){}};p(Jn,"Coordinate"),d(Jn,"__type","coordinate");var af=Jn,K=af;m();var sf=class sf{constructor(t){d(this,"id");this.id=t}};p(sf,"BaseMetaData");var Ve=sf;var $i,pt,Yo,Ji,Qn=class Qn extends Ve{constructor(e,i){super(i.mvfData.properties.id);d(this,"__type",Qn.__type);C(this,$i,void 0);C(this,pt,{});C(this,Yo,void 0);C(this,Ji,void 0);P(this,$i,e),P(this,Yo,i.floorId),P(this,Ji,i.mvfData)}static is(e){return e.__type===Qn.__type}get locations(){return a(this,pt).locations?a(this,pt).locations:(a(this,pt).locations=(a(this,$i).locationIdsByNodeId[this.id]||[]).map(e=>a(this,$i).getById("enterprise-location",e)).filter(Boolean),a(this,pt).locations)}get floor(){let e=a(this,$i).getById("floor",a(this,Yo));if(e==null)throw new Error("Floor ".concat(a(this,Yo)," not found!"));return e}get coordinate(){if(a(this,pt).coordinate==null){let[e,i]=a(this,Ji).geometry.coordinates;a(this,pt).coordinate=new K(i,e,a(this,Yo))}return a(this,pt).coordinate}get externalId(){var e;return(e=a(this,Ji).properties.externalId)!=null?e:""}get neighbors(){if(a(this,pt).neighbours==null){let e=a(this,Ji).properties.neighbors.map(i=>{let o=a(this,$i).getById("node",i.id);if(o==null)throw new Error("Node ".concat(i.id," not found!"));return o});a(this,pt).neighbours=e}return a(this,pt).neighbours}get geoJSON(){return{...a(this,Ji),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(a(this,pt)))delete a(this,pt)[e]}};$i=new WeakMap,pt=new WeakMap,Yo=new WeakMap,Ji=new WeakMap,p(Qn,"Node"),d(Qn,"__type","node");var lf=Qn,ri=lf;m();m();m();m();var Hs,Kn,js=class js extends Ve{constructor(e){super(String(ge()));C(this,Hs,{});C(this,Kn,void 0);P(this,Kn,e.mvfData)}static is(e){return e.__type===js.__type}get url(){return a(this,Kn).url}get name(){return a(this,Kn).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Hs)))delete a(this,Hs)[e]}};Hs=new WeakMap,Kn=new WeakMap,p(js,"Hyperlink"),d(js,"__type","hyperlink");var cf=js,Us=cf;m();var Ws,Zo,Xs=class Xs extends Ve{constructor(e){super(String(ge()));C(this,Ws,{});C(this,Zo,void 0);P(this,Zo,e.mvfData)}static is(e){return e.__type===Xs.__type}get url(){return a(this,Zo).url}get name(){return a(this,Zo).altText}get altText(){return a(this,Zo).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Ws)))delete a(this,Ws)[e]}};Ws=new WeakMap,Zo=new WeakMap,p(Xs,"Image"),d(Xs,"__type","image");var pf=Xs,Ys=pf;var uf=class uf{constructor(t,e,i){d(this,"id");d(this,"links");d(this,"images");var o,n,s,c;this.id=t,this.links=(n=(o=i==null?void 0:i.links)==null?void 0:o.map(l=>new Us({mvfData:l})))!=null?n:[],this.images=(c=(s=i==null?void 0:i.images)==null?void 0:s.map(l=>new Ys({mvfData:{...l,url:e.sasToken?l.url+"?".concat(e.sasToken):l.url}})))!=null?c:[]}};p(uf,"BaseMapData");var Te=uf;var zo,Vt,er,ta,ea=class ea extends Te{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",ea.__type);C(this,zo,void 0);C(this,Vt,{});C(this,er,void 0);C(this,ta,void 0);P(this,zo,e),P(this,er,i.mvfData),P(this,ta,i.facadeId)}static is(e){return e.__type===ea.__type}get type(){return a(this,er).type}get name(){var e;return(e=a(this,er).name)!=null?e:""}get externalId(){var e;return(e=a(this,er).externalId)!=null?e:""}get floors(){var e,i;if(a(this,Vt).floors==null){let o=((i=(e=a(this,er).floors)!=null?e:a(this,er).maps)!=null?i:[]).reduce((n,s)=>{let c=a(this,zo).floorsById[s];return c&&n.push(c),n},[]);o.length===0&&L.error("Floor stack ".concat(this.id," has no floors")),a(this,Vt).floors=o}return a(this,Vt).floors}get defaultFloor(){if(a(this,Vt).defaultFloor!=null)return a(this,Vt).defaultFloor;let e=a(this,er).defaultFloor?a(this,zo).getById("floor",a(this,er).defaultFloor):void 0;return a(this,Vt).defaultFloor=e||this.floors.reduce((i,o)=>Math.abs(o.elevation)<Math.abs(i.elevation)?o:i),a(this,Vt).defaultFloor}get facade(){return a(this,ta)?a(this,zo).facadesById[a(this,ta)]:void 0}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,Vt)))delete a(this,Vt)[e]}};zo=new WeakMap,Vt=new WeakMap,er=new WeakMap,ta=new WeakMap,p(ea,"FloorStack"),d(ea,"__type","floor-stack");var df=ea,Zs=df;m();m();m();var zs,qo,ia,ii,ra=class ra extends Te{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",ra.__type);C(this,zs,void 0);C(this,qo,void 0);C(this,ia,{});C(this,ii,void 0);P(this,zs,e),P(this,qo,i.floorId),P(this,ii,i.mvfData)}static is(e){return e.__type===ra.__type}get name(){var e,i;return(i=(e=a(this,ii).properties.details)==null?void 0:e.name)!=null?i:""}get externalId(){var e;return(e=a(this,ii).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,ii).properties.details)==null?void 0:e.description)!=null?i:""}get center(){var e;if(a(this,ia).center==null){let[i,o]=(e=a(this,ii).properties.center)!=null?e:[0,0];a(this,ia).center=new K(o,i,a(this,qo))}return a(this,ia).center}get floor(){let e=a(this,zs).getById("floor",a(this,qo));if(e==null)throw new Error("Floor ".concat(a(this,qo)," not found!"));return e}get geoJSON(){return{...a(this,ii),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};zs=new WeakMap,qo=new WeakMap,ia=new WeakMap,ii=new WeakMap,p(ra,"Area"),d(ra,"__type","area");var hf=ra,oi=hf;m();var $o,ni,Jo,tr,oa=class oa extends Te{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",oa.__type);C(this,$o,void 0);C(this,ni,void 0);C(this,Jo,void 0);C(this,tr,void 0);P(this,ni,{}),P(this,tr,i.mvfData),P(this,$o,e),P(this,Jo,i.floorId)}static is(e){return e.__type===oa.__type}get name(){var e,i,o;return"details"in a(this,tr).properties?(o=(i=a(this,tr).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,tr).properties.externalId)!=null?e:""}get externalId(){var e;return(e=a(this,tr).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,tr).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=a(this,$o).getById("floor",a(this,Jo));if(e==null)throw new Error("Floor ".concat(a(this,Jo)," not found!"));return e}get center(){if(a(this,ni).center==null){let[[e,i],[o,n]]=a(this,tr).geometry.coordinates,s=(e+o)/2,c=(i+n)/2;a(this,ni).center=new K(c,s,a(this,Jo))}return a(this,ni).center}get isExterior(){var o;let e=a(this,$o).obstructionIdByEntranceId[this.id],i=a(this,$o).getMVFFeatureById("obstruction",e);return(o=i==null?void 0:i.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...a(this,tr),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(a(this,ni)))delete a(this,ni)[e]}};$o=new WeakMap,ni=new WeakMap,Jo=new WeakMap,tr=new WeakMap,p(oa,"Door"),d(oa,"__type","door");var ff=oa,rr=ff;m();var Qi,Qo,At,ut,na=class na extends Te{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",na.__type);C(this,Qi,void 0);C(this,Qo,void 0);C(this,At,{});C(this,ut,void 0);P(this,Qi,e),P(this,Qo,i.floorId),P(this,ut,i.mvfData)}getMvfData(){return a(this,ut)}static is(e){return e.__type===na.__type}get name(){var e,i,o;return"details"in a(this,ut).properties?(o=(i=a(this,ut).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,ut).properties.externalId)!=null?e:""}get type(){return a6(a(this,ut).properties.kind)}get description(){var e,i;return(i=(e=a(this,ut).properties.details)==null?void 0:e.description)!=null?i:""}get externalId(){var e;return(e=a(this,ut).properties.externalId)!=null?e:""}get locations(){if(a(this,At).locations)return a(this,At).locations;a(this,At).locations=[];let e=a(this,Qi).mvfLocationsBySpaceId[a(this,ut).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let o=a(this,Qi).getById("enterprise-location",i.id);o&&a(this,At).locations.push(o)}return a(this,At).locations}get floor(){let e=a(this,Qi).getById("floor",a(this,Qo));if(e==null)throw new Error("Floor ".concat(a(this,Qo)," not found!"));return e}get doors(){return a(this,ut).properties.destinationNodes.reduce((e,i)=>{let o=a(this,Qi).doorsByNodeId[i];return o&&e.push(o),e},[])}get center(){var e;if(a(this,At).center==null){let[i,o]=(e=a(this,ut).properties.center)!=null?e:[0,0];a(this,At).center=new K(o,i,a(this,Qo))}return a(this,At).center}get geoJSON(){return{...a(this,ut),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(a(this,At)))delete a(this,At)[e]}};Qi=new WeakMap,Qo=new WeakMap,At=new WeakMap,ut=new WeakMap,p(na,"Space"),d(na,"__type","space");var mf=na,n6=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function a6(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return n6.includes(t)?t:"room"}p(a6,"validateSpaceType");var Be=mf;m();var or,ve,jt,aa=class aa extends Te{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",aa.__type);C(this,or,void 0);C(this,ve,{});C(this,jt,void 0);P(this,or,e),P(this,jt,i.mvfData)}static is(e){return e.__type===aa.__type}get focusTarget(){return this}get name(){var e,i;return"name"in a(this,jt)?(i=a(this,jt).name)!=null?i:"":(e=a(this,jt).externalId)!=null?e:""}get shortName(){var e,i;return"shortName"in a(this,jt)?(i=a(this,jt).shortName)!=null?i:"":(e=a(this,jt).externalId)!=null?e:""}get externalId(){var e;return(e=a(this,jt).externalId)!=null?e:""}get elevation(){return a(this,jt).elevation}get spaces(){if(a(this,ve).spaces==null){let e=a(this,or).spaces.filter(i=>i.floor.id===this.id);a(this,ve).spaces=e}return a(this,ve).spaces}get objects(){if(a(this,ve).objects==null){let e=a(this,or).objects.filter(i=>i.floor.id===this.id);a(this,ve).objects=e}return a(this,ve).objects}get connections(){if(a(this,ve).connections==null){let e=a(this,or).connections.filter(i=>i.floors.includes(this));a(this,ve).connections=e}return a(this,ve).connections}get doors(){if(a(this,ve).doors==null){let e=a(this,or).doors.filter(i=>i.floor.id===this.id);a(this,ve).doors=e}return a(this,ve).doors}get annotations(){if(a(this,ve).annotations==null){let e=a(this,or).annotations.filter(i=>i.floor.id===this.id);a(this,ve).annotations=e}return a(this,ve).annotations}get pois(){if(a(this,ve).pois==null){let e=a(this,or).pointsOfInterest.filter(i=>i.floor.id===this.id);a(this,ve).pois=e}return a(this,ve).pois}get floorStack(){if(a(this,ve).floorStack==null){let e=a(this,or).floorStacks.find(i=>i.floors.includes(this));a(this,ve).floorStack=e}return a(this,ve).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,ve)))delete a(this,ve)[e]}};or=new WeakMap,ve=new WeakMap,jt=new WeakMap,p(aa,"Floor"),d(aa,"__type","floor");var yf=aa,Ki=yf;m();m();m();var qs=p(r=>r!=null,"notNull");m();function $s(r){return typeof r=="string"?r:r.id}p($s,"getId");function V2(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}p(V2,"isPosition");m();function ai(r){let t;if(Be.is(r)||rr.is(r)||Ht.is(r)||oi.is(r)||Ut.is(r))t=r.center;else if(si.is(r)||li.is(r))t=r.coordinate;else if(K.is(r))t=r;else if(ri.is(r))t=r.coordinate;else if(Or.is(r))t=r.coordinates[0];else return;return t}p(ai,"getCoordinateFromStuffs");m();m();var Js={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},Lr="ExteriorWalls",eo="Walls",j2=0,sa="InteriorDoors",la="ExteriorDoors",Me="GeometryLayer",ci="LabelsLayer",Ar="MarkersLayer",ca="FootprintLayer",pa="OcclusionLayer",H2="ImagesLayer";var U2=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],X2={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function gf(r){var t,e;if((t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}p(gf,"validateOptions");function vf(r,t){var o,n,s,c;let e=((o=r==null?void 0:r.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,i={...Js,...r!=null?r:{},outdoorView:{enabled:((n=r==null?void 0:r.outdoorView)==null?void 0:n.enabled)===void 0?!!e:(s=r==null?void 0:r.outdoorView)==null?void 0:s.enabled,layersHiddenByGeometry:(c=Js.outdoorView)==null?void 0:c.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}p(vf,"handleShow3DMapOptionDefault");function W2(r){let t={remove_watermark:!1};if(r)try{let e=kp(r);Object.assign(t,e.capabilities)}catch(e){L.error("Error decoding capabilities from token",e)}return t}p(W2,"handleTokenCapabilities");var da,pi,nr,ua=class ua extends Te{constructor(e,i){let o=Object.values(i.mvfDataByFloorId)[0];super(o.properties.id,e,"details"in o.properties?o.properties.details:void 0);d(this,"__type",ua.__type);C(this,da,void 0);C(this,pi,void 0);C(this,nr,void 0);P(this,pi,{}),P(this,da,e),P(this,nr,i.mvfDataByFloorId)}static is(e){return e.__type===ua.__type}get name(){var i,o,n;let e=Object.values(a(this,nr))[0];return"details"in e.properties?(n=(o=e.properties.details)==null?void 0:o.name)!=null?n:"":(i=e.properties.externalId)!=null?i:""}get description(){var e,i;return(i=(e=Object.values(a(this,nr))[0].properties.details)==null?void 0:e.description)!=null?i:""}get accessible(){var e;return(e=Object.values(a(this,nr))[0].properties.accessible)!=null?e:!1}get externalId(){var e;return(e=Object.values(a(this,nr))[0].properties.externalId)!=null?e:""}get type(){var e,i;return(i=(e=Object.values(a(this,nr))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get coordinates(){return a(this,pi).coordinates==null&&(a(this,pi).coordinates=Object.entries(a(this,nr)).map(([e,i])=>new K(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),a(this,pi).coordinates}get nodes(){return Object.values(a(this,nr))[0].properties.nodes.map(e=>a(this,da).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?a(this,da).getById("floor",e.floorId):void 0).filter(qs)}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)}}destroy(){for(let e of Object.keys(a(this,pi)))delete a(this,pi)[e]}};da=new WeakMap,pi=new WeakMap,nr=new WeakMap,p(ua,"Connection"),d(ua,"__type","connection");var bf=ua,to=bf;m();var Qs,Ko,ro,Xt,ha=class ha extends Te{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",ha.__type);C(this,Qs,void 0);C(this,Ko,void 0);C(this,ro,{});C(this,Xt,void 0);P(this,Qs,e),P(this,Ko,i.floorId),P(this,Xt,i.mvfData)}static is(e){return e.__type===ha.__type}get name(){var e,i,o;return"details"in a(this,Xt).properties?(o=(i=a(this,Xt).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,Xt).properties.externalId)!=null?e:""}get externalId(){var e;return(e=a(this,Xt).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,Xt).properties.details)==null?void 0:e.description)!=null?i:""}get type(){let e=a(this,Xt).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=a(this,Qs).getById("floor",a(this,Ko));if(e==null)throw new Error("Floor ".concat(a(this,Ko)," not found!"));return e}get center(){var e;if(a(this,ro).center==null){let[i,o]=(e=a(this,Xt).properties.center)!=null?e:[0,0];a(this,ro).center=new K(o,i,a(this,Ko))}return a(this,ro).center}get geoJSON(){return{...a(this,Xt),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(a(this,ro)))a(this,ro)[e]=null}};Qs=new WeakMap,Ko=new WeakMap,ro=new WeakMap,Xt=new WeakMap,p(ha,"MapObject"),d(ha,"__type","object");var Cf=ha,Ht=Cf;m();var Ks,en,io,ar,fa=class fa extends Te{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",fa.__type);C(this,Ks,void 0);C(this,en,void 0);C(this,io,{});C(this,ar,void 0);P(this,Ks,e),P(this,ar,i.mvfData),P(this,en,i.floorId)}static is(e){return e.__type===fa.__type}get name(){var e,i,o;return"details"in a(this,ar).properties?(o=(i=a(this,ar).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,ar).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,ar).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=a(this,Ks).getById("floor",a(this,en));if(e==null)throw new Error("Floor ".concat(a(this,en)," not found!"));return e}get coordinate(){var e;if(a(this,io).coordinate==null){let[i,o]=(e=a(this,ar).geometry.coordinates)!=null?e:[0,0];a(this,io).coordinate=new K(o,i,a(this,en))}return a(this,io).coordinate}get externalId(){var e;return(e=a(this,ar).properties.externalId)!=null?e:""}get geoJSON(){return{...a(this,ar),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in a(this,io))a(this,io)[e]=null}};Ks=new WeakMap,en=new WeakMap,io=new WeakMap,ar=new WeakMap,p(fa,"PointOfInterest"),d(fa,"__type","point-of-interest");var Sf=fa,si=Sf;m();var el,tn,oo,no,tl,If,ma=class ma extends Te{constructor(e,i){super(i.mvfData.properties.id,e);C(this,tl);d(this,"__type",ma.__type);C(this,el,void 0);C(this,tn,void 0);C(this,oo,{});C(this,no,void 0);P(this,el,e),P(this,tn,i.floorId),P(this,no,i.mvfData)}static is(e){return e.__type===ma.__type}get group(){return V(this,tl,If).call(this).group}get type(){return V(this,tl,If).call(this).type}get externalId(){var e;return(e=a(this,no).properties.externalId)!=null?e:""}get coordinate(){if(a(this,oo).coordinate==null){let[e,i]=a(this,no).geometry.coordinates;a(this,oo).coordinate=new K(i,e,a(this,tn))}return a(this,oo).coordinate}get floor(){let e=a(this,el).getById("floor",a(this,tn));if(e==null)throw new Error("Floor ".concat(a(this,tn)," not found!"));return e}get geoJSON(){return{...a(this,no),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(a(this,oo)))delete a(this,oo)[e]}};el=new WeakMap,tn=new WeakMap,oo=new WeakMap,no=new WeakMap,tl=new WeakSet,If=p(function(){let[e,i]=a(this,no).properties.symbolId.split("--");return{group:e,type:i}},"#getGroupAndTypeFromSymbolId"),p(ma,"Annotation"),d(ma,"__type","annotation");var xf=ma,li=xf;m();var s6=p((r,t)=>{let e={},i={},o={},n={},s={};for(let c of r["location.json"]||[]){let l=new il(t,{mvfData:c});if(e[c.id]=l,c.externalId&&(n[c.externalId]==null&&(n[c.externalId]=[]),n[c.externalId].push(l)),c.categories)for(let u of c.categories)s[u]==null&&(s[u]=[]),s[u].push(l)}for(let c of r["category.json"]||[]){let l=new Mf(t,{mvfData:c});i[c.id]=l,c.parent&&(o[c.parent]==null&&(o[c.parent]=[]),o[c.parent].push(l))}return{locationCategoriesByParentId:o,locationProfilesById:e,locationCategoriesById:i,locationProfilesByExternalId:n,locationProfilesByCategoryId:s}},"processMVFLocationProfilesAndCategories"),l6=p((r,t)=>{var x,b;let e={},i={},o={},n={},s={},c={},l={},u={},f={},y={},g={},v={},I=globalThis.Object.keys(r.space);for(let S of I){let w=r.space[S];if(w!=null)for(let T of w.features){v[T.properties.id]=S,l[T.properties.id]=T;for(let E of T.properties.destinationNodes)s[E]==null&&(s[E]=[]),s[E].push(T.properties.id);if(T.properties.kind==="desk-entrance"&&(c[T.properties.externalId]==null&&(c[T.properties.externalId]=[]),c[T.properties.externalId].push(...T.properties.destinationNodes)),!["void","desk-entrance"].includes((x=T.properties.kind)!=null?x:"")){if((b=T.properties.kind)!=null&&b.includes("connection")){let E="".concat(T.geometry.coordinates[1],"-").concat(T.geometry.coordinates[0]);y[E]==null&&(y[E]=[]),y[E].push(T.properties.id);continue}if(T.properties.kind==="poi"){let E=new si(t,{floorId:S,mvfData:T});o[T.properties.id]=E,f[S]||(f[S]=[]),f[S].push(T),T.properties.externalId&&(n[T.properties.externalId]==null&&(n[T.properties.externalId]=[]),n[T.properties.externalId].push(E))}else{let E=new Be(t,{floorId:S,mvfData:T});e[T.properties.id]=E,T.properties.externalId&&(i[T.properties.externalId]==null&&(i[T.properties.externalId]=[]),i[T.properties.externalId].push(E)),u[S]||(u[S]=[]),u[S].push(T)}}}}for(let S in y){let w=y[S],T={};for(let D of w){let A=v[D],R=l[D];T[A]=R}let E=new to(t,{mvfDataByFloorId:T});g[E.id]=E}return{spacesById:e,spacesByExternalId:i,poisById:o,poisByExternalId:n,connectionsById:g,spaceIdsByDestinationNodeId:s,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:l,connectionIdsByLatLon:y,mvfSpacesByFloorId:u,mvfPoisByFloorId:f}},"processMVFSpaces"),c6=p((r,t)=>{var s,c;let e={},i={},o={},n={};for(let l of r["node.geojson"].features){o[l.properties.id]=l;let u=new ri(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});e[l.properties.id]=u,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(u));let f=(c=l.properties.floor)!=null?c:l.properties.map;n[f]||(n[f]=[]),n[f].push(l)}return{nodesById:e,nodesByExternalId:i,mvfNodesById:o,mvfNodesByFloorId:n}},"processMVFNodes"),p6=p((r,t)=>{let e={},i={},o={},n={},s=globalThis.Object.keys(r.obstruction);for(let c of s){let l=r.obstruction[c];if(l!=null)for(let u of l.features){o[u.properties.id]=u;for(let y of u.properties.entrances)n[y]=u.properties.id;if(u.properties.kind==="Wall")continue;let f=new Ht(t,{floorId:c,mvfData:u});e[u.properties.id]=f,u.properties.externalId&&(i[u.properties.externalId]==null&&(i[u.properties.externalId]=[]),i[u.properties.externalId].push(f))}}return{objectsById:e,objectsByExternalId:i,mvfObstructionById:o,obstructionIdByEntranceId:n}},"processMVFObstructions"),u6=p((r,t)=>{let e={},i={},o={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){o[n.properties.id]=n.properties;let s=new Ki(t,{mvfData:n.properties});e[n.properties.id]=s,n.properties.externalId&&(i[n.properties.externalId]==null&&(i[n.properties.externalId]=[]),i[n.properties.externalId].push(s))}else for(let n of r["map.geojson"]){o[n.id]=n;let s=new Ki(t,{mvfData:n});e[n.id]=s}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:o}},"processMVFFloors"),d6=p((r,t)=>{var l;let e={},i={},o={},n={},s={},c=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(c!=null)for(let u of c){let f=(l=r.facade)==null?void 0:l[u.id],y=new Zs(t,{mvfData:u,facadeId:f==null?void 0:f.id});if(e[u.id]=y,u.externalId&&(i[u.externalId]==null&&(i[u.externalId]=[]),i[u.externalId].push(y)),o[u.id]=u,f){let g=new Ut(t,{mvfData:f,floorStackId:u.id});n[f.id]=g;for(let v of f.spaces)s[v.spaceId]=g}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:o,facadesById:n,facadesBySpaceId:s}},"processMVFFloorStacks"),h6=p(r=>{let t={},e=r["connection.json"].reduce((i,o)=>(o.nodes.forEach(n=>i[n]=o),t[o.id]=o,i),{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:e}},"processMVFConnections"),f6=p((r,t)=>{let e={},i={},o={},n={},s={},c=globalThis.Object.keys(r.entrance);for(let l of c){let u=r.entrance[l];if(u!=null)for(let f of u.features){n[f.properties.id]=f;let y=new rr(t,{floorId:l,mvfData:f});f.properties.node&&(o[f.properties.node]=y),e[f.properties.id]=y,f.properties.externalId&&(i[f.properties.externalId]==null&&(i[f.properties.externalId]=[]),i[f.properties.externalId].push(y)),s[l]||(s[l]=[]),s[l].push(f)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:o,mvfEntrancesById:n,mvfEntrancesByFloorId:s}},"processMVFEntrances"),m6=p((r,t,e)=>{var i;if(r.textAreas!=null)for(let o in r.textAreas){let n=(i=r.textAreas[o])==null?void 0:i.features;if(n!=null){for(let s of n)if("anchorId"in s.properties){let c=s==null?void 0:s.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let u=l.properties;u.textArea=c,u.textArea&&(u.textArea.position=s.geometry.coordinates)}}}}},"processMVFTextAreas"),y6=p((r,t,e)=>{var i;if(r.floorImages!=null)for(let o in r.floorImages){let n=(i=r.floorImages[o])==null?void 0:i.features;if(n!=null){for(let s of n)if("anchorId"in s.properties){let c=s==null?void 0:s.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let u=l.properties;u.image=c,u.image&&(u.image.position=s.geometry.coordinates)}}}}},"processMVFPolygonImages"),g6=p((r,t)=>{let e={},i={},o={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o};let n=globalThis.Object.keys(r.annotation);for(let s of n){let c=r.annotation[s];if(c!=null)for(let l of c.features){i[l.properties.id]=l;let u=new li(t,{floorId:s,mvfData:l});e[l.properties.id]=u,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o}},"processMVFAnnotations"),v6=p((r,t)=>{let e={},i={},o={};if(r.area==null)return{areasById:e,areasByExternalId:i,mvfAreasById:o};let n=globalThis.Object.keys(r.area);for(let s of n){let c=r.area[s];if(c!=null)for(let l of c.features){o[l.properties.id]=l;let u=new oi(t,{floorId:s,mvfData:l});e[l.properties.id]=u,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(u))}}return{areasById:e,areasByExternalId:i,mvfAreasById:o}},"processMVFAreas"),Y2=p((r,t)=>{var b,S,w,T,E,D,A,R,N;let e={},i={},o={},n={},s=((S=(b=r.enterprise)==null?void 0:b.locations)!=null?S:[]).reduce((B,H)=>(B[H.id]=H,B),{}),c={},l={},u={},f={},y={},g={},v=((w=r.enterprise)==null?void 0:w.venue)||{},I={};for(let B of(E=(T=r.enterprise)==null?void 0:T.categories)!=null?E:[]){let H=new rl(t,{mvfData:B});c[B.id]=H,B.externalId&&(l[B.externalId]==null&&(l[B.externalId]=[]),l[B.externalId].push(H)),u[B.id]=B,B.locations.forEach(G=>{y[G]==null&&(y[G]=[]),y[G].push(B.id)})}let x={};for(let B of(A=(D=r.enterprise)==null?void 0:D.locationInstances)!=null?A:[]){let H=s[B.parent],G=Object.keys(H),$={};for(let he of G)$[he]=void 0;let J={...$,polygons:[],nodes:[],...B};x[J.parent]==null&&(x[J.parent]=[]),x[J.parent].push(new Or(t,{mvfData:J,categoryIds:y[J.id],parentId:B.parent})),I[J.id]=B}for(let B of(N=(R=r.enterprise)==null?void 0:R.locations)!=null?N:[]){let H=new Or(t,{mvfData:B,categoryIds:y[B.id],locationInstances:x[B.id]});o[B.id]=H,B.externalId&&(n[B.externalId]==null&&(n[B.externalId]=[]),n[B.externalId].push(H)),B.nodes.forEach(G=>{g[G.id]==null&&(g[G.id]=[]),g[G.id].push(B.id)});for(let G of B.polygons)f[G.id]==null&&(f[G.id]=[]),f[G.id].push(B)}if(t.enterpriseMode===!0){for(let B in t.mvfConnectionsById){let H={},G=t.mvfConnectionsById[B];for(let $ of t.mvfConnectionsById[B].nodes){let J=t.nodesById[$];J!=null&&(H[J.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[J.coordinate.longitude,J.coordinate.latitude]},properties:{id:B,externalId:G.externalId,kind:"enterprise."+G.type,destinationNodes:[],flags:"",type:G.type,nodes:G.nodes,accessible:G.accessible}})}Object.keys(H).length>0&&(e[B]=new to(t,{mvfDataByFloorId:H}),G.externalId&&(i[G.externalId]==null&&(i[G.externalId]=[]),i[G.externalId].push(e[B])))}t.connectionsById=e}return{connectionsByExternalId:i,locationIdsByNodeId:g,mvfLocationsBySpaceId:f,mvfLocationsById:s,mvfCategoriesById:u,locationsById:o,locationsByExternalId:n,locationInstancesById:I,categoriesById:c,categoriesByExternalId:l,venue:v}},"createEnterpriseDataFromMVF"),Z2=p((r,t)=>{let{spacesById:e,spacesByExternalId:i,spaceIdsByDestinationNodeId:o,poisById:n,poisByExternalId:s,mvfSpacesById:c,objectEntranceNodeIdsByObstructionId:l,connectionsById:u,connectionIdsByLatLon:f,mvfSpacesByFloorId:y,mvfPoisByFloorId:g}=l6(r,t),{nodesById:v,nodesByExternalId:I,mvfNodesById:x,mvfNodesByFloorId:b}=c6(r,t),{objectsById:S,objectsByExternalId:w,mvfObstructionById:T,obstructionIdByEntranceId:E}=p6(r,t),{floorsById:D,floorsByExternalId:A,mvfFloorsById:R}=u6(r,t),{floorStacksById:N,floorStacksByExternalId:B,mvfFloorStacksById:H,facadesById:G,facadesBySpaceId:$}=d6(r,t),{mvfConnectionsById:J,mvfConnectionsByNodeId:he}=h6(r),{doorsById:Se,doorsByExternalId:Ge,doorsByNodeId:Lt,mvfEntrancesById:me,mvfEntrancesByFloorId:Fe}=f6(r,t),{annotationsById:xe,mvfAnnotationsById:st,mvfAnnotationsByFloorId:$t}=g6(r,t),{areasById:et,areasByExternalId:lt,mvfAreasById:Qr}=v6(r,t);y6(r,c,T),m6(r,c,T);let{locationCategoriesByParentId:Gi,locationProfilesById:ee,locationCategoriesById:se,locationProfilesByExternalId:ye,locationProfilesByCategoryId:xt}=s6(r,t);return{spacesById:e,spacesByExternalId:i,nodesById:v,nodesByExternalId:I,objectsById:S,objectsByExternalId:w,floorsById:D,floorsByExternalId:A,floorStacksById:N,floorStacksByExternalId:B,facadesById:G,facadesBySpaceId:$,connectionsById:u,doorsById:Se,doorsByExternalId:Ge,doorsByNodeId:Lt,poisById:n,poisByExternalId:s,annotationsById:xe,areasById:et,areasByExternalId:lt,spaceIdsByDestinationNodeId:o,objectEntranceNodeIdsByObstructionId:l,obstructionIdByEntranceId:E,connectionIdsByLatLon:f,locationProfilesById:ee,locationCategoriesById:se,locationProfilesByExternalId:ye,locationProfilesByCategoryId:xt,locationCategoriesByParentId:Gi,mvfSpacesById:c,mvfNodesById:x,mvfObstructionById:T,mvfFloorsById:R,mvfFloorStacksById:H,mvfConnectionsById:J,mvfConnectionsByNodeId:he,mvfEntrancesById:me,mvfAnnotationsById:st,mvfNodesByFloorId:b,mvfSpacesByFloorId:y,mvfPoisByFloorId:g,mvfAreasById:Qr,mvfEntrancesByFloorId:Fe,mvfAnnotationsByFloorId:$t}},"createDataFromMVF");m();m();m();var b6=p(function(){let t=globalThis.fetch;return{fetch(...e){if(!qs(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")(),z2=b6.fetch;var Q2=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],q2=Q2[0],K2="https://api-gateway.mappedin.com/track-analytics/a/",ev="deny-watchposition",tv="load-mapview",rv="load-mapdata",iv="change-language",ov="query-directions";var ui,sr,ya,Qp,Tf=class Tf{constructor(){C(this,ya);C(this,ui,Object.freeze({}));C(this,sr,void 0);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",I0((t,e)=>this.sendAnalyticEvent(ov,{start:t,end:e,type:"location_to_location"}),2500));P(this,sr,V(this,ya,Qp).call(this,a(this,ui)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){P(this,ui,{}),P(this,sr,V(this,ya,Qp).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return P(this,ui,Object.freeze(Object.assign({},a(this,ui),t))),P(this,sr,V(this,ya,Qp).call(this,t)),a(this,sr)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=Pf({...a(this,sr),mapId:e.mapId})),e.context&&(e.context=J2(e.context)),e.baseUri&&(e.analyticsBaseUrl=Pf({baseUri:e.baseUri,mapId:a(this,sr).mapId})),Object.assign(a(this,sr),e),this.handleStateUpdate(t)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:i}=this.getState();return!!(t&&e)||!!i}getState(){return a(this,sr)}getContext(){return this.getState().context||a(this,ui).context||q2}getSessionId(){return this.getState().sessionId||a(this,ui).sessionId||$2()}sendAnalyticEvent(t,e={}){let i=this.getState(),o=S6(i.analyticsBaseUrl,t),n={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&L.log("Analytics.track",o,n),!i.sendEvents)return Promise.resolve();if(!this.authReady)return L.warn("Auth needs to be ready to send analytics.");let s={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(s,i.userPosition),n["Content-Type"]="application/json",i.accessToken?n.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(n["x-mappedin-key"]=btoa(i.key),n["x-mappedin-secret"]=btoa(i.secret)),z2(o,{method:"POST",mode:"cors",headers:n,body:JSON.stringify(s)})}capture(t,e){if(I6.includes(t))return L.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=x6.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(rv,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(iv,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(ev)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(tv,{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)}};ui=new WeakMap,sr=new WeakMap,ya=new WeakSet,Qp=p(function(t){var i,o,n,s;let e=(i=t.baseUri)!=null?i:K2;return{baseUri:e,analyticsBaseUrl:Pf({...t,baseUri:e}),version:((o=M==null?void 0:M.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||C6(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||$2(),platformString:t.platformString||"",context:J2(t.context)||q2,geolocationMode:!1,sendEvents:(n=t.sendEvents)!=null?n:!0,logEvents:(s=t.logEvents)!=null?s:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),p(Tf,"AnalyticsInternal");var ga=Tf;function Pf({mapId:r,baseUri:t=K2}){return"".concat(t).concat(r,"/")}p(Pf,"getBaseUrl");function C6(){return Xn.getInstance().loadLocalData("deviceId")}p(C6,"getDeviceIDFromStorage");function $2(){return Xn.getInstance().loadSessionData("id")}p($2,"getSessionIDFromStorage");function S6(r,t){return r+t}p(S6,"buildUrl");function J2(r){return Q2.find(t=>t===r)}p(J2,"getValidContext");var x6=["$select-location","$select-category","$query-suggest","$query-search"],I6=[tv,rv,ov,ev,iv],SO=new ga,di,wf=class wf{constructor(t){C(this,di,void 0);d(this,"capture");d(this,"updateState");P(this,di,t),this.capture=a(this,di).capture.bind(a(this,di)),this.updateState=a(this,di).updateState.bind(a(this,di))}getState(){return Object.assign({},a(this,di).getState())}};di=new WeakMap,p(wf,"Analytics");var ol=wf;m();var M6=new Set(["polygons"]),lr,Pe,Mt,nl,va=class va extends Ve{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",va.__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","");C(this,lr,void 0);C(this,Pe,{});C(this,Mt,void 0);C(this,nl,void 0);P(this,lr,e),P(this,Mt,i.mvfData),P(this,nl,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let o in i.mvfData)!M6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(i.parentId){let n=a(this,lr).locationsById[i.parentId];return a(this,Mt)[o]!=null?a(this,lr).getPropTranslation(this.__type,o,a(this,Mt).id,a(this,Mt)[o]):a(this,lr).getPropTranslation(this.__type,o,a(this,Mt).id,n[o])}return a(this,lr).getPropTranslation(this.__type,o,a(this,Mt).id,a(this,Mt)[o])}})}static is(e){return e.__type===va.__type}get focusTarget(){return this.spaces}get categories(){return a(this,Pe).categories?a(this,Pe).categories:(a(this,Pe).categories=(a(this,nl).map(e=>a(this,lr).getById("enterprise-category",e))||[]).filter(Boolean),a(this,Pe).categories)}get coordinates(){if(a(this,Pe).coordinates)return a(this,Pe).coordinates;a(this,Pe).coordinates=[];for(let e=0;e<this.nodes.length;e++)a(this,Pe).coordinates.push(this.nodes[e].coordinate);return a(this,Pe).coordinates}get nodes(){if(a(this,Pe).nodes)return a(this,Pe).nodes;a(this,Pe).nodes=[];for(let e=0;e<a(this,Mt).nodes.length;e++){let i=a(this,lr).getById("node",a(this,Mt).nodes[e].id);i&&a(this,Pe).nodes.push(i)}return a(this,Pe).nodes}get spaces(){if(a(this,Pe).spaces)return a(this,Pe).spaces;a(this,Pe).spaces=[];for(let e=0;e<a(this,Mt).polygons.length;e++){let i=a(this,lr).getById("space",a(this,Mt).polygons[e].id);i&&a(this,Pe).spaces.push(i)}return a(this,Pe).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,Pe)))delete a(this,Pe)[e]}};lr=new WeakMap,Pe=new WeakMap,Mt=new WeakMap,nl=new WeakMap,p(va,"EnterpriseLocation"),d(va,"__type","enterprise-location");var Ef=va,Or=Ef;m();var P6=new Set,rn,dt,Fr,ba=class ba extends Ve{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",ba.__type);d(this,"name","");d(this,"color");d(this,"externalId","");d(this,"extra");d(this,"icon");d(this,"iconFromDefaultList");d(this,"sortOrder",-1);C(this,rn,void 0);C(this,dt,{});C(this,Fr,void 0);P(this,rn,e),P(this,Fr,i.mvfData);for(let o in i.mvfData)!P6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return a(this,rn).getPropTranslation(this.__type,o,a(this,Fr).id,a(this,Fr)[o])}})}static is(e){return e.__type===ba.__type}get children(){if(a(this,dt).children)return a(this,dt).children;a(this,dt).children=[];for(let e=0;e<a(this,Fr).children.length;e++){let i=a(this,rn).getById("enterprise-category",a(this,Fr).children[e]);i&&a(this,dt).children.push(i)}return a(this,dt).children}get locations(){if(a(this,dt).locations)return a(this,dt).locations;a(this,dt).locations=[];for(let e=0;e<a(this,Fr).locations.length;e++){let i=a(this,rn).getById("enterprise-location",a(this,Fr).locations[e]);i&&a(this,dt).locations.push(i)}return a(this,dt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,dt)))delete a(this,dt)[e]}};rn=new WeakMap,dt=new WeakMap,Fr=new WeakMap,p(ba,"EnterpriseCategory"),d(ba,"__type","enterprise-category");var Df=ba,rl=Df;m();var T6=new Set,al,sl,Ca=class Ca extends Ve{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Ca.__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");C(this,al,{});C(this,sl,void 0);P(this,sl,i.mvfData);for(let o in i.mvfData)!T6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=i.mvfData[o])}static is(e){return e.__type===Ca.__type}get name(){var e;return(e=a(this,sl).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,al)))delete a(this,al)[e]}};al=new WeakMap,sl=new WeakMap,p(Ca,"EnterpriseVenue"),d(Ca,"__type","enterprise-venue");var Of=Ca,Kp=Of;m();var nv=globalThis.fetch,cv,w6=(cv=M==null?void 0:M.env)==null?void 0:cv.npm_package_version,Af="https://app.mappedin.com/",E6="https://auth.mappedin.com/",av="accessTokens",sv="sasTokens";function hi(){if(nv==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return nv}p(hi,"isomorphicFetch");var pv={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function uv(r){var e;let t={...pv,...r};return t.headers={...t.headers,"mappedin-sdk-version":w6},t.things=[],"platformString"in r&&(t.headers={...t.headers,"mappedin-platform-version":r.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}p(uv,"parseOptions");function D6(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete i.language;let{headers:o}=r;o["Content-Type"]=o["Content-Type"]||"text/json",r.accessToken?o.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(o["x-mappedin-key"]=btoa(r.clientId),o["x-mappedin-secret"]=btoa(r.clientSecret));let n={method:"GET",headers:o};return r.secure&&(t+="&withcdntoken"),{req:n,url:t}}p(D6,"constructParamsForRequest");async function O6(r,t,e=!1){let i=D6(r,t,e),o=await hi()(i.url,i.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}p(O6,"generateAPIRequest");async function L6(r,t="exports/mvf/1/bundle"){var n;let e=uv({baseUri:"https://api-gateway.mappedin.com/",...pv,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((n=e.version)!=null?n:"2.0.0");return e.headers["Content-Type"]="application/zip",await O6(e,i)}p(L6,"getVenueMVFURL");var Lf=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function Ff(r,{signal:t}){let e=await(await hi()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}p(Ff,"getLanguagePackUnitArray");async function Sa(r){let e=(await import("./browser-U3652NS6.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let o=e["enterprise/locations.json"];o&&(i.enterprise.locations=JSON.parse(Lf().decode(o)));let n=e["enterprise/categories.json"];n&&(i.enterprise.categories=JSON.parse(Lf().decode(n)))}return e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Lf().decode(e["manifest.json"]))),i}p(Sa,"parseLanguagePack");async function dv(r,{signal:t}){try{let e=await(await hi()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Sa(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}p(dv,"downloadLanguagePack");async function Bf(r){return new Promise(async(t,e)=>{try{let{url:i,locale_packs:o}=await L6(r,"exports/mvf2/1/bundle"),n=await hi()(i).then(c=>c.arrayBuffer()),s=new Uint8Array(n);t({compressed:s,localePacks:o})}catch(i){e(i)}})}p(Bf,"downloadVenueBundleMVFAPIGateway");async function kf(r,t){return new Promise(async(e,i)=>{try{let{url:o}=await A6(r,t),n=await hi()(o).then(c=>c.arrayBuffer()),s=new Uint8Array(n);e(s)}catch(o){i(o)}})}p(kf,"downloadMVF");function _f(r){return r.endsWith("/")?r:"".concat(r,"/")}p(_f,"normalizeUrl");async function A6(r,t){let e="".concat(r.baseUri?_f(r.baseUri):Af,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await hi()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}p(A6,"getMakerBundleURL");async function ll(r,t=!1){let e="".concat(r.key),i=Xn.getInstance(),o=(i==null?void 0:i.loadSessionData(av))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expiresTimestamp)return o[e];let s=t?await F6(r,n):await B6(r,n),c={...o,[e]:s};return i==null||i.saveSessionData(av,c),s}p(ll,"getAccessToken");async function F6(r,t){var n;let e="".concat((n=r.baseAuthUri)!=null?n:E6,"oauth2/token"),i=await hi()(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:r.key,client_secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let o=await i.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}p(F6,"fetchAccessTokenEnterprise");async function B6(r,t){let e="".concat(r.baseAuthUri?_f(r.baseAuthUri):Af,"api/api-key/token"),i=await hi()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:r.key,secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let o=await i.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}p(B6,"fetchAccessToken");function cl(r){var i,o,n,s,c,l,u,f,y,g;let t=new TextDecoder,e=t.decode.bind(t);try{let v={"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&&(v.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(v.enterprise.locations=JSON.parse(e((o=r.enterprise)==null?void 0:o["locations.json"]))),(n=r.enterprise)!=null&&n["categories.json"]&&(v.enterprise.categories=JSON.parse(e((s=r.enterprise)==null?void 0:s["categories.json"]))),(c=r.enterprise)!=null&&c["venue.json"]&&(v.enterprise.venue=JSON.parse(e((l=r.enterprise)==null?void 0:l["venue.json"]))),(u=r.enterprise)!=null&&u["layers.json"]&&(v.enterprise.layers=JSON.parse(e((f=r.enterprise)==null?void 0:f["layers.json"]))),(y=r.enterprise)!=null&&y["locationInstances.json"]&&(v.enterprise.locationInstances=JSON.parse(e((g=r.enterprise)==null?void 0:g["locationInstances.json"])))),r["floorstack.json"]!=null?v["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(v["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),v["floorstack.json"]==null&&v["mapstack.json"]==null&&v["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(v["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),v["floor.geojson"]==null&&v["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(v["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(v["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(v["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(v["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){v.annotation={};let x=Object.keys(r.annotation);for(let b of x){let S=b.replace(/\.json|\.geojson/g,"");v.annotation[S]=JSON.parse(e(r.annotation[b]))}}let I=Object.keys(r.space);for(let x of I){let b=x.replace(/\.json|\.geojson/g,"");v.space[b]=JSON.parse(e(r.space[x]))}if(r.obstruction!=null){let x=Object.keys(r.obstruction);for(let b of x){let S=b.replace(/\.json|\.geojson/g,"");v.obstruction[S]=JSON.parse(e(r.obstruction[b]))}}else v.obstruction={};if(r.entrance!=null){let x=Object.keys(r.entrance);for(let b of x){let S=b.replace(/\.json|\.geojson/g,"");v.entrance[S]=JSON.parse(e(r.entrance[b]))}}else v.entrance={};if("floorImages"in r&&r.floorImages!=null){v.floorImages={};for(let x of Object.keys(r.floorImages)){let b=x.replace(/\.json|\.geojson/g,"");v.floorImages[b]=JSON.parse(e(r.floorImages[x]))}}if("textAreas"in r&&r.textAreas!=null){v.textAreas={};for(let x of Object.keys(r.textAreas)){let b=x.replace(/\.json|\.geojson/g,"");v.textAreas[b]=JSON.parse(e(r.textAreas[x]))}}if("facade"in r&&r.facade!=null){v.facade={};for(let x of Object.keys(r.facade)){let b=x.replace(/\.json|\.geojson/g,"");v.facade[b]=JSON.parse(e(r.facade[x]))}}if("area"in r&&r.area!=null){v.area={};for(let x of Object.keys(r.area)){let b=x.replace(/\.json|\.geojson/g,"");v.area[b]=JSON.parse(e(r.area[x]))}}return v}catch(v){throw L.error(v),new Error("MVF parsing failed! Probably encountered a bad file.")}}p(cl,"parseMVF");function k6(r){if(r==null||typeof r!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&t.push("styles.json"),"shapes.json"in r&&t.push("shapes.json");for(let e of t)if(r[e]==null||r[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}p(k6,"validateStaticMVFFiles");async function pl(r){return new Promise(async(t,e)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let o=(await import("./browser-U3652NS6.js")).unzipSync(r);if(!k6(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let n={},s=Object.keys(o);for(let c of s){if(o[c].length===0)continue;let l=c.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){n[l[0]]=o[c];continue}if(l[0]==="image"){L.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else n[l[0]]==null&&(n[l[0]]={}),n[l[0]][l[1]]=o[c]}t(n)}catch(i){e(i)}})}p(pl,"unzipMVF");async function eu(r,t){let e="".concat(t),i=Xn.getInstance(),o=(i==null?void 0:i.loadSessionData(sv))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expires)return o[e];let s=await _6(r,t),c={...o,[e]:{token:s.token,expires:n+new Date(s.expires).getTime()/1e3}};return i==null||i.saveSessionData(sv,c),s}p(eu,"getSasToken");async function _6(r,t){let e="".concat(r.baseAuthUri?_f(r.baseAuthUri):Af,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await hi()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));return await i.json()}p(_6,"fetchSasToken");function on(){let r="us",t={};function e(){return G6(j6(r),t)}return p(e,"getState"),{updateByUserOption(i){var o,n;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(o=i.analytics)!=null&&o.baseUri&&(t.analyticsBaseUri=(n=i.analytics)==null?void 0:n.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?lv.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?lv.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}p(on,"createEnvControl");var hv=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"}),lv=Object.freeze({...hv,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),R6=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"}),N6=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function G6(r,t){return{...r,...t}}p(G6,"getAuthStateByEnvironment");var V6={eu:R6,us:hv,"us-staging":N6};function j6(r){return V6[r]}p(j6,"getEnvironmentAuthState");m();function Rf(r){var e,i,o,n,s;let t=((i=(e=r.enterprise)==null?void 0:e.locations)==null?void 0:i.reduce((c,l)=>(c[l.id]=l,c),{}))||{};for(let c of((o=r.enterprise)==null?void 0:o.locationInstances)||[])t[c.id]=c;return{type:"downloaded",data:r,optimized:{locations:t,categories:(s=(n=r.enterprise)==null?void 0:n.categories)==null?void 0:s.reduce((c,l)=>(c[l.id]=l,c),{})}}}p(Rf,"parseLocalePackToLanguagePack");m();m();m();m();m();m();m();var Nf=class Nf{constructor({origin:t,destination:e,distance:i=0,angle:o=0,pathWeight:n=0}){d(this,"origin");d(this,"destination");d(this,"distance");d(this,"angle");d(this,"weight");this.origin=t,this.destination=e,this.distance=i,this.angle=o;let s=n||0;if(this.weight=s>=0?this.distance+s:0,isNaN(this.angle))throw new Error("nan angle")}};p(Nf,"Edge");var nn=Nf;m();m();m();m();function Wt(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}p(Wt,"getCoord");function Ft(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}p(Ft,"getCoords");function xa(r){return r.type==="Feature"?r.geometry:r}p(xa,"getGeom");function fv(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}p(fv,"getType");function fi(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=Wt(r),o=xa(t),n=o.type,s=t.bbox,c=o.coordinates;if(s&&H6(i,s)===!1)return!1;n==="Polygon"&&(c=[c]);for(var l=!1,u=0;u<c.length&&!l;u++)if(mv(i,c[u][0],e.ignoreBoundary)){for(var f=!1,y=1;y<c[u].length&&!f;)mv(i,c[u][y],!e.ignoreBoundary)&&(f=!0),y++;f||(l=!0)}return l}p(fi,"booleanPointInPolygon");function mv(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,n=t.length-1;o<t.length;n=o++){var s=t[o][0],c=t[o][1],l=t[n][0],u=t[n][1],f=r[1]*(s-l)+c*(l-r[0])+u*(r[0]-s)===0&&(s-r[0])*(l-r[0])<=0&&(c-r[1])*(u-r[1])<=0;if(f)return!e;var y=c>r[1]!=u>r[1]&&r[0]<(l-s)*(r[1]-c)/(u-c)+s;y&&(i=!i)}return i}p(mv,"inRing");function H6(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}p(H6,"inBBox");m();m();function mi([r,t],[e,i]){let o=t-i,n=r-e;return(Math.atan2(n,o)+Math.PI*3)%(Math.PI*2)}p(mi,"getAngle");m();var U6=63710088e-1;function cr(r,t){let[e,i]=r.map(f=>f*Math.PI/180),[o,n]=t.map(f=>f*Math.PI/180),s=n-i,c=o-e,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*Math.cos(n)*Math.sin(c/2)*Math.sin(c/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return U6*u}p(cr,"getDistance");m();m();function tu(r,t,e,i){let[o,n]=r,[s,c]=t,[l,u]=e,[f,y]=i;if(n===c&&o===s||u===y&&l===f)return null;let g=(f-l)*(c-n)-(y-u)*(s-o);if(g===0)return null;let v=((y-u)*(o-l)-(f-l)*(n-u))/g,I=((c-n)*(o-l)-(s-o)*(n-u))/g;if(v<0||v>1||I<0||I>1)return null;let x=n+v*(c-n);return[o+v*(s-o),x]}p(tu,"getLineIntersection");m();m();function an(r,t,e,i){i===void 0&&(i={});var o=Wt(r),n=It(o[0]),s=It(o[1]),c=It(e),l=T0(t,i.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(c)),f=n+Math.atan2(Math.sin(c)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u)),y=_s(f),g=_s(u);return Mr([y,g],i.properties)}p(an,"destination");function Gf(r,t,e,i){let o=an(r,e/1e3,i),n=an(t,e/1e3,i);return[o.geometry.coordinates,n.geometry.coordinates]}p(Gf,"getOffsetLine");m();function Vf(r){let t=r*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}p(Vf,"radToDegNormalized");var yv=111e3;function gv(r,t,e=[],i=0){let o=!0,n=r.geometry.coordinates,s=t.geometry.coordinates,c=Vf(mi(n,s)-Math.PI/2),l=Vf(mi(n,s)+Math.PI/2),u=i/yv,f=i/(yv*Math.cos(n[1]*Math.PI/180)),y=Math.min(n[1],s[1])-u,g=Math.max(n[1],s[1])+u,v=Math.min(n[0],s[0])-f,I=Math.max(n[0],s[0])+f;for(let x of e)if(!(Math.max(x[0][1],x[1][1])<y||Math.min(x[0][1],x[1][1])>g||Math.max(x[0][0],x[1][0])<v||Math.min(x[0][0],x[1][0])>I)){if(i>0){let b=Gf(n,s,i,c),S=Gf(n,s,i,l);if(tu(b[0],b[1],x[0],x[1])||tu(S[0],S[1],x[0],x[1])){o=!1;return}}else if(tu(n,s,x[0],x[1])){o=!1;return}}return o}p(gv,"hasLineOfSight");var sn,ul,jf,iu,vv,ou,bv,nu,Cv,au,Sv,su,xv,lu,Iv,cu,Hf=class Hf{constructor({nodes:t,groupBy:e}){C(this,ul);C(this,iu);C(this,ou);C(this,nu);C(this,au);C(this,su);C(this,lu);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);C(this,sn,void 0);C(this,cu,p((t,e)=>{let i=0;for(let o of e)(!o[a(this,sn)]||o[a(this,sn)]===t.properties[a(this,sn)])&&fi(t.geometry.coordinates,o.geometry.geometry)&&(i+=Math.max(0,o.cost));return i},"#getZonalCost"));P(this,sn,e);let{features:i}=t;this.nodesById=V(this,iu,vv).call(this,i),V(this,ou,bv).call(this),V(this,nu,Cv).call(this,i,e)}getShortestEuclideanDistance(t,e){return e.reduce((i,o)=>{let n=cr(t.geometry.coordinates,o.geometry.coordinates);return Math.min(i,n)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,zones:o}){let n=V(this,ul,jf).call(this,t),s=V(this,ul,jf).call(this,e);if(n.length===0||s.length===0)return[];let{frontier:c,cameFrom:l,costSoFar:u}=V(this,au,Sv).call(this,n,s);for(;c.length>0;){let f=c.shift();if(!f)break;if(V(this,su,xv).call(this,f.origin,s))return V(this,lu,Iv).call(this,l,f.origin.properties.id);for(let y of this.edges[f.origin.properties.id]){let g=u[f.origin.properties.id]+y.weight+a(this,cu).call(this,y.destination,o);if(!(g===1/0||i!=null&&i.has(y.destination.properties.id))&&(u[y.destination.properties.id]==null||g<u[y.destination.properties.id])){let v=g+this.getShortestEuclideanDistance(y.destination,s);u[y.destination.properties.id]=g,l[y.destination.properties.id]=y,c.push({origin:y.destination,priority:v})}}c.sort((y,g)=>y.priority-g.priority)}return[]}};sn=new WeakMap,ul=new WeakSet,jf=p(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),iu=new WeakSet,vv=p(function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},"#createNodesById"),ou=new WeakSet,bv=p(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},"#removeInvalidNeighbors"),nu=new WeakSet,Cv=p(function(t,e){t.forEach(i=>{let o=e==="default"?e:i.properties[e];this.nodesByGroup.has(o)||this.nodesByGroup.set(o,[]),this.nodesByGroup.get(o).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:n,weight:s})=>{let c=this.nodesById[n],l=cr(i.geometry.coordinates,c.geometry.coordinates),u=mi(i.geometry.coordinates,c.geometry.coordinates);return new nn({origin:i,destination:c,pathWeight:s,distance:l,angle:u})})})},"#initializeEdgesAndGroups"),au=new WeakSet,Sv=p(function(t,e){let i=[],o={},n={};return t.forEach(s=>{let c=this.getShortestEuclideanDistance(s,e);i.push({origin:s,priority:c}),o[s.properties.id]=null,n[s.properties.id]=0}),i.sort((s,c)=>s.priority-c.priority),{frontier:i,cameFrom:o,costSoFar:n}},"#initializeSearch"),su=new WeakSet,xv=p(function(t,e){return e.some(i=>i.properties.id===t.properties.id)},"#isDestinationNode"),lu=new WeakSet,Iv=p(function(t,e){let i=[],o=t[e];for(;o;)i.push(o),o=t[o.origin.properties.id];return i.reverse()},"#reconstructPath"),cu=new WeakMap,p(Hf,"NavigationGraph");var ru=Hf;var X6=.4,Uf=class Uf{constructor({nodes:t,geojsonCollection:e,groupBy:i="default"}){d(this,"groupBy");d(this,"graph");d(this,"geometryEdgesByMapId",new Map);d(this,"generatePath",p(t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let n=0;n<t.length;n++){let{origin:s}=t[n],c={id:s.properties.id,angle:t[n].angle,distance:t[n].distance};this.groupBy!=="default"&&(c.groupBy=s.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:c})}let o={id:e.properties.id};return this.groupBy!=="default"&&(o.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:o}),i},"generatePath"));d(this,"getDistance",p((t,e)=>cr(t,e),"getDistance"));d(this,"getAngle",p((t,e)=>mi(t,e),"getAngle"));this.groupBy=i,this.graph=new ru({nodes:t,groupBy:this.groupBy}),((e==null?void 0:e.features)||[]).forEach(n=>{let s=null;if(n.geometry.type==="LineString"?s=n.geometry.coordinates:n.geometry.type==="Polygon"&&(s=n.geometry.coordinates.flat()),s){let c=this.groupBy==="default"?this.groupBy:n.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),s.forEach((l,u)=>{this.geometryEdgesByMapId.get(c).push([l,s[u+1]||s[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:o,simplify:n}){var u,f;let s=(u=n==null?void 0:n.enabled)!=null?u:!0,c=t!=null?t:[],l=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:c,excludedNodeIds:new Set(o)});return l.length===0?{type:"FeatureCollection",features:[]}:(s&&(l=this.simplifyAllSteps(l,(f=n==null?void 0:n.bufferRadius)!=null?f:X6)),this.generatePath(l))}simplifyAllSteps(t,e){var l,u;let i=[],o=[t[0]];for(let f=1;f<t.length;f++)if(this.groupBy!=="default"&&t[f].origin.properties[this.groupBy]!==t[f-1].origin.properties[this.groupBy]){let y=t[f-1].origin.properties[this.groupBy],g=(l=this.geometryEdgesByMapId.get(y))!=null?l:[];i.push(...this.simplifySteps(o,g,e)),o=[t[f]]}else o.push(t[f]);let n=t[t.length-1],s=this.groupBy==="default"?this.groupBy:n.origin.properties[this.groupBy],c=(u=this.geometryEdgesByMapId.get(s))!=null?u:[];return i.push(...this.simplifySteps(o,c,e)),i}simplifySteps(t,e,i){if(t.length<3)return t;let o=[t[0]],n=1;for(let s=n+2;s<t.length;s++)if(!gv(t[n].origin,t[s].origin,e,i)){let c=s-1;o.push(new nn({...t[n],destination:t[c].origin,distance:cr(t[n].origin.geometry.coordinates,t[c].origin.geometry.coordinates),angle:mi(t[n].origin.geometry.coordinates,t[c].origin.geometry.coordinates)})),n=c}return o.push(new nn({...t[n],destination:t[t.length-1].origin,distance:cr(t[n].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:mi(t[n].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates)}),t[t.length-1]),o}};p(Uf,"Navigator");var Ia=Uf;m();var mE={};b0(mE,{Annotation:()=>li,Area:()=>oi,Connection:()=>to,Coordinate:()=>K,DOORS:()=>Sc,Door:()=>rr,E_SDK_LOG_LEVEL:()=>C0,EnterpriseCategory:()=>rl,EnterpriseLocation:()=>Or,EnterpriseVenue:()=>Kp,Facade:()=>Ut,Floor:()=>Ki,FloorStack:()=>Zs,Hyperlink:()=>Us,ImageData:()=>Ys,MAPPEDIN_COLORS:()=>X2,MapObject:()=>Ht,Node:()=>ri,PointOfInterest:()=>si,Space:()=>Be,WALLS:()=>Cc,createMapLibreOverlay:()=>hE,enableTestMode:()=>Ry,getMapData:()=>_S,getMapDataEnterprise:()=>dE,hydrateMapData:()=>uE,hydrateMapDataFromMVF:()=>cE,parseMVF:()=>cl,preloadFont:()=>Qh,setLoggerLevel:()=>S0,setUseEnterpriseAPI:()=>pE,show3dMap:()=>RS,show3dMapGeojson:()=>fE,unzipMVF:()=>pl});m();m();m();m();var hl,fl,ml,Xf=class Xf{constructor(t,e,{enabled:i=!1}={}){C(this,hl,void 0);d(this,"searchInstance");C(this,fl,void 0);C(this,ml,void 0);d(this,"enabled",!1);P(this,hl,t),P(this,fl,e),P(this,ml,()=>{var o;(o=this.searchInstance)==null||o.then(n=>n.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return L.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return L.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-UZLA3JGN.js").then(({InternalSearch:t})=>new t(a(this,hl)))),a(this,fl).on("language-change",a(this,ml)),await this.searchInstance)}};hl=new WeakMap,fl=new WeakMap,ml=new WeakMap,p(Xf,"Search");var dl=Xf;var Mv=new WeakMap,Re,Yf=class Yf extends z{constructor(e,{search:i}={}){super();C(this,Re,void 0);d(this,"Analytics");d(this,"Search");d(this,"Query");d(this,"getDirections",p((e,i,o)=>a(this,Re).getDirections(e,i,o),"getDirections"));d(this,"getDirectionsMultiDestination",p((e,i,o)=>a(this,Re).getDirectionsMultiDestination(e,i,o),"getDirectionsMultiDestination"));P(this,Re,e),Mv.set(this,e),this.Analytics=new ol(e.Analytics),this.Query=e.Query,this.Search=new dl(this,e,{enabled:i==null?void 0:i.enabled}),a(this,Re).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return a(this,Re).getEnv()}get mapName(){return a(this,Re).mapName}get mapCenter(){return a(this,Re).mapCenter}get organizationId(){return a(this,Re).organizationId}get outdoorViewToken(){return a(this,Re).outdoorViewToken}getByType(e){return a(this,Re).getByType(e)}getById(e,i){return a(this,Re).getById(e,i)}getByExternalId(e,i){return a(this,Re).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return a(this,Re).changeLanguage(e)}get currentLanguage(){return a(this,Re).currentLanguage}getDistance(e,i){return a(this,Re).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return a(this,Re).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return a(this,Re).toJSONBundle({downloadLanguagePacks:e})}};Re=new WeakMap,p(Yf,"MapData");var Wf=Yf,pu=Wf;function yl(r){let t=Mv.get(r);if(!t)throw new Error("MapDataInternal not found");return t}p(yl,"getMapDataInternal");m();m();m();m();m();function W6(r,t,e){e===void 0&&(e={});for(var i=Wt(r),o=Ft(t),n=0;n<o.length-1;n++){var s=!1;if(e.ignoreEndVertices&&(n===0&&(s="start"),n===o.length-2&&(s="end"),n===0&&n+1===o.length-1&&(s="both")),Y6(o[n],o[n+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}p(W6,"booleanPointOnLine");function Y6(r,t,e,i,o){var n=e[0],s=e[1],c=r[0],l=r[1],u=t[0],f=t[1],y=e[0]-c,g=e[1]-l,v=u-c,I=f-l,x=y*I-g*v;if(o!==null){if(Math.abs(x)>o)return!1}else if(x!==0)return!1;if(i){if(i==="start")return Math.abs(v)>=Math.abs(I)?v>0?c<n&&n<=u:u<=n&&n<c:I>0?l<s&&s<=f:f<=s&&s<l;if(i==="end")return Math.abs(v)>=Math.abs(I)?v>0?c<=n&&n<u:u<n&&n<=c:I>0?l<=s&&s<f:f<s&&s<=l;if(i==="both")return Math.abs(v)>=Math.abs(I)?v>0?c<n&&n<u:u<n&&n<c:I>0?l<s&&s<f:f<s&&s<l}else return Math.abs(v)>=Math.abs(I)?v>0?c<=n&&n<=u:u<=n&&n<=c:I>0?l<=s&&s<=f:f<=s&&s<=l;return!1}p(Y6,"isPointOnLineSegment");var Pv=W6;m();function Z6(r,t){t===void 0&&(t={});var e=Gp(r),i=(e[0]+e[2])/2,o=(e[1]+e[3])/2;return Mr([i,o],t.properties,t)}p(Z6,"center");var uu=Z6;m();m();function z6(r,t,e){e===void 0&&(e={});var i=Wt(r),o=Wt(t),n=It(o[1]-i[1]),s=It(o[0]-i[0]),c=It(i[1]),l=It(o[1]),u=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(c)*Math.cos(l);return P0(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}p(z6,"distance");var ao=z6;function du(r,t){return t===void 0&&(t={}),w0(r,function(e,i){var o=i.geometry.coordinates;return e+ao(o[0],o[1],t)},0)}p(du,"length");m();m();m();function hu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return q6(r,t);var i=Wt(r),o=Wt(t),n=It(i[0]),s=It(o[0]),c=It(i[1]),l=It(o[1]),u=Math.sin(s-n)*Math.cos(l),f=Math.cos(c)*Math.sin(l)-Math.sin(c)*Math.cos(l)*Math.cos(s-n);return _s(Math.atan2(u,f))}p(hu,"bearing");function q6(r,t){var e=hu(t,r);return e=(e+180)%360,e}p(q6,"calculateFinalBearing");m();m();function $6(r){if(!r)throw new Error("geojson is required");var t=[];return Pr(r,function(e){J6(e,t)}),jo(t)}p($6,"lineSegment");function J6(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ft(i);break;case"LineString":e=[Ft(i)]}e.forEach(function(o){var n=Q6(o,r.properties);n.forEach(function(s){s.id=t.length,t.push(s)})})}}p(J6,"lineSegmentFeature");function Q6(r,t){var e=[];return r.reduce(function(i,o){var n=Kr([i,o],t);return n.bbox=K6(i,o),e.push(n),o}),e}p(Q6,"createSegments");function K6(r,t){var e=r[0],i=r[1],o=t[0],n=t[1],s=e<o?e:o,c=i<n?i:n,l=e>o?e:o,u=i>n?i:n;return[s,c,l,u]}p(K6,"bbox");var Zf=$6;var BC=Bp(AC(),1);function xM(r,t){var e={},i=[];if(r.type==="LineString"&&(r=Uh(r)),t.type==="LineString"&&(t=Uh(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=FC(r,t);return o&&i.push(o),jo(i)}var n=(0,BC.default)();return n.load(Zf(t)),Xh(Zf(r),function(s){Xh(n.search(s),function(c){var l=FC(s,c);if(l){var u=Ft(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),jo(i)}p(xM,"lineIntersect");function FC(r,t){var e=Ft(r),i=Ft(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],n=e[0][1],s=e[1][0],c=e[1][1],l=i[0][0],u=i[0][1],f=i[1][0],y=i[1][1],g=(y-u)*(s-o)-(f-l)*(c-n),v=(f-l)*(n-u)-(y-u)*(o-l),I=(s-o)*(n-u)-(c-n)*(o-l);if(g===0)return null;var x=v/g,b=I/g;if(x>=0&&x<=1&&b>=0&&b<=1){var S=o+x*(s-o),w=n+x*(c-n);return Mr([S,w])}return null}p(FC,"intersects");var ka=xM;function IM(r,t,e){e===void 0&&(e={});var i=Mr([1/0,1/0],{dist:1/0}),o=0;return Pr(r,function(n){for(var s=Ft(n),c=0;c<s.length-1;c++){var l=Mr(s[c]);l.properties.dist=ao(t,l,e);var u=Mr(s[c+1]);u.properties.dist=ao(t,u,e);var f=ao(l,u,e),y=Math.max(l.properties.dist,u.properties.dist),g=hu(l,u),v=an(t,y,g+90,e),I=an(t,y,g-90,e),x=ka(Kr([v.geometry.coordinates,I.geometry.coordinates]),Kr([l.geometry.coordinates,u.geometry.coordinates])),b=null;x.features.length>0&&(b=x.features[0],b.properties.dist=ao(t,b,e),b.properties.location=o+ao(l,b,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=c,i.properties.location=o),u.properties.dist<i.properties.dist&&(i=u,i.properties.index=c+1,i.properties.location=o+f),b&&b.properties.dist<i.properties.dist&&(i=b,i.properties.index=c),o+=f}}),i}p(IM,"nearestPointOnLine");var Bl=IM;function MM(r,t,e){var i=Ft(e);if(fv(e)!=="LineString")throw new Error("line must be a LineString");var o=Bl(e,r),n=Bl(e,t),s;o.properties.index<=n.properties.index?s=[o,n]:s=[n,o];for(var c=[s[0].geometry.coordinates],l=s[0].properties.index+1;l<s[1].properties.index+1;l++)c.push(i[l]);return c.push(s[1].geometry.coordinates),Kr(c,e.properties)}p(MM,"lineSlice");var By=MM;var PM=1e-7;function ky(r){return{type:"Point",coordinates:r}}p(ky,"point");function TM(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,o=e.map(n=>Bl(r,ky(n)));return i.reduce((n,s)=>{let c=By(ky(s),o[0],r),l=By(ky(s),o[1],r),u=du(c)<du(l)?c:l;return u.properties={...r.properties,entrances:[]},n.concat([u])},[])}p(TM,"splitObstructionByEntrance");function _y(r,t){return t.reduce((e,i)=>{let o={epsilon:PM},n=e.obstructions.findIndex(c=>Pv(uu(i),c,o)),s=e.obstructions[n];if(s){let[c,l]=TM(s,i);e.entrances.push(i),e.obstructions.splice(n,1,c,l)}return e},{obstructions:[r],entrances:[]})}p(_y,"findAndSplitObstructionByAllEntrances");m();m();m();m();m();m();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var kC="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";m();m();var _C=!1;function Ry(){_C=!0}p(Ry,"enableTestMode");function RC(){return _C}p(RC,"isTestMode");var Ny=class Ny{constructor(t){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new Ze);d(this,"width",0);d(this,"height",0);d(this,"options",{});d(this,"renderer");d(this,"enabledLayers",new Set([0,1]));var e,i;try{this.options=t,RC()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Ze,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new z0({canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Ze((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(i=t.backgroundAlpha)!=null?i:1}catch(o){L.error(o),t.onWebGLRendererError&&t.onWebGLRendererError(o)}}destroy(){var t,e;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t))}render(t,e){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}};p(Ny,"Renderer");var pd=Ny;m();m();var NC='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(J(n,typeof e!="symbol"?e+"":e,t),t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';m();m();m();m();m();function GC(r,t){return t.x+t.w<r.x+r.w&&t.x>r.x&&t.y>r.y&&t.y+t.h<r.y+r.h}p(GC,"contains");m();function VC(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}p(VC,"intersectPoint");m();function jC(r,t){let e=t.x,i=t.y,o=t.x+t.w,n=t.y+t.h,s=r.x,c=r.y,l=r.x+r.w,u=r.y+r.h;return e<l&&s<o&&i<u&&c<n}p(jC,"intersects");m();function bi(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}p(bi,"appendItems");m();var Gy=class Gy{constructor(t,e,i,o,n){d(this,"x");d(this,"y");d(this,"w");d(this,"h");d(this,"userData");this.userData=typeof n>"u"?null:n,this.x=t,this.y=e,this.w=i,this.h=o}contains(t){return t===this?!1:GC(this,t)}intersects(t){return jC(this,t)}intersectsPoint(t){return VC(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};p(Gy,"Rectangle");var Ue=Gy;var un=class un{constructor(t,e){d(this,"topLeft");d(this,"topRight");d(this,"bottomLeft");d(this,"bottomRight");d(this,"divided",!1);d(this,"boundary");d(this,"capacity",16);d(this,"objects",[]);d(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:o}=this.boundary;this.topLeft=new un(new Ue(t,e,i/2,o/2),this),this.topRight=new un(new Ue(t+i/2,e,i/2,o/2),this),this.bottomLeft=new un(new Ue(t,e+o/2,i/2,o/2),this),this.bottomRight=new un(new Ue(t+i/2,e+o/2,i/2,o/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(bi(e,this.topLeft.queryRect(t)),bi(e,this.topRight.queryRect(t)),bi(e,this.bottomLeft.queryRect(t)),bi(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(bi(e,this.topLeft.queryPoint(t)),bi(e,this.topRight.queryPoint(t)),bi(e,this.bottomLeft.queryPoint(t)),bi(e,this.bottomRight.queryPoint(t))),e}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(e=>e.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};p(un,"QuadTree");var Rr=un;m();function UC(r,t,e){let i,o,n,s=null,c=0;e||(e={});let l=p(function(){c=e.leading===!1?0:Date.now(),s=null,n=r.apply(i,o),s||(i=o=null)},"later");return function(){let u=Date.now();!c&&e.leading===!1&&(c=u);let f=t-(u-c);return i=globalThis,o=arguments,f<=0||f>t?(s&&(clearTimeout(s),s=null),c=u,n=r.apply(i,o),s||(i=o=null)):!s&&e.trailing!==!1&&(s=setTimeout(l,f)),n}}p(UC,"throttle");var dn=!1,EM=150,Vy=class Vy extends z{constructor(e,i,o=new Worker(URL.createObjectURL(new Blob([NC],{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 Rr(new Ue(0,0,0,0)));d(this,"interactiveCollidersQTree",new Rr(new Ue(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",p(()=>{dn=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",p(()=>{dn=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));d(this,"currentMsgId","");d(this,"working",!1);d(this,"_postMessage",p(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));d(this,"componentArray",[]);d(this,"update",p((e,i,o="bottom-left",n=!0)=>{let s=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let l of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(l);u&&(c=u.components[0],this.componentArray.push(c))}this.resize(e,i,o),this.collidersDirty=!1,s=!0}else s=this.componentArray.some(c=>c.collisionDirty===!0);s&&this.componentArray.sort((c,l)=>l.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let l=this.componentArray[c].toPackedMessage(!n&&!s);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=l.bboxes,this.packedMessage[0][c][1]=l.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=l.rank===5?1:0,this.packedMessage[0][c][3]=l.x,this.packedMessage[0][c][4]=l.y,this.packedMessage[0][c][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=l.lockedToStrategyIndex}this.working||this.postMessage()},"update"));d(this,"resolve",p(e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,o=-1,n,s,c;dn&&(this.visibleCollidersQTree=new Rr(new Ue(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Rr(new Ue(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let u=this.componentArray[l];i[l]!=null&&(o=i[l][0],n=i[l][2],u.offscreen=i[l][1]===1,o!==-1&&n!=null?(c=new Ue(n.x,n.y,n.w,n.h,{entityId:u.id}),dn&&this.visibleCollidersQTree.insert(c),s=this.coreState.geometry2DMap.get(u.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new Ue(n.x,n.y,n.w,n.h,{entityId:u.id})),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),o!==-1&&o!==u.currentStrategyIndex&&(u.activeBoundingBox=c,u.onStrategySelected(o))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),o!==-1&&o!==u.currentStrategyIndex&&u.onStrategySelected(o)))}dn&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",p(()=>{dn&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));d(this,"destroy",p(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=o,this.worker.onmessage=n=>this.resolve(n),this.postMessage=UC(this._postMessage,EM,!1),dn?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,i,o){this.packedMessage[6]=o,this.packedMessage[5]=i,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};p(Vy,"CollisionSystem");var ud=Vy;m();m();m();m();var Hy=class Hy{constructor(t){d(this,"type");d(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};p(Hy,"Tap");var dd=Hy,Uy=class Uy{constructor(){d(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};p(Uy,"TapsController");var hd=Uy;m();function WC(r){let t=new Set;for(let e of r){let i=e.object;for(;i.parent&&!t.has(i.parent);)i=i.parent,i instanceof Ie&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}p(WC,"getUniqueIntersectedGroupContainers");function YC(r,t){if(r==null||t==null)return r===t;if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}p(YC,"arraysEqual");var _a,Xy=class Xy extends z{constructor(e,i,o,n,s){super();d(this,"raycaster",new Er);d(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});d(this,"coreState");d(this,"camera");d(this,"cameraPlane");d(this,"_quadtree",new Rr(new Ue(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);C(this,_a,void 0);d(this,"onPointerMoveRaf",p(e=>{this.lastPointerEvent=e,a(this,_a)&&cancelAnimationFrame(a(this,_a)),P(this,_a,requestAnimationFrame(()=>{this.onPointerMove(e)}))},"onPointerMoveRaf"));d(this,"onPointerMove",p(e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()},"onPointerMove"));d(this,"tapsControl",new hd);d(this,"onPointerDown",p(e=>{e.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new dd(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));d(this,"clickTimeout");d(this,"onPointerUp",p(e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));d(this,"dirty3D",!0);d(this,"cachedHitBoxes",{entities:[],groups:[]});d(this,"ndcPoint",new Q);d(this,"debugPanel");d(this,"resize",p(()=>{let{top:e,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[e,i]},"resize"));this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=e,this.coreState=i,this.cameraPlane=n,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:o,entity2D:n,position:s,groupContainers:c}=this.intersect(i);(this.detect3DEntityHover(o)||this.detect2DEntityHover(n)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=n,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:s,groupContainers:c})),this.handleCursor()}handleCursor(){let e=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,n=LM(e,o,i);this.cursor!==n&&(this.cursor=n,n==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),((e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path")&&e.components[2]?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var b,S;let i=[e.offsetX,e.offsetY],o=this._quadtree.queryPoint(i),[n]=o.filter(w=>w.intersectsPoint(i)),s=this.state.containerOffset[0],c=this.state.containerOffset[1];this.ndcPoint.x=(e.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-s)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[l]=this.getMouseRayIntersects(),u=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(w=>w.object.visible),[f]=u,y=(b=f==null?void 0:f.instanceId)!=null?b:f==null?void 0:f.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(w=>w.object.visible),v;g!=null&&g.length>0&&(v=WC(g));let I=y!=null?this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entities[y]):this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entityId),x;return I||(x=FM(f==null?void 0:f.object,this.coreState.geometry3DMap)),{entity2D:((S=n==null?void 0:n.userData)==null?void 0:S.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(n==null?void 0:n.userData.entityId),entity3D:I!=null?I:x,position:Array.isArray(g)&&(g==null?void 0:g.length)>0?g[0].point:l==null?void 0:l.point,groupContainers:v}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&zC(this.state.lastHover,!1,this.coreState),e&&zC(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!YC(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.cameraPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var o,n,s;this.queueDebugMessage("CLICK \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var o,n,s;this.queueDebugMessage("HOVER \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var n;let o=document.createElement("pre");o.style.maxWidth="300px",o.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",o.style.backgroundColor=i,o.textContent=e,(n=this.debugPanel)==null||n.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};_a=new WeakMap,p(Xy,"InteractionSystem");var kl=Xy;function zC(r,t,e){var s;let i=r.components[2];i&&i.hover!==!0&&(i.hover=t?"user-interaction":!1,i.dirty=!0);let o=(s=r.components[0].textMesh)==null?void 0:s.userData.entityId;if(!o)return;let n=e.geometry3DMap.get(o);(n==null?void 0:n.type)==="text3d"&&(n.components[1].hoverByPolygon=t,n.components[1].dirty=!0)}p(zC,"updateHover");function LM(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}p(LM,"processCursor");function AM(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof ji)return;if(t.userData.isSingleModel)return t;t=t.parent}}p(AM,"findModelParent");function FM(r,t){let e=AM(r);return e?t.get(e.userData.entityId):void 0}p(FM,"findModelParentEntity");m();m();var hn,Nr,fd,md,qC,Rl,yd,gd,$C,vd,JC,Nl,bd,Gl,Vl,Cd,Yy=class Yy{constructor(t){C(this,md);C(this,gd);C(this,vd);C(this,hn,null);C(this,Nr,void 0);d(this,"getCurrentSceneGLTF",p(async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await V(this,md,qC).call(this),o=a(this,fd).call(this,e),n=await i.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),s;if(n instanceof ArrayBuffer)s=new Blob([n],{type:"application/octet-stream"});else{let c=JSON.stringify(n,null,2);s=new Blob([c],{type:"text/plain"})}return s},"getCurrentSceneGLTF"));C(this,fd,p(t=>{let{scale:e,light:i,onlyVisible:o}=t,n=new ji,s=new ei().setFromObject(a(this,Nr).entityScene);if(a(this,Rl).call(this,a(this,Nr).entityScene,n,o),i){let c=new Wp(16777215,.3*Math.PI);c.position.set(0,Math.max(s.max.x,s.max.y)*e*.5,s.max.y*e*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),n.add(c)}return n},"#getExportedScene"));C(this,Rl,p((t,e,i)=>{t.material&&(t instanceof Up?V(this,gd,$C).call(this,t).forEach(o=>e.add(o)):t instanceof Yh&&e.add(V(this,vd,JC).call(this,t))),t.children.forEach(o=>{(!i||o.visible)&&a(this,Rl).call(this,o,e,i)})},"#processObject3D"));C(this,yd,p((t,e,i)=>{let o=new X0({color:new Ze(t),metalness:0});return o.opacity=e,o.transparent=i,o},"#createStandardMaterial"));C(this,Nl,p(t=>{let{geometry:e,material:i,position:o,rotation:n,quaternion:s,scale:c}=t;if(!(e!=null&&e.isBufferGeometry))return t;let l=e.attributes.position,u=e.attributes.normal,f=e.attributes.uv;return a(this,bd).call(this,l,u),a(this,Vl).call(this,o,c,n,s),f&&a(this,Cd).call(this,f),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=Ho),t},"#convertGeometry"));C(this,bd,p((t,e)=>{let i=new q,o=new q;for(let n=0;n<t.count;n++)i.fromBufferAttribute(t,n),a(this,Gl).call(this,i),t.setXYZ(n,i.x,i.y,i.z),e&&(o.fromBufferAttribute(e,n),a(this,Gl).call(this,o),e.setXYZ(n,o.x,o.y,o.z))},"#convertAttributes"));C(this,Gl,p(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));C(this,Vl,p((t,e,i,o)=>{let n=t.y;t.y=t.z,t.z=-n;let s=e.y;if(e.y=e.z,e.z=s,i instanceof Yn)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let c=o.y;o.set(o.x,o.z,-c,o.w)}},"#convertObjectProperties"));C(this,Cd,p(t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),o=t.getY(e);t.setXY(e,i,o)}},"#convertUVs"));P(this,Nr,t),a(this,Nr).entityScene=t.entityScene,a(this,Nr).geometry3DMap=t.geometry3DMap}destroy(){P(this,hn,null)}};hn=new WeakMap,Nr=new WeakMap,fd=new WeakMap,md=new WeakSet,qC=p(async function(){if(!a(this,hn)){let{GLTFExporter:t}=await import("./GLTFExporter-PEUUASSN.js");P(this,hn,new t)}return a(this,hn)},"#getGLTFExporter"),Rl=new WeakMap,yd=new WeakMap,gd=new WeakSet,$C=p(function(t){var s,c;let e=[],o=((s=t.userData)!=null&&s.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(l=>a(this,Nr).geometry3DMap.get(l)),n=new Map;return o.forEach(l=>{var v;if(!l||!(l instanceof Oe))return;let u=l.components[1],f=l.components[2];if(!u.visible||u instanceof Dr&&u.opacity===0||u instanceof qp||u instanceof $p)return;let y=f!=null&&f.hover?u.hoverColor||a(this,Nr).hoverColor:u.color,g="".concat(y,"-").concat(u.opacity,"-").concat(Number(u.visible));n.has(g)||n.set(g,[]),(v=n.get(g))==null||v.push(l)}),n.forEach((l,u)=>{let[f,y,g]=u.split("-"),v=l.reduce((S,w)=>{if(w.type==="custom-geometry")return S;let T=w.components[0];return"geometry"in T&&T.geometry instanceof R0&&S.push(T.geometry),S},[]),I=a(this,yd).call(this,f,Number(y),t.material.transparent),x=qi(v,!0),b=new ce(x,I);b.position.copy(t.position),b.rotation.copy(t.rotation),b.scale.copy(t.scale),b.visible=!!g,a(this,Vl).call(this,b.position,b.scale,b.rotation,b.quaternion),e.push(a(this,Nl).call(this,b))}),e},"#processBatchedMesh"),vd=new WeakSet,JC=p(function(t){let e=t.geometry.clone(),i=t.material,o=new Jt({color:i.color,side:Ho});o.opacity=i.opacity,o.transparent=i.transparent;let n=new Yh(e,o);return n.position.copy(t.position),n.rotation.copy(t.rotation),n.scale.copy(t.scale),n.visible=t.visible,a(this,Nl).call(this,n)},"#processLineSegments"),Nl=new WeakMap,bd=new WeakMap,Gl=new WeakMap,Vl=new WeakMap,Cd=new WeakMap,p(Yy,"ExporterSystem");var _l=Yy;m();m();m();m();var jl={top:0,bottom:0,left:0,right:0,type:"pixel"};m();m();var BM="gray",kM=.1;function Sd(r,t,e){let{color:i=BM,opacity:o=1,altitude:n=0,height:s=kM}=e||{};Array.isArray(o)&&(o=1);let c={min:{x:1/0,y:1/0,z:n},max:{x:-1/0,y:-1/0,z:s+n},center:{x:0,y:0,z:(s+n)/2}},l=new Tr,u=r.geometry.coordinates[0].map(v=>{let I=t(v[1],v[0]);return c.min.x=Math.min(c.min.x,I.x),c.min.y=Math.min(c.min.y,I.y),c.max.x=Math.max(c.max.x,I.x),c.max.y=Math.max(c.max.y,I.y),I});l.moveTo(u[0].x,u[0].y),u.slice(1).forEach(v=>l.lineTo(v.x,v.y)),l.lineTo(u[0].x,u[0].y);let f=r.geometry.coordinates.slice(1);l.holes=f.map(v=>{let I=v.map(b=>t(b[1],b[0])),x=new Hi;return x.moveTo(I[0].x,I[0].y),I.slice(1).forEach(b=>x.lineTo(b.x,b.y)),x.lineTo(I[0].x,I[0].y),x});let y={bevelEnabled:!1,depth:s},g=new wr(l,y);return g.userData={style:{color:i,opacity:o}},g}p(Sd,"renderPolygonGeometry");m();var _M="gray",RM=.1;function xd(r,t,e){let{color:i=_M,opacity:o=1,altitude:n=0,height:s=RM}=e||{};Array.isArray(o)&&(o=1);let c={min:{x:1/0,y:1/0,z:n},max:{x:-1/0,y:-1/0,z:s+n}},l={bevelEnabled:!1,depth:s},u=[];r.geometry.coordinates.forEach(y=>{let g=new Tr,v=y[0].map(b=>{let S=t(b[1],b[0]);return c.min.x=Math.min(c.min.x,S.x),c.min.y=Math.min(c.min.y,S.y),c.max.x=Math.max(c.max.x,S.x),c.max.y=Math.max(c.max.y,S.y),S});g.moveTo(v[0].x,v[0].y),v.slice(1).forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(v[0].x,v[0].y);let I=y.slice(1);g.holes=I.map(b=>{let S=b.map(T=>t(T[1],T[0])),w=new Hi;return w.moveTo(S[0].x,S[0].y),S.slice(1).forEach(T=>w.lineTo(T.x,T.y)),w.lineTo(S[0].x,S[0].y),w});let x=new wr(g,l);u.push(x)});let f=qi(u);return f.translate(0,0,n||0),f.userData={style:{color:i,opacity:o}},f}p(xd,"renderMultiPolygonGeometry");m();m();var qy=Bp(s7());function l7(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}p(l7,"JSClipperError");l7.prototype=Error.prototype;qy.default.Error=function(r){throw new l7(r)};var Tt=qy.default;var OT="gray",$y=new Tt.ClipperOffset,ft=100;function c7(r,t,e){let{color:i=OT,opacity:o=1,width:n=1,join:s="round",cap:c="round",height:l=.01,altitude:u=0}=e||{};Array.isArray(o)&&(o=0);let f=[];for(let x=0;x<r.geometry.coordinates.length-1;x++){let b=t(r.geometry.coordinates[x][1],r.geometry.coordinates[x][0]),S=t(r.geometry.coordinates[x+1][1],r.geometry.coordinates[x+1][0]);f.push([b,S])}$y.AddPaths(f.map(x=>x.map(b=>({X:b.x*ft,Y:b.y*ft}))),s==="round"?Tt.JoinType.jsRound:s==="miter"?Tt.JoinType.jsMiter:Tt.JoinType.jsSquare,c==="round"?Tt.EndType.etOpenRound:c==="butt"?Tt.EndType.etOpenButt:Tt.EndType.etOpenSquare);let y=new Tt.PolyTree;$y.Execute(y,n/2*ft);let g=[],v={bevelEnabled:!1,depth:l};for(let x of y.m_AllPolys){let b=new Tr;if(x.IsHole())continue;let S=x.m_polygon;b.moveTo(S[0].X/ft,S[0].Y/ft),S.slice(1).forEach(w=>b.lineTo(w.X/ft,w.Y/ft)),b.lineTo(S[0].X/ft,S[0].Y/ft),b.holes=x.m_Childs.map(w=>{let T=new Hi,E=w.m_polygon;return T.moveTo(E[0].X/ft,E[0].Y/ft),E.slice(1).forEach(D=>T.lineTo(D.X/ft,D.Y/ft)),T.lineTo(E[0].X/ft,E[0].Y/ft),T}),g.push(new wr(b,v))}let I=qi(g);return I.translate(0,0,u||0),I.userData={style:{color:i,opacity:o}},$y.Clear(),I}p(c7,"renderLineStringGeometry");m();var mt=100,LT=.22,AT=.01;function p7(r,t,e={}){let{width:i=LT,height:o=AT,color:n="gray",opacity:s=1,altitude:c=0}=e,l={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+o}},u={bevelEnabled:!1,depth:o},f=new Tt.ClipperOffset,y=r.geometry.coordinates.map(x=>x.map(b=>t(b[1],b[0])));f.AddPaths(y.map(x=>x.map(b=>({X:b.x*mt,Y:b.y*mt}))),Tt.JoinType.jsMiter,Tt.EndType.etOpenRound);let g=new Tt.PolyTree;f.Execute(g,i/2*mt);let v=[];for(let x of g.m_AllPolys){let b=new Tr;if(x.IsHole())continue;l.min.x=Math.min(l.min.x,x.m_polygon[0].X),l.min.y=Math.min(l.min.y,x.m_polygon[0].Y),l.max.x=Math.max(l.max.x,x.m_polygon[0].X),l.max.y=Math.max(l.max.y,x.m_polygon[0].Y);let S=x.m_polygon;b.moveTo(S[0].X/mt,S[0].Y/mt),S.slice(1).forEach(w=>b.lineTo(w.X/mt,w.Y/mt)),b.lineTo(S[0].X/mt,S[0].Y/mt),b.holes=x.m_Childs.map(w=>{let T=new Hi,E=w.m_polygon;return T.moveTo(E[0].X/mt,E[0].Y/mt),E.slice(1).forEach(D=>T.lineTo(D.X/mt,D.Y/mt)),T.lineTo(E[0].X/mt,E[0].Y/mt),T}),v.push(new wr(b,u))}let I=qi(v);return I.translate(0,0,c||0),I.userData={style:{color:n,opacity:s}},f.Clear(),I}p(p7,"renderMultiLineStringGeometry");m();m();var Ga=_.object({type:_.enum(["Point"]),coordinates:_.array(_.number()).length(2)});var FT=_.object({rotation:_.array(_.number()).length(3).optional(),altitude:_.number().optional(),scale:_.array(_.number()).length(3).optional(),interactive:_.boolean().optional(),verticalOffset:_.number().optional(),id:_.union([_.number(),_.string()]).optional()}),BT=_.object({type:_.enum(["Feature"]),geometry:Ga,properties:FT}),kT=_.object({type:_.enum(["FeatureCollection"]),features:_.array(BT)}),_T=_.object({color:_.string()}),RT=_.object({url:_.string(),color:_.string().optional(),opacity:_.number().optional(),material:_.record(_.string(),_T).optional()});function u7(r,t,e){_.union([_.number(),_.string()]).parse(r),kT.parse(t),RT.parse(e)}p(u7,"validateModelGroup");var Xl,Wl,Jy=class Jy{constructor(t){d(this,"mesh");d(this,"type","model");d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new Ze);d(this,"position",new q);C(this,Xl,0);C(this,Wl,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return a(this,Xl)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Xl,t))}get opacity(){return a(this,Wl)}set opacity(t){var e,i,o;if(this.mesh){if(this.mesh.children[0]instanceof Zn){for(let n of this.mesh.children)if(n instanceof Zn){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let s=Yi(t,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=s,n.material.transparent=s<1,n.material.needsUpdate=!0}}else(o=this.mesh)==null||o.traverse(n=>{n instanceof ce&&n.material&&(Array.isArray(n.material)?n.material.forEach(s=>{s.opacity=t}):n.material.opacity=t)});P(this,Wl,t)}}};Xl=new WeakMap,Wl=new WeakMap,p(Jy,"ModelComponent");var go=Jy;m();function wd(r){var o;let t=r.components[0],e=r.components[1];e.opacity!=null&&e.opacity!==t.opacity&&(t.opacity=e.opacity);let i=e.material;i&&((o=t.mesh)==null||o.traverse(n=>{n instanceof ce&&n.material&&(Array.isArray(n.material)?n.material.forEach(s=>{i[s.name]&&s.color.set(i[s.name].color)}):i[n.material.name]&&n.material.color.set(i[n.material.name].color))})),t.altitude!==e.verticalOffset&&(t.altitude=e.verticalOffset)}p(wd,"applyModelGeometryStyle");function NT(r){let{color:t,opacity:e,topColor:i,texture:o,topTexture:n}=r;return"".concat(t).concat(e).concat(i||"").concat(o||"").concat(n||"")}p(NT,"generateIndex");var GT=1e4,Qy=class Qy extends z{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-UA5TMSMR.js");return this.loader=new e,this.loader}createEntityFromFeature(e,i,o){let n=new ct(i),s=new Oe(n,new Dr(o));return s.id=e,s}createModelFromFeature(e,i,o){let n=new go(i),s=o;i.properties.verticalOffset!=null&&(s={...o,verticalOffset:i.properties.verticalOffset});let c=new Oe(n,new $p(s));return c.id=e,c}populateEntityMesh(e,i){let o=e.components[0];o.geometry=i,o.currentHeight=e.components[1].height,o.dirty=!1}async populateModelGroup(e,i,o){let n=new Wn,s=new Yn,c=new k0,l=new q,u=new Wi,f=await this.getGLTFLoader(),y=new Promise(g=>{f.load(i,v=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?v.scene.traverse(I=>{let x=I;if("isMesh"in x&&x.isMesh===!0){let b=new Zn(x.geometry,x.material,e.size);b.userData={entities:{}},u.add(b),o.add(u)}}):(v.scene.traverse(I=>{"isMesh"in I&&I.isMesh===!0&&(I.position.set(0,0,0),I.rotation.set(0,0,0),I.scale.set(1,1,1),I.updateMatrix())}),u.add(v.scene),o.add(u),u.userData.isSingleModel=!0,u.userData.entityId=e.values().next().value,u.userData.type="model")),g()})});return this.optimizePromise.push(y.then(()=>{var I,x,b,S,w,T;let g=0,v;for(let E of e.values()){if(v=this.state.geometry3DMap.get(E),!v||(v==null?void 0:v.type)!=="model")continue;let D=v.components[0],A=v.components[0].feature;D.mesh=u,D.instanceIndex=g,wd(v),v.components[1].dirty=!1;let{x:R,y:N}=this.convertTo3DMapPosition(A.geometry.coordinates[1],A.geometry.coordinates[0],0);D.position.set(R,N,D.altitude),s.set(((I=A.properties.rotation)==null?void 0:I[0])||0,((x=A.properties.rotation)==null?void 0:x[1])||0,((b=A.properties.rotation)==null?void 0:b[2])||0),l.set(((S=A.properties.scale)==null?void 0:S[0])||1,((w=A.properties.scale)==null?void 0:w[1])||1,((T=A.properties.scale)==null?void 0:T[2])||1),c.setFromEuler(s),n.compose(D.position,c,l),u.children.forEach(B=>{!v||(v==null?void 0:v.type)!=="model"||!(B instanceof Zn)||(B.setMatrixAt(g,n),B.userData.entities[g]=v.id)}),D.mesh.userData.isSingleModel&&(D.mesh.matrix.copy(n),D.mesh.matrix.decompose(D.mesh.position,D.mesh.quaternion,D.mesh.scale)),g++}this.publish("model-loaded")})),u}populateEntityGroup(e){let i,o,n,s;for(let c of e.values())s=this.state.geometry3DMap.get(c),s.components[0]instanceof ct&&(o=s.components[0].feature,n=s.components[1],o.geometry.type==="Polygon"?(i=Sd(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiPolygon"?(i=xd(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="LineString"?(i=c7(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiLineString"&&(i=p7(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof Kt||e instanceof Ie)){for(let s of e.children)this.optimize(s);if(e instanceof Ie||e.userData.dirty===!1)return;let o={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(s){L.warn(s)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let n=0;if(e.userData.dirty){let s=0,c;for(let l of e.userData.entities3D.values()){c=this.state.geometry3DMap.get(l);let u=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let f=c.components[1];s++,s>=GT&&(s=0,n++);let y=NT(f)+n;o[y]===void 0&&(o[y]={style:f,entities:[]}),o[y].entities.push(c)}else u&&"mesh"in u&&u.mesh&&((i=u.mesh)==null?void 0:i.parent)!==e&&e.add(u.mesh)}for(let l in o){let u=R2(o[l].entities,o[l].style);e.add(u),e.userData.outlineDirty=!0,e.userData.dirty=!1}for(let l of e.userData.entities3D.values())if(c=this.state.geometry3DMap.get(l),c!=null&&c.entities2D.size>0)for(let u of c.entities2D.values())u&&c.addEntity(u)}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};p(Qy,"MeshCreationAndOptimizationSystem");var Ed=Qy;m();var Ky=class Ky{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 Xi&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:t.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};p(Ky,"DOMVisibilitySystem");var Dd=Ky;m();var eg=class eg{constructor(t,e){d(this,"state");d(this,"project");this.state=t,this.project=e}update(){let t,e=0,i=0,o=!0,n,s;for(let c of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(c),t){let l=this.state.geometry3DMap.get(t.object3d.userData.parentEntityId);l instanceof Oe&&(n=l.components[1],n.dirty&&(e=n.height,i=n.opacity,o=n.visible,s=t.components[0],(i===0||o===!1)&&s.visible===!0?t.components[0].visible=!1:s.visible===!1&&(t.components[0].visible=!0),t.setAltitude(e))),this.project(t.components[0].projection,t.position)}}};p(eg,"TwoDProjectionSystem");var Od=eg;m();m();var VT=p(function(){let t,e;return i=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*i,t.height=500*i,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}},"createMeasureCanvasContext")(),d7=p(({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:o=2,lineHeight:n=1.2,options:s={strokeText:!0}})=>{let c="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=VT(i);l.font=c;let u=[],f=r.split(" "),y=0,g=0,v=0;for(;g<f.length;){let S=f[g];if(y===o&&y>0){u[y-1]+="...";break}if(u[y]==null&&(u[y]=S,g++),f.length===1){u[y]=S;break}if(f[g]==null)break;let{width:w}=l.measureText(u[y]+" "+f[g]);w<=e*i?(u[y]+=" "+f[g],g++):y++}u.forEach(S=>{let{width:w}=l.measureText(S);v=Math.max(w,v)});let I=t*i*n,x=u.length*I;return{maxWidth:v,maxHeight:x,lines:u.length,draw:(S,w,T)=>{u.length===1?(s.strokeText&&S.strokeText(u[0],w,T),S.fillText(u[0],w,T)):(s.strokeText&&(S.strokeText(u[0],w,T-I/2),S.strokeText(u[1],w,T+I/2)),S.fillText(u[0],w,T-I/2),S.fillText(u[1],w,T+I/2))}}},"shaveText");m();function h7(r){let t=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}p(h7,"createImage");var jT=3.5,HT=2.5,UT=2,XT=5,Yl=2.5;var tg=class tg{constructor(t,e){d(this,"dirty",!1);d(this,"state");d(this,"colliderContext");d(this,"colliderCanvas");d(this,"pinCache",{});d(this,"imagePromiseCache",{});d(this,"imageDimensionsCache",{});d(this,"textCache",{});d(this,"update",p((t,e,i)=>{let o=(t-e)/(i-e),n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let s,c,l,u,f,y;for(let g of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(g),y!=null&&(f=y.components[0],f instanceof Zi&&!y.disposed)){if(c=f.appearance.marker.foregroundColor,l=f.appearance.marker.backgroundColor,u=f.markerSize,s="".concat(c.active,"-").concat(c.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(u),this.pinCache[s]||this.prepare(f,s,this.colliderContext),f.appearance.marker.icon&&(!f.imageHash||f.dirty)&&this.cacheImage(f),this.textCache[f.id]==null||f.dirty||this.dirty){f.dirty=!1,f.collisionDirty=!0,this.textCache[f.id]={};let{textDrawFn:v,width:I,height:x}=this.processText(f.text,f.appearance.text.size,f.appearance.text.maxWidth,f.appearance.text.numLines,f.appearance.text.lineHeight);["left","center","right"].forEach(S=>{this.textCache[f.id][S]=this.textToCanvas(v,f.appearance.text.size,S,I,x,f.appearance.text.foregroundColor,f.appearance.text.backgroundColor)}),f.dimensions={width:Math.ceil(I/n),height:Math.ceil(x/n)},f.currentStrategyIndex===-1&&(f.currentStrategyIndex=0);let b=f.strategies[f.currentStrategyIndex];if(b){b.onStrategySelected(f);let S=f.style;f.style=f.newStyle,f.newStyle=S}}f.canShow&&f.visible&&(f.enabled||f.visibilityNeedsUpdate!==!1)&&(f.zoomProportion=o,this.draw(f,s,this.colliderContext))}this.dirty=!1},"update"));d(this,"processText",p((t,e,i,o,n)=>{let s=this.state.pixelRatio,{draw:c,maxWidth:l,maxHeight:u}=d7({text:t,size:e,pixelRatio:s,maxWidth:i,maxLines:o,lineHeight:n});return{textDrawFn:c,width:l+Yl*s*2,height:u+Yl*s*2}},"processText"));d(this,"textToCanvas",p((t,e,i,o,n,s,c)=>{let l=this.state.pixelRatio,u,f=o,y=n;window.OffscreenCanvas!=null&&!t2()?u=new OffscreenCanvas(f,y):(u=document.createElement("canvas"),u.width=f,u.height=y,u.style.width=f+"px",u.style.height=y+"px");let g=u.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=i,g.font="bold ".concat(e*l,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=Yl*l,g.fillStyle=s,g.strokeStyle=c;let v=i==="left"?0:i==="center"?f/2:f-Yl*l/2;return t(g,v,(y+Yl*l/2)/2),u},"textToCanvas"));d(this,"cacheImage",p(t=>{if(!t.appearance.marker.icon)return;let e=a2(t.appearance.marker.icon);if(t.imageHash=e,!this.imagePromiseCache[e]){let i=h7(t.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[e]=i}}},"cacheImage"));d(this,"createPinCanvas",p((t,e,i,o)=>{let n,s=this.state.pixelRatio,c=t.totalMarkerSize*2*s;window.OffscreenCanvas!=null?n=new OffscreenCanvas(c,c):(n=document.createElement("canvas"),n.width=c,n.height=c,n.style.width=c/s+"px",n.style.height=c/s+"px");let l=n.getContext("2d");return l.shadowColor="rgba(0,0,0,0.3)",l.shadowOffsetY=UT*s,l.shadowBlur=XT*s,l.beginPath(),l.arc(c/2,c/2,e/2+HT*s/2,0,2*Math.PI),l.fillStyle=i,l.fill(),l.beginPath(),l.arc(c/2,c/2,e/2,0,2*Math.PI),l.shadowColor="transparent",l.fillStyle=o,l.fill(),n},"createPinCanvas"));d(this,"prepare",p((t,e,i)=>{let o=this.state.pixelRatio;i.lineWidth=4*o;let n=this.createPinCanvas(t,t.markerSize,t.appearance.marker.backgroundColor.active,t.appearance.marker.foregroundColor.active),s=this.createPinCanvas(t,t.iconVisible?t.markerSize:jT*o,t.appearance.marker.backgroundColor.inactive,t.appearance.marker.foregroundColor.inactive);this.pinCache[e]=[n,s]},"prepare"));this.state=t,this.colliderCanvas=e,this.colliderContext=e.getContext("2d")}draw(t,e,i){if(!t.canShow||!t.visible)return;i.save(),i.globalAlpha=t.opacity;let o=this.state.pixelRatio,n=t.projection.x*o,s=t.projection.y*o,c=t.style.pinVisibility===1?this.pinCache[e][0]:this.pinCache[e][1];if(i.drawImage(c,n-t.totalMarkerSize*o,s-t.totalMarkerSize*o),t.appearance.marker.icon&&t.iconVisible&&t.imageHash&&t.appearance.marker.iconSize&&this.imagePromiseCache[t.imageHash]){let l=this.imagePromiseCache[t.imageHash],u=(t.appearance.marker.iconSize-t.appearance.marker.iconPadding)*o,f=t.appearance.marker.iconFit,y=u,g=u,v="".concat(t.imageHash,"_").concat(f);if(this.imageDimensionsCache[v])y=this.imageDimensionsCache[v].width,g=this.imageDimensionsCache[v].height;else{let I=l.width*o,x=l.height*o;if(f==="contain"){let b=Math.sqrt(I**2+x**2),S=u/b;y=I*S,g=x*S}if(f==="cover"){let b=u/I,S=u/x,w=Math.max(b,S);y=I*w,g=x*w}}i.save(),i.beginPath(),i.arc(n,s,u/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(l,n-y/2,s-g/2,y,g),i.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left&&t.style.top&&i.drawImage(this.textCache[t.id][t.style.textAlign],n+t.style.left*o,s+t.style.top*o),i.restore()}};p(tg,"TwoDDrawSystem");var Ld=tg;m();m();var vo=class vo{constructor(){d(this,"loader");this.loader=new zn}static getInstance(){return vo.instance||(vo.instance=new vo),vo.instance}getLoader(){return this.loader}load(t){return new Promise((e,i)=>{this.loader.load(t,e,void 0,i)})}};p(vo,"TextureLoaderSingleton"),d(vo,"instance");var rg=vo,bo=rg.getInstance();function YT(r,t){let e=r.components[2],i=r.components[1];return e!=null&&e.hover?[i.hoverColor||t,i.hoverColor||t]:[i.color,i.topColor||i.color]}p(YT,"processColor");var Zl,ig,og=class og extends z{constructor(e){super();C(this,Zl);d(this,"state");d(this,"textureLoadingCache",new Map);this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,o){i.texture!==e.texture&&i.texture!==""&&V(this,Zl,ig).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&V(this,Zl,ig).call(this,i.topTexture,e,"topTexture"),(e.texture!=null||e.topTexture!=null)&&(o!=null&&o.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var n,s,c,l,u,f,y,g,v;let e,i,o;for(let I of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(I),o instanceof Kt&&o.type==="geometry-group"){let x=o.components[0];if(o.userData.shadingDirty){let b=o.userData.entities3D.values().next().value;if(b==null)continue;let S=this.state.geometry3DMap.get(b);S instanceof Oe&&(S.type==="geometry"||S.type==="custom-geometry")&&(e=S.components[0],o.userData.shadingDirty&&x.shading&&this.setShading(e,x.shading));let w,T;for(let E of o.userData.entities3D.values())w=this.state.geometry3DMap.get(E),T=w.components[0],w.type==="geometry"&&T.detached&&o.userData.shadingDirty&&x.shading&&this.setShading(T,x.shading);o.userData.shadingDirty=!1}if(x.dirty){let b=J0(o);b&&b.material instanceof V0&&(b.material.color.set(N2(x.color)),b.material.needsUpdate=!0);let S=o.getfirstChildEntityId();if(S){let w=this.state.geometry3DMap.get(S),T=w==null?void 0:w.components[0];T instanceof ct&&this.processTextures(T,x)}x.dirty=!1}}else if(o&&(o.type==="geometry"||o.type==="custom-geometry")&&((n=o.components[1])!=null&&n.dirty||(s=o.components[2])!=null&&s.dirty)){let x=o.components[0],b=o.components[1];i=o.components[2];let S=YT(o,this.state.hoverColor);if(x.setColor(S[0],S[1]),b.visible!==x.visible&&(x.visible=b.visible,x instanceof ct&&x.textMesh)){let w=this.state.geometry3DMap.get(x.textMesh.userData.entityId);(w==null?void 0:w.type)==="text3d"&&(w.components[0].visible=b.visible)}b.altitude!==x.altitude&&(x.altitude=b.altitude),b.opacity!==x.opacity&&(x.opacity=b.opacity),b.renderOrder!==x.renderOrder&&(x.renderOrder=b.renderOrder),b.dirty=!1,x instanceof ct&&this.processTextures(x,b,i),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model"&&((c=o.components[1])!=null&&c.dirty))wd(o),o.components[1].dirty=!1;else if((o==null?void 0:o.type)==="image"&&((l=o.components[1])!=null&&l.dirty)){e=o.components[0];let x=o.components[1];x.visible!==e.visible&&(e.visible=x.visible),x.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((u=o.components[1])!=null&&u.dirty)){e=o.components[0];let x=o.components[1];x.visible!=null&&x.visible!==e.visible&&(e.visible=x.visible);let{textMesh:b}=e;if(b){Object.assign(b,x.getState());let S=(f=x.hoverColor)!=null?f:this.state.text3dHoverColor;b.color=x.hoverByPolygon?S:(y=x.color)!=null?y:$n.color,b.outlineColor=x.hoverByPolygon?S:(g=x.outlineColor)!=null?g:$n.outlineColor,b.strokeColor=x.hoverByPolygon?S:(v=x.strokeColor)!=null?v:$n.strokeColor}x.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};Zl=new WeakSet,ig=p(async function(e,i,o){if(!(!e||!i.showTextures))if(this.textureLoadingCache.has(e)){o==="topTexture"?i.topTexture=await this.textureLoadingCache.get(e):i.texture=await this.textureLoadingCache.get(e),i.showTextures();return}else{let n=new Promise((s,c)=>{bo.getLoader().load(e,l=>{o==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{L.error("Failed to load texture: ".concat(e)),c("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,n)}},"#loadTexture"),p(og,"DrawSystem");var Ad=og;m();var ng=class ng extends z{constructor(e){super();d(this,"state");d(this,"animating",new Map);d(this,"isAnimating",!1);d(this,"startTime",-1);d(this,"showDuration",300);d(this,"hideDuration",250);d(this,"update",p(()=>{this.animating.clear();let e,i;for(let o of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i instanceof Zi&&(i.visibilityNeedsUpdate==="show"?(i.canShow=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));d(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[o,n]]of this.animating.entries()){let s=n===1?this.showDuration:this.hideDuration,c=(e-this.startTime)/s;i.opacity=Yi(c,0,1,o,n,n===0?s2:l2),e-this.startTime>=s&&(n===1?i.canShow=!0:n===0&&(i.canShow=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};p(ng,"TwoDVisibilitySystem");var Fd=ng;m();var ag=class ag extends z{constructor(e,i,o,n,s,c,l){super();d(this,"state");d(this,"renderer");d(this,"mode");d(this,"scene");d(this,"cameraObject");d(this,"viewCamera");d(this,"systems");d(this,"twoDdirty",!0);d(this,"threeDdirty",!0);d(this,"frameId",null);d(this,"twoDFrameId",null);d(this,"animationFrameId",null);d(this,"nextFrame",null);d(this,"update",p((e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)==null)return Promise.resolve();if(e){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise(o=>{this.frameId=requestAnimationFrame(()=>{var n,s;return((n=this.renderer)==null?void 0:n.renderer)==null?o():this.mode==="standalone"?(s=this.commitRenderState())==null?void 0:s.then(()=>{this.paint(),o()}):o()})})},"update"));d(this,"animate2D",p(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));d(this,"drawEntities2D",p(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"drawEntities2D"));d(this,"updateEntities2D",p(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));d(this,"commitRenderState",p(()=>{try{let e=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),o2(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(),i2(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let i=this.systems.meshOptimizationSystem.update();return i&&e.push(i),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,this.systems.cameraSystem.rotationDirty)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(e)}catch(e){L.error("Render failed: ",e)}},"commitRenderState"));this.renderer=e,this.state=i,this.mode=o,this.scene=n,this.cameraObject=s,this.viewCamera=c,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};p(ag,"RenderSystem");var Bd=ag;m();var ZT=_.object({interactive:_.boolean().optional(),id:_.string().optional(),nearRadius:_.number().optional(),farRadius:_.number().optional(),accentColor:_.string().optional(),displayArrowsOnPath:_.boolean().optional(),animateArrowsOnPath:_.boolean().optional()}),zT=_.object({type:_.enum(["Feature"]),geometry:Ga,properties:_.object({parentId:_.any().optional()})});function f7(r,t){_.object({features:_.array(zT)}).parse(r),ZT.parse(t)}p(f7,"validatePath");var zl,sg=class sg{constructor(t,e){d(this,"type","path");d(this,"mesh",new Wi);d(this,"material");d(this,"geometry");d(this,"outline");d(this,"feature");d(this,"options");d(this,"nearRadius",.2);d(this,"farRadius",.4);d(this,"accentColor","blue");d(this,"completeFraction",1);d(this,"altitudeAdjustment",1);d(this,"displayArrowsOnPath",!1);d(this,"animateArrowsOnPath",!1);d(this,"isVertical",!1);d(this,"dirty",!0);d(this,"materialDirty",!0);d(this,"position",new q);C(this,zl,0);var i,o,n,s,c;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(o=e==null?void 0:e.nearRadius)!=null?o:this.nearRadius,this.farRadius=(n=e==null?void 0:e.farRadius)!=null?n:this.farRadius,this.displayArrowsOnPath=(s=e==null?void 0:e.displayArrowsOnPath)!=null?s:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=e==null?void 0:e.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return a(this,zl)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,zl,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};zl=new WeakMap,p(sg,"PathComponent");var Co=sg;m();var lg=class lg{constructor(t){d(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Ie&&t.components[0]){let i=t.components[0];if(i.dirty){for(let o of t.children)(o instanceof Kt||o instanceof Ie)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));i.dirty=!1}}}};p(lg,"StackSystem");var kd=lg;m();m();m();var we=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-we.Bounce.Out(1-r)},Out:function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},InOut:function(r){return r<.5?we.Bounce.In(r*2)*.5:we.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),ql=p(function(){return performance.now()},"now"),pg=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return p(r,"Group"),r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var o=0,n=e;o<n.length;o++){var s=n[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,o=t;i<o.length;i++){var n=o[i];n._group=void 0,delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=ql()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var n=this._tweens[i[o]],s=!e;n&&n.update(t,s)===!1&&!e&&this.remove(n)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),Va={Linear:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=Va.Utils.Linear;return t<0?n(r[0],r[1],i):t>1?n(r[e],r[e-1],e-i):n(r[o],r[o+1>e?e:o+1],i-o)},Bezier:function(r,t){for(var e=0,i=r.length-1,o=Math.pow,n=Va.Utils.Bernstein,s=0;s<=i;s++)e+=o(1-t,i-s)*o(t,s)*r[s]*n(i,s);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=Va.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(o=Math.floor(i=e*(1+t))),n(r[(o-1+e)%e],r[o],r[(o+1)%e],r[(o+2)%e],i-o)):t<0?r[0]-(n(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(n(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):n(r[o?o-1:0],r[o],r[e<o+1?e:o+1],r[e<o+2?e:o+2],i-o)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=Va.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,o){var n=(e-r)*.5,s=(i-t)*.5,c=o*o,l=o*c;return(2*t-2*e+n+s)*l+(-3*t+3*e-2*n-s)*c+n*o+t}}},m7=function(){function r(){}return p(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),cg=new pg,wt=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=we.Linear.None,this._interpolationFunction=Va.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=m7.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=cg,cg.add(this))}return p(r,"Tween"),r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=ql()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var n in this._valuesEnd)o[n]=this._valuesEnd[n];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,o,n){for(var s in i){var c=t[s],l=Array.isArray(c),u=l?"array":typeof c,f=!l&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var y=i[s];if(y.length===0)continue;for(var g=[c],v=0,I=y.length;v<I;v+=1){var x=this._handleRelativeValue(c,y[v]);if(isNaN(x)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(x)}f&&(i[s]=g)}if((u==="object"||l)&&c&&!f){e[s]=l?[]:{};var b=c;for(var S in b)e[s][S]=b[S];o[s]=l?[]:{};var y=i[s];if(!this._isDynamic){var w={};for(var S in y)w[S]=y[S];i[s]=y=w}this._setupProperties(b,e[s],y,o[s],n)}else(typeof e[s]>"u"||n)&&(e[s]=c),l||(e[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=e[s]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=ql()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=ql()),!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=we.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=Va.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,o;if(t===void 0&&(t=ql()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var n;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,c=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*c,u=p(function(){if(i._duration===0||s>l)return 1;var x=Math.trunc(s/c),b=s-x*c,S=Math.min(b/i._duration,1);return S===0&&s===i._duration?1:S},"calculateElapsedPortion"),f=u(),y=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,y),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((s-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=g);for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,I=this._chainedTweens.length;v<I;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,o){for(var n in i)if(e[n]!==void 0){var s=e[n]||0,c=i[n],l=Array.isArray(t[n]),u=Array.isArray(c),f=!l&&u;f?t[n]=this._interpolationFunction(c,o):typeof c=="object"&&c?this._updateProperties(t[n],s,c,o):(c=this._handleRelativeValue(s,c),typeof c=="number"&&(t[n]=s+(c-s)*o))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var cH=m7.nextId,Gr=cg,pH=Gr.getAll.bind(Gr),uH=Gr.removeAll.bind(Gr),dH=Gr.add.bind(Gr),hH=Gr.remove.bind(Gr),fH=Gr.update.bind(Gr);m();m();m();var y7=p((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),g7=p((r,t)=>new Q(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),ug=p((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),$l=p((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),dg=p((r,t)=>new Q((r.x+t.x)/2,(r.y+t.y)/2),"average"),hg=p(r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t},"getScrollDelta");var fg=class fg{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=ug(t,e),this.lastDistance=$l(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=$l(t,e);this.input1=t,this.input2=e;let o=ug(t,e);this.lastAngle=o,this.lastDistance=i,this.totalDistance+=($l(this.first,t)+$l(this.second,e))/2,this.first=dg(this.first,t),this.second=dg(this.second,e)}};p(fg,"InputSet");var _d=fg;m();var mg=class mg{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 Q(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Er,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=e&&e.length>0?e[0].point:null,this.snapshotted=!0}updateAnchorState(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var i,o;let t=new Q(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(t,this.snapCamera);let e=(o=this.raycaster)==null?void 0:o.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};p(mg,"TouchAnchor");var Jl=mg;var dr={};b0(dr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>$T,CLIPPING_RADIUS:()=>Ql,CONTROL_OPTIONS:()=>qT,DEFAULT_BEARING:()=>tw,DEFAULT_MAX_ZOOM_LEVEL:()=>KT,DEFAULT_MIN_ZOOM_LEVEL:()=>Cg,DEFAULT_PITCH:()=>ew,DEFAULT_ZOOM_LEVEL:()=>QT,EVENTS:()=>Vd,MAPLIBRE_TILE_SIZE:()=>Rd,MAX_LAT:()=>gg,MAX_MERCATOR_ZOOM_LEVEL:()=>Gd,MIN_LAT:()=>yg,MIN_MERCATOR_ZOOM_LEVEL:()=>Nd,ROOM_MERCATOR_ZOOM_LEVEL:()=>JT,TWO_PI:()=>vg,WHEEL_ZOOM_MULTIPLIER:()=>bg,ZRANGE:()=>ja});m();var Rd=512,yg=-85.051129,gg=85.051129,Ql=1e4,qT={chain:"chain",cancel:"cancel"},vg=Math.PI*2,ja=100,bg=1e4,Nd=0,Gd=24,$T=17,JT=20,Vd=["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"],QT=18,Cg=12,KT=22,ew=0,tw=0;var jd=!1,rw=!1;var Hd,Ud=class Ud extends z{constructor(e,i,o,n,s){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);d(this,"rotationDirty",!1);C(this,Hd,Cg);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:Vp.RIGHT,ZOOM:Vp.MIDDLE,PAN:Vp.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new Er);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 Y0(!0));d(this,"coords",{mouse:new Q,rotateStart:new Q,rotateEnd:new Q,rotateDelta:new Q,panStart:new q,panCameraStart:new q,panEnd:new q,panDelta:new q,initialShiftPos:new Q,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,"raycastToFloor",p(e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new q},"raycastToFloor"));d(this,"isUserInteracting",p(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",p(()=>new q(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));d(this,"getPedestal",p(()=>this.orbit.position.z,"getPedestal"));d(this,"pan",p((e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));d(this,"postRender",p(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));d(this,"isCameraMoving",p(()=>this.state!==-1,"isCameraMoving"));d(this,"setPosition",p((e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));d(this,"updateCameraPosition",p((e,i)=>{let o=e-this.panBounds.center.x,n=i-this.panBounds.center.y,s=Math.sqrt(o*o+n*n);if(this.stayInsideBounds&&s>this.panBounds.radius){let c=Math.atan2(n,o),l={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=e,this.orbit.position.y=i},"updateCameraPosition"));d(this,"tilt",p(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));d(this,"zoomIn",p((e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n/1.5},e,i,o)},"zoomIn"));d(this,"zoomOut",p((e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n*1.5},e,i,o)},"zoomOut"));d(this,"getRotation",p(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));d(this,"cancelAnimation",p(()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));d(this,"animateCamera",p((e,i,o,n,s,c)=>{let l={interruptible:!0,...c},u={},f={},y=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(u.x=y.x,f.x=e.position.x),e.position.y!==void 0&&(u.y=y.y,f.y=e.position.y),e.position.z!==void 0&&(u.z=y.z,f.z=e.position.z)),e.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.zoom=e.zoom:f.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:T,end:E}=Rp(this.getRotation(),e.rotation);u.rotation=T,f.rotation=E}e.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.tilt=e.tilt:f.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let g=u.zoom!==f.zoom,v=u.rotation!==f.rotation,I=u.tilt!==f.tilt,x=new wt(u).to(f,M.env.TESTING?0:i).onUpdate(T=>{this.setMulti({x:T.x,y:T.y,z:T.z},T.zoom,T.rotation,T.tilt)}).onComplete(()=>{this.completeTween(x),this.publish("multi-end",{zooming:g,rotating:v,tilting:I}),n&&n()}).onStart(()=>{this.state!==7&&(this.state=7,x.state=7,this.publish("multi-start",{zooming:g,rotating:v,tilting:I})),this.publish("change")});this.rendererState.tweenGroup.add(x);let b=Array.from(this.tweens.entries()),S=b[b.length-1],w=!1;return S!=null&&(S[1].interruptible?(typeof S[1].cancelledCallback=="function"&&S[1].cancelledCallback(),this.completeTween(S[0])):(w=!0,S[0].chain(x))),this.tweens.set(x,{cancelledCallback:s,interruptible:l.interruptible}),o?x.easing(o):x.easing(we.Quadratic.In),!e.doNotAutoStart&&!w&&(x.start(),this.publish("change")),x.cameraAnimation=!0,x},"animateCamera"));d(this,"setMulti",p((e,i,o,n,s=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),c=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),c=!0)),c&&this.publish("position-updated");let l={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let u=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;u!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Ql&&(this.camera.near=i-Ql,this.camera.far=i+Ql):(this.camera.near=i/ja,this.camera.far=i*ja),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(l.rotating=!0,this.orbit.rotation.z=-o,this.publish("rotation-updated")),n!==void 0&&!isNaN(n)){let u=this.stayInsideBounds?Math.max(Math.min(n,this.maxTilt),this.minTilt):n;u!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=u,this.publish("tilt-updated"))}s&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)},"setMulti"));d(this,"getZoomScaledMin",p(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));d(this,"getZoomScaledMax",p(()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)},"getZoomScaledMax"));d(this,"setRotation",p((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=-(e%vg);o!==this.orbit.rotation.z&&(this.orbit.rotation.z=o,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));d(this,"setZoomAltitude",p(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(e,this.getZoomScaledMin()),this.getZoomScaledMax()):e;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/ja,this.camera.far=i*ja,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));d(this,"setZoomLevel",p(e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))},"setZoomLevel"));d(this,"getZoomAltitude",p(()=>this.camera.position.z,"getZoomAltitude"));d(this,"getZoomLevel",p(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));d(this,"setTilt",p((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));d(this,"getTilt",p(()=>this.elevation.rotation.x,"getTilt"));d(this,"setCameraPlaneElevation",p(e=>{this.cameraPlane.position.z=e},"setCameraPlaneElevation"));d(this,"zoom",p(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));d(this,"getProjectionScaleFactor",p((e,i,o)=>Jh(e,i,o),"getProjectionScaleFactor"));d(this,"update",p(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));d(this,"setPedestal",p((e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)},"setPedestal"));d(this,"dispose",p(()=>{for(let e of Vd)e.endsWith("start")?this.off(e,this.setUserInteracting):e.endsWith("end")&&this.off(e,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));d(this,"createCameraPlane",p(()=>{let e=jd?2e3:1e10,i=jd?100:1,o=new ti(e,e,i,i),n=new Jt({color:0,wireframe:jd,visible:jd}),s=new ce(o,n);return this.scene.add(s),s},"createCameraPlane"));d(this,"addEventListeners",p(()=>{let{domElement:e}=this.renderer;for(let i of Vd)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));d(this,"addMouseEventListeners",p(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));d(this,"addMouseMoveEventListeners",p(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));d(this,"removeMouseMoveEventListeners",p(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));d(this,"removeEventListeners",p(()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));d(this,"removeMouseUpEventListeners",p(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));d(this,"onContextMenu",p(e=>{e.preventDefault()},"onContextMenu"));d(this,"onMouseUp",p(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1}},"onMouseUp"));d(this,"onMouseMove",p(e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)},"onMouseMove"));d(this,"onTouchStart",p(e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new _d(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));d(this,"onTouchMove",p(e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let i={...this.touch.inputs.first},o={...this.touch.inputs.second},n=new Q(this.touch.touches[0].x,this.touch.touches[0].y),s=new Q(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(e);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=i.y<n.y&&o.y<s.y,l=i.y>n.y&&o.y>s.y;this.enableRotate&&this.state!==4&&(l||c)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}},"onTouchMove"));d(this,"onTouchEnd",p(e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}},"onTouchEnd"));d(this,"handleTouchMovePan",p(e=>{let i=Object.hasOwn(e,"x")?new Q(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panEnd.set(o.x,o.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleTouchMovePan"));d(this,"handleTouchStartDolly",p(()=>{let e=this.touch.touches[0].x-this.touch.touches[1].x,i=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let o=new Q(this.touch.touches[0].x-e/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(o),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Jl(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Jl(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));d(this,"handleMouseMovePan",p(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleMouseMovePan"));d(this,"handleTouchStartTilt",p(e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));d(this,"handleTouchMovePedestal",p(e=>{this.handleMouseMovePedestal(e.touches[0])},"handleTouchMovePedestal"));d(this,"handleTouchMoveTilt",p(e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));d(this,"handleTouchMoveDolly",p(()=>{let e=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let o=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);o&&this.setCameraFromTransformMatrix(o),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));d(this,"handleTouchEnd",p(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")},"handleTouchEnd"));d(this,"handleTouchStartPan",p(e=>{let i=Object.hasOwn(e,"x")?new Q(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panStart.set(o.x,o.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));d(this,"handleTouchStartPedestal",p(e=>{this.handleMouseDownPedestal(e.touches[0])},"handleTouchStartPedestal"));d(this,"onMouseDown",p(e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));d(this,"onMouseWheel",p(e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))},"onMouseWheel"));d(this,"handleMouseWheel",p(e=>{if(this.publish("zoom-start"),!this.canScrollZoom(e)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),o=i-hg(e)*i/bg*this.zoomSpeed;if(this.setZoomAltitude(o),this.enablePan){let n=o/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-n),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));d(this,"setCameraFromTransformMatrix",p(e=>{this.orbit.updateMatrixWorld();let i=new Yn;i.setFromRotationMatrix(e,"ZYX");let o=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),n=i.z,s=new q(0,0,1);s.applyEuler(i),s.setLength(o);let c=new q;c.setFromMatrixPosition(e),c.sub(s),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-n)},"setCameraFromTransformMatrix"));d(this,"makeTransformFromTouchAnchors",p((e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),n=e.worldCoordinate,s=i.worldCoordinate,c=e.reUnproject(),l=i.reUnproject();if(!c||!l||!n||!s)return null;let u=e.viewCoordinate,f=i.viewCoordinate,y=s.x-n.x,g=s.y-n.y,v=Math.atan2(g,y),I=l.x-c.x,x=l.y-c.y,b=Math.atan2(x,I),S=y7(v,b),w=new Wn;w.makeRotationZ(-S);let T=w.clone();T.multiply(e.snapHolderMatrix);let E=p((t6,r6,i6)=>t6.elements[(r6-1)*4+i6-1],"m"),D=E(o,1,1)*E(T,1,1)-u.x*E(o,3,4)*E(T,3,1),A=E(o,1,1)*E(T,1,2)-u.x*E(o,3,4)*E(T,3,2),R=E(o,1,1)*E(T,1,3)-u.x*E(o,3,4)*E(T,3,3),N=n.x*D+n.y*A+n.z*R,B=E(o,2,2)*E(T,2,1)-u.y*E(o,3,4)*E(T,3,1),H=E(o,2,2)*E(T,2,2)-u.y*E(o,3,4)*E(T,3,2),G=E(o,2,2)*E(T,2,3)-u.y*E(o,3,4)*E(T,3,3),$=n.x*B+n.y*H+n.z*G,J=E(o,1,1)*E(T,1,1)-f.x*E(o,3,4)*E(T,3,1),he=E(o,1,1)*E(T,1,2)-f.x*E(o,3,4)*E(T,3,2),Se=E(o,1,1)*E(T,1,3)-f.x*E(o,3,4)*E(T,3,3),Ge=s.x*J+s.y*he+s.z*Se,Lt=E(o,2,2)*E(T,2,1)-f.y*E(o,3,4)*E(T,3,1),me=E(o,2,2)*E(T,2,2)-f.y*E(o,3,4)*E(T,3,2),Fe=E(o,2,2)*E(T,2,3)-f.y*E(o,3,4)*E(T,3,3),xe=s.x*Lt+s.y*me+s.z*Fe,st=Math.abs(J-D),$t=Math.abs(he-A),et=Math.abs(Se-R),lt=Math.abs(J-B),Qr=Math.abs(he-H),Gi=Math.abs(Se-G),ee=Math.abs(Lt-D),se=Math.abs(me-A),ye=Math.abs(Fe-R),xt=Math.abs(Lt-B),Un=Math.abs(me-H),Bs=Math.abs(Fe-G),Ir=Math.min(st+$t+et,lt+Qr+Gi),Vi=Math.min(ee+se+ye,xt+Un+Bs);Ir<Vi&&(J=Lt,he=me,Se=Fe,Ge=xe);let ks=B*R-D*G,Gh=H*R-A*G,f0=$*R-N*G,Vh=J*G-B*Se,jh=he*G-H*Se,m0=Ge*G-$*Se,$S=(m0*Gh-f0*jh)/(Vh*Gh-ks*jh),JS=(m0*ks-f0*Vh)/(jh*ks-Gh*Vh),y0=H*D-A*B,QS=G*D-R*B,KS=$*D-N*B,g0=he*B-H*J,e6=Se*B-G*J,v0=((Ge*B-$*J)*y0-KS*g0)/(e6*y0-QS*g0),Fp=T.clone();return Fp.elements[12]=$S,Fp.elements[13]=JS,Fp.elements[14]=v0,v0>0?Fp:null},"makeTransformFromTouchAnchors"));d(this,"updateTouchOrigin",p(()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top},"updateTouchOrigin"));d(this,"touchToScene",p(e=>{this.touch.touches=[];for(let i=0,o=e.touches.length;i<o;i++){let n=e.touches[i],s=g7(n,this.touch.origin);this.touch.touches.push(new Q(s.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(s.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));d(this,"canScrollZoom",p(e=>{let i=hg(e),o=this.getZoomAltitude();return!(i<0&&o===this.getZoomScaledMax()||i>0&&o===this.getZoomScaledMin())},"canScrollZoom"));d(this,"mouseToScene",p(e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));d(this,"getMousePos",p(e=>({x:e.offsetX,y:e.offsetY}),"getMousePos"));d(this,"handleMouseDownRotate",p(e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));d(this,"handleMouseDownPan",p(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));d(this,"handleMouseDownPedestal",p(e=>{let i=new Q(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=Jh(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));d(this,"handleMouseMovePedestal",p(e=>{let i={x:e.clientX,y:e.clientY},o=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(o<this.minPedestal?o=Math.max(o,this.minPedestal):o>this.maxPedestal&&(o=Math.min(o,this.maxPedestal))),o!==this.getPedestal()&&this.setPedestal(o,!0)},"handleMouseMovePedestal"));d(this,"handleMouseMoveRotate",p(e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));d(this,"publishUserZoomDebounced",Wo(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));d(this,"publishUserZoomEvent",p(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));d(this,"setUserInteracting",p(()=>{this.userInteracting=!0},"setUserInteracting"));d(this,"unsetUserInteracting",p(()=>{this.userInteracting=!1},"unsetUserInteracting"));d(this,"publishPedestalChangeEvent",p(e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));d(this,"convertAltitudeToZoomLevel",p(e=>{let[,i]=this.center,n=e*2*Math.tan(le.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(le.degToRad(i))*2*Math.PI*Hh/n;return le.clamp(Math.log2(s/512),Nd,Gd)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",p(e=>{let[,i]=this.center,o=le.clamp(e,Nd,Gd),n=Math.pow(2,o),s=le.clamp(i,yg,gg),c=n*512;return Math.cos(le.degToRad(s))*Math.PI*2*Hh/c*this.options.canvasHeight/2/Math.tan(le.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));d(this,"completeTween",p(e=>{e.isPlaying()&&e.stop(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)},"completeTween"));d(this,"debugContainer",new Ns);this.camera=e,this.renderer=o,this.rendererState=n,this.scene=i,this.options=s,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,s.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return a(this,Hd)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,i),o=Math.max(o,e),(o-e)/(i-e)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var n,s,c,l;let e=this.getPosition(),{lat:i,lon:o}=Yp((s=(n=this.rendererState.center)==null?void 0:n[1])!=null?s:0,(l=(c=this.rendererState.center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[o,i]}setCenter(e,i){var s,c,l,u;let{x:o,y:n}=Zp((c=(s=this.rendererState.center)==null?void 0:s[1])!=null?c:0,(u=(l=this.rendererState.center)==null?void 0:l[0])!=null?u:0,i,e);this.setPosition(o,n)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}getCameraFrameForCoordinates(e,i){let o=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,n=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,s=this.options.canvasWidth,c=this.options.canvasHeight,l=this.getRotation(),u=this.getTilt(),f=this.getPosition();this.setRotation(i.rotation||l),this.setTilt(i.tilt||u);let y=v7(e,{canvasWidth:s,canvasHeight:c,paddingOption:i.padding,minZoom:o,maxZoom:n,position:f,camera:this.camera,orbit:this.orbit});return this.setRotation(l),this.setTilt(u),{center:y.position,zoomLevel:this.convertAltitudeToZoomLevel(y.zoom)}}focusOn(e,i){rw&&(this.debugContainer&&ze(this.debugContainer),e.forEach(b=>{let S=new ce(new Hp(2,2,2),new Jt({color:65280}));S.position.copy(b),this.debugContainer.add(S),this.scene.add(this.debugContainer)}));let o=i.curve,n=i.callback,s=i.cancelledCallback,c=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,l=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,f=this.options.canvasHeight,y;i.duration!==void 0?y=i.duration:M.env.TESTING==="true"?y=0:y=200;let g=i.padding,v=this.getRotation(),I=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let x=v7(e,{canvasHeight:f,paddingOption:g,canvasWidth:u,minZoom:c,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(v),this.setTilt(I),this.animateCamera({position:x.position,tilt:i.tilt,rotation:i.rotation,zoom:x.zoom},y,o,n,s,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};Hd=new WeakMap,p(Ud,"CameraSystem"),d(Ud,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Ha=Ud;function v7(r,{canvasWidth:t,orbit:e,paddingOption:i,canvasHeight:o,minZoom:n,maxZoom:s,camera:c,position:l}){let u={zoom:n,position:l};if(r.length===0)return u;for(let Vi of Ha.CAMERA_FRAME_PADDING_SIDES)typeof i[Vi]!="number"&&(i[Vi]=0);let f=i.type==="portion"?{top:i.top*o,bottom:i.bottom*o,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(f.left+f.right>=t||f.top+f.bottom>=o)return u;e.updateMatrixWorld();let y=c.matrixWorldInverse,g=c.fov*(Math.PI/180)/2,v=g,x=Math.atan(Math.tan(g)*(t/o)),b=new q(1/0,1/0,1/0),S=new q(-1/0,-1/0,-1/0),w=new ei().setFromPoints(r),T;for(let Vi=0,ks=r.length;Vi<ks;Vi++)T=r[Vi].clone(),T.applyMatrix4(y),b.min(T),S.max(T);let E=S.x-b.x,D=S.y-b.y,A=t-f.left-f.right,R=o-f.top-f.bottom,N=(S.x+b.x)/2,B=(S.y+b.y)/2,H=E/A,G=D/R,$=n,J=s,he=$*Math.tan(x)*2,Se=J*Math.tan(x)*2,Ge=he/t,Lt=Se/t,me=Math.max(H,G);me=le.clamp(me,Ge,Lt);let Fe=A*me,xe=R*me,st={min:{x:N-Fe/2-f.left*me,y:B-xe/2-f.bottom*me},max:{x:N+Fe/2+f.right*me,y:B+xe/2+f.top*me}},$t=(st.min.x+st.max.x)/2,et=(st.min.y+st.max.y)/2,lt=w.getCenter(new q),Qr=Math.abs($t-st.min.x),Gi=Math.abs(et-st.min.y),ee=Qr/Math.tan(x),se=Gi/Math.tan(v),ye=new q;ye.set($t,et,S.z+Math.max(ee,se)),ye.applyMatrix4(c.matrixWorld);let xt=new q;xt.set($t,et,S.z),xt.applyMatrix4(c.matrixWorld);let Un=new q().subVectors(xt,ye),Bs=(lt.z-ye.z)/Un.z,Ir=new q().copy(ye).add(Un.clone().multiplyScalar(Bs));return xt.set(Ir.x,Ir.y,Ir.z),ye.sub(xt),{position:Ir,zoom:ye.length()}}p(v7,"getCameraFrameForPoints");m();var iw=300,Kl,ec,Sg=class Sg{constructor(t){d(this,"state");C(this,Kl,new q);C(this,ec,new q);this.state=t}update(t){var o;let e,i;this.state.cameraObject.getWorldPosition(a(this,ec));for(let n of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if((i.canShow===!0&&i.visible===!0||((o=i.animation)==null?void 0:o.pending)===!0)&&!i.offscreen)if(i.options.zIndex!=null)i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.options.zIndex,"px)");else{e.object3d.getWorldPosition(a(this,Kl));let s=a(this,ec).distanceTo(a(this,Kl));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-s,"px)")}if(i.canShow===!0&&i.visible===!0?i.containerEl.style.pointerEvents=t?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.currentStrategyIndex===-1&&i.visible&&i.visibilityNeedsUpdate==="show")continue;i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.animation&&i.animation.cancel(),i.visibilityNeedsUpdate==="show"?(i.containerEl.style.opacity="0",i.canShow=!0):i.canShow=!1,i.animation=i.containerEl.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:iw,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};Kl=new WeakMap,ec=new WeakMap,p(Sg,"DOMDrawSystem");var Xd=Sg;m();var xg=class xg{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};p(xg,"StackComponent");var Wd=xg;m();var Ig=class Ig extends z{constructor(e,i){super();d(this,"state");d(this,"dirty",!0);d(this,"domTree");d(this,"observers",new Map);d(this,"updateDimensions",p(e=>{e.forEach(i=>{let o=i.target,n=o.getAttribute("data-marker-id");if(n){let s=this.state.geometry2DMap.get(n);s&&s.components[0]instanceof Xi&&o.firstElementChild&&(s.components[0].updateDimensions(),s.components[0].collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=e,this.domTree=i}setupObserver(){var i;if(this.observers){for(let o of this.observers.values())o.disconnect();this.observers.clear()}let e;for(let o of this.domTree.children){let n=o.getAttribute("data-marker-id");if(n!=null&&(e=this.state.geometry2DMap.get(n),(i=e.components[0].options)!=null&&i.dynamicResize)){let s=new ResizeObserver(this.updateDimensions);s.observe(o),this.observers.set(o.userData.entityId,s)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};p(Ig,"DOMResizeSystem");var Yd=Ig;m();var ow=0,nw=90;function Ci(r,t,e,i){return(r<t||r>e)&&L.warn(i),Math.min(e,Math.max(t,r))}p(Ci,"clampWithWarning");var Ua={linear:we.Linear.None,"ease-in":we.Quadratic.In,"ease-out":we.Quadratic.Out,"ease-in-out":we.Quadratic.InOut},U,Z,Xa,tc,rc,ic,Mg,Pg=class Pg{constructor(t,e,i,o){C(this,ic);C(this,U,void 0);C(this,Z,void 0);C(this,Xa,void 0);C(this,tc,void 0);C(this,rc,void 0);P(this,U,t),P(this,Z,e),P(this,Xa,i),P(this,tc,o),a(this,Z).cameraSystem.on("pedestal-change",({pedestal:n})=>{a(this,U).map&&(a(this,U).map.transform.elevation=n,a(this,U).map.transform.minElevationForCurrentTile=n,a(this,U).map.triggerRepaint()),a(this,Z).cameraSystem.setCameraPlaneElevation(n),a(this,tc).position.z=n})}get center(){return a(this,U).mode==="outdoors-overlay"&&a(this,U).map?a(this,U).map.getCenter().toArray():a(this,Z).cameraSystem.center}setCenter(t){var e;if(a(this,U).mode==="outdoors-overlay"&&a(this,U).map){(e=a(this,U).map)==null||e.setCenter(t),a(this,Z).interactionSystem.handleHover();return}a(this,Z).cameraSystem.setCenter(t[0],t[1]),a(this,Z).interactionSystem.handleHover()}get zoomLevel(){var t;return a(this,U).mode==="outdoors-overlay"&&a(this,U).map?(t=a(this,U).map)==null?void 0:t.getZoom():a(this,Z).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;a(this,U).mode==="outdoors-overlay"&&a(this,U).map&&((e=a(this,U).map)==null||e.setZoom(t)),a(this,Z).cameraSystem.setZoomLevel(Ci(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return a(this,Z).cameraSystem.isAnimating}cancelAnimation(){a(this,Z).cameraSystem.cancelAnimation()}get maxZoomLevel(){return a(this,Z).cameraSystem.maxZoomLevel}get minZoomLevel(){return a(this,Z).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){a(this,Z).panBoundsSystem.autoMinZoomLevel=t,t&&(a(this,Z).panBoundsSystem.dirty=!0,a(this,Z).panBoundsSystem.update())}get autoMinZoomLevel(){return a(this,Z).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var o;e&&this.setAutoMinZoomLevel(!1);let i=Ci(t,dr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(dr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));a(this,Z).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(o=a(this,U).map)==null||o.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=Ci(t,this.minZoomLevel,dr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(dr.MAX_MERCATOR_ZOOM_LEVEL,"."));a(this,Z).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=a(this,U).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return a(this,U).mode==="outdoors-overlay"&&a(this,U).map?(t=a(this,U).map)==null?void 0:t.getMaxPitch():le.radToDeg(a(this,Z).cameraSystem.maxTilt)}get minPitch(){var t;return a(this,U).mode==="outdoors-overlay"&&a(this,U).map?(t=a(this,U).map)==null?void 0:t.getMinPitch():le.radToDeg(a(this,Z).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(ow,t);(i=a(this,U).map)==null||i.setMinPitch(e),a(this,Z).cameraSystem.minTilt=le.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(nw,t);(i=a(this,U).map)==null||i.setMaxPitch(e),a(this,Z).cameraSystem.maxTilt=le.degToRad(e)}get bearing(){var t;return a(this,U).mode==="outdoors-overlay"&&a(this,U).map?(t=a(this,U).map)==null?void 0:t.getBearing():le.radToDeg(a(this,Z).cameraSystem.getRotation())}setBearing(t){var e;if(a(this,U).mode==="outdoors-overlay"&&a(this,U).map){(e=a(this,U).map)==null||e.setBearing(t);return}a(this,Z).cameraSystem.setRotation(le.degToRad(t))}get pitch(){var t;return a(this,U).mode==="outdoors-overlay"&&a(this,U).map?(t=a(this,U).map)==null?void 0:t.getPitch():le.radToDeg(a(this,Z).cameraSystem.getTilt())}setPitch(t){var e;if(a(this,U).mode==="outdoors-overlay"&&a(this,U).map){(e=a(this,U).map)==null||e.setPitch(t);return}a(this,Z).cameraSystem.setTilt(le.degToRad(Ci(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return a(this,Z).cameraSystem.getPedestal()}setElevation(t){a(this,Z).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return a(this,rc)&&a(this,rc).stop(),new Promise(i=>{let o=a(this,Z).cameraSystem.getPosition();o.z=t,a(this,Z).cameraSystem.animateCamera({position:o},(e==null?void 0:e.duration)||300,Ua[(e==null?void 0:e.easing)||"ease-in-out"],i,i,{interruptible:e==null?void 0:e.interruptible})})}get insetsPadding(){return a(this,Xa).insetsPadding}get panMode(){return a(this,Z).cameraSystem.enablePan===!1&&a(this,Z).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(a(this,Z).cameraSystem.enablePan=!0,a(this,Z).cameraSystem.enablePedestal=!1):(a(this,Z).cameraSystem.enablePan=!1,a(this,Z).cameraSystem.enablePedestal=!0))}setInsetPadding(t){a(this,Xa).insetsPadding=Object.assign({},jl,t)}animateTo(t){var s,c,l,u,f,y;if(a(this,U).mode==="outdoors-overlay"&&a(this,U).map)return(y=a(this,U).map)==null||y.flyTo({center:(s=t.center)!=null?s:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(l=t.bearing)!=null?l:this.bearing,pitch:(u=t.pitch)!=null?u:this.pitch,duration:(f=t.duration)!=null?f:600}),Promise.resolve();let e=t.center?a(this,U).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?a(this,Z).cameraSystem.convertZoomLevelToAltitude(Ci(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,o=t.bearing!==void 0?le.degToRad(t.bearing):void 0,n=t.pitch!==void 0?le.degToRad(Ci(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(g=>{a(this,Z).cameraSystem.animateCamera({position:e,zoom:i,rotation:o,tilt:n},t.duration||0,Ua[t.easing||"ease-in-out"],()=>{a(this,Z).interactionSystem.handleHover(),g()},g,{interruptible:t==null?void 0:t.interruptible})})}getCameraFrameForCoordinates(t,e){let i=V(this,ic,Mg).call(this,e||{},()=>Promise.resolve()),{center:o,zoomLevel:n}=a(this,Z).cameraSystem.getCameraFrameForCoordinates(t.map(s=>a(this,U).convertTo3DMapPosition(s[1],s[0],s[2]||0)),i);return{center:a(this,U).convert3DMapPositionToCoordinate(o),zoomLevel:n}}focusOn(t,e){var i,o;return t==null||!Array.isArray(t)||t.length<=0?(L.error("focusOn coordinates are invalid:",t),Promise.resolve()):a(this,U).mode==="outdoors-overlay"&&a(this,U).map?(t.length===1?(i=a(this,U).map)==null||i.flyTo({center:t[0],duration:(e==null?void 0:e.duration)||a(this,U).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?a(this,U).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,U).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||a(this,U).map.getMaxZoom()}):(o=a(this,U).map)==null||o.fitBounds(t,{duration:e==null?void 0:e.duration,animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?a(this,U).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,U).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||a(this,U).map.getMaxZoom()}),a(this,Z).interactionSystem.handleHover(),Promise.resolve()):new Promise(n=>{a(this,Z).cameraSystem.focusOn(t.map(s=>a(this,U).convertTo3DMapPosition(s[1],s[0],s[2]||0)),V(this,ic,Mg).call(this,e||{},n))})}};U=new WeakMap,Z=new WeakMap,Xa=new WeakMap,tc=new WeakMap,rc=new WeakMap,ic=new WeakSet,Mg=p(function(t,e){return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:a(this,Z).cameraSystem.convertZoomLevelToAltitude(Ci(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:a(this,Z).cameraSystem.convertZoomLevelToAltitude(Ci(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({},jl,t==null?void 0:t.padding):this.insetsPadding,curve:Ua[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:le.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?le.degToRad(Ci(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:()=>{a(this,Z).interactionSystem.handleHover(),e()},cancelledCallback:e,interruptible:t==null?void 0:t.interruptible}},"#convertToLegacy"),p(Pg,"Camera");var Zd=Pg;m();var b7="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 C7="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";m();var S7=4.291666666666667,x7=15,I7=25,M7=43/60;m();var P7=["horizontal","icon"],lw=new Map([[P7[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>'],[P7[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>']]),cw=/<svg([^>]*)>/g;function T7(r,t,e,i){let o=lw.get(r);return o?o.replace(cw,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}p(T7,"getLogoIcon");var w7=!1,fe,Si,Wa,ot,yt,gn,hr,Vr,Tg=class Tg extends z{constructor(e,i,o){super();C(this,fe,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});C(this,Si,void 0);C(this,Wa,void 0);C(this,ot,void 0);C(this,yt,void 0);C(this,gn,void 0);C(this,hr,0);C(this,Vr,0);d(this,"dirty",!0);d(this,"getPositionAlignedCanvasCoordinates",p((e,i)=>({"top-left":{x:0,y:0},"top-right":{x:e,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:e,y:i},center:{x:e/2,y:i/2},top:{x:e/2,y:0},bottom:{x:e/2,y:i},left:{x:0,y:i/2},right:{x:e,y:i/2}})[a(this,fe).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",p(()=>{var o,n,s,c;let e=a(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}}[a(this,fe).position];let i={top:(o=e.top)!=null?o:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(c=e.left)!=null?c:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));P(this,fe,Object.assign({},a(this,fe),o)),P(this,Wa,e),P(this,Si,i)}get color(){return a(this,fe).color==="light"?"white":"#293136"}get iconName(){return a(this,fe).iconOnly?"icon":"horizontal"}get minWidth(){return a(this,fe).iconOnly?x7:75}get defaultWidth(){return a(this,fe).iconOnly?I7:150}get aspectRatio(){return a(this,fe).iconOnly?M7:S7}get options(){return{...a(this,fe)}}set options(e){P(this,fe,{padding:e.padding||a(this,fe).padding,position:e.position||a(this,fe).position,iconOnly:e.iconOnly||a(this,fe).iconOnly,color:e.color||a(this,fe).color,scale:e.scale||a(this,fe).scale,onClick:a(this,fe).onClick,visible:e.visible||a(this,fe).visible})}get icon(){return T7(this.iconName,this.color,a(this,hr)*a(this,Si).pixelRatio,a(this,Vr)*a(this,Si).pixelRatio)}setSize(e,i){a(this,yt)&&(a(this,yt).uniforms.uSize.value.x=e,a(this,yt).uniforms.uSize.value.y=i)}setXY(e,i){a(this,yt)&&(a(this,yt).uniforms.uSize.value.w=e,a(this,yt).uniforms.uSize.value.z=i)}get width(){return a(this,hr)}get height(){return a(this,Vr)}getPositionAlignedOffset(e,i){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-e,y:-i},center:{x:-(e/2),y:-(i/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-e,y:-(i/2)}}[a(this,fe).position]}insertIntoQuadTree(e){a(this,gn)!=null&&typeof a(this,fe).onClick=="function"&&e.insert(a(this,gn))}resize(e,i){if(a(this,fe).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(e,i),n=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(a(this,hr),a(this,Vr)),c=Math.min(e-a(this,hr),Math.max(0,o.x+n.x+s.x)),l=Math.min(i-a(this,Vr),Math.max(0,o.y+n.y+s.y));this.setSize(a(this,hr)/e,a(this,Vr)/i),this.setXY(c/e,l/i),P(this,gn,new Ue(c,l,a(this,hr),a(this,Vr),{entityId:"watermark"}))}update(){this.dirty&&a(this,fe).visible===!0&&(P(this,hr,Math.min(a(this,Si).canvasWidth,Math.max(this.minWidth,this.defaultWidth*a(this,fe).scale))),P(this,Vr,a(this,hr)/this.aspectRatio),bo.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(P(this,yt,new Xo({uniforms:{uTexture:{value:e},uSize:{value:new F0(0,0,0,0)},uOpacity:{value:.7}},vertexShader:b7,fragmentShader:C7,depthWrite:!1,depthTest:!1,defines:{debug:w7},wireframe:w7,transparent:!0,visible:!0})),a(this,ot))a(this,ot).material=a(this,yt),a(this,ot).material.needsUpdate=!0;else{let i=new ti(2,2,1,1);P(this,ot,new ce(i,a(this,yt))),a(this,ot).position.set(0,0,-1),a(this,ot).frustumCulled=!1,a(this,ot).renderOrder=999;let o=new Hp(1,1,1),n=new ce(o,new Jt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));n.frustumCulled=!1,n.layers.set(1),a(this,ot).add(n),a(this,Wa).add(a(this,ot))}this.resize(a(this,Si).canvasWidth,a(this,Si).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){a(this,ot)&&(a(this,Wa).remove(a(this,ot)),ze(a(this,ot))),P(this,ot,void 0),a(this,yt)&&a(this,yt).dispose(),P(this,yt,void 0),P(this,gn,void 0)}};fe=new WeakMap,Si=new WeakMap,Wa=new WeakMap,ot=new WeakMap,yt=new WeakMap,gn=new WeakMap,hr=new WeakMap,Vr=new WeakMap,p(Tg,"WatermarkSystem");var zd=Tg;m();var wg=100,dw=!1,Eg=class Eg extends z{constructor(e,i){super();d(this,"currentTotalBoundingBox");d(this,"state");d(this,"cameraSystem");d(this,"debugMesh",null);d(this,"dirty",!1);d(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new ei,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new q(0,0,0),new q(wg*2,wg*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(wg))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let e of this.state.geometry2DMap.values())e.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(e.position),e.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new q),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new _0).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,dw&&this.state.entityScene.parent instanceof ji&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new ce(new H0(this.cameraSystem.panBounds.radius),new Jt({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};p(Eg,"PanBoundsSystem");var qd=Eg;m();var E7="\xA9 Mappedin",hw="https://info.mappedin.com/feedback",Og=["top-left","top-right","bottom-left","bottom-right"],fw=640,mw=p(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),Dg={custom:[],position:"bottom-right",feedback:!0},Lg=class Lg{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",E7);d(this,"customAttributions",[]);d(this,"toggleAttribution",p(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Og.reduce((e,i)=>{let o=document.createElement("div");return o.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(o),e[i]=o,e},{})}addAttributionControl(t=Dg){var o;let e=t.position&&Og.includes(t.position)?t.position:Dg.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=mw(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((o=t.feedback)!=null?o:Dg.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=hw,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=[E7],i=t.style.sourceCaches;for(let o in i){let n=i[o];if(n.used||n.usedForTerrain){let s=n.getSource();s.attribution&&e.indexOf(s.attribution)<0&&e.push(s.attribution)}}e=e.filter(o=>String(o).trim()),e=e.filter((o,n)=>{for(let s=n+1;s<e.length;s++)if(e[s].indexOf(o)>=0)return!1;return!0}),this.attribHTML=e.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=fw||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};p(Lg,"HTMLControlsSystem");var $d=Lg;m();var oc,Ag=class Ag{constructor(t,e){d(this,"mesh");d(this,"type","custom-geometry");d(this,"dirty",!0);d(this,"feature");d(this,"builder");d(this,"outline");d(this,"color",new Ze);C(this,oc,0);this.mesh=new Wi,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){L.warn("TODO: implement custom geometry opacity")}get opacity(){return L.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return a(this,oc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,oc,t))}get renderOrder(){return L.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){L.warn("TODO: implement custom geometry render order")}};oc=new WeakMap,p(Ag,"CustomGeometryComponent");var Ya=Ag;m();var Fg=class Fg{constructor(t,e){d(this,"state");d(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(i);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],e=o.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(n=>{n.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};p(Fg,"CustomGeometrySystem");var Jd=Fg;m();m();var Bg=class Bg extends ce{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};p(Bg,"EntityMesh");var Qd=Bg,yw=_.object({flipImageToFaceCamera:_.boolean().optional(),url:_.string()}),gw=_.object({type:_.enum(["Feature"]),properties:_.object({width:_.number(),height:_.number(),rotation:_.number().min(0).max(360).optional(),verticalOffset:_.number().optional()}),geometry:Ga});function D7(r,t,e){_.union([_.number(),_.string()]).parse(r),gw.parse(t),yw.parse(e)}p(D7,"validateImage");var kg=class kg{constructor(t){d(this,"mesh",new Wi);d(this,"imageMesh");d(this,"outline");d(this,"type","image");d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"position",new q);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};p(kg,"ImageComponent");var Kd=kg;var O7=Math.PI*2,L7=Math.PI/2,A7=Math.PI*1.5,vw=.01,bw=!1,_g=class _g extends z{constructor(e,i){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}createImageMesh(e,i,o,n=0,s){var y,g;let c=new Ui({transparent:!0,depthWrite:!1,side:Ho}),l=new ti(o.width,o.height),u=new Qd(l);u.visible=!1,(y=this.getOrDownloadImage(i))==null||y.then(v=>{c.map=v,c.needsUpdate=!0,c.map.colorSpace=jp,u.visible=!0,this.publish("image-loaded")}),u.userData.entityId=e,u.material=c;let f=this.convertTo3DMapPosition(s);if(bw){let v=new ce(new ti(o.width,o.height),new Ui({color:"gray"}));u.add(v);let I=new Z0;u.add(I),I.scale.set(10,10,10)}return u.renderOrder=1,u.position.set(f.x,f.y,n+vw),u.rotation.z=-le.degToRad((g=o.rotation)!=null?g:0),u}getOrDownloadImage(e){if(this.imageLoadingCache.has(e))return this.imageLoadingCache.get(e);{let i=new Promise(o=>{bo.getLoader().load(e,n=>{o(n)})});return this.imageLoadingCache.set(e,i),i}}flipIfNeeded(e,i){let n=(e.imageMesh.rotation.z-i+O7)%O7;(n>L7&&n<A7||n<-L7&&n>-A7)&&(e.imageMesh.rotation.z=e.imageMesh.rotation.z-Math.PI)}update(e){var s,c,l,u,f;let i,o,n;for(let y of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(y),(i==null?void 0:i.type)==="image")o=i.components[0],n=i.components[1],n.url&&o.imageMesh==null&&(o.imageMesh=this.createImageMesh(i.id,n.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)),o.imageMesh&&n.flipImageToFaceCamera&&this.flipIfNeeded(o,e);else if((i==null?void 0:i.type)==="geometry"){if(o=i.components[0],n=i.components[1],n.showImage&&((s=o.feature.properties)!=null&&s.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((c=o.feature.properties)==null?void 0:c.image.position)!=null){let g=this.createImageMesh(y,(l=o.feature.properties)==null?void 0:l.image.path,(u=o.feature.properties)==null?void 0:u.image,n.height,(f=o.feature.properties)==null?void 0:f.image.position);o.mesh.parent.add(g),o.imageMesh=g}o.imageMesh&&(o.visible?n.showImage&&!o.imageMesh.visible?o.imageMesh.visible=!0:!n.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1):o.imageMesh.visible=!1,n.flipImageToFaceCamera&&this.flipIfNeeded(o,e))}}};p(_g,"ImageSystem");var eh=_g;m();var So,Rg=class Rg extends z{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);C(this,So,void 0);d(this,"update",p((e=!1)=>{e||(a(this,So)&&cancelAnimationFrame(a(this,So)),P(this,So,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new Q(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new Q(e.x/1.2,e.y/1.2),o=new Q(e.x+(e.x-i.x),i.y),n=new Q(i.x,e.y+(e.y-i.y)),s=new Q(o.x,n.y),c=new Q(e.x,e.y/1.5),l=new Q(e.x,e.y+(e.y-c.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[e,c,l,i,o,n,s].map((u,f)=>{if(this.debugRaycasters){let x=document.createElement("div");x.style.position="absolute",x.style.top=u.y+"px",x.style.left=u.x+"px",x.style.width="10px",x.style.height="10px",x.style.backgroundColor="red",this.debugEl.append(x)}let y=u.x/this.state.canvasWidth*2-1,g=-(u.y/this.state.canvasHeight)*2+1,v=new Q(y,g),I=new Er;return I.setFromCamera(v,this.camera),[I,v,f===0?10:f<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let o of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(o),i!=null&&(e=i.components[0],e instanceof ct&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let n=new ce(e.geometry);n.userData={entityId:i.id},e.focusMesh=n}this.focusableEntities.add(e.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.collisions.clear();for(let[i,o]of this.raycasters)i.setFromCamera(o,this.camera);for(let[i,o,n]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var l;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let u=c.object.userData.entityId,f=(l=this.collisions.get(u))!=null?l:0;this.collisions.set(u,f+n)}});let e=Array.from(this.collisions,([i,o])=>({entityId:i,weight:o})).sort((i,o)=>o.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){a(this,So)&&cancelAnimationFrame(a(this,So)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};So=new WeakMap,p(Rg,"GeometryInFocusSystem");var th=Rg;m();m();m();m();function nc(r,t){t===void 0&&(t={});var e=xa(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return Cw(e,t);case"MultiPolygon":return Sw(e,t);default:throw new Error("invalid poly")}}p(nc,"default");function Cw(r,t){t===void 0&&(t={});var e=xa(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{};return F7(i,o)}p(Cw,"polygonToLine");function Sw(r,t){t===void 0&&(t={});var e=xa(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{},n=[];return i.forEach(function(s){n.push(F7(s,o))}),jo(n)}p(Sw,"multiPolygonToLine");function F7(r,t){return r.length>1?M0(r,t):Kr(r[0],t)}p(F7,"coordsToLine");function xw(r,t){var e=!0;return Pr(r,function(i){Pr(t,function(o){if(e===!1)return!1;e=Iw(i.geometry,o.geometry)})}),e}p(xw,"booleanDisjoint");function Iw(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!ww(r.coordinates,t.coordinates);case"LineString":return!B7(t,r);case"Polygon":return!fi(r,t)}break;case"LineString":switch(t.type){case"Point":return!B7(r,t);case"LineString":return!Mw(r,t);case"Polygon":return!k7(t,r)}break;case"Polygon":switch(t.type){case"Point":return!fi(t,r);case"LineString":return!k7(r,t);case"Polygon":return!Pw(t,r)}}return!1}p(Iw,"disjoint");function B7(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(Tw(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}p(B7,"isPointOnLine");function Mw(r,t){var e=ka(r,t);return e.features.length>0}p(Mw,"isLineOnLine");function k7(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var o=i[e];if(fi(o,r))return!0}var n=ka(t,nc(r));return n.features.length>0}p(k7,"isLineInPoly");function Pw(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var o=i[e];if(fi(o,t))return!0}for(var n=0,s=t.coordinates[0];n<s.length;n++){var c=s[n];if(fi(c,r))return!0}var l=ka(nc(r),nc(t));return l.features.length>0}p(Pw,"isPolyInPoly");function Tw(r,t,e){var i=e[0]-r[0],o=e[1]-r[1],n=t[0]-r[0],s=t[1]-r[1],c=i*s-o*n;return c!==0?!1:Math.abs(n)>=Math.abs(s)?n>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:s>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}p(Tw,"isPointOnLineSegment");function ww(r,t){return r[0]===t[0]&&r[1]===t[1]}p(ww,"compareCoords");var _7=xw;function Ng(r,t){var e=!1;return Pr(r,function(i){Pr(t,function(o){if(e===!0)return!0;e=!_7(i.geometry,o.geometry)})}),e}p(Ng,"booleanIntersects");var Gg=class Gg{constructor(t){d(this,"dirty",!0);d(this,"map");d(this,"stylesheetId","");d(this,"userHiddenLayers",new Set);d(this,"hiddenLayersInStyle",new Set);d(this,"centerPoint");d(this,"bbox");d(this,"polygons");d(this,"handleRender",p(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let t=[];if(this.centerPoint){let i=this.map.project(this.centerPoint),o=this.map.queryRenderedFeatures(i,{layers:Array.from(this.hiddenLayersInStyle)});for(var e of o)t.push(["!=",["id"],e.id])}else if(this.bbox&&this.polygons){let i=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(i.length>0){for(let o of i)if(o.geometry!=null&&"coordinates"in o.geometry){let n=Np(o.geometry.coordinates);for(let s of this.polygons)if(Ng(s,n)){t.push(["!=",["id"],o.id]);break}}}}t.length>0&&(this.hiddenLayersInStyle.forEach(i=>{this.map.setFilter(i,["all",...t])}),this.dirty=!1)},"handleRender"));d(this,"handleStyleChange",p(t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let o=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!o||o!==this.stylesheetId)&&(this.stylesheetId=o,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,e,i){this.bbox=t,this.polygons=e.reduce((o,n)=>(n.geometry.type==="Polygon"?o.push(Np(n.geometry.coordinates)):n.geometry.type==="MultiPolygon"&&o.push(...n.geometry.coordinates.map(s=>Np(s))),o),[]);for(let o of i)this.userHiddenLayers.add(o);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};p(Gg,"OutdoorLayers");var rh=Gg;m();m();m();var Vg="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 jg='#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 R7="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 Lw=new zn;function N7(r,t,e){let{nearRadius:i,farRadius:o,accentColor:n,completeFraction:s,isVertical:c}=t,{color:l}=e,u=!0,f=0,y=1/0,g=t.displayArrowsOnPath,v=!c,I=!0,x=g,b=i/2+Aw,S=0;r[0].z+=b;for(let ee=1;ee<r.length;++ee){r[ee].z+=b;let se=r[ee].x-r[ee-1].x,ye=r[ee].z-r[ee-1].z;if(c)S+=Math.sqrt(se*se+ye*ye);else{let xt=r[ee].y-r[ee-1].y;S+=Math.sqrt(se*se+xt*xt+ye*ye)}}if(!c){let ee=b-.01;r.push(r[r.length-1].clone().setZ(ee)),r.unshift(r[0].clone().setZ(ee))}let w=new A0;x&&(w=Lw.load(R7),w.colorSpace=jp);let T=new Ze(l),E=new Ze(n),D={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Q(1,1)},cameraParameters:{type:"v2",value:new Q(f,0)},complete:{type:"f",value:u?0:1},color:{type:"c",value:T},pathLength:{type:"f",value:S},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:f},farZoom:{type:"f",value:y},pulseColor:{type:"c",value:E},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:w},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:I},opacityMultiplier:{type:"f",value:1}},A=new j0(r);A.curveType="catmullrom",A.tension=0;let R=30,N=8,B=R*r.length,H=new U0(A,B,i,N,!1),G=new Float32Array(H.attributes.position.count);for(let ee=r.length;ee<G.length;ee++)G[ee]=ee;H.setAttribute("vertexIndex",new Uo(G,1));let $=new Float32Array(H.attributes.position.count),J=new Uo($,1);for(let ee=0;ee<=B;ee++)for(let se=0;se<=N;++se)J.setX(ee*(N+1)+se,ee/B);H.setAttribute("pathDistance",J);let he=new Float32Array(H.attributes.normal.count*3),Se=new Uo(he,3);for(let ee=0;ee<B;ee++){let se=H.tangents[ee];for(let ye=0;ye<=N;++ye)Se.setXYZ(ee*(N+1)+ye,se.x,se.y,se.z)}H.setAttribute("pathTangent",Se);let Ge=new Float32Array(H.attributes.normal.count*3),Lt=new Uo(Ge,3);for(let ee=0;ee<B;ee++){let se=H.tangents[ee];var me,Fe,xe;c?(me=se.x*se.y,Fe=-1+se.y*se.y,xe=se.z*se.y):(me=-se.x*se.z,Fe=-se.y*se.z,xe=1-se.z*se.z);let ye=Math.sqrt(me*me+Fe*Fe+xe*xe);ye===0&&(ye=1);let xt=me/ye,Un=Fe/ye,Bs=xe/ye;for(let Ir=0;Ir<=N;++Ir)Lt.setXYZ(ee*(N+1)+Ir,xt,Un,Bs)}H.setAttribute("pathNormal",Lt);let st=new Xo({uniforms:D,vertexShader:Vg,fragmentShader:jg});st.transparent=!0,st.alphaTest=.5,D.resolution.value.x=1,D.resolution.value.y=1,D.vertexes.value=G.length,D.arrowTexture.value.wrapS=Rs,D.arrowTexture.value.wrapT=Rs,D.arrowTexture.value.anisotropy=16,D.complete.value=s;let $t=new ce(H,st),et=$t.clone(),lt={...D,opacityMultiplier:{type:"f",value:.25}};lt.complete.value=1,et.material=new Xo({uniforms:lt,vertexShader:Vg,fragmentShader:jg}),et.material.transparent=!0,et.material.alphaTest=.5,et.material.depthWrite=!1,et.material.depthTest=!1,et.renderOrder=1,lt.resolution.value.x=1,lt.resolution.value.y=1,lt.vertexes.value=G.length,lt.arrowTexture.value.wrapS=Rs,lt.arrowTexture.value.wrapT=Rs,lt.arrowTexture.value.anisotropy=16,lt.complete.value=s,$t.userData=et.userData=t.mesh.userData;let Qr=t.mesh;Qr.add($t),Qr.add(et),H.computeBoundingBox();let Gi=new q;return H.boundingBox.getCenter(Gi),{mesh:Qr,material:st,center:Gi}}p(N7,"buildPath");var Aw=.15;var Hg=class Hg extends z{constructor(e,i,o){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=o}update(e,i,o){let n,s=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="path"&&n.components[0].type==="path"){let l=n.components[0],u=n.components[1],f=l.isVertical&&this.altitudeDirty;if(!(l instanceof Co))continue;if(l.dirty||f){if(l.mesh.parent!=null)for(let g=l.mesh.children.length-1;g>=0;g--)ze(l.mesh.children[0]);let y=[];if(l.feature.features.forEach(g=>{let v=g.geometry.coordinates[2]||0,I;if(g.properties.parentId&&(I=this.getParentContainer(g.properties.parentId,!0),I!=null&&I.altitude!=null&&(v+=I.altitude,l.isVertical=!0)),!g.properties.parentId||I!=null&&I.visible){let x=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],v);y.push(x)}}),y.length>1){let{mesh:g,material:v,center:I}=N7(y,l,{color:u.color});l.mesh=g,l.material=v,l.position=I}l.dirty=!1}u.dirty&&(l.mesh.children.forEach(y=>{y.material.uniforms.color.value.set(u.color),y.material.needsUpdate=!0}),l.mesh.position.z=u.altitude,u.dirty=!1),l.material&&(l.mesh.children.forEach(y=>{let g=y.material.uniforms;g.nearZoom.value=e,g.farZoom.value=i,g.cameraParameters.value.x=o,l.materialDirty&&(g.nearRadius.value=l.nearRadius,g.displayArrowsOnPath.value=l.displayArrowsOnPath,g.farRadius.value=l.farRadius,g.pulseColor.value.set(l.accentColor),g.complete.value=l.completeFraction),y.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(y=>{y.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,y.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};p(Hg,"PathSystem");var ac=Hg;m();var We,Za,fr,Ug=class Ug{constructor(t){d(this,"rendererState");d(this,"dirty",!1);C(this,We,void 0);C(this,Za,void 0);C(this,fr,void 0);this.rendererState=t}updateOne(t){if(t instanceof Oe&&t.components[0]instanceof ct&&t.components[1]instanceof Dr&&t.parentObject3D instanceof Kt&&(P(this,We,t.components[0]),P(this,fr,t.components[1]),a(this,We).detached&&a(this,We).dirty&&a(this,We).geometry!=null&&a(this,We).material!=null)){P(this,Za,t.parentObject3D),a(this,We).visible=!1;let e=new Ze(a(this,fr).color),i=new _2({color:e,side:Ho,opacity:a(this,fr).opacity||1,transparent:a(this,fr).opacity!==void 0?a(this,fr).opacity<1:!1},1,a(this,We).material.repeatYFactor),o=new $0(1,a(this,We).geometry.attributes.position.count||0,0,i),n=o.addGeometry(a(this,We).geometry);o.addInstance(n),o.userData={entities:{0:t.id},detached:!0},a(this,We).instanceIndex=n,a(this,We).material.setColor(a(this,We).instanceIndex,e,a(this,fr).topColor?new Ze(a(this,fr).topColor):e),a(this,We).mesh=o,a(this,We).material=i,a(this,Za).add(o),a(this,We).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,We,void 0),P(this,Za,void 0),P(this,fr,void 0)}};We=new WeakMap,Za=new WeakMap,fr=new WeakMap,p(Ug,"MeshDetachmentSystem");var ih=Ug;m();m();function G7(r,t,e){var i;if(r.geometry!=null){let o=t||1e-4,n=o/r.currentHeight,s=o/e;r.geometry.scale(1,1,n),r.material&&(r.material.repeatYFactor=s),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=o}}p(G7,"updateHeight");var vn,xo,Xg=class Xg{constructor(t){d(this,"rendererState");d(this,"dirty",!1);C(this,vn,void 0);C(this,xo,void 0);this.rendererState=t}updateOne(t){var e;t instanceof Oe&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(P(this,vn,t.components[0]),P(this,xo,t.components[1]),t.type==="geometry"&&a(this,xo).height!==a(this,vn).currentHeight&&G7(a(this,vn),a(this,xo).height,a(this,xo).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,vn,void 0),P(this,xo,void 0)}};vn=new WeakMap,xo=new WeakMap,p(Xg,"MeshModificationSystem");var oh=Xg;m();var Fw={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1},Wg=class Wg{constructor(t){d(this,"state",Fw);d(this,"core");this.core=t}update(t){let e={};for(let[i,o]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=o,e[i]=o);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1))}};p(Wg,"Debug");var nh=Wg;m();var ah=9,Bw=!1,V7=.1;function kw(r,t,e){for(let i=0;i<t;i++){let o=(e&16711680)>>16,n=(e&65280)>>8,s=e&255;r[i*3]=o/255,r[i*3+1]=n/255,r[i*3+2]=s/255}}p(kw,"fillArrayWithColor");var Yg=class Yg{constructor(t,e,i){d(this,"state");d(this,"renderer");d(this,"renderService");d(this,"pickingTexture");d(this,"pickingMaterial");d(this,"pixelBuffer");d(this,"width",0);d(this,"height",0);d(this,"scale",1/2);d(this,"color",1);d(this,"convertTo3DMapPosition");d(this,"destroyed",!1);d(this,"enabled",!1);d(this,"resize",p(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new B0(this.width,this.height,{format:O0,type:D0,internalFormat:"RGBA"})},"resize"));d(this,"shouldShowByXY",p((t,e,i)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-e-1)*this.width,n=this.pixelBuffer[o*4],s=this.pixelBuffer[o*4+1],c=this.pixelBuffer[o*4+2];return(n<<16|s<<8|c)===i},"shouldShowByXY"));d(this,"activeOccluders",new Set);d(this,"update",p(()=>{if(!this.enabled||(this.activeOccluders.clear(),!this.pickingTexture||!this.pixelBuffer))return;let t,e;for(let o of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(o);if(n&&n instanceof Ie&&n.userData.occluderFeature!=null&&n.userData.occluderId!=null&&(this.activeOccluders.add(n.userData.occluderId),n.userData.occluderDirty)){if(t=n.userData.occluderFeature,t.geometry.type==="Polygon"){let s=Sd(t,this.convertTo3DMapPosition,{color:"white",height:V7});e=this.createOccluderMesh(s,n.userData.occluderId),n.add(e)}else if(t.geometry.type==="MultiPolygon"){let s=xd(t,this.convertTo3DMapPosition,{color:"white",height:V7});e=this.createOccluderMesh(s,n.userData.occluderId),n==null||n.add(e)}n.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let i=new Ze(1,1,1);this.renderer.setClearColor(i),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(ah),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),Bw?this.renderService.enabledLayers.add(ah):this.renderService.enabledLayers.delete(ah),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let o of this.state.geometry2DIdsInScene){let n=this.state.geometry2DMap.get(o);if(n&&(n==null?void 0:n.occluderId)!=null&&this.activeOccluders.has(n==null?void 0:n.occluderId)){let s=n.components[0].projection,c=Math.floor(s.x*this.scale),l=Math.floor(s.y*this.scale),u=this.shouldShowByXY(c,l,n.occluderId);n.components[0].isOccluded=!u}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=e,(i==null?void 0:i.renderer)==null)throw new Error("No Renderer");this.renderService=i,this.renderer=i.renderer,this.resize(),this.pickingMaterial=new Xo({glslVersion:L0,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,e){let i=t.attributes.position,o=new Float32Array(i.count*3);kw(o,i.count,e),t.setAttribute("color",new Uo(o,3))}createOccluderMesh(t,e){let i=new ce(t,this.pickingMaterial);return i.layers.set(ah),this.applyId(i.geometry,e),i.userData.occluderId=e,i}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};p(Yg,"Occlusion2DSystem");var sh=Yg;var j7=new Er;var{DEFAULT_PITCH:Jg,DEFAULT_BEARING:Qg,DEFAULT_ZOOM_LEVEL:Kg,DEFAULT_MIN_ZOOM_LEVEL:_w,DEFAULT_MAX_ZOOM_LEVEL:Rw}=dr,Nw=le.radToDeg(.6435011087932844),Le,Ae,bn,sc,za,Io,Cn,qa,lc,zg,F,ue,mr,Ee,jr,$e,O,cc,Ne,be,lh,H7,ch,U7,ph,X7,Mo,pc,uc,$a,uh,dc,hc,fc,Ja,mc,qg,Sn,yc,gt,vt,gc,$g,Qa,vc,e1=class e1 extends z{constructor(e,i={}){var g,v,I,x,b,S,w,T,E,D;super();C(this,lc);C(this,lh);C(this,ch);C(this,ph);C(this,mc);C(this,gc);d(this,"options");d(this,"container");d(this,"Debug");C(this,Le,void 0);C(this,Ae,void 0);C(this,bn,void 0);C(this,sc,void 0);C(this,za,void 0);C(this,Io,void 0);C(this,Cn,void 0);C(this,qa,void 0);d(this,"rendererDomElement");C(this,F,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ie("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:jl,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new pg,cameraObject:new Wh});d(this,"camera");C(this,ue,void 0);C(this,mr,void 0);C(this,Ee,void 0);C(this,jr,void 0);C(this,$e,void 0);C(this,O,{});C(this,cc,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");C(this,Ne,p(()=>{a(this,O).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));C(this,be,p(()=>{a(this,O).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));C(this,Mo,"standalone");C(this,pc,p(e=>Math.trunc(e*10)/10,"#round10"));C(this,uc,p(()=>{a(this,O).twoDDrawSystem.dirty=!0,V(this,lc,zg).call(this,qn()),a(this,O).watermarkSystem.dirty=!0,a(this,O).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));C(this,$a,p(()=>{a(this,F).canvasWidth=this.rendererDomElement.clientWidth,a(this,F).canvasHeight=this.rendererDomElement.clientHeight,V(this,lc,zg).call(this,qn()),a(this,Ja).call(this),V(this,ph,X7).call(this),a(this,O).cameraSystem.resize(this.canvasWidth,this.canvasHeight),a(this,O).cameraSystem.dirty=!0,a(this,O).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),a(this,O).htmlControlsSystem.resize(this.canvasWidth),a(this,O).geometryInFocusSystem.resize(),a(this,O).interactionSystem.resize(),a(this,O).occlusion2DSystem.resize(),this.render()},"#handleWindowResize"));C(this,uh,p(()=>{this.renderSync()},"#renderFull"));C(this,dc,new q);C(this,hc,p((e,i)=>{let o=this.mode==="standalone"?a(this,Ae):this.viewCamera;if(a(this,Ae).position.z+this.camera.elevation>i.z){a(this,dc).copy(i);let n=a(this,dc).project(o),s=(n.x+1)/2*this.canvasWidth-0/2,c=(-n.y+1)/2*this.canvasHeight-0/2,l=a(this,pc).call(this,s),u=a(this,pc).call(this,c);e.x=l,e.y=u}else e.x=-1e3,e.y=-1e3},"#project"));C(this,fc,p((e,i)=>{a(this,$e).setBufferSize(e,i),a(this,Ae).aspect=e/i,a(this,Ae).updateProjectionMatrix(),a(this,Ae).updateMatrixWorld(!0),a(this,za).x=e,a(this,za).y=i},"#setBufferSize"));C(this,Ja,p(()=>{var s;let e=a(this,F).canvasWidth=this.rendererDomElement.clientWidth,i=a(this,F).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(e*this.resolutionScale),n=Math.floor(i*this.resolutionScale);a(this,fc).call(this,o,n),(s=this.map)==null||s.resize(),a(this,F).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",p((e,i=!0)=>{if(!e)return i?a(this,F).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let o=a(this,F).geometry3DMap.get(e);return o instanceof Ie?o:(L.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?a(this,F).entityScene:void 0)}else if(e.type==="group-container"){let o=a(this,F).geometry3DMap.get(e.id);if(o instanceof Ie)return o}return i?a(this,F).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",p(()=>{a(this,O).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",p(()=>{a(this,O).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",p((e,i)=>{var l;let o=e/this.canvasWidth*2-1,n=-(i/this.canvasHeight)*2+1,s=new Q(o,n);j7.setFromCamera(s,a(this,Ae).clone());let c=(l=j7.intersectObject(a(this,Io),!1)[0])==null?void 0:l.point;return c!=null?this.convert3DMapPositionToCoordinate(c):void 0},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",p(e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o=new Q;return a(this,hc).call(this,o,i),{x:o.x,y:o.y}},"projectCoordinateToScreenXY"));d(this,"convert3DMapPositionToCoordinate",p(e=>{var n,s,c,l;let{lat:i,lon:o}=Yp((s=(n=a(this,F).center)==null?void 0:n[1])!=null?s:0,(l=(c=a(this,F).center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[o,i,e.z]},"convert3DMapPositionToCoordinate"));d(this,"setBackgroundColor",p((e,i)=>{a(this,$e).setBackgroundColor(e,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",p(()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,i),n=this.projectScreenXYToCoordinate(e,i);return o==null||n==null?void 0:_p(o,n)/e},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",p((e,i)=>{!this.map||(i==null?void 0:i.length)===0||(a(this,O).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())},"hideOutdoorLayersUnderPoint"));d(this,"hideOutdoorLayersIntersectingPolygons",p((e,i,o)=>{a(this,O).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,o),this.render()},"hideOutdoorLayersIntersectingPolygons"));C(this,Sn,new G0);C(this,yc,new Wn);d(this,"render",p(()=>{if(a(this,O).renderSystem!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return a(this,O).renderSystem.update()},"render"));d(this,"renderSync",p(()=>a(this,O).renderSystem.update(!0),"renderSync"));C(this,gt,Wo(()=>{this.publish("user-interaction-start",void 0)},0,!0));C(this,vt,Wo(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));d(this,"on",p((e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&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",p((e,i)=>{super.off(e,i)},"off"));d(this,"getCursor",p(()=>a(this,O).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",p(()=>{var e;a(this,O)&&(a(this,O).cameraSystem.off("user-dolly-start",a(this,gt)),a(this,O).cameraSystem.off("user-pan-start",a(this,gt)),a(this,O).cameraSystem.off("user-rotate-start",a(this,gt)),a(this,O).cameraSystem.off("user-zoom-start",a(this,gt)),a(this,O).cameraSystem.off("user-tilt-start",a(this,gt)),a(this,O).cameraSystem.off("user-pedestal-start",a(this,gt)),a(this,O).cameraSystem.off("user-dolly-end",a(this,vt)),a(this,O).cameraSystem.off("user-pan-end",a(this,vt)),a(this,O).cameraSystem.off("user-rotate-end",a(this,vt)),a(this,O).cameraSystem.off("user-zoom-end",a(this,vt)),a(this,O).cameraSystem.off("user-tilt-end",a(this,vt)),a(this,O).cameraSystem.off("user-pedestal-end",a(this,vt)),a(this,O).renderSystem.off("measure-canvas",a(this,Ja)),this.remove("__scene"),a(this,Ne).call(this),a(this,be).call(this),this.renderSync(),a(this,O).renderSystem.destroy(),a(this,O).cameraSystem.off("change",this.render),a(this,O).pathSystem.off("animate:path",this.render),a(this,O).cameraSystem.dispose(),a(this,O).exporterSystem.destroy(),a(this,O).outdoorLayersSystem.destroy(),a(this,O).drawSystem.destroy(),window.removeEventListener("resize",a(this,$a),!1),a(this,cc).removeEventListener("change",a(this,uc)),a(this,Cn)&&a(this,Cn).disconnect(),this._subscribers={},a(this,$e).destroy(),(e=a(this,Le))==null||e.traverse(i=>{ze(i),"dispose"in i&&typeof i.dispose=="function"&&i.dispose()}),P(this,Le,void 0),a(this,O).htmlControlsSystem.destroy(),a(this,O).collisionSystem.destroy(),a(this,O).interactionSystem.destroy(),a(this,O).domMutationSystem.destroy(),a(this,O).geometryInFocusSystem.destroy(),P(this,O,void 0),a(this,Mo)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(a(this,jr)),this.container.removeChild(a(this,ue)),P(this,$e,void 0))},"destroy"));C(this,Qa,new q);C(this,vc,new q);if(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,Mo,i.mode),this.map=i.map),a(this,F).entityScene.addEventListener("childadded",()=>{a(this,be).call(this),a(this,Ne).call(this)}),a(this,F).entityScene.addEventListener("childremoved",()=>{a(this,be).call(this),a(this,Ne).call(this)}),a(this,F).geometry3DMap.set(a(this,F).entityScene.userData.entityId,a(this,F).entityScene),i.center&&(a(this,F).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,V(this,lh,H7).call(this),V(this,ch,U7).call(this),a(this,O).htmlControlsSystem=new $d(this.container),a(this,Mo)!=="outdoors-overlay"&&a(this,O).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),M.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),P(this,$e,new pd({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(g=i.gl)==null?void 0:g.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:()=>{typeof i.onWebGLContextLost=="function"&&i.onWebGLContextLost()},onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),a(this,Ne).call(this),a(this,be).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(v=i.backgroundAlpha)!=null?v:1})),P(this,Le,new ji),a(this,Le).add(a(this,F).entityScene);let o=window.__THREE_DEVTOOLS__;M.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:a(this,Le)})),o.dispatchEvent(new CustomEvent("observe",{detail:a(this,$e)}))),P(this,Ae,new Wh(Nw,this.aspect,50,1e5)),a(this,F).cameraObject=a(this,Ae),P(this,sc,new N0),a(this,Ae).renderOrder=999;let n=new Ns;n.add(a(this,Ae)),P(this,qa,new Ns),a(this,qa).add(n),a(this,Le).add(a(this,qa)),a(this,Ae).updateProjectionMatrix(),a(this,Ae).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=a(this,$e).domElement(),P(this,za,new Q);let s=new ti(1e6,1e6),c=new Jt({color:0,visible:!1});P(this,Io,new ce(s,c)),a(this,Le).add(a(this,Io)),(I=i.gl)!=null&&I.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",a(this,$a),!1),a(this,cc).addEventListener("change",a(this,uc)),typeof ResizeObserver=="function"&&((x=M.env)==null?void 0:x.NODE_ENV)!=="test"&&(P(this,Cn,new ResizeObserver(Wo(()=>{a(this,$a).call(this)},0))),(b=a(this,Cn))==null||b.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(S=globalThis.MappedinDebug)!=null&&S.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"),a(this,F).canvasWidth=this.rendererDomElement.clientWidth,a(this,F).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,u=this.canvasHeight;a(this,O).watermarkSystem=new zd(a(this,Ae),a(this,F),i==null?void 0:i.watermark),a(this,O).watermarkSystem.on("texture-loaded",this.render),a(this,F).shouldMeasureCanvas=!0,a(this,F).pixelRatio=this.resolutionScale,a(this,fc).call(this,Math.floor(l*this.resolutionScale),Math.floor(u*this.resolutionScale));let f=new Wp(16777215,.3*Math.PI);f.position.set(-150,-150,350),a(this,Le).add(f);let y=new W0(16777215,.741*Math.PI);a(this,Le).add(y),a(this,O).cameraSystem=new Ha(a(this,Ae),a(this,Le),a(this,$e).renderer,a(this,F),{mode:this.mode,canvasHeight:u,canvasWidth:l}),a(this,O).cameraSystem.on("user-dolly-start",a(this,gt)),a(this,O).cameraSystem.on("user-pan-start",a(this,gt)),a(this,O).cameraSystem.on("user-rotate-start",a(this,gt)),a(this,O).cameraSystem.on("user-zoom-start",a(this,gt)),a(this,O).cameraSystem.on("user-tilt-start",a(this,gt)),a(this,O).cameraSystem.on("user-pedestal-start",a(this,gt)),a(this,O).cameraSystem.on("user-dolly-end",a(this,vt)),a(this,O).cameraSystem.on("user-pan-end",a(this,vt)),a(this,O).cameraSystem.on("user-rotate-end",a(this,vt)),a(this,O).cameraSystem.on("user-zoom-end",a(this,vt)),a(this,O).cameraSystem.on("user-tilt-end",a(this,vt)),a(this,O).cameraSystem.on("user-pedestal-end",a(this,vt)),a(this,O).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),a(this,O).geometryInFocusSystem&&(a(this,O).geometryInFocusSystem.cameraDirty=!0),this.render()}),a(this,O).pathSystem=new ac(a(this,F),this.convertTo3DMapPosition,this.getParentContainer),a(this,O).pathSystem.on("animate:path",this.render),a(this,O).panBoundsSystem=new qd(a(this,F),a(this,O).cameraSystem),a(this,O).panBoundsSystem.on("update",()=>{let{panBounds:A,fov:R,convertAltitudeToZoomLevel:N}=a(this,O).cameraSystem;if(a(this,O).panBoundsSystem.autoMinZoomLevel){let B=R*Math.PI/180,H=Math.tan(B/2);if(A.radius<=0)return;let G=N(A.radius/H);this.camera.setMinZoomLevel(G)}}),this.camera=new Zd(this,a(this,O),a(this,F),a(this,Io)),this.camera.setZoomLevel((T=i.zoomLevel)!=null?T:Kg),this.camera.setBearing((E=i.bearing)!=null?E:Qg),this.camera.setPitch((D=i.pitch)!=null?D:Jg),this.camera.setMaxZoomLevel(Rw),this.camera.setMinZoomLevel(_w),a(this,O).domVisiblitySystem=new Dd(a(this,F),a(this,jr)),a(this,O).domMutationSystem=new Yd(a(this,F),a(this,jr)),a(this,O).domMutationSystem.on("dimensions-update",()=>{a(this,O).collisionSystem.collidersDirty=!0,this.render()}),a(this,O).domDrawSystem=new Xd(a(this,F)),a(this,O).collisionSystem=new ud(a(this,mr),a(this,F)),a(this,O).twoDDrawSystem=new Ld(a(this,F),a(this,Ee)),a(this,O).interactionSystem=new kl(this.rendererDomElement,a(this,F),a(this,Ae),a(this,Io),a(this,O).cameraSystem.isUserInteracting),a(this,O).interactionSystem.on("hover",this.render),a(this,O).interactionSystem.on("click",A=>{var R,N,B,H,G,$;if(((R=A.entity2D)==null?void 0:R.id)==="watermark"&&typeof a(this,O).watermarkSystem.options.onClick=="function"){a(this,O).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(A.position),geometry:A.entity3D?[(N=A.entity3D)==null?void 0:N.id]:[],paths:((B=A.entity3D)==null?void 0:B.components[0])instanceof Co?[A.entity3D.id]:[],markers:((H=A.entity2D)==null?void 0:H.components[0])instanceof Xi?[A.entity2D.id]:[],models:((G=A.entity3D)==null?void 0:G.components[0])instanceof go?[A.entity3D.id]:[],labels:(($=A.entity2D)==null?void 0:$.components[0])instanceof Zi?[A.entity2D.id]:[],containers:Array.isArray(A.groupContainers)?A.groupContainers.map(J=>J.userData.entityId):[],pointerEvent:A.pointerEvent})}),a(this,O).interactionSystem.on("hover",A=>{var R,N,B,H,G,$;A.position&&((R=A.entity2D)==null?void 0:R.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(A.position),geometry:A.entity3D?[(N=A.entity3D)==null?void 0:N.id]:[],paths:((B=A.entity3D)==null?void 0:B.components[0])instanceof Co?[A.entity3D.id]:[],markers:((H=A.entity2D)==null?void 0:H.components[0])instanceof Xi?[A.entity2D.id]:[],models:((G=A.entity3D)==null?void 0:G.components[0])instanceof go?[A.entity3D.id]:[],labels:(($=A.entity2D)==null?void 0:$.components[0])instanceof Zi?[A.entity2D.id]:[],containers:Array.isArray(A.groupContainers)?A.groupContainers.map(J=>J.userData.entityId):[]})}),a(this,O).geometryInFocusSystem=new th(a(this,F),a(this,Ae)),a(this,O).geometryInFocusSystem.on("geometry-in-focus",A=>{this.publish("geometry-in-focus",A)}),a(this,O).twoDVisiblitySystem=new Fd(a(this,F)),a(this,O).drawSystem=new Ad(a(this,F)),a(this,O).drawSystem.on("texture-loaded",this.render),a(this,O).stackSystem=new kd(a(this,F)),a(this,O).twoDProjectionSystem=new Od(a(this,F),a(this,hc)),a(this,O).exporterSystem=new _l(a(this,F)),a(this,O).meshOptimizationSystem=new Ed(a(this,F),this.convertTo3DMapPosition),a(this,O).meshOptimizationSystem.on("model-loaded",this.render),a(this,O).meshDetachmentSystem=new ih(a(this,F)),a(this,O).meshModificationSystem=new oh(a(this,F)),a(this,O).customGeometrySystem=new Jd(a(this,F),this.convertTo3DMapPosition),a(this,O).outlineInterpolationSystem=new G2(a(this,F)),a(this,O).renderSystem=new Bd(a(this,$e),a(this,F),this.mode,a(this,Le),a(this,Ae),this.viewCamera,a(this,O)),a(this,O).imageSystem=new eh(a(this,F),this.convertTo3DMapPosition),a(this,O).text3DSystem=new h2(a(this,F),this.convertTo3DMapPosition),a(this,O).text3DSystem.on("render",this.render),a(this,O).imageSystem.on("image-loaded",this.render),a(this,O).renderSystem.on("pre-render",()=>this.publish("pre-render")),a(this,O).renderSystem.on("post-render",()=>this.publish("post-render")),a(this,O).renderSystem.on("measure-canvas",a(this,Ja)),a(this,O).outdoorLayersSystem=new rh(this.map),a(this,O).occlusion2DSystem=new sh(a(this,F),this.convertTo3DMapPosition,a(this,$e)),i.occlusionEnabled&&a(this,O).occlusion2DSystem.enable(),this.Debug=new nh(this),i.environment!==!1&&P(this,bn,V(this,gc,$g).call(this)),a(this,uh).call(this)}get viewCamera(){return a(this,sc)}get canvasWidth(){return a(this,F).canvasWidth}get canvasHeight(){return a(this,F).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:qn()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return a(this,Mo)}addGroupContainer(e,i,o){if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let n=new Ie(e);n.addEventListener("childadded",()=>{a(this,be).call(this),a(this,Ne).call(this)}),n.addEventListener("childremoved",()=>{a(this,be).call(this),a(this,Ne).call(this)}),(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&n.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&Qt(n,i.interactive,a(this,F)),a(this,F).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Ie&&s.addEntity(n),a(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,o){if(a(this,F).geometry3DMap.has(e))L.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let n=new Ie(e);n.addEventListener("childadded",()=>{a(this,be).call(this),a(this,Ne).call(this)}),n.addEventListener("childremoved",()=>{a(this,be).call(this),a(this,Ne).call(this)}),n.components[0]=new Wd,(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),a(this,F).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Ie&&s.addEntity(n)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,o,n,s){if(a(this,F).geometry3DMap.has(e))L.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new Ya(i,o),l=new Oe(c,new Dr(n));l.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},a(this,F).geometry3DMap.set(l.id,l);let u=this.getParentContainer(s);u instanceof Ie&&u.addEntity(l),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,o,n){var s,c;if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let l=new Kt(e,new Zh(o));l.addEventListener("childadded",()=>{a(this,be).call(this),a(this,Ne).call(this)}),l.addEventListener("childremoved",()=>{a(this,be).call(this),a(this,Ne).call(this)}),l.userData.dirty=!0,a(this,F).geometry3DMap.set(e,l);for(let f of i.features){if(f.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(f.geometry.type))continue;let y=(f==null?void 0:f.id)||((s=f==null?void 0:f.properties)==null?void 0:s.id)||ge(),{visible:g,...v}=o||{color:q0},I=a(this,O).meshOptimizationSystem.createEntityFromFeature(y,f,v);a(this,F).geometry3DMap.set(y,I),l.userData.entities3D.add(y)}l.setVisible((c=o==null?void 0:o.visible)!=null?c:!0),(o==null?void 0:o.altitude)!=null&&l.setAltitude(o.altitude);let u=this.getParentContainer(n);u instanceof Ie&&u.addEntity(l),a(this,be).call(this),this.render()}else L.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return a(this,O).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,i){let o=this.getParentContainer(i),n=a(this,O).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(e,n),n}addImage(e,i,o,n){try{D7(e,i,o)}catch(s){L.error(s);return}if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let s=new Kd(i),c=new Oe(s,new Dr(o));c.id=e||ge(),s.mesh.userData={entityId:c.id,type:"path"},a(this,F).geometry3DMap.set(c.id,c);let l=this.getParentContainer(n);l instanceof Ie&&l.addEntity(c),a(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,o,{parent:n,onComplete:s}={}){var c,l;try{u7(e,i,o)}catch(u){L.error(u);return}if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let u=new Kt(e,new Zh(o));u.addEventListener("childadded",()=>{a(this,be).call(this),a(this,Ne).call(this)}),u.addEventListener("childremoved",()=>{a(this,be).call(this),a(this,Ne).call(this)}),a(this,F).geometry3DMap.set(e,u),u.userData.dirty=!0,u.userData.modelURL=o.url;for(let y of i.features){let g=y.id||y.properties.id||ge(),v=a(this,O).meshOptimizationSystem.createModelFromFeature(g,y,o);(y.properties.interactive!==void 0||o.interactive!=null)&&Qt(v,(c=y.properties.interactive)!=null?c:o.interactive,a(this,F)),a(this,F).geometry3DMap.set(g,v),u.userData.entities3D.add(g)}let f=this.getParentContainer(n);f instanceof Ie&&f.addEntity(u),a(this,be).call(this),(l=this.render())==null||l.then(s)}else L.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,o,n){var c;let s=o==null?void 0:o.id;try{Q0(e,i,o||{})}catch(l){L.error(l);return}if(s===void 0||!a(this,F).geometry2DMap.has(s)&&!a(this,F).geometry3DMap.has(s)){let l=V(this,mc,qg).call(this,e,new Xi(i,o),o==null?void 0:o.occluderId);l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&o.interactive!=="pointer-events-auto"&&Qt(l,o==null?void 0:o.interactive,a(this,F)),(c=this.getParentContainer(n))==null||c.addEntity(l),this.render()}else L.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}labelText3D(e,i,o={}){var u,f;try{if(!i||!e)throw new Error("content and meshGeometryId are required");f2.parse(o)}catch(y){L.error(y);return}let n=a(this,F).geometry3DMap.get(e);if((n==null?void 0:n.type)!=="geometry"){L.error(".labelText3D failed: target incorrect");return}let s=n==null?void 0:n.components[0];if(!s.feature.properties.textArea)return;if(s.textEntityId){let y=a(this,F).geometry3DMap.get(s.textEntityId);if((y==null?void 0:y.type)!=="text3d"){L.error(".labelText3D failed: existing text3d not found");return}return{id:y.id,type:y.type}}let c=new m2({type:"Feature",geometry:{coordinates:(u=s.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:i,id:ge()}});c.polygonEntityId=e;let l=new Oe(c,new qp(o==null?void 0:o.appearance));return s.textEntityId=l.id.toString(),c.mesh.userData.entityId=l.id.toString(),c.mesh.userData.type="text3d",a(this,F).geometry3DMap.set(l.id.toString(),l),o.parentId&&((f=this.getParentContainer(o.parentId))==null||f.addEntity(l)),this.render(),{id:l.id,type:"text3d"}}addLabel2D(e,i,o,n){var c;let s=o==null?void 0:o.id;try{d2(e,i,o||{})}catch(l){L.error(l);return}if(s===void 0||!a(this,F).geometry2DMap.has(s)&&!a(this,F).geometry3DMap.has(s)){let l=V(this,mc,qg).call(this,e,new Zi(i,o||{},a(this,F)),o==null?void 0:o.occluderId);l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&Qt(l,o==null?void 0:o.interactive,a(this,F));let u=typeof n=="string"||typeof n=="number"?a(this,F).geometry3DMap.get(n):void 0;u instanceof Oe?u.addEntity(l):(c=this.getParentContainer(n))==null||c.addEntity(l),a(this,Ne).call(this),this.render()}else L.error("Label2D with ID '".concat(s,"' already exists. The label cannot be added."));return{id:s,type:"label"}}addPath(e,i={},o){var l;try{f7(e,i||{})}catch(u){L.error(u);return}let n=new Co(e,A2(i)),s=new Oe(n,new Dr({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));s.id=(i==null?void 0:i.id)||ge(),n.mesh.userData={entityId:s.id,type:"path"},a(this,F).geometry3DMap.set(s.id,s),(i==null?void 0:i.interactive)!=null&&Qt(s,i==null?void 0:i.interactive,a(this,F));let c=this.getParentContainer(o);return c instanceof Ie&&c.addEntity(s),a(this,be).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(e){a(this,O).watermarkSystem.options=e,a(this,O).watermarkSystem.dirty=!0,a(this,O).collisionSystem.collidersDirty=!0,this.render()}remove(e){var o,n;let i;if(typeof e=="string"||typeof e=="number"?(i=a(this,F).geometry2DMap.get(e),i==null&&(i=a(this,F).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=a(this,F).geometry2DMap.get(e.id),i==null&&(i=a(this,F).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")a(this,F).geometry3DMap.delete(i.id),i.object3d&&ze(i.object3d);else if(i.type==="group-container"){a(this,F).geometry3DMap.delete(i.userData.entityId);for(let s of i.childrenIds.values())this.remove(s),i.userData.entities2D.delete(s);ze(i)}else if(i.type==="geometry-group"){a(this,F).geometry3DMap.delete(i.userData.entityId);for(let s of i.userData.entities3D.values())this.remove(s),i.userData.entities3D.delete(s);ze(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let s=i.components[0];if(i.entities2D.size>0){for(let c of i.entities2D.values())this.remove(c);i.removeAllEntities()}i.object3d&&(((o=i.parentObject3D)==null?void 0:o.type)==="geometry-group"&&i.parentObject3D.userData.entities3D.delete(i.id),ze(i.object3d)),"outline"in s&&s.outline&&ze(s.outline),"focusMesh"in s&&s.focusMesh!=null&&ze(s.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),a(this,F).geometry3DMap.delete(i.id)}else if(i.type==="marker"||i.type==="label"){if(((n=i.parentObject3D)==null?void 0:n.type)==="geometry-group"){let s=i.object3d.userData.parentEntityId;if(s){let c=a(this,F).geometry3DMap.get(s);c instanceof Oe&&c.removeEntity(i)}}i.object3d&&ze(i.object3d),i.type==="label"&&delete a(this,O).twoDDrawSystem.textCache[i.id],a(this,F).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&ze(i.object3d),a(this,F).geometry3DMap.delete(i.id);else if(i.type==="text3d"){ze(i.object3d);let{batchedText:s,textMesh:c,polygonEntityId:l}=i.components[0];if(c&&(s&&s.removeText(c),ze(c)),l){a(this,O).text3DSystem.remove(l);let u=a(this,F).geometry3DMap.get(l);(u==null?void 0:u.type)==="geometry"&&(u.components[0].textMesh=void 0,u.components[0].textEntityId=void 0)}a(this,F).geometry3DMap.delete(i.id)}a(this,be).call(this),a(this,Ne).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return a(this,Le)}async setEnvironment(e){if(a(this,Le))if(e==="basic"){a(this,bn)||P(this,bn,V(this,gc,$g).call(this));let i=await a(this,bn);a(this,Le).environment=i}else a(this,Le).environment=null}getEnvironment(){var e;return(e=a(this,Le))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return a(this,O).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(a(this,O).renderSystem.threeDdirty||a(this,O).renderSystem.twoDdirty)&&this.renderSync();let i=new ei;if(e==null)i.setFromObject(a(this,F).entityScene);else{let o=Vs(a(this,F),e);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let n=o.components[0],s=n instanceof ct?n.geometry:void 0;n.mesh instanceof Up&&s?(s.computeBoundingBox(),s.boundingBox&&i.union(s.boundingBox)):i.setFromObject(o.object3d)}else((o==null?void 0:o.type)==="geometry-group"||(o==null?void 0:o.type)==="group-container")&&(o==null?void 0:o.userData.entityId)!=null&&i.setFromObject(o)}if(p2(i))return e2(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var o,n,s,c,l;if(e==null)return{type:"map-view",hoverColor:a(this,F).hoverColor,text3dHoverColor:a(this,F).text3dHoverColor};let i=Vs(a(this,F),e);if((i==null?void 0:i.type)==="custom-geometry"){let u=i.components[0],f=i.components[1];return{id:i.id,type:"custom-geometry",visible:f.visible,altitude:f.altitude,parent:(o=i.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(u.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let u=[];for(let y of i.userData.entities3D.values()){let g=this.getState(y);((g==null?void 0:g.type)==="geometry"||(g==null?void 0:g.type)==="model")&&u.push(g)}let f=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:f.opacity,color:f.color,initialColor:f.initialColor,height:f.height,altitude:i.altitude,topColor:f.topColor,outline:f.outline,shading:f.shading,texture:f.texture,topTexture:f.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(y=>a(this,F).geometry3DMap.get(y)).every(y=>y&&y.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(y=>this.getState(y)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(u=>this.getState(u)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let u=i.components[0],f=i.object3d.parent,y=f==null?void 0:f.userData.entityId;return{id:i.id,type:"label",text:u.text||"",parent:{id:y,type:f==null?void 0:f.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:u.enabled,visible:u.visible,initialRank:Gs(u.initialRank),options:{rank:Gs(u.rank),appearance:u.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let u=i.components[0],f=i.object3d.parent,y=f==null?void 0:f.userData.entityId;return{id:i.id,type:"marker",enabled:u.enabled,visible:u.visible,anchor:u.options.anchor,dynamicResize:u.options.dynamicResize,parent:{id:y,type:f==null?void 0:f.type},position:this.convert3DMapPositionToCoordinate(i.position),element:u.containerEl,initialRank:Gs(u.initialRank),options:{rank:Gs(u.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:u,hoverColor:f,initialColor:y,initialTopColor:g,topColor:v}=i.components[1],I=i.components[0],x=i.components[1],b=i.components[2];return{id:i.id,type:"geometry",opacity:x.opacity,initialColor:y,color:u,focusable:I.focusable,initialTopColor:g,topColor:v,hoverColor:f,hovered:!!(b!=null&&b.hover),height:x.height,visible:x.visible,outline:x.outline,showImage:x.showImage,texture:x.texture,topTexture:x.topTexture,flipImageToFaceCamera:x.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(I.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let u=i.components[0],f=i.components[1],y=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(u.position),interactive:y!=null,material:f.material,visible:f.visible,verticalOffset:f.verticalOffset,opacity:f.opacity}}else if((i==null?void 0:i.type)==="path"){let u=i.components[0],f=i.components[2],y=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(u.position),visible:y.visible,interactive:f!=null,completeFraction:u.completeFraction,color:y.color,accentColor:u.accentColor,nearRadius:u.nearRadius,farRadius:u.farRadius,animateArrowsOnPath:u.animateArrowsOnPath,displayArrowsOnPath:u.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let u=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(u.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"){F2(i);let u=i.components[0],f=i.components[1],{textMesh:y}=u,g=(n=u.mesh)==null?void 0:n.parent;g instanceof Ie&&((s=g.children.find(x=>x.type==="batchedtext"))==null||s.getWorldPosition(a(this,vc))),a(this,Qa).set(0,0,0);let v=y?y.getWorldPosition(a(this,Qa)):a(this,Qa);return Object.assign({},$n,f.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(v.add(a(this,vc))),visible:(c=u.visible)!=null?c:!1,content:(l=u.feature.properties.content)!=null?l:""})}else return}}setState(e,i){var n,s;if(typeof e=="object"&&i==null){"hoverColor"in e&&(a(this,F).hoverColor=(n=e.hoverColor)!=null?n:a(this,F).hoverColor),"text3dHoverColor"in e&&(a(this,F).text3dHoverColor=(s=e.text3dHoverColor)!=null?s:a(this,F).text3dHoverColor);return}let o=Vs(a(this,F),e);if(o!=null){if(o.type==="custom-geometry"){let c=a(this,F).geometry3DMap.get(o.id);if(c instanceof Oe&&c.components[0]instanceof Ya){let l=i;zi(o,l.visible),Jp(o,l.altitude),ef(o,l.position,this.convertTo3DMapPosition),tf(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let c=i;Qt(o,c.interactive,a(this,F))&&a(this,be).call(this),o.type==="path"&&(Jp(o,c.altitude),L2(o,c))}else if(o.type==="model"){let c=i;Qt(o,c.interactive,a(this,F))&&a(this,be).call(this),zi(o,c.visible),k2(o,c)}else if(o.type==="group-container"){let c=i;zi(o,c.visible)&&(a(this,O).outlineInterpolationSystem.dirty=!0,a(this,O).pathSystem.altitudeDirty=!0),Jp(o,c.altitude)&&(a(this,O).pathSystem.altitudeDirty=!0),Qt(o,c.interactive,a(this,F))&&a(this,be).call(this)}else if(o.type==="geometry-group"){let c=i;zi(o,c.visible)&&(a(this,O).outlineInterpolationSystem.dirty=!0),y2(o,a(this,F),c)&&(a(this,O).outlineInterpolationSystem.dirty=!0),of(o,c.outline)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),c.height!=null&&(Kh(o,a(this,F),c.height),a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),c.altitude!=null&&(o.setAltitude(c.altitude),o.userData.outlineDirty=!0),T2(o,c),g2(o,c.shading),P2(o,a(this,F),c.opacity)&&(o.userData.outlineDirty=!0,a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),Qt(o,c.interactive,a(this,F))&&(a(this,be).call(this),a(this,Ne).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof ct){let c=i;zi(o,c.visible)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),of(o,c.outline)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),v2(o,c),D2(o,c.focusable)&&(a(this,O).geometryInFocusSystem.focusablesDirty=!0),O2(o,c.renderOrder)&&(a(this,O).meshDetachmentSystem.dirty=!0),E2(o,c.opacity)&&(a(this,O).meshDetachmentSystem.dirty=!0,a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),rf(o,c.flipImageToFaceCamera),c.height!=null&&(Kh(o,a(this,F),c.height),a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),w2(o,c)&&(a(this,O).meshDetachmentSystem.dirty=!0),b2(o,c),I2(o,c.hoverColor),Qt(o,c.interactive,a(this,F)),M2(o,c.hovered)}a(this,be).call(this)}else if(o.type==="label"||o.type==="marker"){let c=i;x2(o,i,a(this,F)),S2(o,i,a(this,F))&&(a(this,Ne).call(this),a(this,O).domMutationSystem.dirty=!0),ef(o,c.position,this.convertTo3DMapPosition),tf(o,this.getParentContainer(c.parent,!1))&&(a(this,Ne).call(this),a(this,O).panBoundsSystem.dirty=!0),C2(o,c.enabled),zi(o,c.visible)}else if(o.type==="image"){let c=i;zi(o,c.visible),rf(o,c.flipImageToFaceCamera)}else o.type==="text3d"&&B2(o,i);this.render()}}convertTo3DMapPosition(e,i,o=0,n){var l,u,f,y,g;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(l=e[2])!=null?l:o,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:s,y:c}=Zp((f=(u=a(this,F).center)==null?void 0:u[1])!=null?f:0,(g=(y=a(this,F).center)==null?void 0:y[0])!=null?g:0,e,i);return n?(n.set(s,c,o),n):new q(s,c,o)}get backgroundColor(){return typeof a(this,$e).backgroundColor=="string"?a(this,$e).backgroundColor:"#".concat(a(this,$e).backgroundColor.getHexString())}get backgroundAlpha(){return a(this,$e).backgroundAlpha}getThreeRenderer(){return a(this,$e)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?c2(i):void 0}isInView(e){let i=Vs(a(this,F),e);if(a(this,yc).identity().multiply(a(this,Ae).projectionMatrix).multiply(a(this,Ae).matrixWorldInverse),a(this,Sn).setFromProjectionMatrix(a(this,yc)),i instanceof zh)return a(this,Sn).containsPoint(i.position);if(i instanceof Oe){let o=i==null?void 0:i.components[0];if(o instanceof Ya||o instanceof go)return a(this,Sn).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof ct){let n=new ei(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return a(this,Sn).intersectsBox(n)}}return!1}getSystems(){return a(this,O)}getInternalState(){return a(this,F)}getTweenGroup(){return a(this,F).tweenGroup}};Le=new WeakMap,Ae=new WeakMap,bn=new WeakMap,sc=new WeakMap,za=new WeakMap,Io=new WeakMap,Cn=new WeakMap,qa=new WeakMap,lc=new WeakSet,zg=p(function(e){var i;a(this,Mo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),a(this,F).pixelRatio=this.resolutionScale},"#setResolutionScale"),F=new WeakMap,ue=new WeakMap,mr=new WeakMap,Ee=new WeakMap,jr=new WeakMap,$e=new WeakMap,O=new WeakMap,cc=new WeakMap,Ne=new WeakMap,be=new WeakMap,lh=new WeakSet,H7=p(function(){P(this,ue,document.createElement("div")),a(this,ue).classList.add("mappedin__smart-collision-engine__container"),P(this,mr,document.createElement("canvas")),a(this,mr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(a(this,ue)),P(this,Ee,document.createElement("canvas")),a(this,Ee).classList.add("mappedin__smart-collision-engine__container"),a(this,Ee).width=a(this,ue).clientWidth*this.resolutionScale,a(this,Ee).height=a(this,ue).clientHeight*this.resolutionScale,a(this,Ee).style.width=a(this,ue).clientWidth+"px",a(this,Ee).style.height=a(this,ue).clientHeight+"px",a(this,ue).appendChild(a(this,mr)),a(this,ue).appendChild(a(this,Ee)),a(this,mr).width=a(this,ue).clientWidth,a(this,mr).height=a(this,ue).clientHeight,a(this,Ee).width=a(this,ue).clientWidth*this.resolutionScale,a(this,Ee).height=a(this,ue).clientHeight*this.resolutionScale,a(this,Ee).style.width=a(this,ue).clientWidth+"px",a(this,Ee).style.height=a(this,ue).clientHeight+"px"},"#renderEntity2DContainer"),ch=new WeakSet,U7=p(function(){P(this,jr,document.createElement("div")),a(this,jr).classList.add("mappedin-2d-entities"),Object.assign(a(this,jr).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(a(this,jr))},"#renderEntityDOMContainer"),ph=new WeakSet,X7=p(function(){a(this,Ee).width=a(this,ue).clientWidth*this.resolutionScale,a(this,Ee).height=a(this,ue).clientHeight*this.resolutionScale,a(this,Ee).style.width=a(this,ue).clientWidth+"px",a(this,Ee).style.height=a(this,ue).clientHeight+"px",a(this,mr).width=a(this,ue).clientWidth,a(this,mr).height=a(this,ue).clientHeight,a(this,Ee).width=a(this,ue).clientWidth*this.resolutionScale,a(this,Ee).height=a(this,ue).clientHeight*this.resolutionScale,a(this,Ee).style.width=a(this,ue).clientWidth+"px",a(this,Ee).style.height=a(this,ue).clientHeight+"px",a(this,O).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Mo=new WeakMap,pc=new WeakMap,uc=new WeakMap,$a=new WeakMap,uh=new WeakMap,dc=new WeakMap,hc=new WeakMap,fc=new WeakMap,Ja=new WeakMap,mc=new WeakSet,qg=p(function(e,i,o){let n=new zh(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||0));return o!=null&&(n.occluderId=o),a(this,F).geometry2DMap.set(n.id,n),n},"#createEntity2D"),Sn=new WeakMap,yc=new WeakMap,gt=new WeakMap,vt=new WeakMap,gc=new WeakSet,$g=p(async function(){return bo.load(kC).then(e=>{var i;return a(this,Le)&&((i=a(this,Le).environment)==null||i.dispose(),e.mapping=E0,a(this,Le).environment=e,this.render()),e})},"#loadEnvMap"),Qa=new WeakMap,vc=new WeakMap,p(e1,"Core");var Zg=e1,bc=Zg;m();function Gw(r,t){Vw(r,t)(r.getScene(),t),jw(r,t),t.addFolder("Export").add({export:async()=>{let s=await r.getCurrentSceneGLTF({binary:!0}),c=new Blob([s],{type:"application/octet-stream"});var l=document.createElement("a");document.body.appendChild(l),l.style.display="none";let u=window.URL.createObjectURL(c);l.href=u,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(u)}},"export");let o=t.addFolder("Camera"),n={get bearing(){return r.camera.bearing},set bearing(s){r.camera.setBearing(s)},get pitch(){return r.camera.pitch},set pitch(s){r.camera.setPitch(s)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(s){r.camera.setZoomLevel(s)}};o.add(n,"bearing",-359,359,1),o.add(n,"pitch",r.camera.minPitch,r.camera.maxPitch,1),o.add(n,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}p(Gw,"mountSceneGraphVisualizer");function Vw(r,t){let e=t;return p(function i(o,n){let s=n.addFolder("".concat([o.type]," ").concat(o.id.slice(0,16)));if(n.close(),o.type==="geometry"||o.type==="model"||o.type==="path"||o.type==="image"){let c={get height(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(o,{height:l})},set flipImageToFaceCamera(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="image"&&r.setState(o,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let u=r.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?l.visible:!1},set outline(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(o,{outline:l})},get outline(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{opacity:l})},get color(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?u2(l.color).toHexString():"#ffffff"},set color(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{color:l})},set interactive(l){let u=r.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"?l.interactive:!1},get completeFraction(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="path"&&r.setState(u,{completeFraction:l})},focus:()=>{}};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?r.camera.focusOn([l.position]):(l==null?void 0:l.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(l))}),s.add(c,"visible"),o.type==="image"?s.add(c,"flipImageToFaceCamera"):(s.add(c,"interactive"),o.type==="path"&&s.add(c,"completeFraction",0,1,.1),o.type!=="model"&&(s.addColor(c,"color"),s.add(c,"outline"))),o.type==="geometry"&&(s.add(c,"height"),s.add(c,"opacity",0,1,.1))}else if(o.type==="marker"){let c={get interactive(){var u;let l=r.getState(o.id);return(l==null?void 0:l.type)==="marker"?(u=l.options)==null?void 0:u.interactive:!1},set interactive(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="marker"&&(r.setState(u,{options:{interactive:l}}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},focus:()=>{}};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="marker"&&r.camera.focusOn([l.position])}),s.add(c,"interactive")}else if(o.type==="label"){let c={get interactive(){var u;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(u=l.options)==null?void 0:u.interactive:!1},set interactive(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&(r.setState(u,{options:{interactive:l}}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get text(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l})},get"Text Color"(){var u,f;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:f.foregroundColor:"#000000"},set"Text Color"(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(o.id,{text:c.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var u,f;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:f.size:10},set"Text Size"(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var u,f;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:f.iconSize:10},set"Icon Size"(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var u,f,y;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(y=(f=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:f.foregroundColor)==null?void 0:y.active:"#000000"},set"Active Foreground Color"(l){var f,y;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var u,f,y;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(y=(f=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:f.foregroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Foreground Color"(l){var f,y;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var u,f,y;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(y=(f=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:f.backgroundColor)==null?void 0:y.active:"#000000"},set"Active Background Color"(l){var f,y;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var u,f,y;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(y=(f=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:f.backgroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Background Color"(l){var f,y;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,inactive:l}}}}})},focus:()=>{}};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="label"&&r.camera.focusOn([l.position])}),s.add(c,"interactive"),s.add(c,"text"),s.add(c,"Text Size",10,50),s.add(c,"Icon Size",10,50),s.addColor(c,"Text Color"),s.addColor(c,"Active Background Color"),s.addColor(c,"Inactive Background Color"),s.addColor(c,"Active Foreground Color"),s.addColor(c,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let c={get opacity(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(o,{opacity:l})},set visible(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(o,{outline:l})},get outline(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var u,f;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(f=(u=l.shading)==null?void 0:u.start)!=null?f:0},set shadingStart(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{start:l}})},get shadingEnd(){var u,f;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(f=(u=l.shading)==null?void 0:u.end)!=null?f:0},set shadingEnd(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{end:l}})},get shadingIntensity(){var u,f;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(f=(u=l.shading)==null?void 0:u.intensity)!=null?f:0},set shadingIntensity(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{intensity:l}})}};s.add(c,"visible"),s.add(c,"opacity",0,1,.1),s.add(c,"interactive"),s.add(c,"outline"),s.add(c,"shadingStart",0,1,.1),s.add(c,"shadingEnd",0,1,.1),s.add(c,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let c={set visible(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="group-container"&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="group-container"&&(r.setState(u,{interactive:l}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};s.add(c,"visible"),s.add(c,"interactive")}if(s.close(),o.children)for(let c of o.children.values())i(c,s)},"parseChild")}p(Vw,"createParseChild");function jw(r,t){let e=t.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};e.add(i,"padding",0,100,1),e.add(i,"scale",.5,1.5,.1),e.add(i,"color",["dark","light"]),e.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),e.add(i,"iconOnly"),e.onChange(()=>{r.updateWatermark(i)})}p(jw,"createWatermarkChild");var W7="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",Hw="https://auth.mappedin.com/oauth2/token";async function Y7(r,t){var e,i,o,n,s;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled&&((i=t==null?void 0:t.outdoorView)!=null&&i.headers)){let{Map:c,MercatorCoordinate:l}=await import("./outdoor-context-v4-HMS4RMHS.js"),u=t.outdoorView.headers;u==null&&(u=await n2(Hw));let f=t.center||[0,0],y=new c({container:r,style:t.outdoorView.style||W7,center:f,attributionControl:!1,zoom:(o=t.zoomLevel)!=null?o:Kg,pitch:(n=t.pitch)!=null?n:Jg,bearing:(s=t.bearing)!=null?s:Qg,transformRequest:r2(u),trackResize:!1,pixelRatio:qn(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=y.painter.context.gl,v=new bc(r,{center:f,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:g,map:y,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled}),I={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(v.camera.minZoomLevel),y.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",E=>{I.center=E.center,I.zoom=E.zoomLevel,I.bearing=E.bearing,I.pitch=E.pitch,y.jumpTo(I)});let x=l.fromLngLat(f,0),b=zp(x,v.viewCamera,v.camera,()=>{v.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(b),v.renderSync())});let S=!1,w=!1;y.on("idle",()=>{y&&(S||(v.publish("outdoor-view-loaded"),S=!0),w||(w=!0,v.publish("outdoor-style-loaded")))});let T=p(E=>{E&&(E.sourceDataType==="metadata"||E.sourceDataType==="visibility"||E.dataType==="style"||E.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",E=>{y&&E&&E.dataType==="style"&&E.type==="styledata"&&(w=!1),T(E)}),y.on("sourcedata",T),y.on("terrain",T),y.on("error",E=>{var D;if(((D=E.error)==null?void 0:D.url)===W7){L.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}L.warn(E)}),v}else return new bc(r,t)}p(Y7,"createRenderer");m();var Cc=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Cc||{}),Sc=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(Sc||{});m();m();var Ka=class Ka{constructor(t,e,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",Ka.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===Ka.__type}get focusTarget(){return this.target.anchorTarget}};p(Ka,"Label"),d(Ka,"__type","Label");var Po=Ka;m();var ts,es=class es{constructor(t,e,i){d(this,"id");C(this,ts,void 0);d(this,"__type",es.__type);d(this,"contentEl");this.id=t,this.contentEl=e,P(this,ts,i)}get target(){return a(this,ts)}static is(t){return t.__type===es.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){P(this,ts,t)}};ts=new WeakMap,p(es,"Marker"),d(es,"__type","Marker");var xi=es;m();var Ic,Mc,rs=class rs{constructor(t,e,i){C(this,Ic,void 0);C(this,Mc,void 0);d(this,"target");d(this,"__type",rs.__type);P(this,Ic,t),P(this,Mc,e),this.target=i}static is(t){return t.__type===rs.__type}get id(){return a(this,Ic)}get url(){return a(this,Mc)}};Ic=new WeakMap,Mc=new WeakMap,p(rs,"Image"),d(rs,"__type","Image");var xc=rs;m();var is=class is{constructor(t,e){d(this,"id");d(this,"groupId");d(this,"__type",is.__type);this.id=t,this.groupId=e}static is(t){return t.__type===is.__type}};p(is,"Model"),d(is,"__type","Model");var xn=is;m();var t1=class t1{constructor(t,e,i){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"__type");this.id=t,this.__type="Path",this.animation=e,this.coordinates=i}get focusTarget(){return this.coordinates}};p(t1,"Path");var In=t1;m();var To,r1=class r1{constructor(t){C(this,To,void 0);P(this,To,t)}get center(){return a(this,To).center}get bearing(){return a(this,To).bearing}get pitch(){return a(this,To).pitch}get zoomLevel(){return a(this,To).zoomLevel}};To=new WeakMap,p(r1,"CameraTransform");var Pc=r1;m();var os=class os{constructor(t){d(this,"id");d(this,"__type",os.__type);this.id=t}static is(t){return t.__type===os.__type}get focusTarget(){return this}};p(os,"Shape"),d(os,"__type","Shape");var wo=os;m();var Tc=class Tc{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===Tc.__type}};p(Tc,"Text3D"),d(Tc,"__type","Text3D");var Eo=Tc;m();m();m();var Uw=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>']]),Xw=/<svg([^>]*)>/g;function Z7(r,t,e){let i=Uw.get(r);return i?i.replace(Xw,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}p(Z7,"getStyledIcon");var Ww=p(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),Yw=p(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(r,'"\n />\n </svg>\n '),"getDestinationPin"),i1="#722ED1",o1="#1890FF",z7=p(({type:r="departure",color:t=o1})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?Ww(t):Yw(t),"\n </div>"),"DroppedPin"),Zw=p(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),q7=p(({type:r="stairs",color:t=i1,direction:e="up"})=>{let i=Zw("default"),o=i/2+2,n=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(Z7("connection-"+r+"-16x16","white",o)||"","\n </div>\n ").concat(n?'<div style="margin-left: -'.concat(i*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(i,"px; height: ").concat(i,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(o,"px; height: ").concat(o,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");m();var $7=p(async r=>new Promise(t=>setTimeout(t,r)),"ms");var ns={setMapOnConnectionClick:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},inactivePathOptions:{drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},markerOptions:{departureColor:o1,destinationColor:i1}},Ii,Mi,Do,Ce,Ec,Pi,Je,Hr,qt,Ti,Mn,fh,J7,as,dh,ss,hh,mh,Q7,Dc,n1=class n1{constructor(t,e,i){C(this,fh);C(this,as);C(this,ss);C(this,mh);C(this,Ii,new Map);C(this,Mi,void 0);C(this,Do,void 0);C(this,Ce,ns);C(this,Ec,void 0);C(this,Pi,void 0);C(this,Je,[]);C(this,Hr,void 0);C(this,qt,new Map);C(this,Ti,new Map);C(this,Mn,new Map);C(this,Dc,p(t=>{var e;if((e=a(this,Ce).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=a(this,Ii).get(t.markers[0]);i!=null&&i.action.toFloor&&(a(this,Ce).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,Mi,t),P(this,Ec,i),P(this,Do,e)}get currentMap(){return a(this,Ec).call(this)}get isMultiFloor(){if(!a(this,Je).length)return!1;let t=new Set;for(let e of a(this,Je))for(let i of e.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return a(this,qt).get(t)}getMarkerById(t){return a(this,Ii).get(t)}get paths(){let t=[];return a(this,qt).forEach(({path:e})=>t.push(e)),t}get activeDirections(){return a(this,Mn).get(a(this,Hr))}get activePath(){var t;if(a(this,Hr))return(t=a(this,qt).get(a(this,Hr).id))==null?void 0:t.path}get floorStacks(){let t=a(this,Do).getMapData();if(!a(this,Je).length||!t)return[];let e=new Set;for(let i of a(this,Je))for(let o of i.coordinates)if(o.floorId){let n=t.getById("floor",o.floorId);n&&e.add(n.floorStack)}return Array.from(e)}get floors(){let t=a(this,Do).getMapData();if(!a(this,Je).length||!t)return[];let e=new Set;for(let i of a(this,Je))for(let o of i.coordinates)if(o.floorId){let n=t.getById("floor",o.floorId);n&&e.add(n)}return Array.from(e)}setActivePathByIndex(t){let e=a(this,Je)[t];if(!a(this,Je).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Je)[t]){L.warn("Direction #".concat(t," does not exist"));return}let i=a(this,Ti).get(e);if(!i){L.warn("The direction is not a part of muli-direcional path");return}V(this,as,dh).call(this,i)}setActivePath(t){if(!a(this,Je).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Mn).get(t)){L.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}V(this,as,dh).call(this,t)}setActivePathByDirections(t){if(!a(this,Je).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=a(this,Ti).get(t);if(!e){L.warn("The direction is not a part of muli-direcional path");return}V(this,as,dh).call(this,e)}async draw(t,e={}){var l;let i=Array.isArray(t)?t:[t],o=i[0],n=i[i.length-1],s=o.coordinates[0];P(this,Je,i),s.floorId&&this.currentMap.setFloor(s.floorId),a(this,Pi)&&this.clear(),P(this,Ce,{setMapOnConnectionClick:(l=e.setMapOnConnectionClick)!=null?l:ns.setMapOnConnectionClick,pathOptions:{...ns.pathOptions,...e.pathOptions},inactivePathOptions:{...ns.inactivePathOptions,...e.inactivePathOptions},createMarkers:{...ns.createMarkers,...e.createMarkers},markerOptions:{...ns.markerOptions,...e.markerOptions}});let c=!1;return P(this,Pi,{promise:new Promise(async u=>{var f,y,g;if(M.env.NODE_ENV!=="test"&&await $7(500),c||!i.length){u();return}(f=a(this,Ce).createMarkers)!=null&&f.departure&&V(this,ss,hh).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let v=0;v<i.length;v++){let I=i[v],x=v?{...a(this,Ce).inactivePathOptions}:{...a(this,Ce).pathOptions};if(I.coordinates.length<2){L.warn("Directions must have at least 2 coordinates"),u();return}let b=this.currentMap.Paths.add(I.coordinates,x),S=b.paths.map(T=>T.id.toString()),w=new In(ge(),b.animation,I.coordinates);for(let T of S){a(this,qt).set(T,{path:w,entityIds:S});let E=v?{...a(this,Ce).inactivePathOptions,altitude:0}:{...a(this,Ce).pathOptions,altitude:.05};a(this,Mi).setState(T,E)}if(a(this,qt).set(w.id,{path:w,entityIds:S}),a(this,Ti).set(I,w),a(this,Mn).set(w,I),M.env.NODE_ENV!=="test"&&await b.animation,c){u();return}(y=a(this,Ce).createMarkers)!=null&&y.connection&&V(this,mh,Q7).call(this,I.instructions,"connection"),v===0&&(P(this,Hr,a(this,Ti).get(a(this,Je)[0])),a(this,Mi).on("click",a(this,Dc)))}if((g=a(this,Ce).createMarkers)!=null&&g.destination&&V(this,ss,hh).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),c){u();return}a(this,Do).mapObjects.forEach(v=>{v.processFloorChange(v.currentFloorId)}),u()}),cancel:()=>{c=!0}}),a(this,Pi).promise}clear(){a(this,Ii).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),a(this,Ii).clear(),a(this,qt).forEach(({path:t,entityIds:e})=>{a(this,qt).delete(t.id),e.forEach(i=>a(this,qt).delete(i)),this.currentMap.Paths.remove(e)}),a(this,Pi)&&(a(this,Pi).cancel(),P(this,Pi,void 0)),P(this,Je,[]),a(this,Ti).clear(),a(this,Mn).clear(),P(this,Hr,void 0),a(this,Mi).off("click",a(this,Dc)),a(this,Do).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};Ii=new WeakMap,Mi=new WeakMap,Do=new WeakMap,Ce=new WeakMap,Ec=new WeakMap,Pi=new WeakMap,Je=new WeakMap,Hr=new WeakMap,qt=new WeakMap,Ti=new WeakMap,Mn=new WeakMap,fh=new WeakSet,J7=p(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),as=new WeakSet,dh=p(function(t){P(this,Hr,t),a(this,Je).forEach(e=>{let i=a(this,Ti).get(e);if(i){let o=a(this,qt).get(i.id),n=o.path.id===a(this,Hr).id?{...a(this,Ce).pathOptions,altitude:.05}:{...a(this,Ce).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{a(this,Mi).setState(s,n)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),ss=new WeakSet,hh=p(function(t,e,i){var o,n,s,c,l;if(e==="connection"&&i){let u=i.action.type==="ExitConnection"?a(this,Ce).markerOptions.departureColor:a(this,Ce).markerOptions.destinationColor,f;if(typeof((o=a(this,Ce).createMarkers)==null?void 0:o.connection)=="function"){let g=a(this,Ce).createMarkers.connection(i);a(this,Mi).setState(g.id.toString(),{options:{interactive:!0}}),f={id:g.id,type:"marker"}}else f=this.currentMap.Markers.add(i.coordinate,q7({type:(s=(n=i.action.connection)==null?void 0:n.type)!=null?s:i.action.connectionType,color:u,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let y=this.currentMap.Markers.getContentEl(f.id.toString());if(!y)throw new Error("marker component should exist");a(this,Ii).set(f.id,{instruction:i,marker:new xi(f.id.toString(),y,i.coordinate)})}else{let u=e==="departure"?a(this,Ce).markerOptions.departureColor:a(this,Ce).markerOptions.destinationColor,f;typeof((c=a(this,Ce).createMarkers)==null?void 0:c.departure)=="function"&&e==="departure"?f={id:a(this,Ce).createMarkers.departure(i).id,type:"marker"}:typeof((l=a(this,Ce).createMarkers)==null?void 0:l.destination)=="function"&&e==="destination"?f={id:a(this,Ce).createMarkers.destination(i).id,type:"marker"}:f=this.currentMap.Markers.add(t,z7({type:e,color:u}),{anchor:"top",rank:"always-visible"}),a(this,Ii).set(f.id,void 0)}},"#addMarker"),mh=new WeakSet,Q7=p(function(t,e){t.filter(o=>V(this,fh,J7).call(this,o.action)).forEach(o=>{V(this,ss,hh).call(this,o.coordinate,e,o)})},"#addMarkers"),Dc=new WeakMap,p(n1,"Navigation");var wc=n1;m();m();m();var zw=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>']]),qw=/<svg([^>]*)>/g;function K7(r,t,e){let i=zw.get(r);return i?i.replace(qw,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}p(K7,"getStyledIcon");var Pn,ls,Oc,a1,gh,eS,vh,tS,Lc,s1,bh,rS,l1=class l1{constructor(t,e){C(this,Oc);C(this,gh);C(this,vh);C(this,Lc);C(this,bh);C(this,Pn,void 0);C(this,ls,void 0);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});P(this,Pn,t),P(this,ls,e)}auto(){let t=a(this,ls)[Object.keys(a(this,ls))[0]];[...t.getByType("connection"),...t.getByType("point-of-interest"),...t.getByType("space")].forEach(e=>{if(e.__type==="connection")e.coordinates.forEach(i=>{let o=e.name||e.externalId;o&&a(this,Pn).Labels.add(i,o,V(this,Oc,a1).call(this,e))});else{e.__type==="space"&&e.name!==""&&a(this,Pn).updateState(e,{interactive:!0,hoverColor:"#F0F0F0"});let i=e.name||e.externalId;i&&a(this,Pn).Labels.add(e,i,V(this,Oc,a1).call(this,e))}})}};Pn=new WeakMap,ls=new WeakMap,Oc=new WeakSet,a1=p(function(t){let e=K7(V(this,gh,eS).call(this,t),"white",12);return{appearance:{text:{foregroundColor:V(this,Lc,s1).call(this,t)},marker:{foregroundColor:{active:V(this,Lc,s1).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:V(this,bh,rS).call(this,t)}},"#generatLabelAppearance"),gh=new WeakSet,eS=p(function(t){return t.__type==="connection"?V(this,vh,tS).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),vh=new WeakSet,tS=p(function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},"#attemptIconNameForConnection"),Lc=new WeakSet,s1=p(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),bh=new WeakSet,rS=p(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),p(l1,"Labels");var yh=l1;var c1=class c1{constructor(t,e){d(this,"Labels");d(this,"auto",p(()=>{this.Labels.auto()},"auto"));this.Labels=new yh(t,e)}};p(c1,"DefaultTheme");var Ch=c1;m();var re,Fc,p1,Sh,iS,u1=class u1{constructor(t){C(this,Fc);C(this,Sh);C(this,re,void 0);d(this,"setMinPitch",p(t=>{a(this,re).camera.setMinPitch(t)},"setMinPitch"));d(this,"setMaxPitch",p(t=>{a(this,re).camera.setMaxPitch(t)},"setMaxPitch"));d(this,"setMinZoomLevel",p(t=>{a(this,re).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",p(t=>{a(this,re).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));P(this,re,t)}setScreenOffsets(t){a(this,re).camera.setInsetPadding(t)}get screenOffsets(){return a(this,re).camera.insetsPadding}get panMode(){return a(this,re).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&a(this,re).camera.setPanMode(t)}getFocusOnTransform(t,e){let i=a(this,re).camera.getCameraFrameForCoordinates(V(this,Fc,p1).call(this,t,e),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:e==null?void 0:e.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing});return{center:new K(i.center[1],i.center[0]),zoomLevel:i.zoomLevel}}focusOn(t,e){return a(this,re).camera.focusOn(V(this,Fc,p1).call(this,t,e),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:e==null?void 0:e.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing})}animateTo(t,e){var l;let{center:i,zoomLevel:o,bearing:n,pitch:s}=t,c=i!=null?i:this.center;return a(this,re).camera.animateTo({center:i!=null?[c.longitude,c.latitude,this.elevation]:void 0,zoomLevel:o,bearing:n,pitch:s,duration:(l=e==null?void 0:e.duration)!=null?l:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:i=this.zoomLevel,bearing:o=this.bearing,pitch:n=this.pitch}=t,s=[e.longitude,e.latitude];a(this,re).camera.setCenter(s),a(this,re).camera.setZoomLevel(i),a(this,re).camera.setBearing(o),a(this,re).camera.setPitch(n)}get center(){let t=a(this,re).camera.center;return new K(t[1],t[0],void 0)}setAutoMinZoomLevel(t){a(this,re).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return a(this,re).camera.autoMinZoomLevel}get zoomLevel(){return a(this,re).camera.zoomLevel}get pitch(){return a(this,re).camera.pitch}get minPitch(){return a(this,re).camera.minPitch}get maxPitch(){return a(this,re).camera.maxPitch}get bearing(){let t=a(this,re).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return a(this,re).camera.minZoomLevel}get maxZoomLevel(){return a(this,re).camera.maxZoomLevel}setElevation(t){a(this,re).camera.setElevation(t)}get elevation(){return a(this,re).camera.elevation}animateElevation(t,e){return a(this,re).camera.animateElevation(t,e)}};re=new WeakMap,Fc=new WeakSet,p1=p(function(t,e){var s,c,l;let i=[],n=(Array.isArray(t)?t:[t]).flatMap(u=>{var f;return(f=u==null?void 0:u.focusTarget)!=null?f:[u]});for(let u of n)if(u!=null)if(K.is(u)){let f=u.floorId!=null?a(this,re).getBoundingArea(u.floorId):void 0;f?i.push([u.longitude,u.latitude,(s=f[0][2])!=null?s:a(this,re).camera.elevation]):i.push([u.longitude,u.latitude,a(this,re).camera.elevation])}else if((u==null?void 0:u.id)!=null){let f=a(this,re).getBoundingArea(u.id);if(f){let y="floor"in u?a(this,re).getBoundingArea((c=u.floor)==null?void 0:c.id):void 0;y?i.push(...f.map(g=>{var v;return[g[0],g[1],(v=y[0][2])!=null?v:a(this,re).camera.elevation]})):i.push(...f)}}else V2(u)&&i.push(u);return((l=e==null?void 0:e.axisAlignedPadding)==null?void 0:l.vertical)!==void 0&&(i=V(this,Sh,iS).call(this,i,e.axisAlignedPadding)),i},"#computeCoordinateCloud"),Sh=new WeakSet,iS=p(function(t,e){var n;let i=(n=e==null?void 0:e.vertical)!=null?n:0;return[t.map(s=>{var c;return[s[0],s[1],((c=s[2])!=null?c:0)-i]}),t.map(s=>{var c;return[s[0],s[1],(c=s[2])!=null?c:0]}),t.map(s=>{var c;return[s[0],s[1],((c=s[2])!=null?c:0)+i]})].flat()},"#expandCoordinateCloud"),p(u1,"Camera");var Ac=u1;m();var cs,d1=class d1{constructor({currentMapGetter:t}){C(this,cs,void 0);P(this,cs,t)}get currentMap(){return a(this,cs).call(this)}async getCurrentSceneGLTF(t){let e=a(this,cs).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)}};cs=new WeakMap,p(d1,"Exporter");var Bc=d1;m();var Ur,_c,h1=class h1{constructor({currentMapGetter:t}){C(this,Ur,new Map);C(this,_c,void 0);P(this,_c,t)}get currentMap(){return a(this,_c).call(this)}getById(t){return a(this,Ur).get(t)}add(t,e,i){let o=t.anchorTarget,n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Labels.add(Xr(o),e,{...i,spaceId:Be.is(t)?t.id:void 0,floorId:o.floorId,rank:(i==null?void 0:i.rank)==null||(i==null?void 0:i.rank)==="initial"?"medium":i.rank}),c=new Po(s.id.toString(),e,t);return a(this,Ur).set(c.id,{label:c,entityId:c.id}),c}all(){var e;let t=[];return(e=this.currentMap)==null||e.Labels.all({onCreate:(i,o,n)=>{let s=new Po(i.toString(),o,n);a(this,Ur).set(s.id,{label:s,entityId:s.id}),t.push(s)}}),t}remove(t){var i;let e=a(this,Ur).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),a(this,Ur).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Ur).forEach(({label:e})=>{this.remove(e),t.push(e),a(this,Ur).delete(e.id.toString())}),t}};Ur=new WeakMap,_c=new WeakMap,p(h1,"Labels");var kc=h1;m();m();var oS={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},nS={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},aS=.5,y1=class y1{constructor(t,e,i=new Map){d(this,"containerId");d(this,"labelIds",new Set);d(this,"layers");d(this,"renderer");this.containerId=e,this.layers=i,this.renderer=t}show(){this.renderer.setState(this.containerId,{visible:!0});for(let t of this.labelIds)this.renderer.setState(t,{visible:!0})}hide(){this.renderer.setState(this.containerId,{visible:!1});for(let t of this.labelIds)this.renderer.setState(t,{visible:!1})}};p(y1,"Layer");var Oo=y1,g1=class g1{constructor(t,e,i,o,n,s,c){d(this,"id");d(this,"name");d(this,"elevation");d(this,"containerId");d(this,"externalId");d(this,"metadata");d(this,"shortName");d(this,"subtitle");d(this,"occluderId");d(this,"loaded",!1);d(this,"styleMap",{});d(this,"obstructions");d(this,"entrances");d(this,"spaces");d(this,"floorImages");d(this,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"footprint");d(this,"floorStackId");d(this,"multiFloorView");d(this,"load",p(()=>{var o,n,s,c,l,u;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(ci,"-").concat(this.id),{},this.id);this.layers.set(ci,new Oo(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(Ar,"-").concat(this.id),{},this.id);this.layers.set(Ar,new Oo(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(Me,"-").concat(this.id),{},this.id);if(this.layers.set(Me,new Oo(this.renderer,i.id.toString())),((o=this.footprint)==null?void 0:o.geometry)!=null&&((n=this.footprint)==null?void 0:n.geometry.coordinates.length)!==0){let f=this.renderer.addGroupContainer("".concat(pa,"-").concat(this.id),{},this.id);this.layers.set(pa,new Oo(this.renderer,f.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,f.id)}if(this.spaces!=null&&this.spaces.features.length>0){let f=this.spaces.features.filter(I=>{var x;return I.geometry.type==="Polygon"&&((x=I.properties.kind)==null?void 0:x.toLowerCase())!=="void"}),y=m1(f,this.styleMap),g=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),v=0;for(let[I,x]of y){let b=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(v),{features:x},Rc(I,this.options),g);v++;let S=g.id.toString();this.layers.get(Me).layers.set(I.id||S,b.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let f=this.obstructions.features.filter(T=>T.geometry.type==="Polygon"&&T.properties.kind==="object"),y=m1(f,this.styleMap),g=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),v=0;for(let[T,E]of y){let D=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(v),{features:E},Rc(T,this.options),g);v++;let A=g.id.toString();this.layers.get(Me).layers.set(T.id||A,D.id.toString())}let I=this.obstructions.features.filter(T=>T.geometry.type==="LineString"&&T.properties.kind==="Wall"&&T.properties.footprintComponent===!1),x=this.obstructions.features.filter(T=>T.geometry.type==="LineString"&&T.properties.kind==="Wall"&&T.properties.footprintComponent===!0),b=this.entrances,S=oS,w=oS;if(I!=null&&I.length>0){let T=this.styleMap[(s=I[0].properties)==null?void 0:s.id];T!=null&&(S={...T}),w=S;let{walls:E,entrances:D}=f1(I,(b==null?void 0:b.features)||[]),A=Math.max(S.height-.11,aS),R={...nS,height:A},N=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),D,R,i);this.layers.get(Me).layers.set(sa,N.id.toString());let B=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[E]},Rc(S,this.options),i);this.layers.get(Me).layers.set(eo,B.id.toString())}if(x!=null&&x.length>0){let T=this.styleMap[(c=x[0].properties)==null?void 0:c.id];T!=null&&(w={...T,id:Lr});let{walls:E,entrances:D}=f1(x,(b==null?void 0:b.features)||[]),A=Math.max(w.height-.11,aS),R={...nS,height:A},N=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),D,R,i);this.layers.get(Me).layers.set(la,N.id.toString());let B=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[E]},Rc(w,this.options),i);this.layers.get(Me).layers.set(Lr,B.id.toString())}}if(this.floorImages!=null){let f=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let y of this.floorImages.features||[])"anchorId"in y.properties||"anchorId"in y.properties&&((l=y.properties)==null?void 0:l.anchorId)==null||this.renderer.addImage(ge(),y,{url:y.properties.path,flipImageToFaceCamera:!0},f);this.layers.set(H2,new Oo(this.renderer,f.id.toString()))}return(u=this.multiFloorView)!=null&&u.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var u,f,y,g;this.id=e.id,this.options=n;let l=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);if(this.containerId=l.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,s!=null&&c!=null&&(this.styleMap=c,this.spaces=s.space[this.id],this.entrances=s.entrance[this.id],this.obstructions=s.obstruction[this.id],this.floorImages=(u=s.floorImages)==null?void 0:u[this.id],this.footprint=(f=s["floor.geojson"])==null?void 0:f.features.find(v=>v.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=o,this.footprint&&((y=this.multiFloorView)!=null&&y.enabled)&&this.obstructions!=null&&this.obstructions.features.length>0){let v=this.obstructions.features.filter(I=>I.geometry.type==="LineString"&&I.properties.kind==="Wall"&&I.properties.footprintComponent===!0);if(v!=null&&v.length>0){let I=this.styleMap[(g=v[0].properties)==null?void 0:g.id],x=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...I,height:-this.multiFloorView.floorHeight,altitude:this.multiFloorView.floorHeight/2,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":I.color},this.id);this.layers.set(ca,new Oo(this.renderer,x.id.toString()))}}}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};p(g1,"FloorObject");var Nc=g1;m();var sS=50,$w=1e3,De,yr,ps,Wr,gr,bt,Vc,us,Tn,jc,v1,wn,Hc,Uc,Xc,Wc,wi,xh,lS,Yc,Lo,Zc,b1,C1=class C1 extends z{constructor({currentMapGetter:e}){super();C(this,jc);C(this,xh);C(this,Zc);C(this,De,void 0);C(this,yr,sS);C(this,ps,0);C(this,Wr,void 0);C(this,gr,!1);C(this,bt,[]);C(this,Vc,0);C(this,us,!1);C(this,Tn,"collapsed");d(this,"expandedFactor",0);C(this,wn,"all-floors");C(this,Hc,p(()=>{let e=a(this,De).call(this);if(a(this,Vc)===this.expandedFactor||e==null||!a(this,gr))return;P(this,Vc,this.expandedFactor);let i=Yi(this.expandedFactor,0,1,0,a(this,yr)),n=Yi(this.expandedFactor,0,.1,0,1)===0;a(this,bt).forEach((s,c)=>{e.renderer.setState(s.containerId,{visible:n?s.id===e.currentFloorId:!0,altitude:i*c})}),this.expandedFactor===0?(P(this,gr,!1),e.renderer.camera.setPanMode("default"),a(this,Lo)&&a(this,Lo).call(this)):this.expandedFactor===1&&(P(this,gr,!1),a(this,Lo)&&a(this,Lo).call(this))},"#handlePreRender"));C(this,Uc,p(()=>{var e,i,o;this.expanded&&P(this,ps,(i=(e=a(this,De).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(o=a(this,De).call(this))==null||o.renderer.on("user-interaction-end",a(this,Wc))},"#handleUserInteractionStart"));C(this,Xc,p(()=>{var i;let e=a(this,De).call(this);if(e!=null&&this.expanded&&a(this,us)&&!a(this,gr)){let o=[1/0,e.currentFloorId];for(let n=0;n<a(this,bt).length;n++){let s=a(this,bt)[n],c=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-n*a(this,yr));c<a(this,yr)/3&&(o[0]=c,o[1]=s.id)}o[1]!==e.currentFloorId&&(e.currentFloorId=o[1],a(this,bt).forEach(n=>{e.renderer.setState(n.containerId,{visible:a(this,wn)==="all-floors"?!0:e.currentFloor.id===n.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId}))}},"#determineCurrentMapBasedOnElevation"));C(this,Wc,p(()=>{var i,o;let e=a(this,De).call(this);if(this.expanded&&e&&a(this,ps)!==((i=e.renderer.camera.elevation)!=null?i:0)){let n=[1/0,e.currentFloorId,0];for(let s=0;s<a(this,bt).length;s++){let c=a(this,bt)[s],l=Math.abs(((o=e.renderer.camera.elevation)!=null?o:0)-s*a(this,yr));l<n[0]&&(n[0]=l,n[1]=c.id,n[2]=s*a(this,yr))}a(this,us)&&V(this,xh,lS).call(this,n[2]),P(this,ps,0),e.renderer.off("user-interaction-end",a(this,Wc))}},"#handleUserInteractionEnd"));C(this,wi,null);C(this,Yc,null);C(this,Lo,void 0);P(this,De,e);let i=a(this,De).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",a(this,Uc)),i.renderer.on("camera-change",a(this,Xc)),i.renderer.on("pre-render",a(this,Hc)))}get state(){return a(this,Tn)}get expanded(){return a(this,Tn)!=="collapsed"}get gapBelowFloors(){return a(this,yr)}get includedFloors(){var e;return(e=a(this,jc,v1))!=null&&e.api.mapData?a(this,bt).map(i=>{var o,n;return(n=(o=a(this,jc,v1))==null?void 0:o.api.mapData)==null?void 0:n.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return a(this,wn)}setFloorVisiblityMode(e){P(this,wn,e);let i=a(this,De).call(this);i!=null&&a(this,bt).forEach(o=>{i.renderer.setState(o.containerId,{visible:a(this,wn)==="all-floors"?!0:i.currentFloor.id===o.id})})}changeFloorOnElevationChanges(e){P(this,us,e)}async expand(e){var o,n,s;let i=a(this,De).call(this);if(i!=null)return P(this,yr,(o=e==null?void 0:e.distanceBetweenFloors)!=null?o:sS),P(this,bt,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(c=>i.floorsById.get(c.id)).filter(Boolean):i.currentFloorStack.floorObjects),a(this,bt).sort((c,l)=>c.elevation-l.elevation),a(this,bt).length<=1||this.expanded===!0?Promise.resolve():(P(this,gr,!0),i.api.Camera.setPanMode((n=e==null?void 0:e.cameraPanMode)!=null?n:"elevation"),this.changeFloorOnElevationChanges((s=e==null?void 0:e.changeFloorOnElevationChanges)!=null?s:!0),V(this,Zc,b1).call(this,"expand",e).then(()=>{P(this,Tn,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{P(this,gr,!1)}))}async collapse(e){let i=a(this,De).call(this);if(i!=null)return this.expanded===!0?(P(this,gr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),V(this,Zc,b1).call(this,"collapse",e).then(()=>{P(this,Tn,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{P(this,gr,!1)})):Promise.resolve()}destroy(){let e=a(this,De).call(this);e!=null&&(e.renderer.off("user-interaction-start",a(this,Uc)),e.renderer.off("camera-change",a(this,Xc)),e.renderer.off("pre-render",a(this,Hc)))}};De=new WeakMap,yr=new WeakMap,ps=new WeakMap,Wr=new WeakMap,gr=new WeakMap,bt=new WeakMap,Vc=new WeakMap,us=new WeakMap,Tn=new WeakMap,jc=new WeakSet,v1=p(function(){return a(this,De).call(this)},"#currentMap"),wn=new WeakMap,Hc=new WeakMap,Uc=new WeakMap,Xc=new WeakMap,Wc=new WeakMap,wi=new WeakMap,xh=new WeakSet,lS=p(function(e){var o,n,s;a(this,wi)&&a(this,wi).stop();let i=a(this,De).call(this);i!=null&&(P(this,wi,new wt({elevation:(o=i.renderer.camera.elevation)!=null?o:0}).to({elevation:e},150).easing(we.Quadratic.Out).onComplete(()=>{var c;a(this,wi)&&((c=a(this,De).call(this))==null||c.renderer.getTweenGroup().remove(a(this,wi)))}).onUpdate(({elevation:c})=>{i.renderer.camera.setElevation(c)}).start()),(n=a(this,De).call(this))==null||n.renderer.getTweenGroup().add(a(this,wi)),(s=a(this,De).call(this))==null||s.renderer.render())},"#animateElevationTo"),Yc=new WeakMap,Lo=new WeakMap,Zc=new WeakSet,b1=p(function(e,i){var c,l,u,f;a(this,Wr)&&a(this,Wr).stop();let o=a(this,De).call(this);if(o==null)return Promise.reject(new Error("No current map"));let n=a(this,bt).indexOf(o.currentFloor)*a(this,yr),s=(c=o.renderer.camera.elevation)!=null?c:0;return P(this,Yc,new Promise(y=>{P(this,Lo,y)})),P(this,Wr,new wt({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:$w).easing(Ua[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:y})=>{this.expandedFactor=y,o.renderer.camera.setElevation(e==="expand"?n*y:s*y)}).onComplete(()=>{var y;a(this,Wr)&&((y=a(this,De).call(this))==null||y.renderer.getTweenGroup().remove(a(this,Wr)))}).start()),a(this,Wr).cameraAnimation=!0,(u=a(this,De).call(this))==null||u.renderer.getTweenGroup().add(a(this,Wr)),(f=a(this,De).call(this))==null||f.renderer.render(),a(this,Yc)},"#animate"),p(C1,"StackedMaps");var Gc=C1;m();var ds,S1=class S1{constructor(t,e,i,o){d(this,"id");d(this,"externalId");d(this,"name");d(this,"type");d(this,"floorIds");d(this,"defaultFloorId");d(this,"floorObjects",[]);d(this,"floorObjectsByElevation",new Map);d(this,"metadata");d(this,"containerId");d(this,"facade");d(this,"renderer");C(this,ds,void 0);var s;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(s=t.floors)!=null?s:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=i;let n=i.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=n.id.toString(),this.facade=o}get defaultFloor(){if(a(this,ds)==null){this.floorObjects.length===0&&L.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),P(this,ds,t)}return a(this,ds)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){L.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(o=>{this.renderer.setState(o.spaceId,{visible:t})})}};ds=new WeakMap,p(S1,"FloorStackObject");var zc=S1;m();function cS(r,t,e){let i=[];for(let o of r){let n={floor:o,visible:!1,visibleLayers:[],expandFootprint:!1};o.id===t.id?(n.visible=!0,n.visibleLayers=[Ar,Me,ci,pa],o.elevation<0&&(n.expandFootprint=!0,n.visibleLayers.push(ca))):e.includes(o.id)&&o.elevation<t.elevation?(n.visible=!0,n.visibleLayers=[ca,Ar,Me,pa],o.elevation<0&&(n.expandFootprint=!0)):t.elevation>0&&o.elevation<t.elevation&&o.elevation>=0&&(n.visible=!0,n.visibleLayers=[ca]),i.push(n)}return i}p(cS,"getVisiblityState");m();m();m();m();var hs,En,Ke,$c,fs,Jc,Qc,ms,Et,x1=class x1{constructor(t,e,i){d(this,"id");C(this,hs,void 0);C(this,En,void 0);C(this,Ke,void 0);C(this,$c,void 0);C(this,fs,[]);C(this,Jc,!1);C(this,Qc,1);C(this,ms,new Map);C(this,Et,void 0);this.id=t.id,P(this,hs,t),P(this,En,e),P(this,Ke,i),this.setDefaultFloor(this.defaultFloor)}get floorStack(){return a(this,En)}get defaultFloor(){var t;return(t=a(this,$c))!=null?t:a(this,En).defaultFloor}setDefaultFloor(t){P(this,$c,t),this.updateChildGeometryIds(t)}updateChildGeometryIds(t){P(this,fs,[]);let e=a(this,Ke).getState(t.layers.get(Me).containerId);for(let i of e.children){let o=a(this,Ke).getState(i);for(let n of o.children){let s=a(this,Ke).getState(n);s&&a(this,fs).push(s.id.toString())}}}set focusable(t){P(this,Jc,t),a(this,hs).spaces.forEach(e=>{let i=a(this,Ke).getState(e.id);i&&a(this,Ke).setState(i,{focusable:t,renderOrder:t?2:0})})}get focusable(){return a(this,Jc)}set opacity(t){P(this,Qc,t),a(this,hs).spaces.forEach(e=>{let i=a(this,Ke).getState(e.id);i&&(a(this,ms).has(e.id)||a(this,ms).set(e.id,i.opacity),a(this,Ke).setState(i,{opacity:Math.min(a(this,ms).get(e.id),t)}))})}get opacity(){return a(this,Qc)}animateOpacity(t,e=300){a(this,Et)&&a(this,Et).stop(),t<1&&this.defaultFloor.setVisible(!0),P(this,Et,new wt({opacity:this.opacity}).easing(we.Quadratic.In).to({opacity:t},e).onUpdate(({opacity:i})=>{this.opacity=i,a(this,fs).forEach(o=>{a(this,Ke).setState(a(this,Ke).getState(o),{opacity:1-i})})}).onStop(()=>{a(this,Et)&&(a(this,Ke).getTweenGroup().remove(a(this,Et)),P(this,Et,void 0))}).onComplete(()=>{a(this,Et)&&(a(this,Ke).getTweenGroup().remove(a(this,Et)),P(this,Et,void 0)),this.opacity===1&&a(this,En).floorObjects.forEach(i=>{i.setVisible(!1)})})),a(this,Et).start(),a(this,Ke).getTweenGroup().add(a(this,Et)),a(this,Ke).render()}};hs=new WeakMap,En=new WeakMap,Ke=new WeakMap,$c=new WeakMap,fs=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,ms=new WeakMap,Et=new WeakMap,p(x1,"FacadeObject");var qc=x1;var uS=!1,br,Dn,ys,Ao,Kc,gs,Cr,kt,vr,Mh,dS,ep,I1,vs,Ih,Fo,tp,rp,M1,bs,P1=class P1 extends z{constructor(e,i,{currentMapGetter:o}){super();C(this,kt);C(this,Mh);C(this,ep);C(this,vs);C(this,rp);C(this,br,void 0);C(this,Dn,!1);C(this,ys,17);C(this,Ao,!1);C(this,Kc,void 0);C(this,gs,void 0);C(this,Cr,new Map);C(this,Fo,new Set);C(this,tp,p(e=>{if(!a(this,Dn)||e.length===0||!a(this,Ao))return;let i=-1/0,o,n=!1,s=new Set,c=new Map;e.forEach((l,u)=>{var v;let f=V(this,ep,I1).call(this,l);if(!f)return;let y=1-u/e.length,g=((v=c.get(f.id))!=null?v:0)+y;c.set(f.id,g),g>i&&(i=g,o=f),a(this,Fo).has(f.id)||(V(this,vs,Ih).call(this,f.id,0),n=!0),s.add(f.id)}),uS&&L.log("likelyInFocus:",[o==null?void 0:o.floorStack.name,i],"Weights:",e.flatMap(l=>{let u=V(this,ep,I1).call(this,l);return u?[u.floorStack.name,c.get(u.id)]:[]}));for(let l of a(this,Fo))s.has(l)||(V(this,vs,Ih).call(this,l,1),n=!0);o&&a(this,kt,vr).currentFloorStackId!==o.floorStack.id&&(V(this,Mh,dS).call(this,o.id),n=!0),P(this,Fo,s),n&&this.publish("focus-change",{facades:Array.from(a(this,Fo)),spaces:e})},"#handleEntitiesInFocus"));C(this,bs,p(e=>{if(e.zoomLevel>=a(this,ys)&&!a(this,Ao))P(this,Ao,!0);else if(e.zoomLevel<a(this,ys)&&a(this,Ao)){P(this,Ao,!1);for(let i of a(this,Cr).values())i.opacity<1&&V(this,vs,Ih).call(this,i.id,1);a(this,Fo).clear(),a(this,kt,vr).outdoorFloorStacks.size>0&&!a(this,kt,vr).outdoorFloorStacks.has(a(this,kt,vr).currentFloorStackId)&&(a(this,kt,vr).setFloorStack(a(this,kt,vr).outdoorFloorStacks.values().next().value),this.publish("focus-change",{facades:[],spaces:[]}))}},"#handleCameraChange"));P(this,br,e),P(this,Kc,o),P(this,gs,i)}enable(e){var i;P(this,ys,(i=e==null?void 0:e.minZoomLevel)!=null?i:17),this.enabled||(a(this,br).on("geometry-in-focus",a(this,tp)),a(this,br).on("camera-change",a(this,bs)),a(this,bs).call(this,a(this,br).camera),V(this,rp,M1).call(this,!0),P(this,Dn,!0)),uS&&a(this,br).getSystems().geometryInFocusSystem.showRaycasters()}disable(){P(this,Dn,!1),a(this,br).off("geometry-in-focus",a(this,tp)),a(this,br).off("camera-change",a(this,bs)),V(this,rp,M1).call(this,!1)}get enabled(){return a(this,Dn)}setDefaultFloorForStack(e,i){a(this,kt,vr)==null&&L.throw("Current map does not exist.");let o=a(this,kt,vr).floorsById.get(i.id);if(o==null){L.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(o.floorStackId!==e.id){L.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}let n=e.facade&&a(this,Cr).get(e.facade.id);n&&n.setDefaultFloor(o)}resetDefaultFloorForStack(e){let i=e.facade&&a(this,Cr).get(e.facade.id);i&&i.setDefaultFloor(i.floorStack.defaultFloor)}};br=new WeakMap,Dn=new WeakMap,ys=new WeakMap,Ao=new WeakMap,Kc=new WeakMap,gs=new WeakMap,Cr=new WeakMap,kt=new WeakSet,vr=p(function(){return a(this,Kc).call(this)},"#currentMap"),Mh=new WeakSet,dS=p(function(e){let i=a(this,Cr).get(e);i&&a(this,kt,vr).setFloor(i.defaultFloor.id)},"#setFloorByFacadeId"),ep=new WeakSet,I1=p(function(e){var o;let i=(o=a(this,gs).getMapDataInternal())==null?void 0:o.facadesBySpaceId[e];return a(this,Cr).get(i.id)},"#getFacadeBySpaceId"),vs=new WeakSet,Ih=p(function(e,i){let o=a(this,Cr).get(e);o&&o.animateOpacity(i)},"#setFacadeOpacity"),Fo=new WeakMap,tp=new WeakMap,rp=new WeakSet,M1=p(function(e){var i;(i=a(this,gs).getMapDataInternal())==null||i.facades.forEach(o=>{let n=a(this,Cr).get(o.id);n==null&&(n=new qc(o,a(this,kt,vr).floorStacksById.get(o.floorStack.id),a(this,br)),a(this,Cr).set(o.id,n)),n.focusable=e})},"#setAllFacadesFocusable"),bs=new WeakMap,p(P1,"DynamicFocus");var Cs=P1;var Qw=5,Kw={linear:we.Linear.None,easeIn:we.Quadratic.In,easeOut:we.Quadratic.Out,easeInOut:we.Quadratic.InOut},_t,w1=class w1 extends z{constructor(e,i,o,n){var u,f,y,g;super();d(this,"floorStacksById",new Map);d(this,"floorsById",new Map);d(this,"currentFloorId","");d(this,"currentFloorStackId","");d(this,"outdoorFloorStacks",new Set);d(this,"id");d(this,"renderer");d(this,"api");d(this,"mvf");d(this,"options",{});d(this,"styleMap");d(this,"StackedMaps");d(this,"DynamicFocus");d(this,"animations",new Map);d(this,"Models",{add:(e,i,o)=>{let{floorId:n,...s}=o,c=n?this.floorsById.get(n):this.currentFloor,l=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(u=>{var f;return{type:"Feature",properties:{id:ge(),rotation:(f=u.rotation)==null?void 0:f.map(y=>y*(Math.PI/180)),scale:u.scale,interactive:u.interactive,verticalOffset:u.verticalOffset},geometry:{type:"Point",coordinates:Xr(u.target)}}})},s,{parent:c.id});if(l==null)throw new Error("error creating model");return this.renderer.getState(l).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});d(this,"Images",{add:(e,i,o)=>{let{floorId:n,flipImageToFaceCamera:s,...c}=o,l=n?this.floorsById.get(n):this.currentFloor,u={type:"Feature",properties:c,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(ge(),u,{url:i,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});d(this,"Markers",{add:(e,i,o)=>{var c;let n=e.floorId?this.floorsById.get(e.floorId):this.currentFloor,s=o;return o.rank==="initial"&&(s.rank="medium"),this.renderer.addMarker2D(Xr(e),i,{...s,occluderId:n==null?void 0:n.occluderId},(c=n==null?void 0:n.layers.get(Ar))==null?void 0:c.containerId)},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(e,i,o)=>{var c;let n=this.renderer.getState(e),s=o?this.floorsById.get(o):this.currentFloor;if(!n){L.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(n.type!=="marker"){L.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(n,{position:i,parent:(c=s==null?void 0:s.layers.get(Ar))==null?void 0:c.containerId})},animateTo:(e,i,o,n)=>{let s=this.renderer.getState(e),c=o?this.floorsById.get(o):this.currentFloor;if(!s)return L.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(s.type!=="marker")return L.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...n};this.cancelAnimation(e);let u=new wt({lon:s.position[0],lat:s.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(Kw[l.easing]).onUpdate(({lon:f,lat:y})=>{var v;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let I=(v=c==null?void 0:c.layers.get(Ar))==null?void 0:v.containerId;I&&this.Markers.setPosition(e,[f,y],I)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(e,u),T1(u).then(()=>{this.animations.delete(e)})}});d(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});d(this,"Shapes",{add:(e,i,o)=>{let n=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=ge();return this.renderer.addGeometryGroup(s,e,i,n.id),s},remove:e=>(this.renderer.remove(e.id),e.id)});d(this,"Text3D",{label:(e,i,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){L.warn("Enterprise mode is not enabled, skipping label creation");return}let n=hS(this.renderer,e,i,o);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode))return L.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let o=[];return i.getByType("space").forEach(s=>{var c,l;if(s.locations[0]){let u=hS(this.renderer,s,(l=(c=s.locations[0])==null?void 0:c.name)!=null?l:s.name,e);u&&o.push({textInfo:u,target:s})}}),o},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){L.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});d(this,"Labels",{all:({onCreate:e})=>{for(let i of Object.entries(this.mvf.space)){let[o,n]=i;n&&n.features.forEach(s=>{var v,I,x;let c=(v=this.api.getMapData())==null?void 0:v.getById("space",s.properties.id);if(!c)return;let l=(I=this.styleMap[s.properties.id])==null?void 0:I.showImage,u=(x=s.properties.details)==null?void 0:x.images,f={};l&&u&&u.length>0&&(f={marker:{icon:u[0].url}});let g=(o?this.floorsById.get(o):this.currentFloor).layers.get(ci);if(s.properties.center&&s.properties.externalId!==""){let b=this.renderer.addLabel2D(s.properties.center,s.properties.externalId,{id:s.properties.id+"-label",appearance:f},Be.is(c)?c.id:g==null?void 0:g.containerId);b&&(Be.is(c)&&g&&g.labelIds.add(b.id.toString()),e(b.id,s.properties.externalId,c))}})}},add:(e,i,o={})=>{let{floorId:n,...s}=o,c=n?this.floorsById.get(n):this.currentFloor,l=c.layers.get(ci),u=this.renderer.addLabel2D(e,i,{...s,occluderId:c.occluderId},(o==null?void 0:o.spaceId)||(l==null?void 0:l.containerId));if(!u)throw new Error("label creating failed");return o!=null&&o.spaceId&&l.labelIds.add(u.id.toString()),u},remove:({label:e,entityId:i})=>{var o;if(Be.is(e.target)){let n=this.floorsById.get(e.target.floor.id);n&&((o=n.layers.get(ci))==null||o.labelIds.delete(e.id.toString()))}this.renderer.remove(i)},removeAll:()=>{}});d(this,"Paths",{add:(e,i)=>{var u;let o=[],n=e[0].floorId||"root",s=0;for(let f of e){let{floorId:y="root",latitude:g,longitude:v}=f;y!==n&&(s++,n=y),o[s]==null&&o.push({floorId:y,coordinates:[]}),o[s].coordinates.push([v,g])}let c=o.reduce((f,{floorId:y,coordinates:g},v)=>{if(v!==0){let x=o[v-1],b=g[0],S=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:x.floorId},geometry:{type:"Point",coordinates:x.coordinates[x.coordinates.length-1]}},{type:"Feature",properties:{parentId:y},geometry:{type:"Point",coordinates:b}}]},i,this.id);S&&f.push(S)}let I=this.renderer.addPath({type:"FeatureCollection",features:g.map(x=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:x}}))},i,y);return I&&f.push(I),f},[]),l=new wt({fraction:0}).to({fraction:1},(u=i==null?void 0:i.drawDuration)!=null?u:1e3).onUpdate(({fraction:f})=>{c.forEach(y=>{this.renderer.setState(y.id,{completeFraction:f})})}).start();return this.renderer.getTweenGroup().add(l),this.renderer.render(),this.animations.set(c[0].id.toString(),l),{paths:c,animation:T1(l).then(()=>{this.animations.delete(c[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});C(this,_t,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=n.core,this.api=n,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new Gc({currentMapGetter:()=>this}),this.DynamicFocus=new Cs(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(u=i==null?void 0:i.mvf)!=null?u:{};let s=fS(this.mvf["styles.json"]||{});if(this.styleMap=s,P(this,_t,{enabled:!1,floorHeight:Qw,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!i){this.id!=="outdoors-container"&&L.warn("Map (".concat(this.id,") created with no data."));let v=new zc({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(v.id,v),this.currentFloorStackId=v.id;let I=new Nc(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,a(this,_t),o!=null?o:{});v.addFloor(I),this.floorsById.set(I.id,I),this.setFloor(I.id);return}let c=i.getMVFFeatureByType("floor-stack");(c==null||c.length===0)&&L.throw("MVF does not contain any Floor Stacks.");for(let v of c){let I=new zc(v,this.id,this.renderer,(f=this.mvf.facade)==null?void 0:f[v.id]);if(I.floorIds.length!==0){for(let x of I.floorIds){let b=i.getMVFFeatureById("floor",x);if(b!=null){let S=this.mvf.space[b.id],w=this.mvf.obstruction[b.id];if((S==null||S.features.length===0)&&(w==null||w.features.length===0))continue;let T=new Nc(I.id,b,this.renderer,a(this,_t),o!=null?o:{},this.mvf,s);I.addFloor(T),this.floorsById.set(T.id,T)}}this.floorStacksById.set(v.id,I),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(i.facadesBySpaceId)){let I=i.getById("space",v);I&&(this.outdoorFloorStacks.add(I.floor.floorStack.id),(y=this.floorsById.get(I.floor.id))==null||y.setVisible(!0))}let l=(g=this.mvf.enterprise)==null?void 0:g.venue.defaultMap;if(o!=null&&o.initialFloor){let v=$s(o.initialFloor);v&&this.floorsById.has(v)?l=v:L.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);return e||L.throw('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found')),e}setFloorStack(e){if(this.currentFloorStackId===e)return;let i=this.floorStacksById.get(e);if(i==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(i.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(i.defaultFloor.id)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);return e||L.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var n,s,c;let i=this.floorsById.get(e),o=this.floorStacksById.get(this.currentFloorStackId);i&&o&&(!((n=a(this,_t))!=null&&n.enabled)||i.floorStackId!==(o==null?void 0:o.id)?(!this.options.keepOutdoorGeometryVisible||!this.outdoorFloorStacks.has(o.id))&&(o==null||o.floorObjects.forEach(l=>{l.id!==e&&l.setVisible(!1)})):(cS(this.currentFloorStack.floorObjects,i,((c=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:c.map(u=>u.id))||[]).forEach(u=>{var f,y,g,v;u.floor.setVisible(u.visible);for(let[I,x]of u.floor.layers)u.visibleLayers.includes(I)?x.show():x.hide();u.expandFootprint?(this.renderer.setState("Footprint-".concat(u.floor.id),{height:Math.abs(u.floor.elevation)*a(this,_t).floorHeight,altitude:-a(this,_t).floorHeight/2}),(y=(f=this.api)==null?void 0:f.Outdoor)==null||y.setOpacity(.2)):(this.renderer.setState("Footprint-".concat(u.floor.id),{height:-a(this,_t).floorHeight,altitude:a(this,_t).floorHeight/2}),i.elevation>=0&&((v=(g=this.api)==null?void 0:g.Outdoor)==null||v.setOpacity("initial")))}),a(this,_t).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*a(this,_t).floorHeight)))}setFloor(e,i){if(this.currentFloorId!==e){if(!this.floorsById.has(e)){L.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}if(this.publish("floor-change-start",{floorId:e}),this.DynamicFocus.enabled){let o=this.floorsById.get(e);if(!this.outdoorFloorStacks.has(this.currentFloorStack.id)&&(o==null?void 0:o.floorStackId)===this.currentFloorStack.id){let n=this.floorsById.get(this.currentFloorId);n==null||n.setVisible(!1)}}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.DynamicFocus.enabled||this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};_t=new WeakMap,p(w1,"GeojsonApiMapObject");var ip=w1;function hS(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}p(hS,"labelSpace");m();var Sr,np,E1=class E1{constructor({currentMapGetter:t}){C(this,Sr,new Map);C(this,np,void 0);P(this,np,t)}get currentMap(){return a(this,np).call(this)}getById(t){return a(this,Sr).get(t)}add(t,e,i){let o=t.anchorTarget;if(!o)throw new Error("get coordinate failed");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Markers.add(o,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(s==null)throw new Error("error creating marker");let c=n.Markers.getContentEl(s.id.toString());if(!c)throw new Error("marker component should exist");let l=new xi(s.id.toString(),c,t);return a(this,Sr).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var i;let e=a(this,Sr).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),a(this,Sr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Sr).forEach(({marker:e})=>{this.remove(e),t.push(e),a(this,Sr).delete(e.id.toString())}),t}setPosition(t,e){var s;let i=e.anchorTarget;if(!i){L.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){L.error("Cannot determine the current map.");return}let n=a(this,Sr).get(t.id);if(!n){L.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(n.entityId,Xr(i),(s=i.floorId)!=null?s:o.currentFloorId),n.marker.updateTarget(e)}animateTo(t,e,i){var c;let o=e.anchorTarget;if(!o)return L.error("Cannot determine coordinate from target."),Promise.resolve();let n=this.currentMap;if(!n)return L.error("Cannot determine the current map."),Promise.resolve();let s=a(this,Sr).get(t.id);return s?(s.marker.updateTarget(e),n.Markers.animateTo(s.entityId,Xr(o),(c=o.floorId)!=null?c:n.currentFloorId,i)):(L.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Sr=new WeakMap,np=new WeakMap,p(E1,"Markers");var op=E1;m();var Ei,sp,D1=class D1{constructor({currentMapGetter:t}){C(this,Ei,new Map);C(this,sp,void 0);P(this,sp,t)}get currentMap(){return a(this,sp).call(this)}getById(t){return a(this,Ei).get(t)}add(t,e,i){let o=ai(t);if(!o)throw new Error("get coordinate failed");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Images.add(Xr(o),e,{...i,floorId:o.floorId});if(!s)throw new Error("image component should exist");let c=new xc(s.id.toString(),e,t);return a(this,Ei).set(c.id,{image:c,entityId:s.id.toString()}),c}remove(t){var i;let e=a(this,Ei).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),a(this,Ei).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Ei).forEach(({image:e})=>{this.remove(e),t.push(e),a(this,Ei).delete(e.id.toString())}),t}};Ei=new WeakMap,sp=new WeakMap,p(D1,"Images");var ap=D1;m();var Yr,cp,O1=class O1{constructor({currentMapGetter:t}){C(this,Yr,new Map);C(this,cp,void 0);P(this,cp,t)}get currentMap(){return a(this,cp).call(this)}getById(t){return a(this,Yr).get(t)}add(t,e){let i=Array.isArray(t)?t:[t],o=i.reduce((c,l)=>{var f;let u=ai(l.target);return u?(c.has(u.floorId)||c.set(u.floorId,[]),(f=c.get(u.floorId))==null||f.push({...l,target:u}),c):(L.error("Cannot determine coordinate from options."),c)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=[];return o.forEach((c,l)=>{let u=ge();n.Models.add(u,c,{...e,floorId:l}).forEach(({id:y})=>{let g=new xn(y.toString(),u);a(this,Yr).set(g.id,{model:g,entityId:y.toString(),groupId:u}),s.push(g)})}),Array.isArray(t)?s:s[0]}remove(t){var i;let e=a(this,Yr).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),a(this,Yr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Yr).forEach(({model:e})=>{var o;let i=a(this,Yr).get(e.id);i&&(t.push(e),(o=this.currentMap)==null||o.Models.remove(i.entityId,i.groupId),a(this,Yr).delete(e.id.toString()))}),t}};Yr=new WeakMap,cp=new WeakMap,p(O1,"Models");var lp=O1;m();var Zr,up,L1=class L1{constructor({currentMapGetter:t}){C(this,Zr,new Map);C(this,up,void 0);P(this,up,t)}get currentMap(){return a(this,up).call(this)}getById(t){return a(this,Zr).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let o=i.Paths.add(t,e),n=o.paths.map(c=>c.id.toString()),s=new In(ge(),o.animation,t);for(let c of n)a(this,Zr).set(c,{path:s,entityIds:n});return a(this,Zr).set(s.id,{path:s,entityIds:n}),s}remove(t){var i;let e=a(this,Zr).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),a(this,Zr).delete(t.id),e.entityIds.forEach(o=>a(this,Zr).delete(o)))}removeAll(){let t=[];return a(this,Zr).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Zr=new WeakMap,up=new WeakMap,p(L1,"Paths");var pp=L1;m();var TS=Bp(o6(),1);m();var A1="#2266ff",eE="#808080",mS="#f5f5f5";var yS={radius:10,color:A1,inactiveColor:eE,heading:{color:A1,opacity:.7},accuracyRing:{color:A1,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};m();var gS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var vS=p((r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=e/Math.tan(r/2),o=e/Math.sin(r/2),n=o+t,s=10,c=new Tr;c.moveTo(-o*Math.sin(r/2),o*Math.cos(r/2)-i);for(let l=0;l<s;l++)c.lineTo(-(n*Math.sin(r/2-r/s*l)),n*Math.cos(r/2-r/s*l)-i);for(let l=0;l<s;l++)c.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/s*l)),e*Math.cos(Math.PI/-2+Math.PI/s*l));return new wr(c,{depth:.1,bevelEnabled:!1,UVGenerator:rE(t)})},"createSectorGeometry"),F1=p((r,t,e)=>{let o=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return o>1?o=1:o<0&&(o=0),new Q(0,o)},"generateRadialUV"),rE=p(r=>({generateTopUV:(t,e,i,o,n)=>{let s=e[i*3],c=e[i*3+1],l=e[o*3],u=e[o*3+1],f=e[n*3],y=e[n*3+1];return[F1(s,c,r),F1(l,u,r),F1(f,y,r)]},generateSideWallUV:()=>[new Q(0,1),new Q(0,1),new Q(0,1),new Q(0,1)]}),"radialUVGenerator");function bS(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}p(bS,"getPositionWithOverrides");function iE([r,t],[e,i],[o,n]){let s=e-r,c=i-t,l=s**2+c**2;if(l===0)return;let u=((o-r)*s+(n-t)*c)/l,f;u<=0?f=[r,t]:u>=1?f=[e,i]:f=[r+u*s,t+u*c];let y=_p([o,n],f);return{proportion:Math.max(0,Math.min(1,u)),intersection:f,distance:y}}p(iE,"getPointLineIntersection");function CS(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,i,o=0,n=0;for(let s=0;s<r.length-1;s++){let c=r[s],l=r[s+1],u=iE(c,l,t);u!=null&&u.distance<e&&(e=u.distance,i=u.intersection,o=s,n=u.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:o,proportion:n}}p(CS,"findBlueDotOnPath");function SS(r,t){let e=new Ui({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,o=.35*4,n=vS(Math.PI/6,o,i);new zn().load(gS,c=>{e.alphaMap=c,e.needsUpdate=!0});let s=new ce(n,e);return s.position.z=-.05,s.renderOrder=0,s}p(SS,"createHeadingCone");function xS(r,t){let e=new Xp(1,1,.05,32),i=new Ui({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),o=new ce(e,i);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}p(xS,"createAccuracyRing");function IS(r){let t=new Xp(.35,.35,.07,32),e=new Ui({transparent:!0,color:mS,depthTest:!1,depthWrite:!1}),i=new ce(t,e);i.renderOrder=2;let o=new Xp(.35*.8,.35*.8,.01,32),n=new Ui({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),s=new ce(o,n);return s.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,s.rotation.x=Math.PI/2,s.position.z=.07,{outerMesh:i,innerMesh:s}}p(IS,"createBlueDot");var wS=Bp(MS(),1);var On,Di,Rt,Nt,Oi,Ln,An,Fn,ke,Dt,dp,Li,hp,fp,mp,yp,Th,zr,Ai,wh,Bn,gp,qr,B1=class B1 extends z{constructor(e,i){super();this.core=e;this.geoJSONApi=i;C(this,On,null);d(this,"geometry");C(this,Di,void 0);C(this,Rt,void 0);C(this,Nt,void 0);C(this,Oi,void 0);C(this,Ln,void 0);C(this,An,void 0);C(this,Fn,void 0);C(this,ke,yS);C(this,Dt,1);C(this,dp,void 0);C(this,Li,void 0);d(this,"state","disabled");d(this,"following",!1);C(this,hp,p(e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)},"#getFloorByFloorId"));C(this,fp,p(e=>{var o;let i;if(e!=null){let n=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(e);i=n?a(this,hp).call(this,n.id):void 0}return i},"#getFloorByFloorLevel"));C(this,mp,p(e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,o,n,s]=e.children;if(a(this,Th).call(this),o.scale.set(a(this,Dt),a(this,Dt),a(this,Dt)),o.position.z=.07/2*a(this,Dt),n.scale.set(a(this,Dt),a(this,Dt),a(this,Dt)),n.position.z=.07*a(this,Dt),this.state==="active"){n.material.color.set(a(this,ke).color);let c=this.accuracy;c!=null?(i.visible=!0,a(this,An)&&a(this,An).stop(),P(this,An,new wt({scale:i.scale.x}).to({scale:c/2},150).onUpdate(({scale:u})=>{i.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(a(this,An))):i.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,a(this,Fn)&&a(this,Fn).stop();let{start:u,end:f}=Rp(s.rotation.z,-le.degToRad(l));P(this,Fn,new wt({rotation:u}).to({rotation:f},150).onUpdate(({rotation:y})=>{s.rotation.z=y}).start()),this.core.getTweenGroup().add(a(this,Fn)),s.scale.set(a(this,Dt),a(this,Dt),1)}else s.visible=!1}else this.state==="inactive"&&(n.material.color.set(a(this,ke).inactiveColor),s.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));C(this,yp,p(e=>{var s,c;let i;try{i=lE.parse(bS(e,a(this,Rt)))}catch(l){a(this,zr).call(this,"error"),L.error("BlueDot: Position parse failed",l instanceof _.ZodError?l.message:String(l)),this.publish("error");return}a(this,ke).debug&&L.log("BlueDot: Parsed position",i),P(this,Nt,i),a(this,zr).call(this,"position-update"),a(this,Oi)&&clearTimeout(a(this,Oi)),typeof a(this,ke).timeout=="number"&&a(this,ke).timeout<1/0&&P(this,Oi,setTimeout(()=>{a(this,ke).debug&&L.log("BlueDot: Position timed out after ".concat(a(this,ke).timeout,"ms")),a(this,zr).call(this,"timeout"),this.core.render()},a(this,ke).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(s=i.floor)==null?void 0:s.elevation,accuracy:i.accuracy}});let o=i.floor!=null?i.floor.id:"outdoors-container",n=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:l=>{let u=xS(a(this,ke).accuracyRing.color,a(this,ke).accuracyRing.opacity),{outerMesh:f,innerMesh:y}=IS(a(this,ke).color),g=SS(a(this,ke).heading.color,a(this,ke).heading.opacity);l.add(u),u.visible=!1,l.add(f),l.add(y),l.add(g),g.visible=!1,a(this,mp).call(this,l)},update:a(this,mp)},{visible:!0},o);else{let l=this.core.getState(this.geometry);n=[l.position[0],l.position[1]]}a(this,Ln)&&a(this,Ln).stop(),P(this,Ln,new wt(n).to([i.longitude,i.latitude],1e3).easing(we.Cubic.Out).onUpdate(l=>{if(this.geometry){let u={position:[l[0],l[1]]};u.parent=o,this.core.setState(this.geometry,u)}}).start()),this.core.getTweenGroup().add(a(this,Ln)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));d(this,"onPositionUpdate",p(e=>{var i,o,n,s,c;if(this.state!=="disabled"){try{sE.parse(e)}catch(l){a(this,zr).call(this,"error"),L.error("BlueDot: Browser sent invalid position",l instanceof _.ZodError?l.message:String(l)),this.publish("error");return}P(this,Di,{latitude:(i=e.coords)==null?void 0:i.latitude,longitude:(o=e.coords)==null?void 0:o.longitude,accuracy:(n=e.coords)==null?void 0:n.accuracy,heading:(s=e.coords)==null?void 0:s.heading,floor:a(this,fp).call(this,(c=e.coords)==null?void 0:c.floorLevel)}),a(this,yp).call(this,a(this,Di))}},"onPositionUpdate"));d(this,"onPositionError",p(e=>{var i;switch(a(this,zr).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"));C(this,Th,p(()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==a(this,dp)){P(this,dp,e);let o=(i=this.core.getMetresPerPixel())!=null?i:1;P(this,Dt,Math.max(a(this,ke).radius/(.35/o),1))}},"#updateScale"));C(this,zr,p(e=>{let i=aE[this.state].actions[e];if(i){switch(a(this,ke).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"));C(this,Ai,void 0);C(this,wh,p(()=>{if(a(this,Ai)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(o=>o.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(o=>o.floorId===this.geoJSONApi.currentFloor.id);P(this,Ai,(0,wS.default)(i.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return a(this,Ai)},"#getSimplifiedDirections"));C(this,Bn,p(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),a(this,qr)&&(this.off("position-update",a(this,qr)),P(this,qr,void 0)),this.following=!1,P(this,Ai,void 0),this.core.off("user-interaction-start",a(this,Bn)),this.geoJSONApi.currentMap.off("navigation-active-path-change",a(this,gp)),this.publish("follow-change",{following:!1})},"#cancelFollow"));C(this,gp,p(()=>{P(this,Ai,void 0)},"#pathChangeHandler"));C(this,qr,void 0);d(this,"follow",p((e,i)=>{var n,s,c,l;if(e===!1){a(this,Bn).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&L.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(n=i==null?void 0:i.zoomLevel)!=null?n:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(s=i==null?void 0:i.pitch)!=null?s:45,duration:(c=i==null?void 0:i.duration)!=null?c:1e3,easing:(l=i==null?void 0:i.easing)!=null?l:"ease-in-out"};this.following?a(this,qr)&&this.off("position-update",a(this,qr)):(this.following=!0,this.core.on("user-interaction-start",a(this,Bn)),this.geoJSONApi.currentMap.on("navigation-active-path-change",a(this,gp))),P(this,qr,u=>{let{coordinate:f,heading:y,floor:g}=u;if(o.center=[f.longitude,f.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),P(this,Ai,void 0)),e==="position-and-heading")o.bearing=y!=null?y:void 0;else if(e==="position-and-path-direction"){let v=a(this,wh).call(this);if(v!=null){let I=CS(v,[f.longitude,f.latitude]);if(I!=null){let x=v[I.segmentIndex],b=v[I.segmentIndex+1];o.bearing=x0(x,b)}}}this.core.camera.animateTo(o)}),this.on("position-update",a(this,qr)),this.publish("follow-change",{following:!0,mode:e})},"follow"))}get heading(){var e;return(e=a(this,Nt))==null?void 0:e.heading}get accuracy(){var e;return(e=a(this,Nt))==null?void 0:e.accuracy}get coordinate(){var e,i;if(a(this,Nt)!=null)return(a(this,Li)==null||((e=this.floor)==null?void 0:e.id)!==a(this,Li).floorId||a(this,Nt).latitude!==a(this,Li).latitude||a(this,Nt).longitude!==a(this,Li).longitude)&&P(this,Li,new K(a(this,Nt).latitude,a(this,Nt).longitude,(i=this.floor)==null?void 0:i.id)),a(this,Li)}get floor(){var e;return(e=a(this,Nt))==null?void 0:e.floor}enable(e){P(this,ke,(0,TS.default)({},e,a(this,ke))),a(this,zr).call(this,"enable"),this.watchDevicePosition(a(this,ke).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),a(this,Oi)&&(clearTimeout(a(this,Oi)),P(this,Oi,void 0)),this.following&&a(this,Bn).call(this),this.watchDevicePosition(!1),P(this,Nt,void 0),P(this,Rt,void 0),a(this,zr).call(this,"disable")}watchDevicePosition(e){if(a(this,On)&&(navigator.geolocation.clearWatch(a(this,On)),P(this,On,null)),a(this,Di)&&P(this,Di,void 0),e){if(this.state==="disabled"){L.warn("BlueDot must be enabled before watching browser position.");return}P(this,On,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var o,n;e==null?P(this,Rt,void 0):"coords"in e?P(this,Rt,Object.assign({},a(this,Rt),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:a(this,fp).call(this,e.coords.floorLevel)})):(P(this,Rt,Object.assign({},a(this,Rt),e)),"floorOrFloorId"in e&&(a(this,Rt).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?a(this,hp).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((o=a(this,Rt))==null?void 0:o.latitude)!=null&&((n=a(this,Rt))==null?void 0:n.longitude)!=null||a(this,Di)!=null)&&a(this,yp).call(this,a(this,Di))}};On=new WeakMap,Di=new WeakMap,Rt=new WeakMap,Nt=new WeakMap,Oi=new WeakMap,Ln=new WeakMap,An=new WeakMap,Fn=new WeakMap,ke=new WeakMap,Dt=new WeakMap,dp=new WeakMap,Li=new WeakMap,hp=new WeakMap,fp=new WeakMap,mp=new WeakMap,yp=new WeakMap,Th=new WeakMap,zr=new WeakMap,Ai=new WeakMap,wh=new WeakMap,Bn=new WeakMap,gp=new WeakMap,qr=new WeakMap,p(B1,"BlueDot");var xs=B1,aE={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"}}},sE=_.object({coords:_.object({latitude:_.number(),longitude:_.number(),accuracy:_.number(),altitude:_.number().optional().nullable(),altitudeAccuracy:_.number().optional().nullable(),heading:_.number().optional().nullable(),speed:_.number().optional().nullable(),floorLevel:_.number().optional().nullable()}),timestamp:_.number()}),lE=_.object({latitude:_.number(),longitude:_.number(),floor:_.custom().optional(),accuracy:_.number().optional(),heading:_.number().optional().nullable()});m();var Fi,bp,k1=class k1{constructor({currentMapGetter:t}){C(this,Fi,new Map);C(this,bp,void 0);P(this,bp,t)}get currentMap(){return a(this,bp).call(this)}getById(t){return a(this,Fi).get(t)}add(t,e,i){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let n=o.Shapes.add(t,e||{},{floorId:i==null?void 0:i.id}),s=new wo(n);return a(this,Fi).set(s.id,s),s}remove(t){var i;a(this,Fi).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),a(this,Fi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Fi).forEach(e=>{this.remove(e),t.push(e.id),a(this,Fi).delete(e.id.toString())}),t}};Fi=new WeakMap,bp=new WeakMap,p(k1,"Shapes");var vp=k1;m();var Sp,_1=class _1{constructor({currentMapGetter:t}){C(this,Sp,void 0);P(this,Sp,t)}get currentMap(){return a(this,Sp).call(this)}setFromStyleCollection(t){var e,i,o;for(let n in t)for(let s of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[n]==null||!s.layers.has(Me))continue;let c=s.layers.get(Me);if(c!=null&&c.layers.has(n)&&"color"in t[n]){let l=c.layers.get(n);(i=this.currentMap)==null||i.renderer.setState(l,{color:t[n].color})}if(c&&n===eo&&!(Lr in t)){let l=c.layers.get(Lr);l&&"color"in t[n]&&((o=this.currentMap)==null||o.renderer.setState(l,{color:t[n].color}))}}}};Sp=new WeakMap,p(_1,"Style");var Cp=_1;m();var R1={opacity:1},nt,xp,Ip,ko,Bi,Mp,N1,Eh,ES,G1=class G1{constructor(t,e){C(this,Mp);C(this,Eh);C(this,nt,void 0);C(this,xp,[]);C(this,Ip,{opacity:"initial"});C(this,ko,{opacity:new Map});C(this,Bi,new Set);P(this,nt,t),P(this,xp,e||[]);let i=a(this,nt).map;i&&i.on("idle",()=>{a(this,ko).opacity.size||V(this,Mp,N1).call(this,i)})}setStyle(t){var e,i;if(a(this,nt).map){(e=a(this,nt).map)==null||e.setStyle(t),a(this,Bi).size&&(a(this,Bi).clear(),this.hide()),V(this,Eh,ES).call(this),V(this,Mp,N1).call(this,a(this,nt).map),this.setOpacity(a(this,Ip).opacity),(i=a(this,nt).map)==null||i.moveLayer(qh);for(let[o,n,s]of a(this,xp)||[])a(this,nt).hideOutdoorLayersIntersectingPolygons(o,n,s)}}get map(){return a(this,nt).map}get enabled(){return!!a(this,nt).map}get visible(){return a(this,Bi).size===0}show(){let t=a(this,nt).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{a(this,Bi).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),a(this,Bi).clear())}hide(t=[]){let e=a(this,nt).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(o=>{let n=e.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&n!=="none"&&(e.setLayoutProperty(o.id,"visibility","none"),a(this,Bi).add(o.id))})}setOpacity(t,e=[]){var n,s;let i=a(this,nt).map;if(!i)return;let o=(s=(n=a(this,nt).map)==null?void 0:n.getStyle())==null?void 0:s.layers;o&&i.once("idle",()=>{o.forEach(c=>{let l=i.getLayoutProperty(c.id,"visibility");if(!e.includes(c.id)&&l!=="none")try{let u=a(this,ko).opacity.get(c.id);u!==void 0&&(c.id==="background"||(c.type==="symbol"?(i.setPaintProperty(c.id,"icon-opacity",t==="initial"?u[0]:t),i.setPaintProperty(c.id,"text-opacity",t==="initial"?u[1]:t)):i.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?u[0]:t)),a(this,Ip).opacity=t)}catch(u){L.warn("Error setting opacity:",u)}})})}};nt=new WeakMap,xp=new WeakMap,Ip=new WeakMap,ko=new WeakMap,Bi=new WeakMap,Mp=new WeakSet,N1=p(function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var n,s,c;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?a(this,ko).opacity.set(i.id,[(n=t.getPaintProperty(i.id,"icon-opacity"))!=null?n:R1.opacity,(s=t.getPaintProperty(i.id,"text-opacity"))!=null?s:R1.opacity]):a(this,ko).opacity.set(i.id,[(c=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?c:R1.opacity,void 0])))})},"#setInitialStyle"),Eh=new WeakSet,ES=p(function(){Object.values(a(this,ko)).forEach(t=>t.clear())},"#clearInitialStyle"),p(G1,"Outdoor");var Is=G1;m();var ki,_i,_o,V1=class V1{constructor({currentMapGetter:t}){C(this,ki,void 0);C(this,_i,new Map);C(this,_o,new Map);P(this,ki,t)}labelAll(t={}){var o,n;let e=[],i=new Set;return(n=(o=a(this,ki).call(this))==null?void 0:o.Text3D.labelAll(t))==null||n.forEach(({textInfo:s,target:c})=>{let l=s.id.toString(),u=a(this,_o).get(l);if(u){i.has(l)||e.push(u.text3DView),i.add(l);return}i.add(l);let f=new Eo(l,c);a(this,_i).set(f.id,{targetId:c.id,text3d:l,text3DView:f}),a(this,_o).set(l,{text3DView:f}),e.push(f)}),e}label(t,e,i={}){var n;if(a(this,ki).call(this))if(Be.is(t)){let s=(n=a(this,ki).call(this))==null?void 0:n.Text3D.label(t,e,i);if(!s)return;let c=s.textInfo.id.toString(),l=a(this,_o).get(c);if(l)return l.text3DView;let u=new Eo(c,s.target);return a(this,_i).set(u.id,{targetId:s.target.id,text3d:c,text3DView:u}),a(this,_o).set(c,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var o;let e=typeof t=="string"?t:t.id,i=a(this,_i).get(e);i&&((o=a(this,ki).call(this))==null||o.Text3D.remove(i.text3d),a(this,_i).delete(e),a(this,_o).delete(i.text3d))}removeAll(){a(this,_i).forEach(t=>{var e;(e=a(this,ki).call(this))==null||e.Text3D.remove(t.text3d)}),a(this,_i).clear()}};ki=new WeakMap,_i=new WeakMap,_o=new WeakMap,p(V1,"Text3D");var Dh=V1;var Oh=.05,U1=class U1{constructor(t,e){d(this,"core");d(this,"mapObjects",[]);d(this,"id");d(this,"mapDataExternal",{});d(this,"mapsByFloorId",{});d(this,"mapData");d(this,"currentMap");d(this,"hiddenOutdoorGeometries",[]);d(this,"lastFacadeIntersected");d(this,"mapView");d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"Outdoor");d(this,"BlueDot");d(this,"Shapes");d(this,"Style");d(this,"Images");d(this,"update",p(()=>{this.core.render()},"update"));this.core=t,this.mapView=e,this.Camera=new Ac(this.core),this.id=this.core.addGroupContainer("root").id.toString();let i=new ip("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")});let o=new Pc(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let n=p(l=>u=>{var T,E,D,A;let f=[],y=[],g=[],v=[];u.labels.forEach(R=>{let N=this.Labels.getById(R.toString());N&&f.push(N.label)}),u.markers.forEach(R=>{let N=this.Markers.getById(R.toString())||this.Navigation.getMarkerById(R.toString());N&&y.push(N.marker)}),u.models.forEach(R=>{let N=this.Models.getById(R.toString());N&&g.push(N.model)}),u.paths.forEach(R=>{let N=this.Paths.getById(R.toString())||this.Navigation.getPathById(R.toString());N&&v.push(N.path)});let I=u.geometry[0],x;I&&(x=(T=this.getMapDataInternal())==null?void 0:T.getById("space",I)),x||(x=(E=this.getMapDataInternal())==null?void 0:E.getById("object",I));let b=u.containers.reduce((R,N)=>{var H;let B=(H=this.getMapDataInternal())==null?void 0:H.getById("floor",N);return B&&Ki.is(B)&&R.push(B),R},[]),S;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(R=>{this.core.setState(R.id,{hovered:!1})}),x&&Be.is(x)&&(S=(D=this.getMapDataInternal())==null?void 0:D.facadesBySpaceId[I],S&&S.spaces.forEach(R=>{this.core.setState(R.id,{hovered:!0})})),this.lastFacadeIntersected=S;let w={coordinate:new K(u.coordinate[1],u.coordinate[0],(A=b==null?void 0:b[0])==null?void 0:A.id),spaces:x&&Be.is(x)?[x]:[],objects:x&&Ht.is(x)?[x]:[],markers:y,labels:f,models:g,paths:v,floors:b,facades:S?[S]:[]};"pointerEvent"in u&&(w.pointerEvent=u.pointerEvent),this.mapView.publish(l,w)},"createHandler");this.core.on("hover",n("hover")),this.core.on("click",n("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let s={currentMapGetter:()=>this.currentMap};this.Markers=new op(s),this.Models=new lp(s),this.Labels=new kc(s),this.Text3D=new Dh(s),this.Exporter=new Bc(s),this.Paths=new pp(s),this.Navigation=new wc(this.core,this,s.currentMapGetter),this.BlueDot=new xs(this.core,this),this.BlueDot.on("position-update",l=>{this.mapView.publish("blue-dot-position-update",l)}),this.BlueDot.on("state-change",l=>{this.mapView.publish("blue-dot-state-change",l)}),this.BlueDot.on("error",l=>{this.mapView.publish("blue-dot-error",l)}),this.BlueDot.on("follow-change",l=>{this.mapView.publish("blue-dot-follow-change",l)}),this.Outdoor=new Is(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 ap(s),this.Shapes=new vp(s),this.Style=new Cp(s);let c=new Ch(e,this.mapDataExternal);this.auto=c.auto}get DynamicFocus(){return this.currentMap.DynamicFocus}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Me);if(n){let s=n.layers.get(eo);s&&this.core.setState(s,j1(e,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Me);if(n){let s=n.layers.get(Lr);s&&this.core.setState(s,j1(e,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Me);if(n){let s=n.layers.get(sa);s&&this.core.setState(s,Lh(e,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Me);if(n){let s=n.layers.get(la);s&&this.core.setState(s,Lh(e,this.core.getState(s)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(Po.is(i))return this.core.setState(i.id,DS({...e,type:"label"},this.core.getState(i.id)));if(xi.is(i))return this.core.setState(i.id,OS({...e,type:"marker"},this.core.getState(i.id)));if((Be.is(i)||Ht.is(i))&&this.core.setState(i.id,H1({...e,type:"geometry"},this.core.getState(i.id))),rr.is(i)&&this.core.setState(i.id,Lh({...e,type:"doors"},this.core.getState(i.id))),wo.is(i)&&this.core.setState(i.id,$h(e,["altitude","color","opacity"])),xn.is(i)&&this.core.setState(i.id,e),Ut.is(i))for(let o of i.spaces)this.core.setState(o.id,H1({...e,type:"geometry"},this.core.getState(o.id)));Eo.is(i)&&this.core.setState(i.id,$h(e,nf))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return yl(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var y,g,v;let o;try{o=yl(t)}catch(I){L.error("Error adding map",I),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:n}=o,s=n["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new K(s[1],s[0])});let c=n["manifest.geojson"].features[0].properties.name,l=new ip("mapObject-".concat(c),o,e,this),u=this.core.getBoundingArea(l.currentFloor.id);u==null&&L.error("Could not determine bounding box for map:",l.currentFloor.id);let f=(g=(y=e==null?void 0:e.outdoorView)==null?void 0:y.layersHiddenByGeometry)!=null?g:[];if(f.length>0){let I,x=[];for(let b of l.floorStacksById.values())if(b.defaultFloor.footprint&&b.defaultFloor.footprint.geometry!=null&&((v=b.defaultFloor.footprint.geometry)==null?void 0:v.coordinates.length)>0){let S=b.defaultFloor.footprint,w=AS(S);I==null?I=w:FS(I,w),x.push(S)}x.length>0&&I!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(I,x,f),this.hiddenOutdoorGeometries.push([I,x,f]))}this.mapObjects.push(l),o.getMVFFeatureByType("floor").forEach(I=>{this.mapsByFloorId[I.id]=l}),l.on("navigation-connection-click",I=>{this.mapView.publish("navigation-connection-click",I)}),l.on("navigation-active-path-change",I=>{this.mapView.publish("navigation-active-path-change",I)}),l.StackedMaps.on("stacked-maps-state-change",({state:I})=>{this.mapView.publish("stacked-maps-state-change",{state:I})}),l.on("floor-change-start",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),l.on("floor-change",I=>{this.mapView.publish("floor-change",{reason:I.reason,floor:this.currentFloor})}),this.currentMap=l,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null?(this.core.camera.setZoomLevel(e.zoomLevel),i(t)):this.core.mode!=="outdoors-overlay"&&u?this.core.camera.focusOn(u,{duration:j2,padding:{top:Oh*this.core.canvasHeight,left:Oh*this.core.canvasWidth,right:Oh*this.core.canvasWidth,bottom:Oh*this.core.canvasHeight}}).then(()=>{i(t)}):i(t)})}setFloor(t,e){return this.currentMap.setFloor($s(t),e)}setFloorStack(t){return this.currentMap.setFloorStack($s(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw L.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw L.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw L.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw L.throw("Missing currentFloor");return e}getState(t){var o,n;if(typeof t=="object"&&Ut.is(t)){L.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}let e=LS(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:s,topColor:c,texture:l,topTexture:u,visible:f,height:y,opacity:g}=i;return{type:"walls",visible:f,color:s,topColor:c,texture:l?{url:l}:void 0,topTexture:u?{url:u}:void 0,height:y,opacity:g}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:s,topColor:c,texture:l,topTexture:u,visible:f,opacity:y}=i;return{type:"doors",visible:f,color:s,topColor:c,opacity:y,texture:l?{url:l}:void 0,topTexture:u?{url:u}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0,topColor:i.topColor};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((o=i.options)==null?void 0:o.rank)!==void 0&&i.options.interactive!==void 0){let s=typeof i.parent=="object"?i.parent.id:i.parent,c=this.Markers.getById(i.id.toString()),l=c!=null&&c.marker.target?c==null?void 0:c.marker.target.anchorTarget:void 0;return l==null&&(l=new K(i.position[1],i.position[0],s.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize}}else{if(i.type==="model")return{...i,type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&wo.is(t)){let[s]=i.children;if(s.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(n=i.altitude)!=null?n:0,visible:i.visible,color:i.color,height:s.height,opacity:s.opacity}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinate(t,e,i){return new K(t,e,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(t,e,i){let o=this.core.projectScreenXYToCoordinate(t,e);return o?new K(o[1],o[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){this.Labels.all()}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};p(U1,"GeoJsonApi");var Pp=U1;m();m();var X1=class X1{constructor(t){d(this,"state");d(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};p(X1,"Debug");var Fh=X1;m();var BS=_.object({environment:_.union([_.literal("basic"),_.literal(!1)]).optional(),text3d:_.object({hoverColor:_.string().optional()}).optional(),geometry:_.object({hoverColor:_.string().optional()}).optional(),backgroundColor:_.string().optional(),backgroundAlpha:_.number().optional()}).strict();var Tp,X,kn,W1=class W1 extends z{constructor(e){super();C(this,Tp,{});C(this,X,void 0);C(this,kn,void 0);d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Images");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"BlueDot");d(this,"Style");d(this,"Shapes");d(this,"Outdoor");d(this,"update",p(()=>{a(this,X).core.render()},"update"));d(this,"getDirections",p((e,i,o)=>{var n;return(n=a(this,X).getMapData())==null?void 0:n.getDirections(e,i,o)},"getDirections"));d(this,"getDirectionsMultiDestination",p((e,i,o)=>{var n;return(n=a(this,X).getMapData())==null?void 0:n.getDirectionsMultiDestination(e,i,o)},"getDirectionsMultiDestination"));d(this,"on",p((e,i)=>{super.on(e,i)},"on"));d(this,"off",p((e,i)=>{super.off(e,i)},"off"));d(this,"Debug");P(this,kn,e);let i=new Pp(e,this);P(this,X,i),this.Camera=a(this,X).Camera,P(this,Tp,a(this,X).mapDataExternal),this.Markers=a(this,X).Markers,this.Models=a(this,X).Models,this.Labels=a(this,X).Labels,this.Text3D=a(this,X).Text3D,this.Exporter=a(this,X).Exporter,this.Paths=a(this,X).Paths,this.Navigation=a(this,X).Navigation,this.BlueDot=a(this,X).BlueDot,this.Shapes=a(this,X).Shapes,this.Style=a(this,X).Style,this.auto=a(this,X).auto,this.Outdoor=a(this,X).Outdoor,this.Images=a(this,X).Images,a(this,kn).container.dataset.version=M.env.npm_package_version,this.Debug=new Fh(a(this,X).core)}get StackedMaps(){return a(this,X).currentMap.StackedMaps}get DynamicFocus(){return a(this,X).currentMap.DynamicFocus}updateState(e,i){return a(this,X).updateState(e,i)}updateGlobalState(e){var i,o,n,s;try{BS.parse(e)}catch(c){L.error("updateGlobalState",c);return}if(typeof e=="object"){let c={};if((i=e.text3d)!=null&&i.hoverColor&&(c.text3dHoverColor=e.text3d.hoverColor),(o=e.geometry)!=null&&o.hoverColor&&(c.hoverColor=e.geometry.hoverColor),e.backgroundColor||e.backgroundAlpha!==void 0){let l=(n=e.backgroundColor)!=null?n:a(this,X).core.backgroundColor,u=(s=e.backgroundAlpha)!=null?s:a(this,X).core.backgroundAlpha;a(this,X).core.setBackgroundColor(l,u)}e.environment!=null&&a(this,X).core.setEnvironment(e.environment),a(this,X).core.setState(c)}}getGlobalState(){let e=a(this,X).core.getState();return{backgroundColor:a(this,X).core.backgroundColor,backgroundAlpha:a(this,X).core.backgroundAlpha,environment:a(this,X).core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return a(this,Tp)}getDimensions(){return{width:a(this,kn).canvasWidth,height:a(this,kn).canvasHeight}}expand(e){var i;return(i=a(this,X).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=a(this,X).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return a(this,X).addMap(e,i)}setFloor(e){return a(this,X).setFloor(e)}setFloorStack(e){return a(this,X).setFloorStack(e)}get currentFloorStack(){return a(this,X).currentFloorStack}get currentFloor(){return a(this,X).currentFloor}updateWatermark(e){a(this,X).updateWatermark(e)}getState(e){return a(this,X).getState(e)}setHoverColor(e){a(this,X).setHoverColor(e)}getHoverColor(){return a(this,X).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return a(this,X).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return a(this,X).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return a(this,X).isInView(e)}getDistance(e,i){var o;return(o=a(this,X).getMapData())==null?void 0:o.getDistance(e,i)}createCoordinate(e,i,o){return a(this,X).createCoordinate(e,i,o)}createCoordinateFromScreenCoordinate(e,i,o){return a(this,X).createCoordinateFromScreenCoordinate(e,i,o)}auto(){this.Labels.all()}get __core(){if(M.env.INTERNAL==="true")return a(this,X).core;throw new Error("__core is not available.")}clear(){a(this,X).clear()}destroy(){a(this,X).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-2SK3WH2F.js");await new i(this,a(this,X)).enable(e)}};Tp=new WeakMap,X=new WeakMap,kn=new WeakMap,p(W1,"MapView");var Ms=W1;m();m();var Y1=class Y1 extends z{constructor(e){super();d(this,"gl");d(this,"el",document.createElement("div"));d(this,"core");d(this,"origin");d(this,"map");d(this,"layer");d(this,"handleStyleChange",p(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));d(this,"handleMove",p(()=>{if(!this.map)return;let[e,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(e,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(le.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(le.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",p(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 bc(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=K0.fromLngLat(this.origin,0);return this.layer=zp(i,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};p(Y1,"MapLibreOverlay");var Bh=Y1;var _n,Ps,Ro,Rn,wp=class wp extends z{constructor(e,i,o){super();C(this,_n,void 0);C(this,Ps,void 0);C(this,Ro,void 0);C(this,Rn,void 0);d(this,"on",p((e,i)=>{super.on(e,i)},"on"));d(this,"off",p((e,i)=>{super.off(e,i)},"off"));P(this,Rn,new Bh(e)),P(this,_n,i),P(this,Ps,o)}onAdd(e){var n,s;let i=a(this,Rn).onAdd(e),o={...Js,...(n=a(this,Ps))!=null?n:{},outdoorView:{token:a(this,_n).outdoorViewToken,...(s=a(this,Ps))==null?void 0:s.outdoorView}};return P(this,Ro,new Ms(a(this,Rn).core)),a(this,Ro).addMap(a(this,_n),o).then(()=>{this.publish("loaded",{mapView:a(this,Ro),mapData:a(this,_n)})}),i}onRemove(){a(this,Ro)&&a(this,Ro).clear(),wp.instance=null,a(this,Rn).onRemove()}};_n=new WeakMap,Ps=new WeakMap,Ro=new WeakMap,Rn=new WeakMap,p(wp,"MappedinMapLibreOverlay"),d(wp,"instance");var Ts=wp;var cE=p(async(r,t)=>{let e,i=on();t&&i.updateByUserOption(t);try{t&&(e=(await ll({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(s){L.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new ws(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new pu(o)},"hydrateMapDataFromMVF"),kS=!1;function pE(r){kS=r}p(pE,"setUseEnterpriseAPI");var uE=p(async(r,t)=>{var u,f,y,g;let e={...t||{}},i,o=on();o.updateByUserOption(e);let n={};if("type"in r&&typeof r.type=="string"){if(n.enterprise=(u=r.options)==null?void 0:u.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let v=await pl(r.main);i=cl(v),n.languagePacks=[];for(let I of(f=r.languagePacks)!=null?f:[])I.localePack instanceof Uint8Array&&n.languagePacks.push({language:I.language,localePack:await Sa(I.localePack)})}else if(r.type==="json")i=r.main,n.languagePacks=(y=r.languagePacks)!=null?y:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(n.binaryBundle=r.main)}else i=r,n.enterprise=i.enterprise!=null;let s;if("accessToken"in e)s=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=o.getBaseAuthUri(n.enterprise);let v=await ll(e,n.enterprise);s=(v==null?void 0:v.accessToken)||""}if(n.outdoorViewToken=s,n.env=o,s&&!n.enterprise)try{n.sasToken=(await eu(e,s)).token}catch(v){L.error("Failed to fetch SAS token.",v)}let c=new ws(i,n);s&&c.Analytics.init({accessToken:s,mapId:e.mapId,key:"key"in e?e.key:void 0,secret:"secret"in e?e.secret:void 0,...e.analytics,baseUri:o.getAnalyticsBaseUri(),context:(g=e.analytics)==null?void 0:g.context});let l=new pu(c);if("language"in e)try{await l.changeLanguage(e.language)}catch{}return l},"hydrateMapData"),_S=p(async r=>{var x;let t=kS,e,i=on();i.updateByUserOption(r);let o={...r};if("accessToken"in o){e=o.accessToken;let{aud:b,sub:S}=kp(e);(U2.some(w=>b.includes(w))||S&&S.startsWith("client"))&&(t=!0)}else if("key"in o&&"secret"in o)o.key.startsWith("mik_")||(t=!0),o.baseAuthUri=i.getBaseAuthUri(t),e=(await ll(o,t)).accessToken;else throw new Error("Missing key or secret.");o.baseUri=i.getBaseUri(t);let n=performance.now(),s,c;if(t){let b={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0"},S=await Bf(b);s=S.compressed,c=S.localePacks}else s=await kf(o,e);let l=performance.now(),u=await pl(s),f=cl(u),y=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(f);let g;if(!t)try{g=(await eu(o,e)).token}catch(b){L.error("Failed to fetch SAS token.",b)}let v=new ws(f,{env:i,outdoorViewToken:e,sasToken:g,enterprise:t,localePacksUrls:c,binaryBundle:s}),I=new pu(v,{search:r.search});if(v.Analytics.init({accessToken:e,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:i.getAnalyticsBaseUri(),context:(x=o.analytics)==null?void 0:x.context}),v.Analytics.sendGetMapDataEvent({parseDuration:y-l,downloadDuration:l-n,viewId:o.viewId}),"language"in o)try{await I.changeLanguage(o.language)}catch{}return I},"getMapData"),dE=_S,hE=p((r,t)=>{Ts.instance!=null&&L.warn("Only a single map venue is supported at this time.");let e=new Ts([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Ts.instance=e,e},"createMapLibreOverlay"),RS=p(async(r,t,e)=>{var u,f,y,g,v,I,x,b,S,w;let i=performance.now(),o=vf(e,t);try{e&&gf(e)}catch(T){if(T instanceof Error&&T.name==="MissingOutdoorViewToken")L.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw T}let n=W2((u=t.outdoorViewToken)!=null?u:""),s=yl(t);(f=o.outdoorView)!=null&&f.style&&s.envControl.updateTileServerBaseUrl((y=o.outdoorView)==null?void 0:y.style);let c=await Y7(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(g=o.style)==null?void 0:g.backgroundAlpha,backgroundColor:(v=o.style)==null?void 0:v.backgroundColor,outdoorView:(I=o.outdoorView)!=null&&I.token?{headers:{"x-mappedin-tiles-key":(x=o.outdoorView)==null?void 0:x.token},style:t.getEnv().tileServerUri,enabled:!!((b=o.outdoorView)!=null&&b.enabled)}:void 0,watermark:{...o.watermark,visible:!s.enterpriseMode&&!n.remove_watermark},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((S=o.antialiasing)!=null&&S.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(w=o.occlusion)==null?void 0:w.enabled}),l=new Ms(c);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},"show3dMap"),fE=RS;function Xr(r){return[r.longitude,r.latitude]}p(Xr,"convertCoordinateToPosition");function yE(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}p(yE,"getEntranceMap");var f1=p((r,t)=>{let e=yE(t),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let o of r){let n=[o.geometry.coordinates],s=(o.properties.entrances||[]).reduce((c,l)=>(e.has(l)&&c.push(e.get(l)),c),[]);if(s.length){let{entrances:c,obstructions:l}=_y(o,s);n=l.map(u=>u.geometry.coordinates),i.entrances.features.push(...c)}i.walls.geometry.coordinates.push(...n)}return i},"cutEntrancesFromLineStrings");function DS(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}p(DS,"translateLabelStateToGeojsonCore");function OS(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}p(OS,"translateMarkerStateToGeojsonCore");function Lh(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}p(Lh,"translateDoorsStateToGeojsonCore");function j1(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}p(j1,"translateWallsStateToGeojsonCore");function H1(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}p(H1,"translateSpaceStateToGeojsonCore");function NS(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}p(NS,"differenceBetweenAngles");function GS(r,t){let e="Left";return r<=-Math.PI/4?e="Right":r<=-t?e="SlightRight":r<=t?e="Straight":r<=Math.PI/4?e="SlightLeft":e="Left",e}p(GS,"getRelativeBearing");function fS(r){let t={};for(let e in r){let i=r[e];if(i!=null){if(i.id=e,"polygons"in i)for(let o of i.polygons)t[o]=i;else if("lineStrings"in i)for(let o of i.lineStrings)t[o]=i;else if("points"in i)for(let o of i.points)t[o]=i}}return t}p(fS,"extractStyleMap");function m1(r,t){return r.reduce((e,i)=>{let o=t[i.properties.id];return o==null||(e.has(o)||e.set(o,[]),e.get(o).push(i)),e},new Map)}p(m1,"groupGeometryByStyle");function Rc(r,t={}){var o,n,s,c,l,u;let e={...r},i=(n=(o=t==null?void 0:t.style)==null?void 0:o.shading)!=null?n:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(c=(s=t==null?void 0:t.style)==null?void 0:s.outlines)!=null?c:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let f=(u=(l=t==null?void 0:t.style)==null?void 0:l.wallTopColor)!=null?u:t==null?void 0:t.wallTopColor;f!=null&&(e.topColor=f)}return e}p(Rc,"translateToCoreStyle");var LS=p((r,t)=>{var o;let i=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Me);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(eo);case"exterior-walls":return i==null?void 0:i.layers.get(Lr);case"interior-doors":return i==null?void 0:i.layers.get(sa);case"exterior-doors":return i==null?void 0:i.layers.get(la);default:return typeof r=="string"?r:r.id}},"getTargetID");function T1(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}p(T1,"tweenToPromise");function AS(r){return r.bbox?r.bbox:Gp(r)}p(AS,"getBoundingBox");function FS(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1]),Math.max(r[2],t[2]),Math.max(r[3],t[3])]}p(FS,"expandBbox");function VS(r){return[...new Set(r)]}p(VS,"unique");var jS=Math.PI*.1,_e,at,Ct,Nn,Gn,Ri,Vn,_h,HS,No,Es,Rh,US,Z1=class Z1{constructor(t,e,i,o){C(this,_h);C(this,No);C(this,Rh);C(this,_e,{});C(this,at,void 0);C(this,Ct,void 0);C(this,Nn,void 0);C(this,Gn,void 0);C(this,Ri,void 0);C(this,Vn,void 0);P(this,at,e),P(this,Ct,t.features),P(this,Nn,i),P(this,Gn,o)}get path(){return a(this,Ct).map(t=>a(this,at).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(a(this,_e).departure)return a(this,_e).departure;let t=a(this,Ct)[0].properties.id,e=a(this,Nn)[0];if(a(this,Nn).length>1){for(let i of a(this,Nn))if(Ep(i,a(this,at)).includes(t)){e=i;break}}return a(this,_e).departure=e,e}get destination(){if(a(this,_e).destination)return a(this,_e).destination;let t=a(this,Ct)[a(this,Ct).length-1].properties.id,e=a(this,Gn)[0];if(a(this,Gn).length>1){for(let i of a(this,Gn))if(Ep(i,a(this,at)).includes(t)){e=i;break}}return a(this,_e).destination=e,e}get coordinates(){return a(this,_e).coordinates?a(this,_e).coordinates:(a(this,_e).coordinates=a(this,Ct).map(t=>new K(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),a(this,_e).coordinates)}get distance(){return a(this,_e).distance?a(this,_e).distance:(a(this,_e).distance=a(this,Ct).reduce((t,e)=>t+(e.properties.distance||0),0),a(this,_e).distance)}get instructions(){if(a(this,Ct).length<2)return[];if(a(this,_e).instructions)return a(this,_e).instructions;let t=[],e=0;for(let i=0;i<a(this,Ct).length;i++){let o=a(this,Ct)[i],n=a(this,Ct)[i-1],s=a(this,Ct)[i+1],c=new K(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=V(this,_h,HS).call(this,{prevDirection:n,direction:o,nextDirection:s});e+=(n==null?void 0:n.properties.distance)||0;for(let u of l)u&&(t.push({action:u,distance:e,coordinate:c,node:a(this,at).getById("node",o.properties.id)}),e=0)}return a(this,_e).instructions=t,a(this,_e).instructions}};_e=new WeakMap,at=new WeakMap,Ct=new WeakMap,Nn=new WeakMap,Gn=new WeakMap,Ri=new WeakMap,Vn=new WeakMap,_h=new WeakSet,HS=p(function(t){var g,v,I;let{prevDirection:e,direction:i,nextDirection:o}=t,n=e&&a(this,at).getById("floor",e.properties.groupBy),s=a(this,at).getById("floor",i.properties.groupBy),c=o&&a(this,at).getById("floor",o.properties.groupBy),l=[];e||l.push({type:"Departure"});let u=a(this,at).getMVFFeatureByNodeId("connection",i.properties.id),f=a(this,at).getMVFFeatureByNodeId("connection",(g=o==null?void 0:o.properties.id)!=null?g:""),y=u?a(this,at).getById("connection",u.id):void 0;if(u)if(!a(this,Ri)||a(this,Ri)==="exit")l.push(V(this,No,Es).call(this,"TakeConnection",s,c,y,u)),P(this,Ri,"take"),P(this,Vn,y);else{let x=a(this,at).getMVFFeatureByNodeId("connection",(v=e==null?void 0:e.properties.id)!=null?v:""),b=a(this,at).getById("connection",(I=x==null?void 0:x.id)!=null?I:"");l.push(V(this,No,Es).call(this,"ExitConnection",s,n,b,x)),P(this,Ri,"exit"),P(this,Vn,y)}else f&&a(this,Ri)==="take"?(l.push(V(this,No,Es).call(this,"ExitConnection",s,n,a(this,Vn))),P(this,Ri,"exit"),P(this,Vn,y)):c&&s.id!==c.id?l.push(V(this,No,Es).call(this,"TakeConnection",s,c,y)):n&&n.id!==s.id?l.push(V(this,No,Es).call(this,"ExitConnection",s,n,y)):l.push(V(this,Rh,US).call(this,e,i));return o||l.push({type:"Arrival"}),l},"#getActions"),No=new WeakSet,Es=p(function(t,e,i,o,n){var l,u;let s="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let f=e.elevation-i.elevation;f>0?s="down":f<0&&(s="up")}let c=(u=(l=o==null?void 0:o.type)!=null?l:n==null?void 0:n.type)!=null?u:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:s,connection:o,connectionType:c}},"#createConnectionAction"),Rh=new WeakSet,US=p(function(t,e){let i=t?-NS(t.properties.angle,e.properties.angle):0;return Math.abs(i)>=jS?{type:"Turn",bearing:GS(i,jS),referencePosition:"At"}:null},"#createTurnAction"),p(Z1,"Directions");var Ah=Z1,z1=class z1{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:o}){d(this,"navigator");d(this,"connections");d(this,"getDirections",p((t,e,i,o)=>{let{accessible:n,smoothing:{enabled:s,radius:c}}=i,l=t.flatMap(v=>Ep(v,o)),u=e.flatMap(v=>Ep(v,o)),f=this.getExcludedNodeIds(n,i.excludedConnections).filter(v=>!l.includes(v)&&!u.includes(v)),y=this.navigator.getDirections({zones:i.zones.map(v=>{var I;return{geometry:v.geometry,cost:v.cost,map:(I=v.floor)==null?void 0:I.id}}),originIds:l,destinationNodeIds:u,excludedNodeIds:f,simplify:{enabled:s,bufferRadius:c}});this.addCoordinateDirections(y,t,e);let g=new Ah(y,o,t,e);if(!(g.distance===0&&new Set([...l,...u]).size===l.length+u.length))return g},"getDirections"));d(this,"getExcludedNodeIds",p((t,e)=>{if(!t&&e.length===0)return[];let i=new Set(e.map(o=>o.id));return this.connections.reduce((o,n)=>n.accessible&&!i.has(n.id)?o:o.concat(n.nodes),[])},"getExcludedNodeIds"));d(this,"addCoordinateDirections",p((t,[e],[i])=>{if(t.features.length){if(K.is(e)){let o=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if(K.is(i)){let o=this.createDirectionFeature(i,0,0),n=t.features[t.features.length-1];n.properties.distance=this.navigator.getDistance(n.geometry.coordinates,[i.longitude,i.latitude]),n.properties.angle=this.navigator.getAngle(n.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(o)}}},"addCoordinateDirections"));d(this,"createDirectionFeature",p((t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i}}),"createDirectionFeature"));this.navigator=new Ia({nodes:t,geojsonCollection:this.createCollection(e),groupBy:o}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,o])=>e.concat(o.features.map(n=>(n.properties.map=i,n))),[])}}};p(z1,"DirectionsInternal");var kh=z1;function Ep(r,t){var e,i,o,n,s;if(il.is(r))return r.navigationTarget.flatMap(c=>Ep(c,t));if(li.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(e=c==null?void 0:c[0])!=null&&e.feature.id?[c[0].feature.id]:[]}else if(K.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(i=c==null?void 0:c[0])!=null&&i.feature.id?[c[0].feature.id]:[]}else if(si.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(o=c==null?void 0:c[0])!=null&&o.feature.id?[c[0].feature.id]:[]}else if(rr.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(n=c==null?void 0:c[0])!=null&&n.feature.id?[c[0].feature.id]:[]}else if(oi.is(r)){let c=t==null?void 0:t.getMVFFeatureById("area",r.id);return(s=c==null?void 0:c.properties.destinationNodes)!=null?s:[]}else if(Be.is(r)){let c=t==null?void 0:t.getMVFFeatureById("space",r.id);return c==null?[]:c.properties.destinationNodes}else{if(to.is(r))return r.coordinates.reduce((c,l)=>{var f;let u=t.Query.nearest(l,{types:["node"]});return(f=u==null?void 0:u[0])!=null&&f.feature.id&&c.push(u[0].feature.id),c},[]);if(Ht.is(r)){let c=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return c!=null?c:[]}else return Ut.is(r)?r.spaces.flatMap(c=>{var l,u;return(u=(l=t==null?void 0:t.getMVFFeatureById("space",c.id))==null?void 0:l.properties.destinationNodes)!=null?u:[]}).filter(c=>typeof c=="string"):Or.is(r)?r.nodes.map(c=>c.id):ri.is(r)?[r.id]:[]}}p(Ep,"getNodesFromTarget");m();m();m();m();m();m();function q1(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return XS(this.cover(t,e),t,e,r)}p(q1,"default");function XS(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var o,n=r._root,s={data:i},c=r._x0,l=r._y0,u=r._x1,f=r._y1,y,g,v,I,x,b,S,w;if(!n)return r._root=s,r;for(;n.length;)if((x=t>=(y=(c+u)/2))?c=y:u=y,(b=e>=(g=(l+f)/2))?l=g:f=g,o=n,!(n=n[S=b<<1|x]))return o[S]=s,r;if(v=+r._x.call(null,n.data),I=+r._y.call(null,n.data),t===v&&e===I)return s.next=n,o?o[S]=s:r._root=s,r;do o=o?o[S]=new Array(4):r._root=new Array(4),(x=t>=(y=(c+u)/2))?c=y:u=y,(b=e>=(g=(l+f)/2))?l=g:f=g;while((S=b<<1|x)===(w=(I>=g)<<1|v>=y));return o[w]=n,o[S]=s,r}p(XS,"add");function WS(r){var t,e,i=r.length,o,n,s=new Array(i),c=new Array(i),l=1/0,u=1/0,f=-1/0,y=-1/0;for(e=0;e<i;++e)isNaN(o=+this._x.call(null,t=r[e]))||isNaN(n=+this._y.call(null,t))||(s[e]=o,c[e]=n,o<l&&(l=o),o>f&&(f=o),n<u&&(u=n),n>y&&(y=n));if(l>f||u>y)return this;for(this.cover(l,u).cover(f,y),e=0;e<i;++e)XS(this,s[e],c[e],r[e]);return this}p(WS,"addAll");m();function $1(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,i=this._y0,o=this._x1,n=this._y1;if(isNaN(e))o=(e=Math.floor(r))+1,n=(i=Math.floor(t))+1;else{for(var s=o-e||1,c=this._root,l,u;e>r||r>=o||i>t||t>=n;)switch(u=(t<i)<<1|r<e,l=new Array(4),l[u]=c,c=l,s*=2,u){case 0:o=e+s,n=i+s;break;case 1:e=o-s,n=i+s;break;case 2:o=e+s,i=n-s;break;case 3:e=o-s,i=n-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=i,this._x1=o,this._y1=n,this}p($1,"default");m();function J1(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}p(J1,"default");m();function Q1(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}p(Q1,"default");m();m();function Ye(r,t,e,i,o){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=o}p(Ye,"default");function K1(r,t,e){var i,o=this._x0,n=this._y0,s,c,l,u,f=this._x1,y=this._y1,g=[],v=this._root,I,x;for(v&&g.push(new Ye(v,o,n,f,y)),e==null?e=1/0:(o=r-e,n=t-e,f=r+e,y=t+e,e*=e);I=g.pop();)if(!(!(v=I.node)||(s=I.x0)>f||(c=I.y0)>y||(l=I.x1)<o||(u=I.y1)<n))if(v.length){var b=(s+l)/2,S=(c+u)/2;g.push(new Ye(v[3],b,S,l,u),new Ye(v[2],s,S,b,u),new Ye(v[1],b,c,l,S),new Ye(v[0],s,c,b,S)),(x=(t>=S)<<1|r>=b)&&(I=g[g.length-1],g[g.length-1]=g[g.length-1-x],g[g.length-1-x]=I)}else{var w=r-+this._x.call(null,v.data),T=t-+this._y.call(null,v.data),E=w*w+T*T;if(E<e){var D=Math.sqrt(e=E);o=r-D,n=t-D,f=r+D,y=t+D,i=v.data}}return i}p(K1,"default");m();function e0(r){if(isNaN(f=+this._x.call(null,r))||isNaN(y=+this._y.call(null,r)))return this;var t,e=this._root,i,o,n,s=this._x0,c=this._y0,l=this._x1,u=this._y1,f,y,g,v,I,x,b,S;if(!e)return this;if(e.length)for(;;){if((I=f>=(g=(s+l)/2))?s=g:l=g,(x=y>=(v=(c+u)/2))?c=v:u=v,t=e,!(e=e[b=x<<1|I]))return this;if(!e.length)break;(t[b+1&3]||t[b+2&3]||t[b+3&3])&&(i=t,S=b)}for(;e.data!==r;)if(o=e,!(e=e.next))return this;return(n=e.next)&&delete e.next,o?(n?o.next=n:delete o.next,this):t?(n?t[b]=n:delete t[b],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[S]=e:this._root=e),this):(this._root=n,this)}p(e0,"default");function YS(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}p(YS,"removeAll");m();function t0(){return this._root}p(t0,"default");m();function r0(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}p(r0,"default");m();function i0(r){var t=[],e,i=this._root,o,n,s,c,l;for(i&&t.push(new Ye(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,n=e.x0,s=e.y0,c=e.x1,l=e.y1)&&i.length){var u=(n+c)/2,f=(s+l)/2;(o=i[3])&&t.push(new Ye(o,u,f,c,l)),(o=i[2])&&t.push(new Ye(o,n,f,u,l)),(o=i[1])&&t.push(new Ye(o,u,s,c,f)),(o=i[0])&&t.push(new Ye(o,n,s,u,f))}return this}p(i0,"default");m();function o0(r){var t=[],e=[],i;for(this._root&&t.push(new Ye(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var o=i.node;if(o.length){var n,s=i.x0,c=i.y0,l=i.x1,u=i.y1,f=(s+l)/2,y=(c+u)/2;(n=o[0])&&t.push(new Ye(n,s,c,f,y)),(n=o[1])&&t.push(new Ye(n,f,c,l,y)),(n=o[2])&&t.push(new Ye(n,s,y,f,u)),(n=o[3])&&t.push(new Ye(n,f,y,l,u))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}p(o0,"default");m();function ZS(r){return r[0]}p(ZS,"defaultX");function n0(r){return arguments.length?(this._x=r,this):this._x}p(n0,"default");m();function zS(r){return r[1]}p(zS,"defaultY");function a0(r){return arguments.length?(this._y=r,this):this._y}p(a0,"default");function Dp(r,t,e){var i=new s0(t==null?ZS:t,e==null?zS:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}p(Dp,"quadtree");function s0(r,t,e,i,o,n){this._x=r,this._y=t,this._x0=e,this._y0=i,this._x1=o,this._y1=n,this._root=void 0}p(s0,"Quadtree");function qS(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}p(qS,"leaf_copy");var St=Dp.prototype=s0.prototype;St.copy=function(){var r=new s0(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=qS(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var o=0;o<4;++o)(i=t.source[o])&&(i.length?e.push({source:i,target:t.target[o]=new Array(4)}):t.target[o]=qS(i));return r};St.add=q1;St.addAll=WS;St.cover=$1;St.data=J1;St.extent=Q1;St.find=K1;St.remove=e0;St.removeAll=YS;St.root=t0;St.size=r0;St.visit=i0;St.visitAfter=o0;St.x=n0;St.y=a0;var Gt,Go,l0=class l0{constructor(t){C(this,Gt,{});C(this,Go,void 0);P(this,Go,t)}getTreeByType(t,e,i){if(a(this,Gt)[t]||(a(this,Gt)[t]={}),a(this,Gt)[t][e]&&a(this,Gt)[t][e][i])return a(this,Gt)[t][e][i];a(this,Gt)[t][e]||(a(this,Gt)[t][e]={}),a(this,Gt)[t][e][i]||(a(this,Gt)[t][e][i]=Dp());let o=a(this,Gt)[t][e][i];o.x(s=>s.geometry.coordinates[1]),o.y(s=>s.geometry.coordinates[0]);let n=[];switch(t){case"node":n=a(this,Go).mvfNodesByFloorId[i]||[];break;case"point-of-interest":n=a(this,Go).mvfPoisByFloorId[i]||[];break;case"door":n=a(this,Go).mvfEntrancesByFloorId[i]||[];break;case"annotation":n=a(this,Go).mvfAnnotationsByFloorId[i]||[];break}return(n==null?void 0:n.length)>0&&o.addAll(n),o}};Gt=new WeakMap,Go=new WeakMap,p(l0,"QueryCache");var Nh=l0;var gE=_.object({limit:_.enum(["same-floor","same-elevation"]).optional(),radius:_.number().optional(),types:_.array(_.enum(["node","point-of-interest"])).min(1)}),$r,Lp,c0=class c0{constructor(t){C(this,$r,void 0);C(this,Lp,void 0);P(this,$r,t),P(this,Lp,new Nh(a(this,$r)))}nearest(t,e){try{gE.parse(e)}catch(s){L.error(s);return}let i=ai(t);if(!i)return;let o=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let s of a(this,$r).getByType("floor-stack")){let c=s.defaultFloor;c&&o.push(c.id)}else if(e.limit==="same-elevation"){let s=a(this,$r).floorsById[i.floorId];if(s){let c=s==null?void 0:s.elevation;c&&(o=a(this,$r).getByType("floor-stack").map(l=>{var u;return(u=l.floors.find(f=>f.elevation===c))==null?void 0:u.id}).filter(Boolean))}}let n=[];for(let s of VS(e.types))for(let c of o){let l=a(this,Lp).getTreeByType(s,a(this,$r).mapName,c).find(i.latitude,i.longitude,e.radius);if(l){let u=a(this,$r).getById(s,l==null?void 0:l.properties.id);u&&n.push({distance:cr([i.longitude,i.latitude],l.geometry.coordinates),feature:u})}}return n.sort((s,c)=>s.distance-c.distance)}};$r=new WeakMap,Lp=new WeakMap,p(c0,"Query");var Op=c0;m();var Ni,de,xr,Ds=class Ds extends Ve{constructor(e,i){super(i.mvfData.id);d(this,"__type",Ds.__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,"pictures",[]);d(this,"links",[]);C(this,Ni,void 0);C(this,de,{});C(this,xr,void 0);P(this,Ni,e),P(this,xr,i.mvfData);for(let o in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,xr)[o]}})}static is(e){return e.__type===Ds.__type}get spaces(){if(a(this,de).spaces)return a(this,de).spaces;a(this,de).spaces=[];for(let e=0;e<a(this,xr).spaces.length;e++){let i=a(this,Ni).getById("space",a(this,xr).spaces[e].id);i&&a(this,de).spaces.push(i)}return a(this,de).spaces}get doors(){return a(this,de).doors?a(this,de).doors:this.spaces.flatMap(e=>e.doors)}get connections(){return a(this,de).connections?a(this,de).connections:a(this,xr).connections.map(e=>a(this,Ni).getById("connection",e)).filter(Boolean)}get annotations(){return a(this,de).annotations?a(this,de).annotations:a(this,xr).annotations.map(e=>a(this,Ni).getById("annotation",e.id)).filter(Boolean)}get categories(){return a(this,de).categories?a(this,de).categories:(a(this,de).categories=a(this,xr).categories.map(e=>a(this,Ni).getById("location-category",e)).filter(Boolean),a(this,de).categories)}get mapObjects(){return a(this,de).mapObjects?a(this,de).mapObjects:(a(this,de).mapObjects=a(this,xr).obstructions.map(e=>a(this,Ni).getById("object",e.id)).filter(Boolean),a(this,de).mapObjects)}get focusTarget(){if(a(this,de).focusTarget)return a(this,de).focusTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);return a(this,de).focusTarget=e,e}get navigationTarget(){if(a(this,de).navigationTarget)return a(this,de).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);return a(this,de).navigationTarget=e,e}toJSON(){return{id:this.id,name:this.name}}};Ni=new WeakMap,de=new WeakMap,xr=new WeakMap,p(Ds,"LocationProfile"),d(Ds,"__type","location-profile");var p0=Ds,il=p0;m();var Vo,Ot,jn,Os=class Os extends Ve{constructor(e,i){super(i.mvfData.id);d(this,"__type",Os.__type);d(this,"id","cat_");d(this,"name","");d(this,"icon","");C(this,Vo,void 0);C(this,Ot,{});C(this,jn,void 0);P(this,Vo,e),P(this,jn,i.mvfData);for(let o in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,jn)[o]}})}static is(e){return e.__type===Os.__type}get parent(){return a(this,Ot).parent?a(this,Ot).parent:(a(this,Ot).parent=a(this,jn).parent?a(this,Vo).getById("location-category",a(this,jn).parent):void 0,a(this,Ot).parent)}get children(){return a(this,Ot).children?a(this,Ot).children:(a(this,Ot).children=a(this,Vo).locationCategoriesByParentId[this.id]||[],a(this,Ot).children)}get locationProfiles(){if(a(this,Ot).locationProfiles)return a(this,Ot).locationProfiles;let e=[];for(let i of a(this,Vo).locationProfilesByCategoryId[this.id]||[]){let o=a(this,Vo).getById("location-profile",i.id);o&&e.push(o)}return a(this,Ot).locationProfiles=e,e}toJSON(){return{id:this.id,name:this.name}}};Vo=new WeakMap,Ot=new WeakMap,jn=new WeakMap,p(Os,"LocationCategory"),d(Os,"__type","location-category");var u0=Os,Mf=u0;var W,Ls,d0=class d0 extends z{constructor(e,i){var c,l,u,f,y;super();d(this,"Analytics");C(this,W,{});d(this,"Query");d(this,"mvf");d(this,"outdoorViewToken");d(this,"spaceIdsByDestinationNodeId");d(this,"objectEntranceNodeIdsByObstructionId");d(this,"obstructionIdByEntranceId");d(this,"venue");d(this,"sasToken");d(this,"directions");d(this,"enterpriseMode",!1);d(this,"nodesById");d(this,"spacesById");d(this,"floorsById");d(this,"floorStacksById");d(this,"facadesById");d(this,"facadesBySpaceId");d(this,"connectionsById");d(this,"objectsById");d(this,"doorsById");d(this,"pointsOfInterestById");d(this,"annotationsById");d(this,"areasById");d(this,"locationProfilesById");d(this,"locationCategoriesById");d(this,"locationProfilesByExternalId");d(this,"locationsById");d(this,"locationProfilesByCategoryId");d(this,"locationCategoriesByParentId");d(this,"categoriesById");d(this,"doorsByNodeId");d(this,"mvfLocationsBySpaceId");d(this,"locationIdsByNodeId");d(this,"mvfAnnotationsById");d(this,"mvfConnectionsById");d(this,"mvfConnectionsByNodeId");d(this,"mvfEntrancesById");d(this,"mvfNodesById");d(this,"mvfObstructionById");d(this,"mvfSpacesById");d(this,"mvfFloorsById");d(this,"mvfFloorStacksById");d(this,"mvfAreasById");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");C(this,Ls,void 0);d(this,"getDirectionsMultiDestination",p((e,i,o)=>this.getDirections(e,i,{...o,multiDestination:!0}),"getDirectionsMultiDestination"));d(this,"getDirections",p((e,i,o)=>{let{accessible:n=!1,smoothing:s=!0,multiDestination:c=!1}=o||{},l=typeof s=="object"?s.enabled:s,u=typeof s=="object"?s.radius:void 0,f=(o==null?void 0:o.zones)||[],y={accessible:n,zones:f,smoothing:{enabled:l!=null?l:!0,radius:u!=null?u:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(c&&Array.isArray(i)){let g=Array.isArray(e)?e:[e],v=[];for(let I of i){let x=Array.isArray(I)?I:[I],b=this.directions.getDirections(g,x,y,this);if(!b){L.error("getDirections failed due to missing directions for one of the segments");return}g=x,v.push(b)}return v}else{let g=Array.isArray(e)?e:[e],v=Array.isArray(i)?i:[i];if(Array.isArray(v[0])){L.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,v[0].id),this.directions.getDirections(g,v,y,this)}},"getDirections"));let o=(c=i==null?void 0:i.env)!=null?c:on();if(this.envControl=o,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new ga,this.localePacksUrls=(l=i==null?void 0:i.localePacksUrls)!=null?l:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,((u=e["tileset.json"])==null?void 0:u.default)!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,o.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let g of e["tileset.json"].others)this.tilesets[g.key]=g;this.enterpriseMode=(f=i==null?void 0:i.enterprise)!=null?f:!1,this.sasToken=i==null?void 0:i.sasToken;let n=Z2(e,this);this.nodesById=n.nodesById,this.spacesById=n.spacesById,this.floorsById=n.floorsById,this.floorStacksById=n.floorStacksById,this.facadesById=n.facadesById,this.facadesBySpaceId=n.facadesBySpaceId,this.connectionsById=n.connectionsById,this.objectsById=n.objectsById,this.doorsById=n.doorsById,this.pointsOfInterestById=n.poisById,this.annotationsById=n.annotationsById,this.areasById=n.areasById,this.locationProfilesById=n.locationProfilesById,this.locationCategoriesById=n.locationCategoriesById,this.locationProfilesByCategoryId=n.locationProfilesByCategoryId,this.locationCategoriesByParentId=n.locationCategoriesByParentId,this.spacesByExternalId=n.spacesByExternalId,this.nodesByExternalId=n.nodesByExternalId,this.objectsByExternalId=n.objectsByExternalId,this.floorsByExternalId=n.floorsByExternalId,this.locationProfilesByExternalId=n.locationProfilesByExternalId,this.floorStacksByExternalId=n.floorStacksByExternalId,this.poisByExternalId=n.poisByExternalId,this.doorsByExternalId=n.doorsByExternalId,this.areasByExternalId=n.areasByExternalId,this.mvfAnnotationsById=n.mvfAnnotationsById,this.mvfConnectionsById=n.mvfConnectionsById,this.mvfConnectionsByNodeId=n.mvfConnectionsByNodeId,this.mvfEntrancesById=n.mvfEntrancesById,this.mvfNodesById=n.mvfNodesById,this.mvfObstructionById=n.mvfObstructionById,this.mvfSpacesById=n.mvfSpacesById,this.mvfFloorsById=n.mvfFloorsById,this.mvfFloorStacksById=n.mvfFloorStacksById,this.mvfNodesByFloorId=n.mvfNodesByFloorId,this.mvfSpacesByFloorId=n.mvfSpacesByFloorId,this.mvfPoisByFloorId=n.mvfPoisByFloorId,this.mvfEntrancesByFloorId=n.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=n.mvfAnnotationsByFloorId,this.mvfAreasById=n.mvfAreasById,this.doorsByNodeId=n.doorsByNodeId,this.spaceIdsByDestinationNodeId=n.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=n.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=n.obstructionIdByEntranceId;let s=Y2(e,this);if(this.locationsById=s.locationsById,this.categoriesById=s.categoriesById,this.mvfLocationsBySpaceId=s.mvfLocationsBySpaceId,this.locationIdsByNodeId=s.locationIdsByNodeId,this.connectionsByExternalId=s.connectionsByExternalId,this.locationsByExternalId=s.locationsByExternalId,this.categoriesByExternalId=s.categoriesByExternalId,s.venue.name!=null){this.venue=new Kp(this,{mvfData:s.venue});let g={};for(let v in s.mvfLocationsById)g[v]=s.mvfLocationsById[v];for(let v in s.locationInstancesById)g[v]=s.locationInstancesById[v];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:g,categories:s.mvfCategoriesById}},(y=i==null?void 0:i.languagePacks)==null||y.forEach(({language:v,localePack:I})=>{this.languagePacks[v.code]=Rf(I)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Op(this),this.directions=new kh({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map"})}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 K(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return a(this,W).spaces==null&&(a(this,W).spaces=globalThis.Object.values(this.spacesById)),a(this,W).spaces}get objects(){return a(this,W).objects==null&&(a(this,W).objects=globalThis.Object.values(this.objectsById)),a(this,W).objects}get connections(){return a(this,W).connections==null&&(a(this,W).connections=globalThis.Object.values(this.connectionsById)),a(this,W).connections}get floors(){return a(this,W).floors==null&&(a(this,W).floors=globalThis.Object.values(this.floorsById)),a(this,W).floors}get floorStacks(){return a(this,W).floorStacks==null&&(a(this,W).floorStacks=globalThis.Object.values(this.floorStacksById)),a(this,W).floorStacks}get facades(){return a(this,W).facades==null&&(a(this,W).facades=globalThis.Object.values(this.facadesById)),a(this,W).facades}get doors(){return a(this,W).doors==null&&(a(this,W).doors=globalThis.Object.values(this.doorsById)),a(this,W).doors}get pointsOfInterest(){return a(this,W).pointsOfInterest==null&&(a(this,W).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),a(this,W).pointsOfInterest}get annotations(){return a(this,W).annotations==null&&(a(this,W).annotations=globalThis.Object.values(this.annotationsById)),a(this,W).annotations}get areas(){return a(this,W).areas==null&&(a(this,W).areas=globalThis.Object.values(this.areasById)),a(this,W).areas}get nodes(){return a(this,W).nodes==null&&(a(this,W).nodes=globalThis.Object.values(this.nodesById)),a(this,W).nodes}get locations(){return a(this,W).locations==null&&(a(this,W).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return a(this,W).categories==null&&(a(this,W).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return a(this,W).locationProfiles==null&&(a(this,W).locationProfiles=globalThis.Object.values(this.locationProfilesById)),a(this,W).locationProfiles}get locationCategories(){return a(this,W).locationCategories==null&&(a(this,W).locationCategories=globalThis.Object.values(this.locationCategoriesById)),a(this,W).locationCategories}get mvfFloors(){return a(this,W).mvfFloors==null&&(a(this,W).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),a(this,W).mvfFloors}get mvfFloorStacks(){return a(this,W).mvfFloorStacks==null&&(a(this,W).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),a(this,W).mvfFloorStacks}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(e,i){switch(e){case"location-profile":return this.locationProfilesById[i];case"location-category":return this.locationCategoriesById[i];case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":return this.connectionsById[i];case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:return}}getByExternalId(e,i){var o,n,s,c,l,u,f,y,g,v,I,x;switch(e){case"location-profile":return(o=this.locationProfilesByExternalId[i])!=null?o:[];case"location-category":return[];case"space":return(n=this.spacesByExternalId[i])!=null?n:[];case"floor":return(s=this.floorsByExternalId[i])!=null?s:[];case"floor-stack":return(c=this.floorStacksByExternalId[i])!=null?c:[];case"node":return(l=this.nodesByExternalId[i])!=null?l:[];case"door":return(u=this.doorsByExternalId[i])!=null?u:[];case"connection":return(f=this.connectionsByExternalId[i])!=null?f:[];case"object":return(y=this.objectsByExternalId[i])!=null?y:[];case"point-of-interest":return(g=this.poisByExternalId[i])!=null?g:[];case"area":return(v=this.areasByExternalId[i])!=null?v:[];case"enterprise-location":return(I=this.locationsByExternalId[i])!=null?I:[];case"enterprise-category":return(x=this.categoriesByExternalId[i])!=null?x:[];default:return[]}}getMapDataById(e){var i,o,n,s,c,l,u,f,y,g;return(g=(y=(f=(u=(l=(c=(s=(n=(o=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?o:this.floorStacksById[e])!=null?n:this.facadesById[e])!=null?s:this.nodesById[e])!=null?c:this.doorsById[e])!=null?l:this.connectionsById[e])!=null?u:this.objectsById[e])!=null?f:this.pointsOfInterestById[e])!=null?y:this.annotationsById[e])!=null?g:this.areasById[e]}getMVFFeatureById(e,i){switch(e){case"space":return this.mvfSpacesById[i];case"node":return this.mvfNodesById[i];case"obstruction":return this.mvfObstructionById[i];case"floor":return this.mvfFloorsById[i];case"floor-stack":return this.mvfFloorStacksById[i];case"connection":return this.mvfConnectionsById[i];case"entrance":return this.mvfEntrancesById[i];case"annotation":return this.mvfAnnotationsById[i];case"area":return this.mvfAreasById[i];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,i){switch(e){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,i,o,n){var u,f;if(!this.currentLanguage)return n;let{code:s}=this.currentLanguage,c=e==="enterprise-category"?"categories":e==="enterprise-location"?"locations":void 0;if(!c)return n;let l=(f=(u=this.languagePacks[s])==null?void 0:u.optimized)==null?void 0:f[c];if(l){let y=l[o];if(y!=null&&y[i]!==void 0)return y[i]}return n}async changeLanguage(e){var c;let i=e.toLowerCase();if(!i){L.error("language code must be defined");return}if(!this.currentLanguage){L.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,n=(c=this.venue)==null?void 0:c.languages.find(({code:l})=>l.toLowerCase()===i.toLowerCase());if(!n){L.warn("language not found");return}if(o===n.code)return;let s=this.languagePacks[n.code];if(!s){let l=this.localePacksUrls[n.code];if(!l){L.error("locale packs url not found for ".concat(n.code));return}a(this,Ls)&&a(this,Ls).abort();let u=new AbortController;P(this,Ls,u);let f;try{f=await dv(l,{signal:u.signal})}catch(y){L.error("failed downloading language pack",y);return}if(!f||u.signal.aborted)return;s=Rf(f),this.languagePacks[n.code]=s}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=n,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let o=ai(e),n=ai(i);return cr([o.longitude,o.latitude],[n.longitude,n.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var o;let i=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let c=await Ff(this.localePacksUrls[s.code],{signal:n.signal}),l=await Sa(c);l&&i.push({language:{code:s.code,name:s.name},localePack:l})}}catch(c){L.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var o;if(!this.binaryBundle){L.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let c=await Ff(this.localePacksUrls[s.code],{signal:n.signal});c&&i.push({language:{code:s.code,name:s.name},localePack:c})}}catch(c){L.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(a(this,W)))a(this,W)[e]=null}};W=new WeakMap,Ls=new WeakMap,p(d0,"MapDataInternal");var ws=d0;var Fs,Hn,Ap,Jr,As=class As extends Te{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",As.__type);C(this,Fs,void 0);C(this,Hn,void 0);C(this,Ap,void 0);C(this,Jr,{});P(this,Fs,i.mvfData),P(this,Hn,e),P(this,Ap,i.floorStackId)}static is(e){return e.__type===As.__type}get floorStack(){return a(this,Hn).getById("floor-stack",a(this,Ap))}get spaces(){if(!a(this,Jr).spaces){a(this,Jr).spaces=[];for(let e of a(this,Fs).spaces){let i=a(this,Hn).getById("space",e.spaceId);i&&a(this,Jr).spaces.push(i)}}return a(this,Jr).spaces}get center(){if(!a(this,Jr).center){let e={type:"FeatureCollection",features:[]};for(let o of this.spaces){let n=a(this,Hn).mvfSpacesById[o.id];n&&e.features.push(n)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=uu(e);a(this,Jr).center=new K(i.geometry.coordinates[1],i.geometry.coordinates[0],a(this,Fs).spaces[0].floorId)}return a(this,Jr).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};Fs=new WeakMap,Hn=new WeakMap,Ap=new WeakMap,Jr=new WeakMap,p(As,"Facade"),d(As,"__type","facade");var h0=As,Ut=h0;export{K as a,ri as b,Be as c,Zs as d,Ut as e,Or as f,rl as g,Gw as h,_S as i,RS as j,mE as k};
|