@mappedin/mappedin-js 6.0.1-beta.45 → 6.0.1-beta.47
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 +2169 -27784
- package/lib/esm/GLTFExporter-TZEIALSW.js +1 -0
- package/lib/esm/GLTFLoader-YCEKYYW3.js +1 -0
- package/lib/esm/{browser-IE62BVYL.js → browser-6R2QCUOI.js} +1 -1
- package/lib/esm/chunk-DNBHISVY.js +1 -0
- package/lib/esm/{chunk-7QYC6UYU.js → chunk-KR33DBLD.js} +1 -1
- package/lib/esm/chunk-KVKD4E33.js +1 -0
- package/lib/esm/chunk-MENDLOSO.js +1 -0
- package/lib/esm/chunk-QRWMPXER.js +1 -0
- package/lib/esm/chunk-TVALVOG4.js +1 -0
- package/lib/esm/chunk-UIDBSU4C.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +338 -129
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-CV34C4XG.js +1 -0
- package/lib/esm/inspector-WWR77OPX.css +1 -0
- package/lib/esm/internal-M7DPGYMI.css +1 -0
- package/lib/esm/internal-YXEVD377.js +1 -0
- package/lib/esm/outdoor-context-v4-IEFB4X2Q.js +1 -0
- package/lib/esm/{roboto-regular-E2V4PXOH.js → roboto-regular-JRVF4TIR.js} +1 -1
- package/lib/esm/text3d-RZEC5VQO.js +1 -0
- package/lib/esm/workers/maplibre-worker.csp.js +1 -1
- package/lib/index.css +1 -1
- package/package.json +12 -12
- package/lib/esm/GLTFExporter-33O74ZRA.js +0 -1
- package/lib/esm/GLTFLoader-TFEUICFY.js +0 -1
- package/lib/esm/chunk-AGPZKMLJ.js +0 -1
- package/lib/esm/chunk-HALSTKAB.js +0 -1
- package/lib/esm/chunk-HTXG2WUL.js +0 -1
- package/lib/esm/chunk-L5IJY45Y.js +0 -1
- package/lib/esm/chunk-N5U7Y27D.js +0 -1
- package/lib/esm/chunk-O57EU3PO.js +0 -1
- package/lib/esm/inspector-CC3UZQDZ.js +0 -1
- package/lib/esm/inspector-GOK26VAV.css +0 -1
- package/lib/esm/internal-7A3UJNAV.css +0 -1
- package/lib/esm/internal-MEGLEQC5.js +0 -1
- package/lib/esm/outdoor-context-v4-5DHMHSDP.js +0 -1
- package/lib/esm/text3d-3PC3DCSJ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as Hs,A as e2,B as t2,C as Ac,D as Kt,E as r2,F as Gg,G as Ci,H as i2,I as js,J as n2,K as Si,L as ph,M as Ze,N as Vg,O as Ot,P as o2,Q as sa,R as Ur,S as we,T as Te,U as Fc,V as jg,W as Ug,X as c2,Y as Bc,Z as p2,_ as Us,a as Iv,aa as u2,ba as ur,ca as d2,d as O,da as h2,e as kg,ea as Hg,f as ah,fa as uh,g as Yv,ga as dh,h as Vs,ha as f2,i as sh,ia as m2,j as qv,ja as g2,k as lh,ka as hh,l as na,la as y2,m as vi,ma as b2,n as $v,na as v2,o as Jv,oa as x2,p as Rg,pa as Ti,q as De,qa as Wg,r as oe,ra as C2,s as oa,sa as S2,t as Ng,ta as la,u as xi,ua as Rc,v as ch,va as Ws,w as sn,wa as fh,x as aa,xa as zs,y as Kv,ya as Zs,z as Qv}from"./chunk-HTXG2WUL.js";import{ba as l2,j as a2,u as s2}from"./chunk-L5IJY45Y.js";import{a as Tr}from"./chunk-7QYC6UYU.js";import{$ as Rv,$a as zv,A as _v,Aa as Vr,Ba as nh,C as Ov,Ca as jv,D as ge,Da as Uv,E as ie,Fa as jr,I as Lv,J as kv,K as Av,L as kc,M as K,N as yt,O as Fv,P as Nr,Pa as Gs,Q as nn,R as on,S as Oe,Ta as oh,U as lt,Ua as Hv,V as an,W as Bv,X as ue,Y as Gr,Ya as Wv,_ as ia,_a as bi,aa as Ag,ab as Zv,b as Qd,c as eh,ca as Qn,cb as Xv,d as Pv,e as tn,f as wv,g as mi,ha as Nv,ka as eo,la as Gv,ma as rh,na as Fg,p as Dv,pa as Ns,q as Ev,r as th,ua as Vv,va as to,wa as ih,xa as Bg,ya as gi,z as rn,za as yi}from"./chunk-O57EU3PO.js";import{a as m,b as T}from"./chunk-N5U7Y27D.js";import{b as H,c as MP,d as ra,e as u,f as s,g as S,h as I,i as N}from"./chunk-HALSTKAB.js";var $2=H((ey,ty)=>{m();(function(r,t){typeof ey=="object"&&typeof ty<"u"?ty.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(ey,function(){"use strict";function r(b,C,M,P,w){(function D(B,_,A,F,G){for(;F>A;){if(F-A>600){var R=F-A+1,z=_-A+1,W=Math.log(R),j=.5*Math.exp(2*W/3),ee=.5*Math.sqrt(W*j*(R-j)/R)*(z-R/2<0?-1:1),Z=Math.max(A,Math.floor(_-z*j/R+ee)),xe=Math.min(F,Math.floor(_+(R-z)*j/R+ee));D(B,_,Z,xe,G)}var fe=B[_],Ie=A,_e=F;for(t(B,A,_),G(B[F],fe)>0&&t(B,A,F);Ie<_e;){for(t(B,Ie,_e),Ie++,_e--;G(B[Ie],fe)<0;)Ie++;for(;G(B[_e],fe)>0;)_e--}G(B[A],fe)===0?t(B,A,_e):t(B,++_e,F),_e<=_&&(A=_e+1),_<=_e&&(F=_e-1)}})(b,C,M||0,P||b.length-1,w||e)}function t(b,C,M){var P=b[C];b[C]=b[M],b[M]=P}function e(b,C){return b<C?-1:b>C?1:0}var i=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()};function n(b,C,M){if(!M)return C.indexOf(b);for(var P=0;P<C.length;P++)if(M(b,C[P]))return P;return-1}function o(b,C){a(b,0,b.children.length,C,b)}function a(b,C,M,P,w){w||(w=v(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var D=C;D<M;D++){var B=b.children[D];c(w,b.leaf?P(B):B)}return w}function c(b,C){return b.minX=Math.min(b.minX,C.minX),b.minY=Math.min(b.minY,C.minY),b.maxX=Math.max(b.maxX,C.maxX),b.maxY=Math.max(b.maxY,C.maxY),b}function l(b,C){return b.minX-C.minX}function p(b,C){return b.minY-C.minY}function d(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function f(b){return b.maxX-b.minX+(b.maxY-b.minY)}function g(b,C){return b.minX<=C.minX&&b.minY<=C.minY&&C.maxX<=b.maxX&&C.maxY<=b.maxY}function y(b,C){return C.minX<=b.maxX&&C.minY<=b.maxY&&C.maxX>=b.minX&&C.maxY>=b.minY}function v(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(b,C,M,P,w){for(var D=[C,M];D.length;)if(!((M=D.pop())-(C=D.pop())<=P)){var B=C+Math.ceil((M-C)/P/2)*P;r(b,B,C,M,w),D.push(C,B,B,M)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var C=this.data,M=[];if(!y(b,C))return M;for(var P=this.toBBox,w=[];C;){for(var D=0;D<C.children.length;D++){var B=C.children[D],_=C.leaf?P(B):B;y(b,_)&&(C.leaf?M.push(B):g(b,_)?this._all(B,M):w.push(B))}C=w.pop()}return M},i.prototype.collides=function(b){var C=this.data;if(!y(b,C))return!1;for(var M=[];C;){for(var P=0;P<C.children.length;P++){var w=C.children[P],D=C.leaf?this.toBBox(w):w;if(y(b,D)){if(C.leaf||g(b,D))return!0;M.push(w)}}C=M.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var C=0;C<b.length;C++)this.insert(b[C]);return this}var M=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===M.height)this._splitRoot(this.data,M);else{if(this.data.height<M.height){var P=this.data;this.data=M,M=P}this._insert(M,this.data.height-M.height-1,!0)}else this.data=M;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=v([]),this},i.prototype.remove=function(b,C){if(!b)return this;for(var M,P,w,D=this.data,B=this.toBBox(b),_=[],A=[];D||_.length;){if(D||(D=_.pop(),P=_[_.length-1],M=A.pop(),w=!0),D.leaf){var F=n(b,D.children,C);if(F!==-1)return D.children.splice(F,1),_.push(D),this._condense(_),this}w||D.leaf||!g(D,B)?P?(M++,D=P.children[M],w=!1):D=null:(_.push(D),A.push(M),M=0,P=D,D=D.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,C){return b.minX-C.minX},i.prototype.compareMinY=function(b,C){return b.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,C){for(var M=[];b;)b.leaf?C.push.apply(C,b.children):M.push.apply(M,b.children),b=M.pop();return C},i.prototype._build=function(b,C,M,P){var w,D=M-C+1,B=this._maxEntries;if(D<=B)return o(w=v(b.slice(C,M+1)),this.toBBox),w;P||(P=Math.ceil(Math.log(D)/Math.log(B)),B=Math.ceil(D/Math.pow(B,P-1))),(w=v([])).leaf=!1,w.height=P;var _=Math.ceil(D/B),A=_*Math.ceil(Math.sqrt(B));x(b,C,M,A,this.compareMinX);for(var F=C;F<=M;F+=A){var G=Math.min(F+A-1,M);x(b,F,G,_,this.compareMinY);for(var R=F;R<=G;R+=_){var z=Math.min(R+_-1,G);w.children.push(this._build(b,R,z,P-1))}}return o(w,this.toBBox),w},i.prototype._chooseSubtree=function(b,C,M,P){for(;P.push(C),!C.leaf&&P.length-1!==M;){for(var w=1/0,D=1/0,B=void 0,_=0;_<C.children.length;_++){var A=C.children[_],F=d(A),G=(R=b,z=A,(Math.max(z.maxX,R.maxX)-Math.min(z.minX,R.minX))*(Math.max(z.maxY,R.maxY)-Math.min(z.minY,R.minY))-F);G<D?(D=G,w=F<w?F:w,B=A):G===D&&F<w&&(w=F,B=A)}C=B||C.children[0]}var R,z;return C},i.prototype._insert=function(b,C,M){var P=M?b:this.toBBox(b),w=[],D=this._chooseSubtree(P,this.data,C,w);for(D.children.push(b),c(D,P);C>=0&&w[C].children.length>this._maxEntries;)this._split(w,C),C--;this._adjustParentBBoxes(P,w,C)},i.prototype._split=function(b,C){var M=b[C],P=M.children.length,w=this._minEntries;this._chooseSplitAxis(M,w,P);var D=this._chooseSplitIndex(M,w,P),B=v(M.children.splice(D,M.children.length-D));B.height=M.height,B.leaf=M.leaf,o(M,this.toBBox),o(B,this.toBBox),C?b[C-1].children.push(B):this._splitRoot(M,B)},i.prototype._splitRoot=function(b,C){this.data=v([b,C]),this.data.height=b.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,C,M){for(var P,w,D,B,_,A,F,G=1/0,R=1/0,z=C;z<=M-C;z++){var W=a(b,0,z,this.toBBox),j=a(b,z,M,this.toBBox),ee=(w=W,D=j,B=void 0,_=void 0,A=void 0,F=void 0,B=Math.max(w.minX,D.minX),_=Math.max(w.minY,D.minY),A=Math.min(w.maxX,D.maxX),F=Math.min(w.maxY,D.maxY),Math.max(0,A-B)*Math.max(0,F-_)),Z=d(W)+d(j);ee<G?(G=ee,P=z,R=Z<R?Z:R):ee===G&&Z<R&&(R=Z,P=z)}return P||M-C},i.prototype._chooseSplitAxis=function(b,C,M){var P=b.leaf?this.compareMinX:l,w=b.leaf?this.compareMinY:p;this._allDistMargin(b,C,M,P)<this._allDistMargin(b,C,M,w)&&b.children.sort(P)},i.prototype._allDistMargin=function(b,C,M,P){b.children.sort(P);for(var w=this.toBBox,D=a(b,0,C,w),B=a(b,M-C,M,w),_=f(D)+f(B),A=C;A<M-C;A++){var F=b.children[A];c(D,b.leaf?w(F):F),_+=f(D)}for(var G=M-C-1;G>=C;G--){var R=b.children[G];c(B,b.leaf?w(R):R),_+=f(B)}return _},i.prototype._adjustParentBBoxes=function(b,C,M){for(var P=M;P>=0;P--)c(C[P],b)},i.prototype._condense=function(b){for(var C=b.length-1,M=void 0;C>=0;C--)b[C].children.length===0?C>0?(M=b[C-1].children).splice(M.indexOf(b[C]),1):this.clear():o(b[C],this.toBBox)},i})});var ay=H(ne=>{"use strict";m();Object.defineProperty(ne,"__esModule",{value:!0});ne.earthRadius=63710088e-1;ne.factors={centimeters:ne.earthRadius*100,centimetres:ne.earthRadius*100,degrees:ne.earthRadius/111325,feet:ne.earthRadius*3.28084,inches:ne.earthRadius*39.37,kilometers:ne.earthRadius/1e3,kilometres:ne.earthRadius/1e3,meters:ne.earthRadius,metres:ne.earthRadius,miles:ne.earthRadius/1609.344,millimeters:ne.earthRadius*1e3,millimetres:ne.earthRadius*1e3,nauticalmiles:ne.earthRadius/1852,radians:1,yards:ne.earthRadius*1.0936};ne.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/ne.earthRadius,yards:1.0936133};ne.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 io(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}ne.feature=io;function r6(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return ry(t).geometry;case"LineString":return ny(t).geometry;case"Polygon":return iy(t).geometry;case"MultiPoint":return K2(t).geometry;case"MultiLineString":return J2(t).geometry;case"MultiPolygon":return Q2(t).geometry;default:throw new Error(r+" is invalid")}}ne.geometry=r6;function ry(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(!Th(r[0])||!Th(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return io(i,t,e)}ne.point=ry;function i6(r,t,e){return e===void 0&&(e={}),Mh(r.map(function(i){return ry(i,t)}),e)}ne.points=i6;function iy(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return io(c,t,e)}ne.polygon=iy;function n6(r,t,e){return e===void 0&&(e={}),Mh(r.map(function(i){return iy(i,t)}),e)}ne.polygons=n6;function ny(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 io(i,t,e)}ne.lineString=ny;function o6(r,t,e){return e===void 0&&(e={}),Mh(r.map(function(i){return ny(i,t)}),e)}ne.lineStrings=o6;function Mh(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}ne.featureCollection=Mh;function J2(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return io(i,t,e)}ne.multiLineString=J2;function K2(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return io(i,t,e)}ne.multiPoint=K2;function Q2(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return io(i,t,e)}ne.multiPolygon=Q2;function a6(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return io(i,t,e)}ne.geometryCollection=a6;function s6(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}ne.round=s6;function e3(r,t){t===void 0&&(t="kilometers");var e=ne.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}ne.radiansToLength=e3;function oy(r,t){t===void 0&&(t="kilometers");var e=ne.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}ne.lengthToRadians=oy;function l6(r,t){return t3(oy(r,t))}ne.lengthToDegrees=l6;function c6(r){var t=r%360;return t<0&&(t+=360),t}ne.bearingToAzimuth=c6;function t3(r){var t=r%(2*Math.PI);return t*180/Math.PI}ne.radiansToDegrees=t3;function p6(r){var t=r%360;return t*Math.PI/180}ne.degreesToRadians=p6;function u6(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 e3(oy(r,t),e)}ne.convertLength=u6;function d6(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=ne.areaFactors[t];if(!i)throw new Error("invalid original units");var n=ne.areaFactors[e];if(!n)throw new Error("invalid final units");return r/i*n}ne.convertArea=d6;function Th(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ne.isNumber=Th;function h6(r){return!!r&&r.constructor===Object}ne.isObject=h6;function f6(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(!Th(t))throw new Error("bbox must only contain numbers")})}ne.validateBBox=f6;function m6(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")}ne.validateId=m6});var a3=H(ct=>{"use strict";m();Object.defineProperty(ct,"__esModule",{value:!0});var Lt=ay();function Xc(r,t,e){if(r!==null)for(var i,n,o,a,c,l,p,d=0,f=0,g,y=r.type,v=y==="FeatureCollection",x=y==="Feature",b=v?r.features.length:1,C=0;C<b;C++){p=v?r.features[C].geometry:x?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var M=0;M<c;M++){var P=0,w=0;if(a=g?p.geometries[M]:p,a!==null){l=a.coordinates;var D=a.type;switch(d=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(l,f,C,P,w)===!1)return!1;f++,P++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],f,C,P,w)===!1)return!1;f++,D==="MultiPoint"&&P++}D==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-d;n++){if(t(l[i][n],f,C,P,w)===!1)return!1;f++}D==="MultiLineString"&&P++,D==="Polygon"&&w++}D==="Polygon"&&P++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-d;o++){if(t(l[i][n][o],f,C,P,w)===!1)return!1;f++}w++}P++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Xc(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function g6(r,t,e,i){var n=e;return Xc(r,function(o,a,c,l,p){a===0&&e===void 0?n=o:n=t(n,o,a,c,l,p)},i),n}function r3(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function y6(r,t,e){var i=e;return r3(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}function i3(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function b6(r,t,e){var i=e;return i3(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}function v6(r){var t=[];return Xc(r,function(e){t.push(e)}),t}function sy(r,t){var e,i,n,o,a,c,l,p,d,f,g=0,y=r.type==="FeatureCollection",v=r.type==="Feature",x=y?r.features.length:1;for(e=0;e<x;e++){for(c=y?r.features[e].geometry:v?r.geometry:r,p=y?r.features[e].properties:v?r.properties:{},d=y?r.features[e].bbox:v?r.bbox:void 0,f=y?r.features[e].id:v?r.id:void 0,l=c?c.type==="GeometryCollection":!1,a=l?c.geometries.length:1,n=0;n<a;n++){if(o=l?c.geometries[n]:c,o===null){if(t(null,g,p,d,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,p,d,f)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,p,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}function x6(r,t,e){var i=e;return sy(r,function(n,o,a,c,l){o===0&&e===void 0?i=n:i=t(i,n,o,a,c,l)}),i}function Ih(r,t){sy(r,function(e,i,n,o,a){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(Lt.feature(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var d=e.coordinates[p],f={type:l,coordinates:d};if(t(Lt.feature(f,n),i,p)===!1)return!1}})}function C6(r,t,e){var i=e;return Ih(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}function n3(r,t){Ih(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var c,l=0,p=0,d=0;if(Xc(e,function(f,g,y,v,x){if(c===void 0||i>l||v>p||x>d){c=f,l=i,p=v,d=x,o=0;return}var b=Lt.lineString([c,f],e.properties);if(t(b,i,n,x,o)===!1)return!1;o++,c=f})===!1)return!1}}})}function S6(r,t,e){var i=e,n=!1;return n3(r,function(o,a,c,l,p){n===!1&&e===void 0?i=o:i=t(i,o,a,c,l,p),n=!0}),i}function o3(r,t){if(!r)throw new Error("geojson is required");Ih(r,function(e,i,n){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,i,n,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<a.length;c++)if(t(Lt.lineString(a[c],e.properties),i,n,c)===!1)return!1;break}}})}function T6(r,t,e){var i=e;return o3(r,function(n,o,a,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,c)}),i}function M6(r,t){if(t=t||{},!Lt.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":a=a||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 o<0&&(o=l.length+o-1),Lt.lineString([l[o],l[o+1]],a,t);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),Lt.lineString([l[n][o],l[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),Lt.lineString([l[i][o],l[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o-1),Lt.lineString([l[i][n][o],l[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}function I6(r,t){if(t=t||{},!Lt.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":a=a||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 Lt.point(l,a,t);case"MultiPoint":return i<0&&(i=l.length+i),Lt.point(l[i],a,t);case"LineString":return o<0&&(o=l.length+o),Lt.point(l[o],a,t);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),Lt.point(l[n][o],a,t);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),Lt.point(l[i][o],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o),Lt.point(l[i][n][o],a,t)}throw new Error("geojson is invalid")}ct.coordAll=v6;ct.coordEach=Xc;ct.coordReduce=g6;ct.featureEach=i3;ct.featureReduce=b6;ct.findPoint=I6;ct.findSegment=M6;ct.flattenEach=Ih;ct.flattenReduce=C6;ct.geomEach=sy;ct.geomReduce=x6;ct.lineEach=o3;ct.lineReduce=T6;ct.propEach=r3;ct.propReduce=y6;ct.segmentEach=n3;ct.segmentReduce=S6});var ly=H((AV,l3)=>{"use strict";m();var s3=Object.prototype.toString;l3.exports=function(t){var e=s3.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&s3.call(t.callee)==="[object Function]"),i}});var y3=H((BV,g3)=>{"use strict";m();var m3;Object.keys||(Yc=Object.prototype.hasOwnProperty,cy=Object.prototype.toString,c3=ly(),py=Object.prototype.propertyIsEnumerable,p3=!py.call({toString:null},"toString"),u3=py.call(function(){},"prototype"),qc=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ph=function(r){var t=r.constructor;return t&&t.prototype===r},d3={$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},h3=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!d3["$"+r]&&Yc.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Ph(window[r])}catch{return!0}}catch{return!0}return!1}(),f3=function(r){if(typeof window>"u"||!h3)return Ph(r);try{return Ph(r)}catch{return!1}},m3=function(t){var e=t!==null&&typeof t=="object",i=cy.call(t)==="[object Function]",n=c3(t),o=e&&cy.call(t)==="[object String]",a=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var c=u3&&i;if(o&&t.length>0&&!Yc.call(t,0))for(var l=0;l<t.length;++l)a.push(String(l));if(n&&t.length>0)for(var p=0;p<t.length;++p)a.push(String(p));else for(var d in t)!(c&&d==="prototype")&&Yc.call(t,d)&&a.push(String(d));if(p3)for(var f=f3(t),g=0;g<qc.length;++g)!(f&&qc[g]==="constructor")&&Yc.call(t,qc[g])&&a.push(qc[g]);return a});var Yc,cy,c3,py,p3,u3,qc,Ph,d3,h3,f3;g3.exports=m3});var Dh=H((NV,x3)=>{"use strict";m();var P6=Array.prototype.slice,w6=ly(),b3=Object.keys,wh=b3?function(t){return b3(t)}:y3(),v3=Object.keys;wh.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(i){return w6(i)?v3(P6.call(i)):v3(i)})}else Object.keys=wh;return Object.keys||wh};x3.exports=wh});var S3=H((VV,C3)=>{"use strict";m();C3.exports=Error});var M3=H((UV,T3)=>{"use strict";m();T3.exports=EvalError});var P3=H((WV,I3)=>{"use strict";m();I3.exports=RangeError});var D3=H((ZV,w3)=>{"use strict";m();w3.exports=ReferenceError});var uy=H((YV,E3)=>{"use strict";m();E3.exports=SyntaxError});var pn=H(($V,_3)=>{"use strict";m();_3.exports=TypeError});var L3=H((KV,O3)=>{"use strict";m();O3.exports=URIError});var $c=H((ej,k3)=>{"use strict";m();k3.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[e]=n;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==n||a.enumerable!==!0)return!1}return!0}});var Eh=H((rj,F3)=>{"use strict";m();var A3=typeof Symbol<"u"&&Symbol,D6=$c();F3.exports=function(){return typeof A3!="function"||typeof Symbol!="function"||typeof A3("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:D6()}});var R3=H((nj,B3)=>{"use strict";m();var dy={__proto__:null,foo:{}},E6=Object;B3.exports=function(){return{__proto__:dy}.foo===dy.foo&&!(dy instanceof E6)}});var V3=H((aj,G3)=>{"use strict";m();var _6="Function.prototype.bind called on incompatible ",O6=Object.prototype.toString,L6=Math.max,k6="[object Function]",N3=function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i},A6=function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},F6=function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e};G3.exports=function(t){var e=this;if(typeof e!="function"||O6.apply(e)!==k6)throw new TypeError(_6+e);for(var i=A6(arguments,1),n,o=function(){if(this instanceof n){var d=e.apply(this,N3(i,arguments));return Object(d)===d?d:this}return e.apply(t,N3(i,arguments))},a=L6(0,e.length-i.length),c=[],l=0;l<a;l++)c[l]="$"+l;if(n=Function("binder","return function ("+F6(c,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var p=function(){};p.prototype=e.prototype,n.prototype=new p,p.prototype=null}return n}});var _h=H((lj,j3)=>{"use strict";m();var B6=V3();j3.exports=Function.prototype.bind||B6});var hy=H((pj,U3)=>{"use strict";m();var R6=Function.prototype.call,N6=Object.prototype.hasOwnProperty,G6=_h();U3.exports=G6.call(R6,N6)});var zr=H((dj,X3)=>{"use strict";m();var Ce,V6=S3(),j6=M3(),U6=P3(),H6=D3(),rl=uy(),tl=pn(),W6=L3(),Z3=Function,fy=function(r){try{return Z3('"use strict"; return ('+r+").constructor;")()}catch{}},ua=Object.getOwnPropertyDescriptor;if(ua)try{ua({},"")}catch{ua=null}var my=function(){throw new tl},z6=ua?function(){try{return arguments.callee,my}catch{try{return ua(arguments,"callee").get}catch{return my}}}():my,Qs=Eh()(),Z6=R3()(),bt=Object.getPrototypeOf||(Z6?function(r){return r.__proto__}:null),el={},X6=typeof Uint8Array>"u"||!bt?Ce:bt(Uint8Array),da={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ce:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ce:ArrayBuffer,"%ArrayIteratorPrototype%":Qs&&bt?bt([][Symbol.iterator]()):Ce,"%AsyncFromSyncIteratorPrototype%":Ce,"%AsyncFunction%":el,"%AsyncGenerator%":el,"%AsyncGeneratorFunction%":el,"%AsyncIteratorPrototype%":el,"%Atomics%":typeof Atomics>"u"?Ce:Atomics,"%BigInt%":typeof BigInt>"u"?Ce:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ce:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ce:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ce:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":V6,"%eval%":eval,"%EvalError%":j6,"%Float32Array%":typeof Float32Array>"u"?Ce:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ce:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ce:FinalizationRegistry,"%Function%":Z3,"%GeneratorFunction%":el,"%Int8Array%":typeof Int8Array>"u"?Ce:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ce:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ce:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Qs&&bt?bt(bt([][Symbol.iterator]())):Ce,"%JSON%":typeof JSON=="object"?JSON:Ce,"%Map%":typeof Map>"u"?Ce:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Qs||!bt?Ce:bt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ce:Promise,"%Proxy%":typeof Proxy>"u"?Ce:Proxy,"%RangeError%":U6,"%ReferenceError%":H6,"%Reflect%":typeof Reflect>"u"?Ce:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ce:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Qs||!bt?Ce:bt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ce:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Qs&&bt?bt(""[Symbol.iterator]()):Ce,"%Symbol%":Qs?Symbol:Ce,"%SyntaxError%":rl,"%ThrowTypeError%":z6,"%TypedArray%":X6,"%TypeError%":tl,"%Uint8Array%":typeof Uint8Array>"u"?Ce:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ce:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ce:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ce:Uint32Array,"%URIError%":W6,"%WeakMap%":typeof WeakMap>"u"?Ce:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ce:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ce:WeakSet};if(bt)try{null.error}catch(r){H3=bt(bt(r)),da["%Error.prototype%"]=H3}var H3,Y6=function r(t){var e;if(t==="%AsyncFunction%")e=fy("async function () {}");else if(t==="%GeneratorFunction%")e=fy("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=fy("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&bt&&(e=bt(n.prototype))}return da[t]=e,e},W3={__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"]},Jc=_h(),Oh=hy(),q6=Jc.call(Function.call,Array.prototype.concat),$6=Jc.call(Function.apply,Array.prototype.splice),z3=Jc.call(Function.call,String.prototype.replace),Lh=Jc.call(Function.call,String.prototype.slice),J6=Jc.call(Function.call,RegExp.prototype.exec),K6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q6=/\\(\\)?/g,e9=function(t){var e=Lh(t,0,1),i=Lh(t,-1);if(e==="%"&&i!=="%")throw new rl("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new rl("invalid intrinsic syntax, expected opening `%`");var n=[];return z3(t,K6,function(o,a,c,l){n[n.length]=c?z3(l,Q6,"$1"):a||o}),n},t9=function(t,e){var i=t,n;if(Oh(W3,i)&&(n=W3[i],i="%"+n[0]+"%"),Oh(da,i)){var o=da[i];if(o===el&&(o=Y6(i)),typeof o>"u"&&!e)throw new tl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new rl("intrinsic "+t+" does not exist!")};X3.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new tl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new tl('"allowMissing" argument must be a boolean');if(J6(/^%?[^%]*%?$/,t)===null)throw new rl("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=e9(t),n=i.length>0?i[0]:"",o=t9("%"+n+"%",e),a=o.name,c=o.value,l=!1,p=o.alias;p&&(n=p[0],$6(i,q6([0,1],p)));for(var d=1,f=!0;d<i.length;d+=1){var g=i[d],y=Lh(g,0,1),v=Lh(g,-1);if((y==='"'||y==="'"||y==="`"||v==='"'||v==="'"||v==="`")&&y!==v)throw new rl("property names with quotes must have matching quotes");if((g==="constructor"||!f)&&(l=!0),n+="."+g,a="%"+n+"%",Oh(da,a))c=da[a];else if(c!=null){if(!(g in c)){if(!e)throw new tl("base intrinsic for "+t+" exists, but the property is not available.");return}if(ua&&d+1>=i.length){var x=ua(c,g);f=!!x,f&&"get"in x&&!("originalValue"in x.get)?c=x.get:c=c[g]}else f=Oh(c,g),c=c[g];f&&!l&&(da[a]=c)}}return c}});var Ah=H((fj,Y3)=>{"use strict";m();var r9=zr(),kh=r9("%Object.defineProperty%",!0)||!1;if(kh)try{kh({},"a",{value:1})}catch{kh=!1}Y3.exports=kh});var Bh=H((gj,q3)=>{"use strict";m();var i9=zr(),Fh=i9("%Object.getOwnPropertyDescriptor%",!0);if(Fh)try{Fh([],"length")}catch{Fh=null}q3.exports=Fh});var Rh=H((bj,K3)=>{"use strict";m();var $3=Ah(),n9=uy(),il=pn(),J3=Bh();K3.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new il("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new il("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new il("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new il("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new il("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new il("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!J3&&J3(t,e);if($3)$3(t,e,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:o===null&&l?l.writable:!o});else if(c||!n&&!o&&!a)t[e]=i;else throw new n9("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Nh=H((xj,ex)=>{"use strict";m();var gy=Ah(),Q3=function(){return!!gy};Q3.hasArrayLengthDefineBug=function(){if(!gy)return null;try{return gy([],"length",{value:1}).length!==1}catch{return!0}};ex.exports=Q3});var no=H((Sj,nx)=>{"use strict";m();var o9=Dh(),a9=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",s9=Object.prototype.toString,l9=Array.prototype.concat,tx=Rh(),c9=function(r){return typeof r=="function"&&s9.call(r)==="[object Function]"},rx=Nh()(),p9=function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!c9(i)||!i())return}rx?tx(r,t,e,!0):tx(r,t,e)},ix=function(r,t){var e=arguments.length>2?arguments[2]:{},i=o9(t);a9&&(i=l9.call(i,Object.getOwnPropertySymbols(t)));for(var n=0;n<i.length;n+=1)p9(r,i[n],t[i[n]],e[i[n]])};ix.supportsDescriptors=!!rx;nx.exports=ix});var cx=H((Mj,lx)=>{"use strict";m();var u9=zr(),ox=Rh(),d9=Nh()(),ax=Bh(),sx=pn(),h9=u9("%Math.floor%");lx.exports=function(t,e){if(typeof t!="function")throw new sx("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||h9(e)!==e)throw new sx("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&ax){var a=ax(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(d9?ox(t,"length",e,!0,!0):ox(t,"length",e)),t}});var ha=H((Pj,Gh)=>{"use strict";m();var yy=_h(),Vh=zr(),f9=cx(),m9=pn(),dx=Vh("%Function.prototype.apply%"),hx=Vh("%Function.prototype.call%"),fx=Vh("%Reflect.apply%",!0)||yy.call(hx,dx),px=Ah(),g9=Vh("%Math.max%");Gh.exports=function(t){if(typeof t!="function")throw new m9("a function is required");var e=fx(yy,hx,arguments);return f9(e,1+g9(0,t.length-(arguments.length-1)),!0)};var ux=function(){return fx(yy,dx,arguments)};px?px(Gh.exports,"apply",{value:ux}):Gh.exports.apply=ux});var hr=H((Dj,yx)=>{"use strict";m();var mx=zr(),gx=ha(),y9=gx(mx("String.prototype.indexOf"));yx.exports=function(t,e){var i=mx(t,!!e);return typeof i=="function"&&y9(t,".prototype.")>-1?gx(i):i}});var by=H((_j,Sx)=>{"use strict";m();var b9=Dh(),xx=$c()(),Cx=hr(),bx=Object,v9=Cx("Array.prototype.push"),vx=Cx("Object.prototype.propertyIsEnumerable"),x9=xx?Object.getOwnPropertySymbols:null;Sx.exports=function(t,e){if(t==null)throw new TypeError("target must be an object");var i=bx(t);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=bx(arguments[n]),a=b9(o),c=xx&&(Object.getOwnPropertySymbols||x9);if(c)for(var l=c(o),p=0;p<l.length;++p){var d=l[p];vx(o,d)&&v9(a,d)}for(var f=0;f<a.length;++f){var g=a[f];if(vx(o,g)){var y=o[g];i[g]=y}}}return i}});var xy=H((Lj,Tx)=>{"use strict";m();var vy=by(),C9=function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},i=0;i<t.length;++i)e[t[i]]=t[i];var n=Object.assign({},e),o="";for(var a in n)o+=a;return r!==o},S9=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};Tx.exports=function(){return!Object.assign||C9()||S9()?vy:Object.assign}});var Ix=H((Aj,Mx)=>{"use strict";m();var T9=no(),M9=xy();Mx.exports=function(){var t=M9();return T9(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var Ex=H((Bj,Dx)=>{"use strict";m();var I9=no(),P9=ha(),w9=by(),Px=xy(),D9=Ix(),E9=P9.apply(Px()),wx=function(t,e){return E9(Object,arguments)};I9(wx,{getPolyfill:Px,implementation:w9,shim:D9});Dx.exports=wx});var Ox=H((Nj,_x)=>{"use strict";m();var Qc=function(){return typeof(function(){}).name=="string"},Kc=Object.getOwnPropertyDescriptor;if(Kc)try{Kc([],"length")}catch{Kc=null}Qc.functionsHaveConfigurableNames=function(){if(!Qc()||!Kc)return!1;var t=Kc(function(){},"name");return!!t&&!!t.configurable};var _9=Function.prototype.bind;Qc.boundFunctionsHaveNames=function(){return Qc()&&typeof _9=="function"&&(function(){}).bind().name!==""};_x.exports=Qc});var Ax=H((Vj,kx)=>{"use strict";m();var Lx=Rh(),O9=Nh()(),L9=Ox().functionsHaveConfigurableNames(),k9=pn();kx.exports=function(t,e){if(typeof t!="function")throw new k9("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||L9)&&(O9?Lx(t,"name",e,!0,!0):Lx(t,"name",e)),t}});var Cy=H((Uj,Fx)=>{"use strict";m();var A9=Ax(),F9=pn(),B9=Object;Fx.exports=A9(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},"get flags",!0)});var Sy=H((Wj,Bx)=>{"use strict";m();var R9=Cy(),N9=no().supportsDescriptors,G9=Object.getOwnPropertyDescriptor;Bx.exports=function(){if(N9&&/a/mig.flags==="gim"){var t=G9(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 R9}});var Gx=H((Zj,Nx)=>{"use strict";m();var V9=no().supportsDescriptors,j9=Sy(),U9=Object.getOwnPropertyDescriptor,H9=Object.defineProperty,W9=TypeError,Rx=Object.getPrototypeOf,z9=/a/;Nx.exports=function(){if(!V9||!Rx)throw new W9("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=j9(),e=Rx(z9),i=U9(e,"flags");return(!i||i.get!==t)&&H9(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Hx=H((Yj,Ux)=>{"use strict";m();var Z9=no(),X9=ha(),Y9=Cy(),Vx=Sy(),q9=Gx(),jx=X9(Vx());Z9(jx,{getPolyfill:Vx,implementation:Y9,shim:q9});Ux.exports=jx});var oo=H(($j,Wx)=>{"use strict";m();var $9=$c();Wx.exports=function(){return $9()&&!!Symbol.toStringTag}});var My=H((Kj,Zx)=>{"use strict";m();var J9=oo()(),K9=hr(),Ty=K9("Object.prototype.toString"),jh=function(t){return J9&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Ty(t)==="[object Arguments]"},zx=function(t){return jh(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Ty(t)!=="[object Array]"&&Ty(t.callee)==="[object Function]"},Q9=function(){return jh(arguments)}();jh.isLegacyArguments=zx;Zx.exports=Q9?jh:zx});var Xx=H(()=>{m()});var hC=H((iU,dC)=>{m();var Ay=typeof Map=="function"&&Map.prototype,Iy=Object.getOwnPropertyDescriptor&&Ay?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hh=Ay&&Iy&&typeof Iy.get=="function"?Iy.get:null,Yx=Ay&&Map.prototype.forEach,Fy=typeof Set=="function"&&Set.prototype,Py=Object.getOwnPropertyDescriptor&&Fy?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wh=Fy&&Py&&typeof Py.get=="function"?Py.get:null,qx=Fy&&Set.prototype.forEach,e8=typeof WeakMap=="function"&&WeakMap.prototype,tp=e8?WeakMap.prototype.has:null,t8=typeof WeakSet=="function"&&WeakSet.prototype,rp=t8?WeakSet.prototype.has:null,r8=typeof WeakRef=="function"&&WeakRef.prototype,$x=r8?WeakRef.prototype.deref:null,i8=Boolean.prototype.valueOf,n8=Object.prototype.toString,o8=Function.prototype.toString,a8=String.prototype.match,By=String.prototype.slice,so=String.prototype.replace,s8=String.prototype.toUpperCase,Jx=String.prototype.toLowerCase,aC=RegExp.prototype.test,Kx=Array.prototype.concat,Mi=Array.prototype.join,l8=Array.prototype.slice,Qx=Math.floor,Ey=typeof BigInt=="function"?BigInt.prototype.valueOf:null,wy=Object.getOwnPropertySymbols,_y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,nl=typeof Symbol=="function"&&typeof Symbol.iterator=="object",kt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===nl||!0)?Symbol.toStringTag:null,sC=Object.prototype.propertyIsEnumerable,eC=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function tC(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||aC.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Qx(-r):Qx(r);if(i!==r){var n=String(i),o=By.call(t,n.length+1);return so.call(n,e,"$&_")+"."+so.call(so.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return so.call(t,e,"$&_")}var Oy=Xx(),rC=Oy.custom,iC=cC(rC)?rC:null;dC.exports=function r(t,e,i,n){var o=e||{};if(ao(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ao(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=ao(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ao(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ao(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return uC(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return c?tC(t,l):l}if(typeof t=="bigint"){var p=String(t)+"n";return c?tC(t,p):p}var d=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof t=="object")return Ly(t)?"[Array]":"[Object]";var f=P8(o,i);if(typeof n>"u")n=[];else if(pC(n,t)>=0)return"[Circular]";function g(W,j,ee){if(j&&(n=l8.call(n),n.push(j)),ee){var Z={depth:o.depth};return ao(o,"quoteStyle")&&(Z.quoteStyle=o.quoteStyle),r(W,Z,i+1,n)}return r(W,o,i+1,n)}if(typeof t=="function"&&!nC(t)){var y=y8(t),v=Uh(t,g);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(v.length>0?" { "+Mi.call(v,", ")+" }":"")}if(cC(t)){var x=nl?so.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):_y.call(t);return typeof t=="object"&&!nl?ep(x):x}if(T8(t)){for(var b="<"+Jx.call(String(t.nodeName)),C=t.attributes||[],M=0;M<C.length;M++)b+=" "+C[M].name+"="+lC(c8(C[M].value),"double",o);return b+=">",t.childNodes&&t.childNodes.length&&(b+="..."),b+="</"+Jx.call(String(t.nodeName))+">",b}if(Ly(t)){if(t.length===0)return"[]";var P=Uh(t,g);return f&&!I8(P)?"["+ky(P,f)+"]":"[ "+Mi.call(P,", ")+" ]"}if(u8(t)){var w=Uh(t,g);return!("cause"in Error.prototype)&&"cause"in t&&!sC.call(t,"cause")?"{ ["+String(t)+"] "+Mi.call(Kx.call("[cause]: "+g(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Mi.call(w,", ")+" }"}if(typeof t=="object"&&a){if(iC&&typeof t[iC]=="function"&&Oy)return Oy(t,{depth:d-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(b8(t)){var D=[];return Yx&&Yx.call(t,function(W,j){D.push(g(j,t,!0)+" => "+g(W,t))}),oC("Map",Hh.call(t),D,f)}if(C8(t)){var B=[];return qx&&qx.call(t,function(W){B.push(g(W,t))}),oC("Set",Wh.call(t),B,f)}if(v8(t))return Dy("WeakMap");if(S8(t))return Dy("WeakSet");if(x8(t))return Dy("WeakRef");if(h8(t))return ep(g(Number(t)));if(m8(t))return ep(g(Ey.call(t)));if(f8(t))return ep(i8.call(t));if(d8(t))return ep(g(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!p8(t)&&!nC(t)){var _=Uh(t,g),A=eC?eC(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",G=!A&&kt&&Object(t)===t&&kt in t?By.call(lo(t),8,-1):F?"Object":"",R=A||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",z=R+(G||F?"["+Mi.call(Kx.call([],G||[],F||[]),": ")+"] ":"");return _.length===0?z+"{}":f?z+"{"+ky(_,f)+"}":z+"{ "+Mi.call(_,", ")+" }"}return String(t)};function lC(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function c8(r){return so.call(String(r),/"/g,""")}function Ly(r){return lo(r)==="[object Array]"&&(!kt||!(typeof r=="object"&&kt in r))}function p8(r){return lo(r)==="[object Date]"&&(!kt||!(typeof r=="object"&&kt in r))}function nC(r){return lo(r)==="[object RegExp]"&&(!kt||!(typeof r=="object"&&kt in r))}function u8(r){return lo(r)==="[object Error]"&&(!kt||!(typeof r=="object"&&kt in r))}function d8(r){return lo(r)==="[object String]"&&(!kt||!(typeof r=="object"&&kt in r))}function h8(r){return lo(r)==="[object Number]"&&(!kt||!(typeof r=="object"&&kt in r))}function f8(r){return lo(r)==="[object Boolean]"&&(!kt||!(typeof r=="object"&&kt in r))}function cC(r){if(nl)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!_y)return!1;try{return _y.call(r),!0}catch{}return!1}function m8(r){if(!r||typeof r!="object"||!Ey)return!1;try{return Ey.call(r),!0}catch{}return!1}var g8=Object.prototype.hasOwnProperty||function(r){return r in this};function ao(r,t){return g8.call(r,t)}function lo(r){return n8.call(r)}function y8(r){if(r.name)return r.name;var t=a8.call(o8.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function pC(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}function b8(r){if(!Hh||!r||typeof r!="object")return!1;try{Hh.call(r);try{Wh.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function v8(r){if(!tp||!r||typeof r!="object")return!1;try{tp.call(r,tp);try{rp.call(r,rp)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function x8(r){if(!$x||!r||typeof r!="object")return!1;try{return $x.call(r),!0}catch{}return!1}function C8(r){if(!Wh||!r||typeof r!="object")return!1;try{Wh.call(r);try{Hh.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function S8(r){if(!rp||!r||typeof r!="object")return!1;try{rp.call(r,rp);try{tp.call(r,tp)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function T8(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function uC(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return uC(By.call(r,0,t.maxStringLength),t)+i}var n=so.call(so.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,M8);return lC(n,"single",t)}function M8(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":"")+s8.call(t.toString(16))}function ep(r){return"Object("+r+")"}function Dy(r){return r+" { ? }"}function oC(r,t,e,i){var n=i?ky(e,i):Mi.call(e,", ");return r+" ("+t+") {"+n+"}"}function I8(r){for(var t=0;t<r.length;t++)if(pC(r[t],"\n")>=0)return!1;return!0}function P8(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=Mi.call(Array(r.indent+1)," ");else return null;return{base:e,prev:Mi.call(Array(t+1),e)}}function ky(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+Mi.call(r,","+e)+"\n"+t.prev}function Uh(r,t){var e=Ly(r),i=[];if(e){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=ao(r,n)?t(r[n],r):""}var o=typeof wy=="function"?wy(r):[],a;if(nl){a={};for(var c=0;c<o.length;c++)a["$"+o[c]]=o[c]}for(var l in r)ao(r,l)&&(e&&String(Number(l))===l&&l<r.length||nl&&a["$"+l]instanceof Symbol||(aC.call(/[^\w$]/,l)?i.push(t(l,r)+": "+t(r[l],r)):i.push(l+": "+t(r[l],r))));if(typeof wy=="function")for(var p=0;p<o.length;p++)sC.call(r,o[p])&&i.push("["+t(o[p])+"]: "+t(r[o[p]],r));return i}});var Ny=H((oU,mC)=>{"use strict";m();var fC=zr(),ol=hr(),w8=hC(),D8=pn(),zh=fC("%WeakMap%",!0),Zh=fC("%Map%",!0),E8=ol("WeakMap.prototype.get",!0),_8=ol("WeakMap.prototype.set",!0),O8=ol("WeakMap.prototype.has",!0),L8=ol("Map.prototype.get",!0),k8=ol("Map.prototype.set",!0),A8=ol("Map.prototype.has",!0),Ry=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},F8=function(r,t){var e=Ry(r,t);return e&&e.value},B8=function(r,t,e){var i=Ry(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},R8=function(r,t){return!!Ry(r,t)};mC.exports=function(){var t,e,i,n={assert:function(o){if(!n.has(o))throw new D8("Side channel does not contain "+w8(o))},get:function(o){if(zh&&o&&(typeof o=="object"||typeof o=="function")){if(t)return E8(t,o)}else if(Zh){if(e)return L8(e,o)}else if(i)return F8(i,o)},has:function(o){if(zh&&o&&(typeof o=="object"||typeof o=="function")){if(t)return O8(t,o)}else if(Zh){if(e)return A8(e,o)}else if(i)return R8(i,o);return!1},set:function(o,a){zh&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new zh),_8(t,o,a)):Zh?(e||(e=new Zh),k8(e,o,a)):(i||(i={key:{},next:null}),B8(i,o,a))}};return n}});var yC=H((sU,gC)=>{"use strict";m();var N8=hy(),ip=Ny()(),un=pn(),Gy={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new un("`O` is not an object");if(typeof t!="string")throw new un("`slot` must be a string");if(ip.assert(r),!Gy.has(r,t))throw new un("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new un("`O` is not an object");if(typeof t!="string")throw new un("`slot` must be a string");var e=ip.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new un("`O` is not an object");if(typeof t!="string")throw new un("`slot` must be a string");var e=ip.get(r);return!!e&&N8(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new un("`O` is not an object");if(typeof t!="string")throw new un("`slot` must be a string");var i=ip.get(r);i||(i={},ip.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(Gy);gC.exports=Gy});var xC=H((cU,vC)=>{"use strict";m();var np=yC(),G8=SyntaxError,bC=typeof StopIteration=="object"?StopIteration:null;vC.exports=function(t){if(!bC)throw new G8("this environment lacks StopIteration");np.set(t,"[[Done]]",!1);var e={next:function(){var n=np.get(this,"[[Iterator]]"),o=np.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(np.set(n,"[[Done]]",!0),a!==bC)throw a;return{done:!0,value:void 0}}}};return np.set(e,"[[Iterator]]",t),e}});var Vy=H((uU,CC)=>{m();var V8={}.toString;CC.exports=Array.isArray||function(r){return V8.call(r)=="[object Array]"}});var jy=H((hU,SC)=>{"use strict";m();var j8=String.prototype.valueOf,U8=function(t){try{return j8.call(t),!0}catch{return!1}},H8=Object.prototype.toString,W8="[object String]",z8=oo()();SC.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:z8?U8(t):H8.call(t)===W8}});var Hy=H((mU,IC)=>{"use strict";m();var Uy=typeof Map=="function"&&Map.prototype?Map:null,Z8=typeof Set=="function"&&Set.prototype?Set:null,Xh;Uy||(Xh=function(t){return!1});var MC=Uy?Map.prototype.has:null,TC=Z8?Set.prototype.has:null;!Xh&&!MC&&(Xh=function(t){return!1});IC.exports=Xh||function(t){if(!t||typeof t!="object")return!1;try{if(MC.call(t),TC)try{TC.call(t)}catch{return!0}return t instanceof Uy}catch{}return!1}});var zy=H((yU,DC)=>{"use strict";m();var X8=typeof Map=="function"&&Map.prototype?Map:null,Wy=typeof Set=="function"&&Set.prototype?Set:null,Yh;Wy||(Yh=function(t){return!1});var PC=X8?Map.prototype.has:null,wC=Wy?Set.prototype.has:null;!Yh&&!wC&&(Yh=function(t){return!1});DC.exports=Yh||function(t){if(!t||typeof t!="object")return!1;try{if(wC.call(t),PC)try{PC.call(t)}catch{return!0}return t instanceof Wy}catch{}return!1}});var VC=H((vU,Jh)=>{"use strict";m();var EC=My(),_C=xC();Eh()()||$c()()?(qh=Symbol.iterator,Jh.exports=function(t){if(t!=null&&typeof t[qh]<"u")return t[qh]();if(EC(t))return Array.prototype[qh].call(t)}):(OC=Vy(),LC=jy(),Zy=zr(),kC=Zy("%Map%",!0),AC=Zy("%Set%",!0),Ir=hr(),Xy=Ir("Array.prototype.push"),Yy=Ir("String.prototype.charCodeAt"),FC=Ir("String.prototype.slice"),BC=function(t,e){var i=t.length;if(e+1>=i)return e+1;var n=Yy(t,e);if(n<55296||n>56319)return e+1;var o=Yy(t,e+1);return o<56320||o>57343?e+1:e+2},$h=function(t){var e=0;return{next:function(){var n=e>=t.length,o;return n||(o=t[e],e+=1),{done:n,value:o}}}},qy=function(t,e){if(OC(t)||EC(t))return $h(t);if(LC(t)){var i=0;return{next:function(){var o=BC(t,i),a=FC(t,i,o);return i=o,{done:o>t.length,value:a}}}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},!kC&&!AC?Jh.exports=function(t){if(t!=null)return qy(t,!0)}:(RC=Hy(),NC=zy(),$y=Ir("Map.prototype.forEach",!0),Jy=Ir("Set.prototype.forEach",!0),(typeof T>"u"||!T.versions||!T.versions.node)&&(Ky=Ir("Map.prototype.iterator",!0),Qy=Ir("Set.prototype.iterator",!0)),e1=Ir("Map.prototype.@@iterator",!0)||Ir("Map.prototype._es6-shim iterator_",!0),t1=Ir("Set.prototype.@@iterator",!0)||Ir("Set.prototype._es6-shim iterator_",!0),GC=function(t){if(RC(t)){if(Ky)return _C(Ky(t));if(e1)return e1(t);if($y){var e=[];return $y(t,function(n,o){Xy(e,[o,n])}),$h(e)}}if(NC(t)){if(Qy)return _C(Qy(t));if(t1)return t1(t);if(Jy){var i=[];return Jy(t,function(n){Xy(i,n)}),$h(i)}}},Jh.exports=function(t){return GC(t)||qy(t)}));var qh,OC,LC,Zy,kC,AC,Ir,Xy,Yy,FC,BC,$h,qy,RC,NC,$y,Jy,Ky,Qy,e1,t1,GC});var r1=H((CU,UC)=>{"use strict";m();var jC=function(r){return r!==r};UC.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||jC(t)&&jC(e))}});var i1=H((TU,HC)=>{"use strict";m();var Y8=r1();HC.exports=function(){return typeof Object.is=="function"?Object.is:Y8}});var zC=H((IU,WC)=>{"use strict";m();var q8=i1(),$8=no();WC.exports=function(){var t=q8();return $8(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var qC=H((wU,YC)=>{"use strict";m();var J8=no(),K8=ha(),Q8=r1(),ZC=i1(),ew=zC(),XC=K8(ZC(),Object);J8(XC,{getPolyfill:ZC,implementation:Q8,shim:ew});YC.exports=XC});var o1=H((EU,QC)=>{"use strict";m();var tw=ha(),KC=hr(),rw=zr(),n1=rw("%ArrayBuffer%",!0),Kh=KC("ArrayBuffer.prototype.byteLength",!0),iw=KC("Object.prototype.toString"),$C=!!n1&&!Kh&&new n1(0).slice,JC=!!$C&&tw($C);QC.exports=Kh||JC?function(t){if(!t||typeof t!="object")return!1;try{return Kh?Kh(t):JC(t,0),!0}catch{return!1}}:n1?function(t){return iw(t)==="[object ArrayBuffer]"}:function(t){return!1}});var tS=H((OU,eS)=>{"use strict";m();var nw=Date.prototype.getDay,ow=function(t){try{return nw.call(t),!0}catch{return!1}},aw=Object.prototype.toString,sw="[object Date]",lw=oo()();eS.exports=function(t){return typeof t!="object"||t===null?!1:lw?ow(t):aw.call(t)===sw}});var aS=H((kU,oS)=>{"use strict";m();var a1=hr(),rS=oo()(),iS,nS,s1,l1;rS&&(iS=a1("Object.prototype.hasOwnProperty"),nS=a1("RegExp.prototype.exec"),s1={},Qh=function(){throw s1},l1={toString:Qh,valueOf:Qh},typeof Symbol.toPrimitive=="symbol"&&(l1[Symbol.toPrimitive]=Qh));var Qh,cw=a1("Object.prototype.toString"),pw=Object.getOwnPropertyDescriptor,uw="[object RegExp]";oS.exports=rS?function(t){if(!t||typeof t!="object")return!1;var e=pw(t,"lastIndex"),i=e&&iS(e,"value");if(!i)return!1;try{nS(t,l1)}catch(n){return n===s1}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:cw(t)===uw}});var cS=H((FU,lS)=>{"use strict";m();var dw=hr(),sS=dw("SharedArrayBuffer.prototype.byteLength",!0);lS.exports=sS?function(t){if(!t||typeof t!="object")return!1;try{return sS(t),!0}catch{return!1}}:function(t){return!1}});var uS=H((RU,pS)=>{"use strict";m();var hw=Number.prototype.toString,fw=function(t){try{return hw.call(t),!0}catch{return!1}},mw=Object.prototype.toString,gw="[object Number]",yw=oo()();pS.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:yw?fw(t):mw.call(t)===gw}});var fS=H((GU,hS)=>{"use strict";m();var dS=hr(),bw=dS("Boolean.prototype.toString"),vw=dS("Object.prototype.toString"),xw=function(t){try{return bw(t),!0}catch{return!1}},Cw="[object Boolean]",Sw=oo()();hS.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:Sw&&Symbol.toStringTag in t?xw(t):vw(t)===Cw}});var bS=H((jU,c1)=>{"use strict";m();var Tw=Object.prototype.toString,Mw=Eh()();Mw?(mS=Symbol.prototype.toString,gS=/^Symbol\(.*\)$/,yS=function(t){return typeof t.valueOf()!="symbol"?!1:gS.test(mS.call(t))},c1.exports=function(t){if(typeof t=="symbol")return!0;if(Tw.call(t)!=="[object Symbol]")return!1;try{return yS(t)}catch{return!1}}):c1.exports=function(t){return!1};var mS,gS,yS});var CS=H((HU,xS)=>{"use strict";m();var vS=typeof BigInt<"u"&&BigInt;xS.exports=function(){return typeof vS=="function"&&typeof BigInt=="function"&&typeof vS(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var MS=H((zU,p1)=>{"use strict";m();var Iw=CS()();Iw?(SS=BigInt.prototype.valueOf,TS=function(t){try{return SS.call(t),!0}catch{}return!1},p1.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:TS(t)}):p1.exports=function(t){return!1};var SS,TS});var PS=H((XU,IS)=>{"use strict";m();var Pw=jy(),ww=uS(),Dw=fS(),Ew=bS(),_w=MS();IS.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(Pw(t))return"String";if(ww(t))return"Number";if(Dw(t))return"Boolean";if(Ew(t))return"Symbol";if(_w(t))return"BigInt"}});var ES=H((qU,DS)=>{"use strict";m();var ef=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,wS=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,tf;ef||(tf=function(t){return!1});var d1=ef?ef.prototype.has:null,u1=wS?wS.prototype.has:null;!tf&&!d1&&(tf=function(t){return!1});DS.exports=tf||function(t){if(!t||typeof t!="object")return!1;try{if(d1.call(t,d1),u1)try{u1.call(t,u1)}catch{return!0}return t instanceof ef}catch{}return!1}});var OS=H((JU,f1)=>{"use strict";m();var Ow=zr(),_S=hr(),Lw=Ow("%WeakSet%",!0),h1=_S("WeakSet.prototype.has",!0);h1?(rf=_S("WeakMap.prototype.has",!0),f1.exports=function(t){if(!t||typeof t!="object")return!1;try{if(h1(t,h1),rf)try{rf(t,rf)}catch{return!0}return t instanceof Lw}catch{}return!1}):f1.exports=function(t){return!1};var rf});var kS=H((QU,LS)=>{"use strict";m();var kw=Hy(),Aw=zy(),Fw=ES(),Bw=OS();LS.exports=function(t){if(t&&typeof t=="object"){if(kw(t))return"Map";if(Aw(t))return"Set";if(Fw(t))return"WeakMap";if(Bw(t))return"WeakSet"}return!1}});var RS=H((tH,BS)=>{"use strict";m();var FS=Function.prototype.toString,al=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,g1,nf;if(typeof al=="function"&&typeof Object.defineProperty=="function")try{g1=Object.defineProperty({},"length",{get:function(){throw nf}}),nf={},al(function(){throw 42},null,g1)}catch(r){r!==nf&&(al=null)}else al=null;var Rw=/^\s*class\b/,y1=function(t){try{var e=FS.call(t);return Rw.test(e)}catch{return!1}},m1=function(t){try{return y1(t)?!1:(FS.call(t),!0)}catch{return!1}},of=Object.prototype.toString,Nw="[object Object]",Gw="[object Function]",Vw="[object GeneratorFunction]",jw="[object HTMLAllCollection]",Uw="[object HTML document.all class]",Hw="[object HTMLCollection]",Ww=typeof Symbol=="function"&&!!Symbol.toStringTag,zw=!(0 in[,]),b1=function(){return!1};typeof document=="object"&&(AS=document.all,of.call(AS)===of.call(document.all)&&(b1=function(t){if((zw||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=of.call(t);return(e===jw||e===Uw||e===Hw||e===Nw)&&t("")==null}catch{}return!1}));var AS;BS.exports=al?function(t){if(b1(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{al(t,null,g1)}catch(e){if(e!==nf)return!1}return!y1(t)&&m1(t)}:function(t){if(b1(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Ww)return m1(t);if(y1(t))return!1;var e=of.call(t);return e!==Gw&&e!==Vw&&!/^\[object HTML/.test(e)?!1:m1(t)}});var VS=H((iH,GS)=>{"use strict";m();var Zw=RS(),Xw=Object.prototype.toString,NS=Object.prototype.hasOwnProperty,Yw=function(t,e,i){for(var n=0,o=t.length;n<o;n++)NS.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},qw=function(t,e,i){for(var n=0,o=t.length;n<o;n++)i==null?e(t.charAt(n),n,t):e.call(i,t.charAt(n),n,t)},$w=function(t,e,i){for(var n in t)NS.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},Jw=function(t,e,i){if(!Zw(e))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),Xw.call(t)==="[object Array]"?Yw(t,e,n):typeof t=="string"?qw(t,e,n):$w(t,e,n)};GS.exports=Jw});var US=H((oH,jS)=>{"use strict";m();jS.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var WS=H((sH,HS)=>{"use strict";m();var v1=US(),Kw=typeof globalThis>"u"?global:globalThis;HS.exports=function(){for(var t=[],e=0;e<v1.length;e++)typeof Kw[v1[e]]=="function"&&(t[t.length]=v1[e]);return t}});var qS=H((cH,YS)=>{"use strict";m();var sf=VS(),Qw=WS(),zS=ha(),S1=hr(),af=Bh(),eD=S1("Object.prototype.toString"),XS=oo()(),ZS=typeof globalThis>"u"?global:globalThis,C1=Qw(),T1=S1("String.prototype.slice"),x1=Object.getPrototypeOf,tD=S1("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},lf={__proto__:null};XS&&af&&x1?sf(C1,function(r){var t=new ZS[r];if(Symbol.toStringTag in t){var e=x1(t),i=af(e,Symbol.toStringTag);if(!i){var n=x1(e);i=af(n,Symbol.toStringTag)}lf["$"+r]=zS(i.get)}}):sf(C1,function(r){var t=new ZS[r],e=t.slice||t.set;e&&(lf["$"+r]=zS(e))});var rD=function(t){var e=!1;return sf(lf,function(i,n){if(!e)try{"$"+i(t)===n&&(e=T1(n,1))}catch{}}),e},iD=function(t){var e=!1;return sf(lf,function(i,n){if(!e)try{i(t),e=T1(n,1)}catch{}}),e};YS.exports=function(t){if(!t||typeof t!="object")return!1;if(!XS){var e=T1(eD(t),8,-1);return tD(C1,e)>-1?e:e!=="Object"?!1:iD(t)}return af?rD(t):null}});var KS=H((uH,JS)=>{"use strict";m();var nD=hr(),$S=nD("ArrayBuffer.prototype.byteLength",!0),oD=o1();JS.exports=function(t){return oD(t)?$S?$S(t):t.byteLength:NaN}});var T4=H((hH,S4)=>{"use strict";m();var v4=Ex(),Ii=hr(),QS=Hx(),aD=zr(),sl=VC(),sD=Ny(),e4=qC(),t4=My(),r4=Vy(),i4=o1(),n4=tS(),o4=aS(),a4=cS(),s4=Dh(),l4=PS(),c4=kS(),p4=qS(),u4=KS(),d4=Ii("SharedArrayBuffer.prototype.byteLength",!0),h4=Ii("Date.prototype.getTime"),M1=Object.getPrototypeOf,f4=Ii("Object.prototype.toString"),pf=aD("%Set%",!0),I1=Ii("Map.prototype.has",!0),uf=Ii("Map.prototype.get",!0),m4=Ii("Map.prototype.size",!0),df=Ii("Set.prototype.add",!0),x4=Ii("Set.prototype.delete",!0),hf=Ii("Set.prototype.has",!0),cf=Ii("Set.prototype.size",!0);function g4(r,t,e,i){for(var n=sl(r),o;(o=n.next())&&!o.done;)if(Zr(t,o.value,e,i))return x4(r,o.value),!0;return!1}function C4(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}function lD(r,t,e,i,n,o){var a=C4(e);if(a!=null)return a;var c=uf(t,a),l=v4({},n,{strict:!1});return typeof c>"u"&&!I1(t,a)||!Zr(i,c,l,o)?!1:!I1(r,a)&&Zr(i,c,l,o)}function cD(r,t,e){var i=C4(e);return i!=null?i:hf(t,i)&&!hf(r,i)}function y4(r,t,e,i,n,o){for(var a=sl(r),c,l;(c=a.next())&&!c.done;)if(l=c.value,Zr(e,l,n,o)&&Zr(i,uf(t,l),n,o))return x4(r,l),!0;return!1}function Zr(r,t,e,i){var n=e||{};if(n.strict?e4(r,t):r===t)return!0;var o=l4(r),a=l4(t);if(o!==a)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return n.strict?e4(r,t):r==t;var c=i.has(r),l=i.has(t),p;if(c&&l){if(i.get(r)===i.get(t))return!0}else p={};return c||i.set(r,p),l||i.set(t,p),dD(r,t,n,i)}function b4(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function pD(r,t,e,i){if(cf(r)!==cf(t))return!1;for(var n=sl(r),o=sl(t),a,c,l;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")l||(l=new pf),df(l,a.value);else if(!hf(t,a.value)){if(e.strict||!cD(r,t,a.value))return!1;l||(l=new pf),df(l,a.value)}if(l){for(;(c=o.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!g4(l,c.value,e.strict,i))return!1}else if(!e.strict&&!hf(r,c.value)&&!g4(l,c.value,e.strict,i))return!1;return cf(l)===0}return!0}function uD(r,t,e,i){if(m4(r)!==m4(t))return!1;for(var n=sl(r),o=sl(t),a,c,l,p,d,f;(a=n.next())&&!a.done;)if(p=a.value[0],d=a.value[1],p&&typeof p=="object")l||(l=new pf),df(l,p);else if(f=uf(t,p),typeof f>"u"&&!I1(t,p)||!Zr(d,f,e,i)){if(e.strict||!lD(r,t,p,d,e,i))return!1;l||(l=new pf),df(l,p)}if(l){for(;(c=o.next())&&!c.done;)if(p=c.value[0],f=c.value[1],p&&typeof p=="object"){if(!y4(l,r,p,f,e,i))return!1}else if(!e.strict&&(!r.has(p)||!Zr(uf(r,p),f,e,i))&&!y4(l,r,p,f,v4({},e,{strict:!1}),i))return!1;return cf(l)===0}return!0}function dD(r,t,e,i){var n,o;if(typeof r!=typeof t||r==null||t==null||f4(r)!==f4(t)||t4(r)!==t4(t))return!1;var a=r4(r),c=r4(t);if(a!==c)return!1;var l=r instanceof Error,p=t instanceof Error;if(l!==p||(l||p)&&(r.name!==t.name||r.message!==t.message))return!1;var d=o4(r),f=o4(t);if(d!==f||(d||f)&&(r.source!==t.source||QS(r)!==QS(t)))return!1;var g=n4(r),y=n4(t);if(g!==y||(g||y)&&h4(r)!==h4(t)||e.strict&&M1&&M1(r)!==M1(t))return!1;var v=p4(r),x=p4(t);if(v!==x)return!1;if(v||x){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var b=b4(r),C=b4(t);if(b!==C)return!1;if(b||C){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var M=i4(r),P=i4(t);if(M!==P)return!1;if(M||P)return u4(r)!==u4(t)?!1:typeof Uint8Array=="function"&&Zr(new Uint8Array(r),new Uint8Array(t),e,i);var w=a4(r),D=a4(t);if(w!==D)return!1;if(w||D)return d4(r)!==d4(t)?!1:typeof Uint8Array=="function"&&Zr(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var B=s4(r),_=s4(t);if(B.length!==_.length)return!1;for(B.sort(),_.sort(),n=B.length-1;n>=0;n--)if(B[n]!=_[n])return!1;for(n=B.length-1;n>=0;n--)if(o=B[n],!Zr(r[o],t[o],e,i))return!1;var A=c4(r),F=c4(t);return A!==F?!1:A==="Set"||F==="Set"?pD(r,t,e,i):A==="Map"?uD(r,t,e,i):!0}S4.exports=function(t,e,i){return Zr(t,e,i,sD())}});var G4=H(Ee=>{"use strict";m();Object.defineProperty(Ee,"__esModule",{value:!0});function hD(r){return r&&r.__esModule?r:{default:r}}var fD=Object.defineProperty,Le=(r,t)=>fD(r,"name",{value:t,configurable:!0}),mD=T4(),gD=hD(mD),M4=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,i,n;this.precision=10**-((e=t==null?void 0:t.precision)!=null?e:17),this.direction=(i=t==null?void 0:t.direction)!=null?i:!1,this.compareProperties=(n=t==null?void 0:t.compareProperties)!=null?n:!0}compare(t,e){if(t.type!==e.type||!op(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=P1(t),n=P1(e);return i.every(o=>n.some(a=>this.compare(o,a)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((i,n)=>Math.abs(i-e[n])<this.precision)}compareLine(t,e,i=0,n=!1){if(!op(t,e))return!1;let o=t,a=e;if(n&&!this.compareCoord(o[0],a[0])){let l=this.fixStartIndex(a,o);if(l)a=l;else return!1}let c=this.compareCoord(o[i],a[i]);return this.direction||c?this.comparePath(o,a):this.compareCoord(o[i],a[a.length-(1+i)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(t,e){let i,n=-1;for(let o=0;o<t.length;o++)if(this.compareCoord(t[o],e[0])){n=o;break}return n>=0&&(i=[].concat(t.slice(n,t.length),t.slice(1,n+1))),i}comparePath(t,e){return t.every((i,n)=>this.compareCoord(i,e[n]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){let i=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length);return i.every(o=>n.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(t,e){return op(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((i,n)=>this.compare(i,e.geometries[n]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?gD.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return op(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((i,n)=>this.compare(i,e.features[n]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}};Le(M4,"GeojsonEquality");var yD=M4;function op(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}Le(op,"sameLength");function P1(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}Le(P1,"explode");var Qt=63710088e-1,D1={centimeters:Qt*100,centimetres:Qt*100,degrees:360/(2*Math.PI),feet:Qt*3.28084,inches:Qt*39.37,kilometers:Qt/1e3,kilometres:Qt/1e3,meters:Qt,metres:Qt,miles:Qt/1609.344,millimeters:Qt*1e3,millimetres:Qt*1e3,nauticalmiles:Qt/1852,radians:1,yards:Qt*1.0936},w1={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 dn(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}Le(dn,"feature");function I4(r,t,e={}){switch(r){case"Point":return ff(t).geometry;case"LineString":return gf(t).geometry;case"Polygon":return mf(t).geometry;case"MultiPoint":return _1(t).geometry;case"MultiLineString":return E1(t).geometry;case"MultiPolygon":return O1(t).geometry;default:throw new Error(r+" is invalid")}}Le(I4,"geometry");function ff(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(!ap(r[0])||!ap(r[1]))throw new Error("coordinates must contain numbers");return dn({type:"Point",coordinates:r},t,e)}Le(ff,"point");function P4(r,t,e={}){return sp(r.map(i=>ff(i,t)),e)}Le(P4,"points");function mf(r,t,e={}){for(let n of r){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<n[n.length-1].length;o++)if(n[n.length-1][o]!==n[0][o])throw new Error("First and last Position are not equivalent.")}return dn({type:"Polygon",coordinates:r},t,e)}Le(mf,"polygon");function w4(r,t,e={}){return sp(r.map(i=>mf(i,t)),e)}Le(w4,"polygons");function gf(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return dn({type:"LineString",coordinates:r},t,e)}Le(gf,"lineString");function D4(r,t,e={}){return sp(r.map(i=>gf(i,t)),e)}Le(D4,"lineStrings");function sp(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Le(sp,"featureCollection");function E1(r,t,e={}){return dn({type:"MultiLineString",coordinates:r},t,e)}Le(E1,"multiLineString");function _1(r,t,e={}){return dn({type:"MultiPoint",coordinates:r},t,e)}Le(_1,"multiPoint");function O1(r,t,e={}){return dn({type:"MultiPolygon",coordinates:r},t,e)}Le(O1,"multiPolygon");function E4(r,t,e={}){return dn({type:"GeometryCollection",geometries:r},t,e)}Le(E4,"geometryCollection");function _4(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}Le(_4,"round");function L1(r,t="kilometers"){let e=D1[t];if(!e)throw new Error(t+" units is invalid");return r*e}Le(L1,"radiansToLength");function yf(r,t="kilometers"){let e=D1[t];if(!e)throw new Error(t+" units is invalid");return r/e}Le(yf,"lengthToRadians");function O4(r,t){return k1(yf(r,t))}Le(O4,"lengthToDegrees");function L4(r){let t=r%360;return t<0&&(t+=360),t}Le(L4,"bearingToAzimuth");function k1(r){return r%(2*Math.PI)*180/Math.PI}Le(k1,"radiansToDegrees");function k4(r){return r%360*Math.PI/180}Le(k4,"degreesToRadians");function A4(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return L1(yf(r,t),e)}Le(A4,"convertLength");function F4(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=w1[t];if(!i)throw new Error("invalid original units");let n=w1[e];if(!n)throw new Error("invalid final units");return r/i*n}Le(F4,"convertArea");function ap(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Le(ap,"isNumber");function B4(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}Le(B4,"isObject");function R4(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(!ap(t))throw new Error("bbox must only contain numbers")})}Le(R4,"validateBBox");function N4(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")}Le(N4,"validateId");Ee.GeojsonEquality=yD;Ee.areaFactors=w1;Ee.bearingToAzimuth=L4;Ee.convertArea=F4;Ee.convertLength=A4;Ee.degreesToRadians=k4;Ee.earthRadius=Qt;Ee.factors=D1;Ee.feature=dn;Ee.featureCollection=sp;Ee.geometry=I4;Ee.geometryCollection=E4;Ee.isNumber=ap;Ee.isObject=B4;Ee.lengthToDegrees=O4;Ee.lengthToRadians=yf;Ee.lineString=gf;Ee.lineStrings=D4;Ee.multiLineString=E1;Ee.multiPoint=_1;Ee.multiPolygon=O1;Ee.point=ff;Ee.points=P4;Ee.polygon=mf;Ee.polygons=w4;Ee.radiansToDegrees=k1;Ee.radiansToLength=L1;Ee.round=_4;Ee.validateBBox=R4;Ee.validateId=N4});var $4=H(pt=>{"use strict";m();Object.defineProperty(pt,"__esModule",{value:!0});var bD=Object.defineProperty,St=(r,t)=>bD(r,"name",{value:t,configurable:!0}),At=G4();function ll(r,t,e){if(r!==null)for(var i,n,o,a,c,l,p,d=0,f=0,g,y=r.type,v=y==="FeatureCollection",x=y==="Feature",b=v?r.features.length:1,C=0;C<b;C++){p=v?r.features[C].geometry:x?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var M=0;M<c;M++){var P=0,w=0;if(a=g?p.geometries[M]:p,a!==null){l=a.coordinates;var D=a.type;switch(d=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(l,f,C,P,w)===!1)return!1;f++,P++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],f,C,P,w)===!1)return!1;f++,D==="MultiPoint"&&P++}D==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-d;n++){if(t(l[i][n],f,C,P,w)===!1)return!1;f++}D==="MultiLineString"&&P++,D==="Polygon"&&w++}D==="Polygon"&&P++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-d;o++){if(t(l[i][n][o],f,C,P,w)===!1)return!1;f++}w++}P++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(ll(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}St(ll,"coordEach");function V4(r,t,e,i){var n=e;return ll(r,function(o,a,c,l,p){a===0&&e===void 0?n=o:n=t(n,o,a,c,l,p)},i),n}St(V4,"coordReduce");function A1(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}}St(A1,"propEach");function j4(r,t,e){var i=e;return A1(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}St(j4,"propReduce");function F1(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++);}St(F1,"featureEach");function U4(r,t,e){var i=e;return F1(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}St(U4,"featureReduce");function H4(r){var t=[];return ll(r,function(e){t.push(e)}),t}St(H4,"coordAll");function bf(r,t){var e,i,n,o,a,c,l,p,d,f,g=0,y=r.type==="FeatureCollection",v=r.type==="Feature",x=y?r.features.length:1;for(e=0;e<x;e++){for(c=y?r.features[e].geometry:v?r.geometry:r,p=y?r.features[e].properties:v?r.properties:{},d=y?r.features[e].bbox:v?r.bbox:void 0,f=y?r.features[e].id:v?r.id:void 0,l=c?c.type==="GeometryCollection":!1,a=l?c.geometries.length:1,n=0;n<a;n++){if(o=l?c.geometries[n]:c,o===null){if(t(null,g,p,d,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,p,d,f)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,p,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}St(bf,"geomEach");function W4(r,t,e){var i=e;return bf(r,function(n,o,a,c,l){o===0&&e===void 0?i=n:i=t(i,n,o,a,c,l)}),i}St(W4,"geomReduce");function lp(r,t){bf(r,function(e,i,n,o,a){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(At.feature.call(void 0,e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var d=e.coordinates[p],f={type:l,coordinates:d};if(t(At.feature.call(void 0,f,n),i,p)===!1)return!1}})}St(lp,"flattenEach");function z4(r,t,e){var i=e;return lp(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}St(z4,"flattenReduce");function B1(r,t){lp(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var c,l=0,p=0,d=0;if(ll(e,function(f,g,y,v,x){if(c===void 0||i>l||v>p||x>d){c=f,l=i,p=v,d=x,o=0;return}var b=At.lineString.call(void 0,[c,f],e.properties);if(t(b,i,n,x,o)===!1)return!1;o++,c=f})===!1)return!1}}})}St(B1,"segmentEach");function Z4(r,t,e){var i=e,n=!1;return B1(r,function(o,a,c,l,p){n===!1&&e===void 0?i=o:i=t(i,o,a,c,l,p),n=!0}),i}St(Z4,"segmentReduce");function R1(r,t){if(!r)throw new Error("geojson is required");lp(r,function(e,i,n){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,i,n,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<a.length;c++)if(t(At.lineString.call(void 0,a[c],e.properties),i,n,c)===!1)return!1;break}}})}St(R1,"lineEach");function X4(r,t,e){var i=e;return R1(r,function(n,o,a,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,c)}),i}St(X4,"lineReduce");function Y4(r,t){if(t=t||{},!At.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":a=a||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 o<0&&(o=l.length+o-1),At.lineString.call(void 0,[l[o],l[o+1]],a,t);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),At.lineString.call(void 0,[l[n][o],l[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),At.lineString.call(void 0,[l[i][o],l[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o-1),At.lineString.call(void 0,[l[i][n][o],l[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}St(Y4,"findSegment");function q4(r,t){if(t=t||{},!At.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":a=a||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return At.point.call(void 0,l,a,t);case"MultiPoint":return i<0&&(i=l.length+i),At.point.call(void 0,l[i],a,t);case"LineString":return o<0&&(o=l.length+o),At.point.call(void 0,l[o],a,t);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),At.point.call(void 0,l[n][o],a,t);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),At.point.call(void 0,l[i][o],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o),At.point.call(void 0,l[i][n][o],a,t)}throw new Error("geojson is invalid")}St(q4,"findPoint");pt.coordAll=H4;pt.coordEach=ll;pt.coordReduce=V4;pt.featureEach=F1;pt.featureReduce=U4;pt.findPoint=q4;pt.findSegment=Y4;pt.flattenEach=lp;pt.flattenReduce=z4;pt.geomEach=bf;pt.geomReduce=W4;pt.lineEach=R1;pt.lineReduce=X4;pt.propEach=A1;pt.propReduce=j4;pt.segmentEach=B1;pt.segmentReduce=Z4});var J4=H(vf=>{"use strict";m();Object.defineProperty(vf,"__esModule",{value:!0});var vD=Object.defineProperty,xD=(r,t)=>vD(r,"name",{value:t,configurable:!0}),CD=$4();function N1(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return CD.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}xD(N1,"bbox");var SD=N1;vf.bbox=N1;vf.default=SD});var r5=H((MH,G1)=>{m();var Pi=$2(),Q4=ay(),e5=a3(),cl=J4().default,TD=e5.featureEach,SH=e5.coordEach,TH=Q4.polygon,K4=Q4.featureCollection;function t5(r){var t=new Pi(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cl(e),Pi.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:cl(n),i.push(n)}):TD(e,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:cl(n),i.push(n)}),Pi.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:cl(e),Pi.prototype.remove.call(this,e,i)},t.clear=function(){return Pi.prototype.clear.call(this)},t.search=function(e){var i=Pi.prototype.search.call(this,this.toBBox(e));return K4(i)},t.collides=function(e){return Pi.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Pi.prototype.all.call(this);return K4(e)},t.toJSON=function(){return Pi.prototype.toJSON.call(this)},t.fromJSON=function(e){return Pi.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=cl(e);else if(e.type==="FeatureCollection")i=cl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}G1.exports=t5;G1.exports.default=t5});var Hb=H((iu,Gl)=>{m();var u_=200,BT="__lodash_hash_undefined__",d_=800,h_=16,RT=9007199254740991,NT="[object Arguments]",f_="[object Array]",m_="[object AsyncFunction]",g_="[object Boolean]",y_="[object Date]",b_="[object Error]",GT="[object Function]",v_="[object GeneratorFunction]",x_="[object Map]",C_="[object Number]",S_="[object Null]",VT="[object Object]",T_="[object Proxy]",M_="[object RegExp]",I_="[object Set]",P_="[object String]",w_="[object Undefined]",D_="[object WeakMap]",E_="[object ArrayBuffer]",__="[object DataView]",O_="[object Float32Array]",L_="[object Float64Array]",k_="[object Int8Array]",A_="[object Int16Array]",F_="[object Int32Array]",B_="[object Uint8Array]",R_="[object Uint8ClampedArray]",N_="[object Uint16Array]",G_="[object Uint32Array]",V_=/[\\^$.*+?()[\]{}|]/g,j_=/^\[object .+?Constructor\]$/,U_=/^(?:0|[1-9]\d*)$/,Ge={};Ge[O_]=Ge[L_]=Ge[k_]=Ge[A_]=Ge[F_]=Ge[B_]=Ge[R_]=Ge[N_]=Ge[G_]=!0;Ge[NT]=Ge[f_]=Ge[E_]=Ge[g_]=Ge[__]=Ge[y_]=Ge[b_]=Ge[GT]=Ge[x_]=Ge[C_]=Ge[VT]=Ge[M_]=Ge[I_]=Ge[P_]=Ge[D_]=!1;var jT=typeof global=="object"&&global&&global.Object===Object&&global,H_=typeof self=="object"&&self&&self.Object===Object&&self,au=jT||H_||Function("return this")(),UT=typeof iu=="object"&&iu&&!iu.nodeType&&iu,nu=UT&&typeof Gl=="object"&&Gl&&!Gl.nodeType&&Gl,HT=nu&&nu.exports===UT,kb=HT&&jT.process,wT=function(){try{var r=nu&&nu.require&&nu.require("util").types;return r||kb&&kb.binding&&kb.binding("util")}catch{}}(),DT=wT&&wT.isTypedArray;function W_(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function z_(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}function Z_(r){return function(t){return r(t)}}function X_(r,t){return r==null?void 0:r[t]}function Y_(r,t){return function(e){return r(t(e))}}var q_=Array.prototype,$_=Function.prototype,Jf=Object.prototype,Ab=au["__core-js_shared__"],Kf=$_.toString,Pn=Jf.hasOwnProperty,ET=function(){var r=/[^.]+$/.exec(Ab&&Ab.keys&&Ab.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),WT=Jf.toString,J_=Kf.call(Object),K_=RegExp("^"+Kf.call(Pn).replace(V_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qf=HT?au.Buffer:void 0,_T=au.Symbol,OT=au.Uint8Array,LT=qf?qf.allocUnsafe:void 0,zT=Y_(Object.getPrototypeOf,Object),kT=Object.create,Q_=Jf.propertyIsEnumerable,eO=q_.splice,ts=_T?_T.toStringTag:void 0,$f=function(){try{var r=Vb(Object,"defineProperty");return r({},"",{}),r}catch{}}(),tO=qf?qf.isBuffer:void 0,AT=Math.max,rO=Date.now,ZT=Vb(au,"Map"),ou=Vb(Object,"create"),iO=function(){function r(){}return function(t){if(!is(t))return{};if(kT)return kT(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function rs(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function nO(){this.__data__=ou?ou(null):{},this.size=0}function oO(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}function aO(r){var t=this.__data__;if(ou){var e=t[r];return e===BT?void 0:e}return Pn.call(t,r)?t[r]:void 0}function sO(r){var t=this.__data__;return ou?t[r]!==void 0:Pn.call(t,r)}function lO(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=ou&&t===void 0?BT:t,this}rs.prototype.clear=nO;rs.prototype.delete=oO;rs.prototype.get=aO;rs.prototype.has=sO;rs.prototype.set=lO;function wn(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function cO(){this.__data__=[],this.size=0}function pO(r){var t=this.__data__,e=Qf(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():eO.call(t,e,1),--this.size,!0}function uO(r){var t=this.__data__,e=Qf(t,r);return e<0?void 0:t[e][1]}function dO(r){return Qf(this.__data__,r)>-1}function hO(r,t){var e=this.__data__,i=Qf(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}wn.prototype.clear=cO;wn.prototype.delete=pO;wn.prototype.get=uO;wn.prototype.has=dO;wn.prototype.set=hO;function Vl(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function fO(){this.size=0,this.__data__={hash:new rs,map:new(ZT||wn),string:new rs}}function mO(r){var t=tm(this,r).delete(r);return this.size-=t?1:0,t}function gO(r){return tm(this,r).get(r)}function yO(r){return tm(this,r).has(r)}function bO(r,t){var e=tm(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}Vl.prototype.clear=fO;Vl.prototype.delete=mO;Vl.prototype.get=gO;Vl.prototype.has=yO;Vl.prototype.set=bO;function jl(r){var t=this.__data__=new wn(r);this.size=t.size}function vO(){this.__data__=new wn,this.size=0}function xO(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}function CO(r){return this.__data__.get(r)}function SO(r){return this.__data__.has(r)}function TO(r,t){var e=this.__data__;if(e instanceof wn){var i=e.__data__;if(!ZT||i.length<u_-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new Vl(i)}return e.set(r,t),this.size=e.size,this}jl.prototype.clear=vO;jl.prototype.delete=xO;jl.prototype.get=CO;jl.prototype.has=SO;jl.prototype.set=TO;function MO(r,t){var e=Nb(r),i=!e&&Rb(r),n=!e&&!i&&$T(r),o=!e&&!i&&!n&&KT(r),a=e||i||n||o,c=a?z_(r.length,String):[],l=c.length;for(var p in r)(t||Pn.call(r,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||YT(p,l)))&&c.push(p);return c}function Fb(r,t,e){(e!==void 0&&!rm(r[t],e)||e===void 0&&!(t in r))&&Gb(r,t,e)}function IO(r,t,e){var i=r[t];(!(Pn.call(r,t)&&rm(i,e))||e===void 0&&!(t in r))&&Gb(r,t,e)}function Qf(r,t){for(var e=r.length;e--;)if(rm(r[e][0],t))return e;return-1}function Gb(r,t,e){t=="__proto__"&&$f?$f(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}var PO=GO();function em(r){return r==null?r===void 0?w_:S_:ts&&ts in Object(r)?VO(r):ZO(r)}function FT(r){return su(r)&&em(r)==NT}function wO(r){if(!is(r)||WO(r))return!1;var t=Ub(r)?K_:j_;return t.test($O(r))}function DO(r){return su(r)&&JT(r.length)&&!!Ge[em(r)]}function EO(r){if(!is(r))return zO(r);var t=qT(r),e=[];for(var i in r)i=="constructor"&&(t||!Pn.call(r,i))||e.push(i);return e}function XT(r,t,e,i,n){r!==t&&PO(t,function(o,a){if(n||(n=new jl),is(o))_O(r,t,a,e,XT,i,n);else{var c=i?i(Bb(r,a),o,a+"",r,t,n):void 0;c===void 0&&(c=o),Fb(r,a,c)}},QT)}function _O(r,t,e,i,n,o,a){var c=Bb(r,e),l=Bb(t,e),p=a.get(l);if(p){Fb(r,e,p);return}var d=o?o(c,l,e+"",r,t,a):void 0,f=d===void 0;if(f){var g=Nb(l),y=!g&&$T(l),v=!g&&!y&&KT(l);d=l,g||y||v?Nb(c)?d=c:JO(c)?d=BO(c):y?(f=!1,d=kO(l,!0)):v?(f=!1,d=FO(l,!0)):d=[]:KO(l)||Rb(l)?(d=c,Rb(c)?d=QO(c):(!is(c)||Ub(c))&&(d=jO(l))):f=!1}f&&(a.set(l,d),n(d,l,i,o,a),a.delete(l)),Fb(r,e,d)}function OO(r,t){return YO(XO(r,t,eM),r+"")}var LO=$f?function(r,t){return $f(r,"toString",{configurable:!0,enumerable:!1,value:tL(t),writable:!0})}:eM;function kO(r,t){if(t)return r.slice();var e=r.length,i=LT?LT(e):new r.constructor(e);return r.copy(i),i}function AO(r){var t=new r.constructor(r.byteLength);return new OT(t).set(new OT(r)),t}function FO(r,t){var e=t?AO(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}function BO(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}function RO(r,t,e,i){var n=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var c=t[o],l=i?i(e[c],r[c],c,e,r):void 0;l===void 0&&(l=r[c]),n?Gb(e,c,l):IO(e,c,l)}return e}function NO(r){return OO(function(t,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&UO(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var c=e[i];c&&r(t,c,i,o)}return t})}function GO(r){return function(t,e,i){for(var n=-1,o=Object(t),a=i(t),c=a.length;c--;){var l=a[r?c:++n];if(e(o[l],l,o)===!1)break}return t}}function tm(r,t){var e=r.__data__;return HO(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Vb(r,t){var e=X_(r,t);return wO(e)?e:void 0}function VO(r){var t=Pn.call(r,ts),e=r[ts];try{r[ts]=void 0;var i=!0}catch{}var n=WT.call(r);return i&&(t?r[ts]=e:delete r[ts]),n}function jO(r){return typeof r.constructor=="function"&&!qT(r)?iO(zT(r)):{}}function YT(r,t){var e=typeof r;return t=t==null?RT:t,!!t&&(e=="number"||e!="symbol"&&U_.test(r))&&r>-1&&r%1==0&&r<t}function UO(r,t,e){if(!is(e))return!1;var i=typeof t;return(i=="number"?jb(e)&&YT(t,e.length):i=="string"&&t in e)?rm(e[t],r):!1}function HO(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}function WO(r){return!!ET&&ET in r}function qT(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Jf;return r===e}function zO(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}function ZO(r){return WT.call(r)}function XO(r,t,e){return t=AT(t===void 0?r.length-1:t,0),function(){for(var i=arguments,n=-1,o=AT(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var c=Array(t+1);++n<t;)c[n]=i[n];return c[t]=e(a),W_(r,this,c)}}function Bb(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var YO=qO(LO);function qO(r){var t=0,e=0;return function(){var i=rO(),n=h_-(i-e);if(e=i,n>0){if(++t>=d_)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function $O(r){if(r!=null){try{return Kf.call(r)}catch{}try{return r+""}catch{}}return""}function rm(r,t){return r===t||r!==r&&t!==t}var Rb=FT(function(){return arguments}())?FT:function(r){return su(r)&&Pn.call(r,"callee")&&!Q_.call(r,"callee")},Nb=Array.isArray;function jb(r){return r!=null&&JT(r.length)&&!Ub(r)}function JO(r){return su(r)&&jb(r)}var $T=tO||rL;function Ub(r){if(!is(r))return!1;var t=em(r);return t==GT||t==v_||t==m_||t==T_}function JT(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=RT}function is(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function su(r){return r!=null&&typeof r=="object"}function KO(r){if(!su(r)||em(r)!=VT)return!1;var t=zT(r);if(t===null)return!0;var e=Pn.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Kf.call(e)==J_}var KT=DT?Z_(DT):DO;function QO(r){return RO(r,QT(r))}function QT(r){return jb(r)?MO(r,!0):EO(r)}var eL=NO(function(r,t,e){XT(r,t,e)});function tL(r){return function(){return r}}function eM(r){return r}function rL(){return!1}Gl.exports=eL});var i0=H((pu,Wl)=>{m();var _L=200,CM="__lodash_hash_undefined__",OL=800,LL=16,SM=9007199254740991,TM="[object Arguments]",kL="[object Array]",AL="[object AsyncFunction]",FL="[object Boolean]",BL="[object Date]",RL="[object Error]",MM="[object Function]",NL="[object GeneratorFunction]",GL="[object Map]",VL="[object Number]",jL="[object Null]",IM="[object Object]",UL="[object Proxy]",HL="[object RegExp]",WL="[object Set]",zL="[object String]",ZL="[object Undefined]",XL="[object WeakMap]",YL="[object ArrayBuffer]",qL="[object DataView]",$L="[object Float32Array]",JL="[object Float64Array]",KL="[object Int8Array]",QL="[object Int16Array]",ek="[object Int32Array]",tk="[object Uint8Array]",rk="[object Uint8ClampedArray]",ik="[object Uint16Array]",nk="[object Uint32Array]",ok=/[\\^$.*+?()[\]{}|]/g,ak=/^\[object .+?Constructor\]$/,sk=/^(?:0|[1-9]\d*)$/,Ve={};Ve[$L]=Ve[JL]=Ve[KL]=Ve[QL]=Ve[ek]=Ve[tk]=Ve[rk]=Ve[ik]=Ve[nk]=!0;Ve[TM]=Ve[kL]=Ve[YL]=Ve[FL]=Ve[qL]=Ve[BL]=Ve[RL]=Ve[MM]=Ve[GL]=Ve[VL]=Ve[IM]=Ve[HL]=Ve[WL]=Ve[zL]=Ve[XL]=!1;var PM=typeof global=="object"&&global&&global.Object===Object&&global,lk=typeof self=="object"&&self&&self.Object===Object&&self,hu=PM||lk||Function("return this")(),wM=typeof pu=="object"&&pu&&!pu.nodeType&&pu,uu=wM&&typeof Wl=="object"&&Wl&&!Wl.nodeType&&Wl,DM=uu&&uu.exports===wM,Zb=DM&&PM.process,dM=function(){try{var r=uu&&uu.require&&uu.require("util").types;return r||Zb&&Zb.binding&&Zb.binding("util")}catch{}}(),hM=dM&&dM.isTypedArray;function EM(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function ck(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}function pk(r){return function(t){return r(t)}}function uk(r,t){return r==null?void 0:r[t]}function dk(r,t){return function(e){return r(t(e))}}var hk=Array.prototype,fk=Function.prototype,sm=Object.prototype,Xb=hu["__core-js_shared__"],lm=fk.toString,_n=sm.hasOwnProperty,fM=function(){var r=/[^.]+$/.exec(Xb&&Xb.keys&&Xb.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),_M=sm.toString,mk=lm.call(Object),gk=RegExp("^"+lm.call(_n).replace(ok,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),om=DM?hu.Buffer:void 0,mM=hu.Symbol,gM=hu.Uint8Array,yM=om?om.allocUnsafe:void 0,OM=dk(Object.getPrototypeOf,Object),bM=Object.create,yk=sm.propertyIsEnumerable,bk=hk.splice,ns=mM?mM.toStringTag:void 0,am=function(){try{var r=e0(Object,"defineProperty");return r({},"",{}),r}catch{}}(),vk=om?om.isBuffer:void 0,vM=Math.max,xk=Date.now,LM=e0(hu,"Map"),du=e0(Object,"create"),Ck=function(){function r(){}return function(t){if(!En(t))return{};if(bM)return bM(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function os(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function Sk(){this.__data__=du?du(null):{},this.size=0}function Tk(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}function Mk(r){var t=this.__data__;if(du){var e=t[r];return e===CM?void 0:e}return _n.call(t,r)?t[r]:void 0}function Ik(r){var t=this.__data__;return du?t[r]!==void 0:_n.call(t,r)}function Pk(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=du&&t===void 0?CM:t,this}os.prototype.clear=Sk;os.prototype.delete=Tk;os.prototype.get=Mk;os.prototype.has=Ik;os.prototype.set=Pk;function On(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function wk(){this.__data__=[],this.size=0}function Dk(r){var t=this.__data__,e=cm(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():bk.call(t,e,1),--this.size,!0}function Ek(r){var t=this.__data__,e=cm(t,r);return e<0?void 0:t[e][1]}function _k(r){return cm(this.__data__,r)>-1}function Ok(r,t){var e=this.__data__,i=cm(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}On.prototype.clear=wk;On.prototype.delete=Dk;On.prototype.get=Ek;On.prototype.has=_k;On.prototype.set=Ok;function zl(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function Lk(){this.size=0,this.__data__={hash:new os,map:new(LM||On),string:new os}}function kk(r){var t=um(this,r).delete(r);return this.size-=t?1:0,t}function Ak(r){return um(this,r).get(r)}function Fk(r){return um(this,r).has(r)}function Bk(r,t){var e=um(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}zl.prototype.clear=Lk;zl.prototype.delete=kk;zl.prototype.get=Ak;zl.prototype.has=Fk;zl.prototype.set=Bk;function Zl(r){var t=this.__data__=new On(r);this.size=t.size}function Rk(){this.__data__=new On,this.size=0}function Nk(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}function Gk(r){return this.__data__.get(r)}function Vk(r){return this.__data__.has(r)}function jk(r,t){var e=this.__data__;if(e instanceof On){var i=e.__data__;if(!LM||i.length<_L-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new zl(i)}return e.set(r,t),this.size=e.size,this}Zl.prototype.clear=Rk;Zl.prototype.delete=Nk;Zl.prototype.get=Gk;Zl.prototype.has=Vk;Zl.prototype.set=jk;function Uk(r,t){var e=Jb(r),i=!e&&$b(r),n=!e&&!i&&RM(r),o=!e&&!i&&!n&&GM(r),a=e||i||n||o,c=a?ck(r.length,String):[],l=c.length;for(var p in r)(t||_n.call(r,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||FM(p,l)))&&c.push(p);return c}function Yb(r,t,e){(e!==void 0&&!dm(r[t],e)||e===void 0&&!(t in r))&&Kb(r,t,e)}function Hk(r,t,e){var i=r[t];(!(_n.call(r,t)&&dm(i,e))||e===void 0&&!(t in r))&&Kb(r,t,e)}function cm(r,t){for(var e=r.length;e--;)if(dm(r[e][0],t))return e;return-1}function Kb(r,t,e){t=="__proto__"&&am?am(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}var Wk=rA();function pm(r){return r==null?r===void 0?ZL:jL:ns&&ns in Object(r)?iA(r):cA(r)}function xM(r){return fu(r)&&pm(r)==TM}function zk(r){if(!En(r)||sA(r))return!1;var t=r0(r)?gk:ak;return t.test(hA(r))}function Zk(r){return fu(r)&&NM(r.length)&&!!Ve[pm(r)]}function Xk(r){if(!En(r))return lA(r);var t=BM(r),e=[];for(var i in r)i=="constructor"&&(t||!_n.call(r,i))||e.push(i);return e}function Qb(r,t,e,i,n){r!==t&&Wk(t,function(o,a){if(n||(n=new Zl),En(o))Yk(r,t,a,e,Qb,i,n);else{var c=i?i(qb(r,a),o,a+"",r,t,n):void 0;c===void 0&&(c=o),Yb(r,a,c)}},VM)}function Yk(r,t,e,i,n,o,a){var c=qb(r,e),l=qb(t,e),p=a.get(l);if(p){Yb(r,e,p);return}var d=o?o(c,l,e+"",r,t,a):void 0,f=d===void 0;if(f){var g=Jb(l),y=!g&&RM(l),v=!g&&!y&&GM(l);d=l,g||y||v?Jb(c)?d=c:fA(c)?d=Qk(c):y?(f=!1,d=$k(l,!0)):v?(f=!1,d=Kk(l,!0)):d=[]:mA(l)||$b(l)?(d=c,$b(c)?d=gA(c):(!En(c)||r0(c))&&(d=nA(l))):f=!1}f&&(a.set(l,d),n(d,l,i,o,a),a.delete(l)),Yb(r,e,d)}function kM(r,t){return uA(pA(r,t,jM),r+"")}var qk=am?function(r,t){return am(r,"toString",{configurable:!0,enumerable:!1,value:vA(t),writable:!0})}:jM;function $k(r,t){if(t)return r.slice();var e=r.length,i=yM?yM(e):new r.constructor(e);return r.copy(i),i}function Jk(r){var t=new r.constructor(r.byteLength);return new gM(t).set(new gM(r)),t}function Kk(r,t){var e=t?Jk(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}function Qk(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}function eA(r,t,e,i){var n=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var c=t[o],l=i?i(e[c],r[c],c,e,r):void 0;l===void 0&&(l=r[c]),n?Kb(e,c,l):Hk(e,c,l)}return e}function tA(r){return kM(function(t,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&oA(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var c=e[i];c&&r(t,c,i,o)}return t})}function rA(r){return function(t,e,i){for(var n=-1,o=Object(t),a=i(t),c=a.length;c--;){var l=a[r?c:++n];if(e(o[l],l,o)===!1)break}return t}}function AM(r,t,e,i,n,o){return En(r)&&En(t)&&(o.set(t,r),Qb(r,t,void 0,AM,o),o.delete(t)),r}function um(r,t){var e=r.__data__;return aA(t)?e[typeof t=="string"?"string":"hash"]:e.map}function e0(r,t){var e=uk(r,t);return zk(e)?e:void 0}function iA(r){var t=_n.call(r,ns),e=r[ns];try{r[ns]=void 0;var i=!0}catch{}var n=_M.call(r);return i&&(t?r[ns]=e:delete r[ns]),n}function nA(r){return typeof r.constructor=="function"&&!BM(r)?Ck(OM(r)):{}}function FM(r,t){var e=typeof r;return t=t==null?SM:t,!!t&&(e=="number"||e!="symbol"&&sk.test(r))&&r>-1&&r%1==0&&r<t}function oA(r,t,e){if(!En(e))return!1;var i=typeof t;return(i=="number"?t0(e)&&FM(t,e.length):i=="string"&&t in e)?dm(e[t],r):!1}function aA(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}function sA(r){return!!fM&&fM in r}function BM(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||sm;return r===e}function lA(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}function cA(r){return _M.call(r)}function pA(r,t,e){return t=vM(t===void 0?r.length-1:t,0),function(){for(var i=arguments,n=-1,o=vM(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var c=Array(t+1);++n<t;)c[n]=i[n];return c[t]=e(a),EM(r,this,c)}}function qb(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var uA=dA(qk);function dA(r){var t=0,e=0;return function(){var i=xk(),n=LL-(i-e);if(e=i,n>0){if(++t>=OL)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function hA(r){if(r!=null){try{return lm.call(r)}catch{}try{return r+""}catch{}}return""}function dm(r,t){return r===t||r!==r&&t!==t}var $b=xM(function(){return arguments}())?xM:function(r){return fu(r)&&_n.call(r,"callee")&&!yk.call(r,"callee")},Jb=Array.isArray;function t0(r){return r!=null&&NM(r.length)&&!r0(r)}function fA(r){return fu(r)&&t0(r)}var RM=vk||xA;function r0(r){if(!En(r))return!1;var t=pm(r);return t==MM||t==NL||t==AL||t==UL}function NM(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=SM}function En(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function fu(r){return r!=null&&typeof r=="object"}function mA(r){if(!fu(r)||pm(r)!=IM)return!1;var t=OM(r);if(t===null)return!0;var e=_n.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&lm.call(e)==mk}var GM=hM?pk(hM):Zk;function gA(r){return eA(r,VM(r))}var yA=kM(function(r){return r.push(void 0,AM),EM(bA,void 0,r)});function VM(r){return t0(r)?Uk(r,!0):Xk(r)}var bA=tA(function(r,t,e,i){Qb(r,t,e,i)});function vA(r){return function(){return r}}function jM(r){return r}function xA(){return!1}Wl.exports=yA});var OI=H((fQ,Cu)=>{"use strict";m();var NA=!1,ls=!1,MI=!0,II=!1,h={},PI=!1;typeof Cu<"u"&&Cu.exports?(Cu.exports=h,PI=!0):typeof document<"u"?window.ClipperLib=h:self.ClipperLib=h;var Mm;PI?(ht="chrome",Mm="Netscape"):(ht=navigator.userAgent.toString().toLowerCase(),Mm=navigator.appName);var ht,ve={};ht.indexOf("chrome")!=-1&&ht.indexOf("chromium")==-1?ve.chrome=1:ve.chrome=0;ht.indexOf("chromium")!=-1?ve.chromium=1:ve.chromium=0;ht.indexOf("safari")!=-1&&ht.indexOf("chrome")==-1&&ht.indexOf("chromium")==-1?ve.safari=1:ve.safari=0;ht.indexOf("firefox")!=-1?ve.firefox=1:ve.firefox=0;ht.indexOf("firefox/17")!=-1?ve.firefox17=1:ve.firefox17=0;ht.indexOf("firefox/15")!=-1?ve.firefox15=1:ve.firefox15=0;ht.indexOf("firefox/3")!=-1?ve.firefox3=1:ve.firefox3=0;ht.indexOf("opera")!=-1?ve.opera=1:ve.opera=0;ht.indexOf("msie 10")!=-1?ve.msie10=1:ve.msie10=0;ht.indexOf("msie 9")!=-1?ve.msie9=1:ve.msie9=0;ht.indexOf("msie 8")!=-1?ve.msie8=1:ve.msie8=0;ht.indexOf("msie 7")!=-1?ve.msie7=1:ve.msie7=0;ht.indexOf("msie ")!=-1?ve.msie=1:ve.msie=0;h.biginteger_used=null;var Lo,GA=0xdeadbeefcafe,SI=(GA&16777215)==15715070;function V(r,t,e){h.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}function Me(){return new V(null)}function VA(r,t,e,i,n,o){for(;--o>=0;){var a=t*this[r++]+e[i]+n;n=Math.floor(a/67108864),e[i++]=a&67108863}return n}function jA(r,t,e,i,n,o){for(var a=t&32767,c=t>>15;--o>=0;){var l=this[r]&32767,p=this[r++]>>15,d=c*l+p*a;l=a*l+((d&32767)<<15)+e[i]+(n&1073741823),n=(l>>>30)+(d>>>15)+c*p+(n>>>30),e[i++]=l&1073741823}return n}function UA(r,t,e,i,n,o){for(var a=t&16383,c=t>>14;--o>=0;){var l=this[r]&16383,p=this[r++]>>14,d=c*l+p*a;l=a*l+((d&16383)<<14)+e[i]+n,n=(l>>28)+(d>>14)+c*p,e[i++]=l&268435455}return n}SI&&Mm=="Microsoft Internet Explorer"?(V.prototype.am=jA,Lo=30):SI&&Mm!="Netscape"?(V.prototype.am=VA,Lo=26):(V.prototype.am=UA,Lo=28);V.prototype.DB=Lo;V.prototype.DM=(1<<Lo)-1;V.prototype.DV=1<<Lo;var x0=52;V.prototype.FV=Math.pow(2,x0);V.prototype.F1=x0-Lo;V.prototype.F2=2*Lo-x0;var HA="0123456789abcdefghijklmnopqrstuvwxyz",Pm=new Array,Kl,Ar;Kl=48;for(Ar=0;Ar<=9;++Ar)Pm[Kl++]=Ar;Kl=97;for(Ar=10;Ar<36;++Ar)Pm[Kl++]=Ar;Kl=65;for(Ar=10;Ar<36;++Ar)Pm[Kl++]=Ar;function TI(r){return HA.charAt(r)}function wI(r,t){var e=Pm[r.charCodeAt(t)];return e==null?-1:e}function WA(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}function zA(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}function Oo(r){var t=Me();return t.fromInt(r),t}function ZA(r,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(r,t);return}this.t=0,this.s=0;for(var i=r.length,n=!1,o=0;--i>=0;){var a=e==8?r[i]&255:wI(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=e,o>=this.DB&&(o-=this.DB)}e==8&&(r[0]&128)!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&V.ZERO.subTo(this,this)}function XA(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}function YA(r){if(this.s<0)return"-"+this.negate().toString(r);var t;if(r==16)t=4;else if(r==8)t=3;else if(r==2)t=1;else if(r==32)t=5;else if(r==4)t=2;else return this.toRadix(r);var e=(1<<t)-1,i,n=!1,o="",a=this.t,c=this.DB-a*this.DB%t;if(a-- >0)for(c<this.DB&&(i=this[a]>>c)>0&&(n=!0,o=TI(i));a>=0;)c<t?(i=(this[a]&(1<<c)-1)<<t-c,i|=this[--a]>>(c+=this.DB-t)):(i=this[a]>>(c-=t)&e,c<=0&&(c+=this.DB,--a)),i>0&&(n=!0),n&&(o+=TI(i));return n?o:"0"}function qA(){var r=Me();return V.ZERO.subTo(this,r),r}function $A(){return this.s<0?this.negate():this}function JA(r){var t=this.s-r.s;if(t!=0)return t;var e=this.t;if(t=e-r.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-r[e])!=0)return t;return 0}function wm(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}function KA(){return this.t<=0?0:this.DB*(this.t-1)+wm(this[this.t-1]^this.s&this.DM)}function QA(r,t){var e;for(e=this.t-1;e>=0;--e)t[e+r]=this[e];for(e=r-1;e>=0;--e)t[e]=0;t.t=this.t+r,t.s=this.s}function eF(r,t){for(var e=r;e<this.t;++e)t[e-r]=this[e];t.t=Math.max(this.t-r,0),t.s=this.s}function tF(r,t){var e=r%this.DB,i=this.DB-e,n=(1<<i)-1,o=Math.floor(r/this.DB),a=this.s<<e&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+o+1]=this[c]>>i|a,a=(this[c]&n)<<e;for(c=o-1;c>=0;--c)t[c]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}function rF(r,t){t.s=this.s;var e=Math.floor(r/this.DB);if(e>=this.t){t.t=0;return}var i=r%this.DB,n=this.DB-i,o=(1<<i)-1;t[0]=this[e]>>i;for(var a=e+1;a<this.t;++a)t[a-e-1]|=(this[a]&o)<<n,t[a-e]=this[a]>>i;i>0&&(t[this.t-e-1]|=(this.s&o)<<n),t.t=this.t-e,t.clamp()}function iF(r,t){for(var e=0,i=0,n=Math.min(r.t,this.t);e<n;)i+=this[e]-r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i-=r[e],t[e++]=i&this.DM,i>>=this.DB;i-=r.s}t.s=i<0?-1:0,i<-1?t[e++]=this.DV+i:i>0&&(t[e++]=i),t.t=e,t.clamp()}function nF(r,t){var e=this.abs(),i=r.abs(),n=e.t;for(t.t=n+i.t;--n>=0;)t[n]=0;for(n=0;n<i.t;++n)t[n+e.t]=e.am(0,i[n],t,n,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&V.ZERO.subTo(t,t)}function oF(r){for(var t=this.abs(),e=r.t=2*t.t;--e>=0;)r[e]=0;for(e=0;e<t.t-1;++e){var i=t.am(e,t[e],r,2*e,0,1);(r[e+t.t]+=t.am(e+1,2*t[e],r,2*e+1,i,t.t-e-1))>=t.DV&&(r[e+t.t]-=t.DV,r[e+t.t+1]=1)}r.t>0&&(r[r.t-1]+=t.am(e,t[e],r,2*e,0,1)),r.s=0,r.clamp()}function aF(r,t,e){var i=r.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Me());var o=Me(),a=this.s,c=r.s,l=this.DB-wm(i[i.t-1]);l>0?(i.lShiftTo(l,o),n.lShiftTo(l,e)):(i.copyTo(o),n.copyTo(e));var p=o.t,d=o[p-1];if(d!=0){var f=d*(1<<this.F1)+(p>1?o[p-2]>>this.F2:0),g=this.FV/f,y=(1<<this.F1)/f,v=1<<this.F2,x=e.t,b=x-p,C=t==null?Me():t;for(o.dlShiftTo(b,C),e.compareTo(C)>=0&&(e[e.t++]=1,e.subTo(C,e)),V.ONE.dlShiftTo(p,C),C.subTo(o,o);o.t<p;)o[o.t++]=0;for(;--b>=0;){var M=e[--x]==d?this.DM:Math.floor(e[x]*g+(e[x-1]+v)*y);if((e[x]+=o.am(0,M,e,b,0,p))<M)for(o.dlShiftTo(b,C),e.subTo(C,e);e[x]<--M;)e.subTo(C,e)}t!=null&&(e.drShiftTo(p,t),a!=c&&V.ZERO.subTo(t,t)),e.t=p,e.clamp(),l>0&&e.rShiftTo(l,e),a<0&&V.ZERO.subTo(e,e)}}}function sF(r){var t=Me();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(V.ZERO)>0&&r.subTo(t,t),t}function cs(r){this.m=r}function lF(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}function cF(r){return r}function pF(r){r.divRemTo(this.m,null,r)}function uF(r,t,e){r.multiplyTo(t,e),this.reduce(e)}function dF(r,t){r.squareTo(t),this.reduce(t)}cs.prototype.convert=lF;cs.prototype.revert=cF;cs.prototype.reduce=pF;cs.prototype.mulTo=uF;cs.prototype.sqrTo=dF;function hF(){if(this.t<1)return 0;var r=this[0];if((r&1)==0)return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}function ps(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}function fF(r){var t=Me();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(V.ZERO)>0&&this.m.subTo(t,t),t}function mF(r){var t=Me();return r.copyTo(t),this.reduce(t),t}function gF(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var t=0;t<this.m.t;++t){var e=r[t]&32767,i=e*this.mpl+((e*this.mph+(r[t]>>15)*this.mpl&this.um)<<15)&r.DM;for(e=t+this.m.t,r[e]+=this.m.am(0,i,r,t,0,this.m.t);r[e]>=r.DV;)r[e]-=r.DV,r[++e]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}function yF(r,t){r.squareTo(t),this.reduce(t)}function bF(r,t,e){r.multiplyTo(t,e),this.reduce(e)}ps.prototype.convert=fF;ps.prototype.revert=mF;ps.prototype.reduce=gF;ps.prototype.mulTo=bF;ps.prototype.sqrTo=yF;function vF(){return(this.t>0?this[0]&1:this.s)==0}function xF(r,t){if(r>4294967295||r<1)return V.ONE;var e=Me(),i=Me(),n=t.convert(this),o=wm(r)-1;for(n.copyTo(e);--o>=0;)if(t.sqrTo(e,i),(r&1<<o)>0)t.mulTo(i,n,e);else{var a=e;e=i,i=a}return t.revert(e)}function CF(r,t){var e;return r<256||t.isEven()?e=new cs(t):e=new ps(t),this.exp(r,e)}V.prototype.copyTo=WA;V.prototype.fromInt=zA;V.prototype.fromString=ZA;V.prototype.clamp=XA;V.prototype.dlShiftTo=QA;V.prototype.drShiftTo=eF;V.prototype.lShiftTo=tF;V.prototype.rShiftTo=rF;V.prototype.subTo=iF;V.prototype.multiplyTo=nF;V.prototype.squareTo=oF;V.prototype.divRemTo=aF;V.prototype.invDigit=hF;V.prototype.isEven=vF;V.prototype.exp=xF;V.prototype.toString=YA;V.prototype.negate=qA;V.prototype.abs=$A;V.prototype.compareTo=JA;V.prototype.bitLength=KA;V.prototype.mod=sF;V.prototype.modPowInt=CF;V.ZERO=Oo(0);V.ONE=Oo(1);function SF(){var r=Me();return this.copyTo(r),r}function TF(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function MF(){return this.t==0?this.s:this[0]<<24>>24}function IF(){return this.t==0?this.s:this[0]<<16>>16}function PF(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}function wF(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function DF(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=Oo(e),n=Me(),o=Me(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(e+o.intValue()).toString(r).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(r)+a}function EF(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),n=!1,o=0,a=0,c=0;c<r.length;++c){var l=wI(r,c);if(l<0){r.charAt(c)=="-"&&this.signum()==0&&(n=!0);continue}a=t*a+l,++o>=e&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),n&&V.ZERO.subTo(this,this)}function _F(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(V.ONE.shiftLeft(r-1),C0,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(V.ONE.shiftLeft(r-1),this);else{var i=new Array,n=r&7;i.length=(r>>3)+1,t.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}function OF(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[n++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),(i&128)!=0&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(t[n++]=i);return t}function LF(r){return this.compareTo(r)==0}function kF(r){return this.compareTo(r)<0?this:r}function AF(r){return this.compareTo(r)>0?this:r}function FF(r,t,e){var i,n,o=Math.min(r.t,this.t);for(i=0;i<o;++i)e[i]=t(this[i],r[i]);if(r.t<this.t){for(n=r.s&this.DM,i=o;i<this.t;++i)e[i]=t(this[i],n);e.t=this.t}else{for(n=this.s&this.DM,i=o;i<r.t;++i)e[i]=t(n,r[i]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}function BF(r,t){return r&t}function RF(r){var t=Me();return this.bitwiseTo(r,BF,t),t}function C0(r,t){return r|t}function NF(r){var t=Me();return this.bitwiseTo(r,C0,t),t}function DI(r,t){return r^t}function GF(r){var t=Me();return this.bitwiseTo(r,DI,t),t}function EI(r,t){return r&~t}function VF(r){var t=Me();return this.bitwiseTo(r,EI,t),t}function jF(){for(var r=Me(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}function UF(r){var t=Me();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}function HF(r){var t=Me();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}function WF(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}function zF(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+WF(this[r]);return this.s<0?this.t*this.DB:-1}function ZF(r){for(var t=0;r!=0;)r&=r-1,++t;return t}function XF(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=ZF(this[e]^t);return r}function YF(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}function qF(r,t){var e=V.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}function $F(r){return this.changeBit(r,C0)}function JF(r){return this.changeBit(r,EI)}function KF(r){return this.changeBit(r,DI)}function QF(r,t){for(var e=0,i=0,n=Math.min(r.t,this.t);e<n;)i+=this[e]+r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i+=r[e],t[e++]=i&this.DM,i>>=this.DB;i+=r.s}t.s=i<0?-1:0,i>0?t[e++]=i:i<-1&&(t[e++]=this.DV+i),t.t=e,t.clamp()}function eB(r){var t=Me();return this.addTo(r,t),t}function tB(r){var t=Me();return this.subTo(r,t),t}function rB(r){var t=Me();return this.multiplyTo(r,t),t}function iB(){var r=Me();return this.squareTo(r),r}function nB(r){var t=Me();return this.divRemTo(r,t,null),t}function oB(r){var t=Me();return this.divRemTo(r,null,t),t}function aB(r){var t=Me(),e=Me();return this.divRemTo(r,t,e),new Array(t,e)}function sB(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}function lB(r,t){if(r!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=r;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function Su(){}function _I(r){return r}function cB(r,t,e){r.multiplyTo(t,e)}function pB(r,t){r.squareTo(t)}Su.prototype.convert=_I;Su.prototype.revert=_I;Su.prototype.mulTo=cB;Su.prototype.sqrTo=pB;function uB(r){return this.exp(r,new Su)}function dB(r,t,e){var i=Math.min(this.t+r.t,t);for(e.s=0,e.t=i;i>0;)e[--i]=0;var n;for(n=e.t-this.t;i<n;++i)e[i+this.t]=this.am(0,r[i],e,i,0,this.t);for(n=Math.min(r.t,t);i<n;++i)this.am(0,r[i],e,i,0,t-i);e.clamp()}function hB(r,t,e){--t;var i=e.t=this.t+r.t-t;for(e.s=0;--i>=0;)e[i]=0;for(i=Math.max(t-this.t,0);i<r.t;++i)e[this.t+i-t]=this.am(t-i,r[i],e,0,0,this.t+i-t);e.clamp(),e.drShiftTo(1,e)}function Ql(r){this.r2=Me(),this.q3=Me(),V.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}function fB(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=Me();return r.copyTo(t),this.reduce(t),t}function mB(r){return r}function gB(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}function yB(r,t){r.squareTo(t),this.reduce(t)}function bB(r,t,e){r.multiplyTo(t,e),this.reduce(e)}Ql.prototype.convert=fB;Ql.prototype.revert=mB;Ql.prototype.reduce=gB;Ql.prototype.mulTo=bB;Ql.prototype.sqrTo=yB;function vB(r,t){var e=r.bitLength(),i,n=Oo(1),o;if(e<=0)return n;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?o=new cs(t):t.isEven()?o=new Ql(t):o=new ps(t);var a=new Array,c=3,l=i-1,p=(1<<i)-1;if(a[1]=o.convert(this),i>1){var d=Me();for(o.sqrTo(a[1],d);c<=p;)a[c]=Me(),o.mulTo(d,a[c-2],a[c]),c+=2}var f=r.t-1,g,y=!0,v=Me(),x;for(e=wm(r[f])-1;f>=0;){for(e>=l?g=r[f]>>e-l&p:(g=(r[f]&(1<<e+1)-1)<<l-e,f>0&&(g|=r[f-1]>>this.DB+e-l)),c=i;(g&1)==0;)g>>=1,--c;if((e-=c)<0&&(e+=this.DB,--f),y)a[g].copyTo(n),y=!1;else{for(;c>1;)o.sqrTo(n,v),o.sqrTo(v,n),c-=2;c>0?o.sqrTo(n,v):(x=n,n=v,v=x),o.mulTo(v,a[g],n)}for(;f>=0&&(r[f]&1<<e)==0;)o.sqrTo(n,v),x=n,n=v,v=x,--e<0&&(e=this.DB-1,--f)}return o.revert(n)}function xB(r){var t=this.s<0?this.negate():this.clone(),e=r.s<0?r.negate():r.clone();if(t.compareTo(e)<0){var i=t;t=e,e=i}var n=t.getLowestSetBit(),o=e.getLowestSetBit();if(o<0)return t;for(n<o&&(o=n),o>0&&(t.rShiftTo(o,t),e.rShiftTo(o,e));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return o>0&&e.lShiftTo(o,e),e}function CB(r){if(r<=0)return 0;var t=this.DV%r,e=this.s<0?r-1:0;if(this.t>0)if(t==0)e=this[0]%r;else for(var i=this.t-1;i>=0;--i)e=(t*e+this[i])%r;return e}function SB(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return V.ZERO;for(var e=r.clone(),i=this.clone(),n=Oo(1),o=Oo(0),a=Oo(0),c=Oo(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!n.isEven()||!o.isEven())&&(n.addTo(this,n),o.subTo(r,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),t?((!a.isEven()||!c.isEven())&&(a.addTo(this,a),c.subTo(r,c)),a.rShiftTo(1,a)):c.isEven()||c.subTo(r,c),c.rShiftTo(1,c);e.compareTo(i)>=0?(e.subTo(i,e),t&&n.subTo(a,n),o.subTo(c,o)):(i.subTo(e,i),t&&a.subTo(n,a),c.subTo(o,c))}if(i.compareTo(V.ONE)!=0)return V.ZERO;if(c.compareTo(r)>=0)return c.subtract(r);if(c.signum()<0)c.addTo(r,c);else return c;return c.signum()<0?c.add(r):c}var Zt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],TB=(1<<26)/Zt[Zt.length-1];function MB(r){var t,e=this.abs();if(e.t==1&&e[0]<=Zt[Zt.length-1]){for(t=0;t<Zt.length;++t)if(e[0]==Zt[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<Zt.length;){for(var i=Zt[t],n=t+1;n<Zt.length&&i<TB;)i*=Zt[n++];for(i=e.modInt(i);t<n;)if(i%Zt[t++]==0)return!1}return e.millerRabin(r)}function IB(r){var t=this.subtract(V.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>Zt.length&&(r=Zt.length);for(var n=Me(),o=0;o<r;++o){n.fromInt(Zt[Math.floor(Math.random()*Zt.length)]);var a=n.modPow(i,this);if(a.compareTo(V.ONE)!=0&&a.compareTo(t)!=0){for(var c=1;c++<e&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(V.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}V.prototype.chunkSize=PF;V.prototype.toRadix=DF;V.prototype.fromRadix=EF;V.prototype.fromNumber=_F;V.prototype.bitwiseTo=FF;V.prototype.changeBit=qF;V.prototype.addTo=QF;V.prototype.dMultiply=sB;V.prototype.dAddOffset=lB;V.prototype.multiplyLowerTo=dB;V.prototype.multiplyUpperTo=hB;V.prototype.modInt=CB;V.prototype.millerRabin=IB;V.prototype.clone=SF;V.prototype.intValue=TF;V.prototype.byteValue=MF;V.prototype.shortValue=IF;V.prototype.signum=wF;V.prototype.toByteArray=OF;V.prototype.equals=LF;V.prototype.min=kF;V.prototype.max=AF;V.prototype.and=RF;V.prototype.or=NF;V.prototype.xor=GF;V.prototype.andNot=VF;V.prototype.not=jF;V.prototype.shiftLeft=UF;V.prototype.shiftRight=HF;V.prototype.getLowestSetBit=zF;V.prototype.bitCount=XF;V.prototype.testBit=YF;V.prototype.setBit=$F;V.prototype.clearBit=JF;V.prototype.flipBit=KF;V.prototype.add=eB;V.prototype.subtract=tB;V.prototype.multiply=rB;V.prototype.divide=nB;V.prototype.remainder=oB;V.prototype.divideAndRemainder=aB;V.prototype.modPow=vB;V.prototype.modInverse=SB;V.prototype.pow=uB;V.prototype.gcd=xB;V.prototype.isProbablePrime=MB;V.prototype.square=iB;var ye=V;ye.prototype.IsNegative=function(){return this.compareTo(ye.ZERO)==-1};ye.op_Equality=function(r,t){return r.compareTo(t)==0};ye.op_Inequality=function(r,t){return r.compareTo(t)!=0};ye.op_GreaterThan=function(r,t){return r.compareTo(t)>0};ye.op_LessThan=function(r,t){return r.compareTo(t)<0};ye.op_Addition=function(r,t){return new ye(r).add(new ye(t))};ye.op_Subtraction=function(r,t){return new ye(r).subtract(new ye(t))};ye.Int128Mul=function(r,t){return new ye(r).multiply(new ye(t))};ye.op_Division=function(r,t){return r.divide(t)};ye.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Im>"u"&&(Im=function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var i=Object.getOwnPropertyNames(t.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(t.prototype,i[n]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}});var Im;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};Im(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)};ve.msie||ve.opera||ve.safari?h.Cast_Int32=function(r){return r|0}:h.Cast_Int32=function(r){return~~r};ve.chrome?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:ve.firefox&&typeof Number.toInteger=="function"?h.Cast_Int64=function(r){return Number.toInteger(r)}:ve.msie7||ve.msie8?h.Cast_Int64=function(r){return parseInt(r,10)}:ve.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,ls)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};ls?(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};II&&(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;NA?(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&&ye.op_Equality(ye.Int128Mul(r.X-t.X,e.Y-t.Y),ye.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,n,o,a,c,l;return t==3?(e=r[0],i=r[1],l=r[2],l?ye.op_Equality(ye.Int128Mul(e.Delta.Y,i.Delta.X),ye.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?(n=r[0],o=r[1],a=r[2],l=r[3],l?ye.op_Equality(ye.Int128Mul(n.Y-o.Y,o.X-a.X),ye.Int128Mul(n.X-o.X,o.Y-a.Y)):h.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-h.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=r[0],o=r[1],a=r[2],c=r[3],l=r[4],l?ye.op_Equality(ye.Int128Mul(n.Y-o.Y,a.X-c.X),ye.Int128Mul(n.X-o.X,a.Y-c.Y)):h.Cast_Int64((n.Y-o.Y)*(a.X-c.X))-h.Cast_Int64((n.X-o.X)*(a.Y-c.Y))===0)};h.ClipperBase.SlopesEqual3=function(r,t,e){return e?ye.op_Equality(ye.Int128Mul(r.Delta.Y,t.Delta.X),ye.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?ye.op_Equality(ye.Int128Mul(r.Y-t.Y,t.X-e.X),ye.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,n){return n?ye.op_Equality(ye.Int128Mul(r.Y-t.Y,e.X-i.X),ye.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,n,o;if(r.Dx==h.ClipperBase.horizontal&&(t?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&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(n=i;n.Prev.Dx==h.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?t||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==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(n=i;n.Next.Dx==h.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?t||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==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 a=new h.LocalMinima;a.Next=null,a.Y=r.Bot.Y,a.LeftBound=null,a.RightBound=r,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,t),this.InsertLocalMinima(a)}}return i};h.ClipperBase.prototype.AddPath=function(r,t,e){MI?!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 n=new Array,o=0;o<=i;o++)n.push(new h.TEdge);var a=!0;n[1].Curr.X=r[1].X,n[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(n[0],n[1],n[i],r[0]),this.InitEdge(n[i],n[0],n[i-1],r[i]);for(var o=i-1;o>=1;--o)c.Value=this.m_UseFullRange,this.RangeTest(r[o],c),this.m_UseFullRange=c.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var l=n[0],p=l,d=l;;){if(h.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==l&&(l=p.Next),p=this.RemoveEdge(p),d=p;continue}if(p.Prev==p.Next)break;if(e&&h.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==l&&(l=p.Next),p=this.RemoveEdge(p),p=p.Prev,d=p;continue}if(p=p.Next,p==d)break}if(!e&&p==p.Next||e&&p.Prev==p.Next)return!1;e||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=h.ClipperBase.Skip);var f=l;p=l;do this.InitEdge2(p,t),p=p.Next,a&&p.Curr.Y!=l.Curr.Y&&(a=!1);while(p!=l);if(a){if(e)return!1;p.Prev.OutIdx=h.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var g=new h.LocalMinima;for(g.Next=null,g.Y=p.Bot.Y,g.LeftBound=null,g.RightBound=p,g.RightBound.Side=h.EdgeSide.esRight,g.RightBound.WindDelta=0;p.Next.OutIdx!=h.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(g),this.m_edges.push(n),!0}this.m_edges.push(n);for(var y,v=null;p=this.FindNextLocMin(p),p!=v;){v==null&&(v=p);var g=new h.LocalMinima;g.Next=null,g.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(g.LeftBound=p.Prev,g.RightBound=p,y=!1):(g.LeftBound=p,g.RightBound=p.Prev,y=!0),g.LeftBound.Side=h.EdgeSide.esLeft,g.RightBound.Side=h.EdgeSide.esRight,e?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,p=this.ProcessBound(g.LeftBound,y);var x=this.ProcessBound(g.RightBound,!y);g.LeftBound.OutIdx==h.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==h.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),y||(p=x)}return!0};h.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],t,e)&&(i=!0);return i};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,ls&&(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,ls&&(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],n=r[1],o=r[2],a=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(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&e){var i=r[0],l=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var 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],n=r[1];return this.Execute(i,n,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 n=this.m_PolyOuts[e];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{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)};ls&&(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 n=0,o=this.m_GhostJoins.length;n<o;n++){var a=this.m_GhostJoins[n];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,e.Bot,e.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&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,n,o;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,n=r,n.PrevInAEL==t?o=t.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=h.EdgeSide.esRight,t.Side=h.EdgeSide.esLeft,n=t,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&h.Clipper.TopX(o,e.Y)==h.Clipper.TopX(n,e.Y)&&h.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,e);this.AddJoin(i,a,n.Top)}return i};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 n=new h.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),ls&&(h.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),r.OutIdx=i.Idx,n}else{var i=this.m_PolyOuts[r.OutIdx],o=i.Pts;if(e&&h.IntPoint.op_Equality(t,o.Pt))return o;if(!e&&h.IntPoint.op_Equality(t,o.Prev.Pt))return o.Prev;var n=new h.OutPt;return n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,e&&(i.Pts=n),ls&&(h.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),n}};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 n=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 o=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 a=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=o&&i>=a||n>=o&&n>=a};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],n;this.Param1RightOfParam2(e,i)?n=i:this.Param1RightOfParam2(i,e)?n=e:n=this.GetLowermostRec(e,i);var o=e.Pts,a=o.Prev,c=i.Pts,l=c.Prev,p;r.Side==h.EdgeSide.esLeft?(t.Side==h.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=o,o.Prev=c,a.Next=l,l.Prev=a,e.Pts=l):(l.Next=o,o.Prev=l,c.Prev=a,a.Next=c,e.Pts=c),p=h.EdgeSide.esLeft):(t.Side==h.EdgeSide.esRight?(this.ReversePolyPtLinks(c),a.Next=l,l.Prev=a,c.Next=o,o.Prev=c):(a.Next=c,c.Prev=a,o.Prev=l,l.Next=o),p=h.EdgeSide.esRight),e.BottomPt=null,n==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var d=r.OutIdx,f=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==f){g.OutIdx=d,g.Side=p;break}g=g.NextInAEL}i.Idx=e.Idx};h.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};h.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};h.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};h.Clipper.prototype.IntersectEdges=function(r,t,e,i){var n=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,o=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,a=r.OutIdx>=0,c=t.OutIdx>=0;if(MI&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(n||o)&&a&&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),a&&(r.OutIdx=-1)):a&&(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),a&&(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))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):h.Error("Error intersecting polylines")),o&&(t.OutIdx<0?this.DeleteFromAEL(t):h.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var l=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=l}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var p,d,f,g;r.PolyTyp==h.PolyType.ptSubject?(p=this.m_SubjFillType,f=this.m_ClipFillType):(p=this.m_ClipFillType,f=this.m_SubjFillType),t.PolyTyp==h.PolyType.ptSubject?(d=this.m_SubjFillType,g=this.m_ClipFillType):(d=this.m_ClipFillType,g=this.m_SubjFillType);var y,v;switch(p){case h.PolyFillType.pftPositive:y=r.WindCnt;break;case h.PolyFillType.pftNegative:y=-r.WindCnt;break;default:y=Math.abs(r.WindCnt);break}switch(d){case h.PolyFillType.pftPositive:v=t.WindCnt;break;case h.PolyFillType.pftNegative:v=-t.WindCnt;break;default:v=Math.abs(t.WindCnt);break}if(a&&c)n||o||y!==0&&y!=1||v!==0&&v!=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(a)(v===0||v==1)&&(this.AddOutPt(r,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(c)(y===0||y==1)&&(this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if((y===0||y==1)&&(v===0||v==1)&&!n&&!o){var x,b;switch(f){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(y==1&&v==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)}n!=o&&(n&&r.OutIdx>=0||o&&t.OutIdx>=0)&&(h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t)),n&&this.DeleteFromAEL(r),o&&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,n=e.Left,o=e.Right,a=r,c=null;a.NextInLML!==null&&h.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(c=this.GetMaximaPair(a));;){for(var l=r==a,p=this.GetNextInAEL(r,i);p!==null&&!(p.Curr.X==r.Top.X&&r.NextInLML!==null&&p.Dx<r.NextInLML.Dx);){var d=this.GetNextInAEL(p,i);if(i==h.Direction.dLeftToRight&&p.Curr.X<=o||i==h.Direction.dRightToLeft&&p.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),p==c&&l){i==h.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),c.OutIdx>=0&&h.Error("ProcessHorizontal error");return}else if(i==h.Direction.dLeftToRight){var f=new h.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,f,!0)}else{var f=new h.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,f,!0)}this.SwapPositionsInAEL(r,p)}else if(i==h.Direction.dLeftToRight&&p.Curr.X>=o||i==h.Direction.dRightToLeft&&p.Curr.X<=n)break;p=d}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&h.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,e),i=e.Dir,n=e.Left,o=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var g=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var y=r.PrevInAEL,d=r.NextInAEL;if(y!==null&&y.Curr.X==r.Bot.X&&y.Curr.Y==r.Bot.Y&&y.WindDelta!==0&&y.OutIdx>=0&&y.Curr.Y>y.Top.Y&&h.ClipperBase.SlopesEqual(r,y,this.m_UseFullRange)){var v=this.AddOutPt(y,r.Bot);this.AddJoin(g,v,r.Top)}else if(d!==null&&d.Curr.X==r.Bot.X&&d.Curr.Y==r.Bot.Y&&d.WindDelta!==0&&d.OutIdx>=0&&d.Curr.Y>d.Top.Y&&h.ClipperBase.SlopesEqual(r,d,this.m_UseFullRange)){var v=this.AddOutPt(d,r.Bot);this.AddJoin(g,v,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 n=e.NextInSEL,o=new h.IntPoint;if(e.Curr.X>n.Curr.X){!this.IntersectPoint(e,n,o)&&e.Curr.X>n.Curr.X+1&&h.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(e.Dx)>Math.abs(n.Dx)?o.X=h.Clipper.TopX(n,r):o.X=h.Clipper.TopX(e,r));var a=new h.IntersectNode;a.Edge1=e,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(e,n),i=!0}else e=n}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};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 PB=function(r){return r<0?Math.ceil(r-.5):Math.round(r)},wB=function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},DB=function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},EB=function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)};ve.msie?h.Clipper.Round=PB:ve.chromium?h.Clipper.Round=DB:ve.safari?h.Clipper.Round=EB:h.Clipper.Round=wB;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,n;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:(n=t.Bot.Y-t.Bot.X/t.Dx,e.Y=h.Clipper.Round(e.X/t.Dx+n));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,n=t.Bot.X-t.Bot.Y*t.Dx;var o=(n-i)/(r.Dx-t.Dx);e.Y=h.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=h.Clipper.Round(r.Dx*o+i):e.X=h.Clipper.Round(t.Dx*o+n)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=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 n=t.PrevInAEL;this.DoMaxima(t),n===null?t=this.m_ActiveEdges:t=n.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 n=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==t.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,t.Curr),a=this.AddOutPt(t,t.Curr);this.AddJoin(o,a,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var o=null;t.OutIdx>=0&&(o=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var n=t.PrevInAEL,c=t.NextInAEL;if(n!==null&&n.Curr.X==t.Bot.X&&n.Curr.Y==t.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&h.ClipperBase.SlopesEqual(t,n,this.m_UseFullRange)&&t.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,t.Bot);this.AddJoin(o,a,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&o!==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 a=this.AddOutPt(c,t.Bot);this.AddJoin(o,a,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 n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),c=0;c<o;c++)a[c]=n.Pt,n=n.Prev;r.push(a)}}}};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],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new h.PolyNode;r.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,c=0;c<n;c++)o.m_polygon[c]=a.Pt,a=a.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};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,n){return r<t?e<i?(n.Left=Math.max(r,e),n.Right=Math.min(t,i)):(n.Left=Math.max(r,i),n.Right=Math.min(t,e)):e<i?(n.Left=Math.max(t,e),n.Right=Math.min(r,i)):(n.Left=Math.max(t,i),n.Right=Math.min(r,e)),n.Left<n.Right};h.Clipper.prototype.JoinHorz=function(r,t,e,i,n,o){var a=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(a==c)return!1;if(a==h.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,!o),h.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=n.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;!o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,o),h.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,o))}if(c==h.Direction.dLeftToRight){for(;e.Next.Pt.X<=n.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,!o),h.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,!o))}else{for(;e.Next.Pt.X>=n.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;!o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,o),h.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,o))}return a==h.Direction.dLeftToRight==o?(r.Prev=e,e.Next=r,t.Next=i,i.Prev=t):(r.Next=e,e.Prev=r,t.Prev=i,i.Next=t),!0};h.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,n=new h.OutPt,o=r.OutPt2,a=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(n=r.OutPt1.Next;n!=i&&h.IntPoint.op_Equality(n.Pt,r.OffPt);)n=n.Next;var l=n.Pt.Y>r.OffPt.Y;for(a=r.OutPt2.Next;a!=o&&h.IntPoint.op_Equality(a.Pt,r.OffPt);)a=a.Next;var p=a.Pt.Y>r.OffPt.Y;return l==p?!1:l?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}else if(c){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var d={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,d))return!1;var f=d.Left,g=d.Right,y=new h.IntPoint,v;return i.Pt.X>=f&&i.Pt.X<=g?(y.X=i.Pt.X,y.Y=i.Pt.Y,v=i.Pt.X>n.Pt.X):o.Pt.X>=f&&o.Pt.X<=g?(y.X=o.Pt.X,y.Y=o.Pt.Y,v=o.Pt.X>a.Pt.X):n.Pt.X>=f&&n.Pt.X<=g?(y.X=n.Pt.X,y.Y=n.Pt.Y,v=n.Pt.X>i.Pt.X):(y.X=a.Pt.X,y.Y=a.Pt.Y,v=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,y,v)}else{for(n=i.Next;h.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var x=n.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(x){for(n=i.Prev;h.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;h.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var b=a.Pt.Y>o.Pt.Y||!h.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(b){for(a=o.Prev;h.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!h.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||t==e&&x==b?!1:x?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}};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 n=0,o=r[t].length;n<o;n++)r[t][n].X<i.left?i.left=r[t][n].X:r[t][n].X>i.right&&(i.right=r[t][n].X),r[t][n].Y<i.top?i.top=r[t][n].Y:r[t][n].Y>i.bottom&&(i.bottom=r[t][n].Y);return i};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 n=t[0],o=1;o<=i;++o){var a=o==i?t[0]:t[o];if(a.Y==r.Y&&(a.X==r.X||n.Y==r.Y&&a.X>r.X==n.X<r.X))return-1;if(n.Y<r.Y!=a.Y<r.Y){if(n.X>=r.X)if(a.X>r.X)e=1-e;else{var c=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(c==0)return-1;c>0==a.Y>n.Y&&(e=1-e)}else if(a.X>r.X){var c=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(c==0)return-1;c>0==a.Y>n.Y&&(e=1-e)}}n=a}return e};h.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var n=t.Pt.X,o=t.Pt.Y,a=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=c<r.Y){if(n>=r.X)if(a>r.X)e=1-e;else{var l=(n-r.X)*(c-r.Y)-(a-r.X)*(o-r.Y);if(l==0)return-1;l>0==c>o&&(e=1-e)}else if(a>r.X){var l=(n-r.X)*(c-r.Y)-(a-r.X)*(o-r.Y);if(l==0)return-1;l>0==c>o&&(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 n=this.m_PolyOuts[e];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,t.Pts)&&(n.FirstLeft=t)}};h.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,n=i.length,o=i[e];e<n;e++,o=i[e])o.FirstLeft==r&&(o.FirstLeft=t)};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),n=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||n.Pts==null)){var o;if(i==n?o=i:this.Param1RightOfParam2(i,n)?o=n:this.Param1RightOfParam2(n,i)?o=i:o=this.GetLowermostRec(i,n),!!this.JoinPoints(e,i,n))if(i==n){if(i.Pts=e.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=e.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,c=this.m_PolyOuts.length;a<c-1;a++){var l=this.m_PolyOuts[a];l.Pts==null||h.Clipper.ParseFirstLeft(l.FirstLeft)!=i||l.IsHole==i.IsHole||this.Poly2ContainsPoly1(l.Pts,e.OutPt2)&&(l.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};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 n=e.Prev,o=i.Prev;e.Prev=o,o.Next=e,i.Prev=n,n.Next=i,t.Pts=e;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,t.Pts)?(a.IsHole=!t.IsHole,a.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,a.Pts)?(a.IsHole=t.IsHole,t.IsHole=!a.IsHole,a.FirstLeft=t.FirstLeft,t.FirstLeft=a):(a.IsHole=t.IsHole,a.FirstLeft=t.FirstLeft),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};h.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,n=t-1;i<t;++i)e+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-e*.5};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};II&&(h.Clipper.OffsetPaths=function(r,t,e,i,n){var o=new h.Paths,a=new h.ClipperOffset(n,n);return a.AddPaths(r,e,i),a.Execute(o,t),o});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,n=e.X-t.X,o=i*t.X+n*t.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};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,n=r.Y-t.Y;return i*i+n*n<=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),n=0;n<e;++n)i[n]=new h.OutPt;for(var n=0;n<e;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%e],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=t*t,a=i[0];a.Idx==0&&a.Next!=a.Prev;)h.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=h.Clipper.ExcludeOp(a),e--):h.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(h.Clipper.ExcludeOp(a.Next),a=h.Clipper.ExcludeOp(a),e-=2):h.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=h.Clipper.ExcludeOp(a),e--):(a.Idx=1,a=a.Next);e<3&&(e=0);for(var c=new Array(e),n=0;n<e;++n)c[n]=new h.IntPoint(a.Pt),a=a.Next;return i=null,c};h.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,n=r.length;i<n;i++)e[i]=h.Clipper.CleanPolygon(r[i],t);return e};h.Clipper.Minkowski=function(r,t,e,i){var n=i?1:0,o=r.length,a=t.length,c=new Array;if(e)for(var l=0;l<a;l++){for(var p=new Array(o),d=0,f=r.length,g=r[d];d<f;d++,g=r[d])p[d]=new h.IntPoint(t[l].X+g.X,t[l].Y+g.Y);c.push(p)}else for(var l=0;l<a;l++){for(var p=new Array(o),d=0,f=r.length,g=r[d];d<f;d++,g=r[d])p[d]=new h.IntPoint(t[l].X-g.X,t[l].Y-g.Y);c.push(p)}for(var y=new Array,l=0;l<a-1+n;l++)for(var d=0;d<o;d++){var v=new Array;v.push(c[l%a][d%o]),v.push(c[(l+1)%a][d%o]),v.push(c[(l+1)%a][(d+1)%o]),v.push(c[l%a][(d+1)%o]),h.Clipper.Orientation(v)||v.reverse(),y.push(v)}var x=new h.Clipper(0);return x.AddPaths(y,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],n=r[2];return h.Clipper.Minkowski(e,i,!0,n)}else if(t==4){for(var e=r[0],o=r[1],a=r[2],n=r[3],c=new h.Clipper,l,p=0,d=o.length;p<d;++p){var l=h.Clipper.Minkowski(e,o[p],!0,n);c.AddPaths(l,h.PolyType.ptSubject,!0)}n&&c.AddPaths(o,h.PolyType.ptClip,!0);var f=new h.Paths;return c.Execute(h.ClipType.ctUnion,f,a,a),f}};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 n=0,o=r.Childs(),a=o.length,c=o[n];n<a;n++,c=o[n])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};Im(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 n=new h.PolyNode;if(n.m_jointype=t,n.m_endtype=e,e==h.EndType.etClosedLine||e==h.EndType.etClosedPolygon)for(;i>0&&h.IntPoint.op_Equality(r[0],r[i]);)i--;n.m_polygon.push(r[0]);for(var o=0,a=0,c=1;c<=i;c++)h.IntPoint.op_Inequality(n.m_polygon[o],r[c])&&(o++,n.m_polygon.push(r[c]),(r[c].Y>n.m_polygon[a].Y||r[c].Y==n.m_polygon[a].Y&&r[c].X<n.m_polygon[a].X)&&(a=o));if(!(e==h.EndType.etClosedPolygon&&o<2||e!=h.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),e==h.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new h.IntPoint(0,a);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>l.Y||n.m_polygon[a].Y==l.Y&&n.m_polygon[a].X<l.X)&&(this.m_lowest=new h.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};h.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,n=r.length;i<n;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 n=1/Math.sqrt(e*e+i*i);return e*=n,i*=n,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 n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(h.ClipperOffset.two_pi/n),this.m_cos=Math.cos(h.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/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 o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||e.m_endtype!=h.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(e.m_jointype==h.JoinType.jtRound)for(var a=1,c=0,l=1;l<=n;l++){this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r)));var p=a;a=a*this.m_cos-this.m_sin*c,c=p*this.m_sin+c*this.m_cos}else for(var a=-1,c=-1,l=0;l<4;++l)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r))),a<0?a=1:c<0?c=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<o-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[o-1],this.m_srcPoly[0])):this.m_normals.push(new h.DoublePoint(this.m_normals[o-2])),e.m_endtype==h.EndType.etClosedPolygon){for(var d=o-1,l=0;l<o;l++)d=this.OffsetPoint(l,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==h.EndType.etClosedLine){for(var d=o-1,l=0;l<o;l++)d=this.OffsetPoint(l,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var f=this.m_normals[o-1],l=o-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(-f.X,-f.Y),d=0;for(var l=o-1;l>=0;l--)d=this.OffsetPoint(l,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var d=0,l=1;l<o-1;++l)d=this.OffsetPoint(l,d,e.m_jointype);var g;if(e.m_endtype==h.EndType.etOpenButt){var l=o-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=o-1;d=o-2,this.m_sinA=0,this.m_normals[l]=new h.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(l,d):this.DoRound(l,d)}for(var l=o-1;l>0;l--)this.m_normals[l]=new h.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new h.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),d=o-1;for(var l=d-1;l>0;--l)d=this.OffsetPoint(l,d,e.m_jointype);e.m_endtype==h.EndType.etOpenButt?(g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(d=1,this.m_sinA=0,e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};h.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof h.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new h.Clipper(0);if(n.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)n.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var o=h.Clipper.GetBounds(this.m_destPolys),a=new h.Path;if(a.push(new h.IntPoint(o.left-10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.top-10)),a.push(new h.IntPoint(o.left-10,o.top-10)),n.AddPath(a,h.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.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 n=new h.Clipper(0);if(n.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)n.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var o=h.Clipper.GetBounds(this.m_destPolys),a=new h.Path;a.push(new h.IntPoint(o.left-10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.top-10)),a.push(new h.IntPoint(o.left-10,o.top-10)),n.AddPath(a,h.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.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))),n=this.m_normals[t].X,o=this.m_normals[t].Y,a,c=0;c<i;++c)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new 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 n=i.length,o,a,c,l,p,d,f,g=[],y=0;y<n;y++)if(a=i[y],o=a.length,o!==0){if(o<3){c=a,g.push(c);continue}for(c=a,l=t*t,p=a[0],d=1,f=1;f<o;f++)(a[f].X-p.X)*(a[f].X-p.X)+(a[f].Y-p.Y)*(a[f].Y-p.Y)<=l||(c[d]=a[f],p=a[f],d++);p=a[d-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=l&&d--,d<o&&c.splice(d,o-d),c.length&&g.push(c)}return!e&&g.length?g=g[0]:!e&&g.length===0?g=[]:e&&g.length===0&&(g=[[]]),g};h.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,n,o,a,c=new Array(e);for(n=0;n<e;n++){for(i=r[n].length,a=new Array(i),o=0;o<i;o++)a[o]={X:r[n][o].X,Y:r[n][o].Y};c[n]=a}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,n,o,a,c,l,p,d,f,g,y,v,x,b,C,M,P=r.length,w=t*t,D=[];for(e=0;e<P;e++)if(n=r[e],c=n.length,c!=0){for(o=0;o<1e6;o++){for(a=[],c=n.length,n[c-1].X!=n[0].X||n[c-1].Y!=n[0].Y?(y=1,n.push({X:n[0].X,Y:n[0].Y}),c=n.length):y=0,g=[],i=0;i<c-2;i++)l=n[i],d=n[i+1],p=n[i+2],C=l.X,M=l.Y,v=p.X-C,x=p.Y-M,(v!==0||x!==0)&&(b=((d.X-C)*v+(d.Y-M)*x)/(v*v+x*x),b>1?(C=p.X,M=p.Y):b>0&&(C+=v*b,M+=x*b)),v=d.X-C,x=d.Y-M,f=v*v+x*x,f<=w&&(g[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<c-1;i++)g[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[c-1].X,Y:n[c-1].Y}),y&&n.pop(),g.length)n=a;else break}c=a.length,a[c-1].X==a[0].X&&a[c-1].Y==a[0].Y&&a.pop(),a.length>2&&D.push(a)}return!r[0]instanceof Array&&(D=D[0]),typeof D>"u"&&(D=[[]]),D};h.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,c=0,l=0,p=0,d=0,f=r.length;if(f<2)return 0;for(t&&(r[f]=r[0],f++);--f;)o=r[f],c=o.X,l=o.Y,a=r[f-1],p=a.X,d=a.Y,n+=i((c-p)*(c-p)+(l-d)*(l-d));return t&&r.pop(),n/e};h.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,n=0;n<r.length;n++)i+=h.JS.PerimeterOfPath(r[n],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,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=n.X/t,n.Y=n.Y/t};h.JS.ScaleUpPath=function(r,t){var e,i,n=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=n(i.X*t),i.Y=n(i.Y*t)};h.JS.ScaleUpPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=o(n.X*t),n.Y=o(n.Y*t)};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(),n=i.length;e.holes=new Array(n);var o,a,c,l,p,d;for(c=0;c<n;c++)for(o=i[c],e.holes[c]=o.Contour(),l=0,p=o.Childs(),d=p.length;l<d;l++)a=p[l],h.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(e)};h.JS.ExPolygonsToPaths=function(r){var t,e,i,n,o=new h.Paths;for(t=0,i=r.length;t<i;t++)for(o.push(r[t].outer),e=0,n=r[t].holes.length;e<n;e++)o.push(r[t].holes[e]);return o};h.JS.PolyTreeToExPolygons=function(r){var t=new h.ExPolygons,e,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)e=n[i],h.JS.AddOuterPolyNodeToExPolygons(e,t);return t};Cu.exports=h});var J7=H((Hce,Sg)=>{m();(function(){"use strict";function r(a,c){var l=a.x-c.x,p=a.y-c.y;return l*l+p*p}function t(a,c,l){var p=c.x,d=c.y,f=l.x-p,g=l.y-d;if(f!==0||g!==0){var y=((a.x-p)*f+(a.y-d)*g)/(f*f+g*g);y>1?(p=l.x,d=l.y):y>0&&(p+=f*y,d+=g*y)}return f=a.x-p,g=a.y-d,f*f+g*g}function e(a,c){for(var l=a[0],p=[l],d,f=1,g=a.length;f<g;f++)d=a[f],r(d,l)>c&&(p.push(d),l=d);return l!==d&&p.push(d),p}function i(a,c,l,p,d){for(var f=p,g,y=c+1;y<l;y++){var v=t(a[y],a[c],a[l]);v>f&&(g=y,f=v)}f>p&&(g-c>1&&i(a,c,g,p,d),d.push(a[g]),l-g>1&&i(a,g,l,p,d))}function n(a,c){var l=a.length-1,p=[a[0]];return i(a,0,l,c,p),p.push(a[l]),p}function o(a,c,l){if(a.length<=2)return a;var p=c!==void 0?c*c:1;return a=l?a:e(a,p),a=n(a,p),a}typeof define=="function"&&define.amd?define(function(){return o}):typeof Sg<"u"?(Sg.exports=o,Sg.exports.default=o):typeof self<"u"?self.simplify=o:window.simplify=o})()});m();m();m();m();m();m();var Nc=r=>r!=null;var IP=function(){let t=globalThis.fetch;return{fetch(...e){if(!Nc(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}}}(),T2=IP.fetch;var w2=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],M2=w2[0],D2="https://api-gateway.mappedin.com/track-analytics/a/",E2="deny-watchposition",_2="load-mapview",O2="load-mapdata",L2="change-language",k2="query-directions";var ln,Hr,Xs,mh,Ys=class{constructor(){S(this,Xs);S(this,ln,Object.freeze({}));S(this,Hr);u(this,"oneTimeEventsSent",new Set);u(this,"sendGetDirectionsEvent",Jv((t,e)=>this.sendAnalyticEvent(k2,{start:t,end:e,type:"location_to_location"}),2500));I(this,Hr,N(this,Xs,mh).call(this,s(this,ln)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){I(this,ln,{}),I(this,Hr,N(this,Xs,mh).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return I(this,ln,Object.freeze(Object.assign({},s(this,ln),t))),I(this,Hr,N(this,Xs,mh).call(this,t)),s(this,Hr)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=zg({...s(this,Hr),mapId:e.mapId})),e.context&&(e.context=P2(e.context)),e.baseUri&&(e.analyticsBaseUrl=zg({baseUri:e.baseUri,mapId:s(this,Hr).mapId})),Object.assign(s(this,Hr),e),this.handleStateUpdate(t)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:i}=this.getState();return!!(t&&e)||!!i}getState(){return s(this,Hr)}getContext(){return this.getState().context||s(this,ln).context||M2}getSessionId(){return this.getState().sessionId||s(this,ln).sessionId||I2()}sendAnalyticEvent(t,e={}){let i=this.getState(),n=wP(i.analyticsBaseUrl,t),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&O.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return O.warn("Auth needs to be ready to send analytics.");let a={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(a,i.userPosition),o["Content-Type"]="application/json",i.accessToken?o.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(o["x-mappedin-key"]=btoa(i.key),o["x-mappedin-secret"]=btoa(i.secret)),T2(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(t,e){if(EP.includes(t))return O.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=DP.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(O2,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(L2,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(E2)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(_2,{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)}};ln=new WeakMap,Hr=new WeakMap,Xs=new WeakSet,mh=function(t){var i,n,o,a;let e=(i=t.baseUri)!=null?i:D2;return{baseUri:e,analyticsBaseUrl:zg({...t,baseUri:e}),version:((n=T==null?void 0:T.env)==null?void 0:n.npm_package_version)||"v6",deviceId:t.deviceId||PP(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||I2(),platformString:t.platformString||"",context:P2(t.context)||M2,geolocationMode:!1,sendEvents:(o=t.sendEvents)!=null?o:!0,logEvents:(a=t.logEvents)!=null?a:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}};function zg({mapId:r,baseUri:t=D2}){return"".concat(t).concat(r,"/")}function PP(){return oa.getInstance().loadLocalData("deviceId")}function I2(){return oa.getInstance().loadSessionData("id")}function wP(r,t){return r+t}function P2(r){return w2.find(t=>t===r)}var DP=["$select-location","$select-category","$query-suggest","$query-search"],EP=[_2,O2,k2,E2,L2],rG=new Ys,cn,Gc=class{constructor(t){S(this,cn);u(this,"capture");u(this,"updateState");I(this,cn,t),this.capture=s(this,cn).capture.bind(s(this,cn)),this.updateState=s(this,cn).updateState.bind(s(this,cn))}getState(){return Object.assign({},s(this,cn).getState())}};cn=new WeakMap;m();m();var jc,Uc,Hc,Vc=class{constructor(t,e,{enabled:i=!1}={}){S(this,jc);u(this,"searchInstance");S(this,Uc);S(this,Hc);u(this,"enabled",!1);I(this,jc,t),I(this,Uc,e),I(this,Hc,()=>{var n;(n=this.searchInstance)==null||n.then(o=>o.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return O.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return O.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-MEGLEQC5.js").then(({InternalSearch:t})=>new t(s(this,jc)))),s(this,Uc).on("language-change",s(this,Hc)),await this.searchInstance)}};jc=new WeakMap,Uc=new WeakMap,Hc=new WeakMap;var A2=new WeakMap,$e,Zg=class extends oe{constructor(e,{search:i}={}){super();S(this,$e);u(this,"Analytics");u(this,"Search");u(this,"Query");u(this,"getDirections",(e,i,n)=>s(this,$e).getDirections(e,i,n));u(this,"getDirectionsMultiDestination",(e,i,n)=>s(this,$e).getDirectionsMultiDestination(e,i,n));I(this,$e,e),A2.set(this,e),this.Analytics=new Gc(e.Analytics),this.Query=e.Query,this.Search=new Vc(this,e,{enabled:i==null?void 0:i.enabled}),s(this,$e).on("language-change",n=>{this.publish("language-change",n)})}getEnv(){return s(this,$e).getEnv()}getAccessToken(){var e;return(e=s(this,$e).tokenManager)==null?void 0:e.getAccessToken().token}get mapName(){return s(this,$e).mapName}get mapCenter(){return s(this,$e).mapCenter}get organizationId(){return s(this,$e).organizationId}get outdoorViewToken(){return s(this,$e).outdoorViewToken}getByType(e){return s(this,$e).getByType(e)}getById(e,i){return s(this,$e).getById(e,i)}getByExternalId(e,i){return s(this,$e).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return s(this,$e).changeLanguage(e)}get currentLanguage(){return s(this,$e).currentLanguage}get naturalBearing(){var e;return(e=s(this,$e).naturalBearing)!=null?e:0}getDistance(e,i){return s(this,$e).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return s(this,$e).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return s(this,$e).toJSONBundle({downloadLanguagePacks:e})}};$e=new WeakMap;var gh=Zg;function Wc(r){let t=A2.get(r);if(!t)throw new Error("MapDataInternal not found");return t}m();m();m();m();m();function qs(r){return r.endsWith("/")?r:"".concat(r,"/")}m();var $s="https://app.mappedin.com/",F2="https://auth.mappedin.com/";m();m();var _P=r=>{let t=Date.now();return r-t},yh=(r,t)=>_P(r)<=t*60*1e3;var R2=60,N2=R2*60*1e3,B2="accessTokens";async function zc(r,t=!1){let e="".concat(r.key),i=oa.getInstance(),n=(i==null?void 0:i.loadSessionData(B2))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&!yh(n[e].expiresTimestamp*1e3,R2))return n[e];let a=t?await OP(r,o):await LP(r,o),c={...n,[e]:a};return i==null||i.saveSessionData(B2,c),a}async function OP(r,t){var o;let e="".concat((o=r.baseAuthUri)!=null?o:F2,"oauth2/token"),i=await Wr()(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:r.key,client_secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let n=await i.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}async function LP(r,t){let e="".concat(r.baseAuthUri?qs(r.baseAuthUri):$s,"api/api-key/token"),i=await Wr()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:r.key,secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let n=await i.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}m();var V2=60,j2=V2*60*1e3,G2="miSasTokens";async function Xg(r,t){let e="".concat(t,"__").concat(r.mapId),i=oa.getInstance(),n=(i==null?void 0:i.loadSessionData(G2))||{};if(n[e]&&!yh(n[e].expires,V2))return n[e];let o=await kP(r,t),a={...n,[e]:{token:o.token,expires:new Date(o.expires).getTime()}};return i==null||i.saveSessionData(G2,a),o}async function kP(r,t){let e="".concat(r.baseUri?qs(r.baseUri):$s,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await Wr()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let n=await i.json();return{token:n.token,expires:new Date(n.expires).getTime()}}var U2=globalThis.fetch,W2,AP=(W2=T==null?void 0:T.env)==null?void 0:W2.npm_package_version;function Wr(){if(U2==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return U2}var Yg={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function z2(r){var e;let t={...Yg,...r};return t.headers={...t.headers,"mappedin-sdk-version":AP},t.things=[],"platformString"in r&&(t.headers={...t.headers,"mappedin-platform-version":r.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}function FP(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete i.language;let{headers:n}=r;n["Content-Type"]=n["Content-Type"]||"text/json",r.accessToken?n.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(n["x-mappedin-key"]=btoa(r.clientId),n["x-mappedin-secret"]=btoa(r.clientSecret));let o={method:"GET",headers:n};return r.secure&&(t+="&withcdntoken"),{req:o,url:t}}async function BP(r,t,e=!1){let i=FP(r,t,e),n=await Wr()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}var RP=r=>{let t=r!=null&&typeof r=="object"&&"perspectives"in r&&r.perspectives!=null&&typeof r.perspectives=="object"?r.perspectives:null;if(t==null||Object.keys(t).length===0)return O.warn("No perspectives available in response!"),null;let e={};for(let[i,n]of Object.entries(t)){let o="url"in n&&typeof n.url=="string"?n.url:null,a="locale_packs"in n&&typeof n.locale_packs=="object"?n.locale_packs:null;if(o==null||a==null){O.warn("Perspective ".concat(i," is missing url or locale_packs!"));continue}e[i]={url:o,locale_packs:a}}return e};async function NP(r,t="exports/mvf/1/bundle"){var p,d;let e=z2({baseUri:"https://api-gateway.mappedin.com/",...Yg,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((p=e.version)!=null?p:"2.0.0");e.headers["Content-Type"]="application/zip";let n=await BP(e,i),o=n.url,a=n.locale_packs,c=(d=e.perspective)!=null?d:Yg.perspective,l=RP(n);if(c!=null&&c!==""&&l!=null){let f=l[c];f==null?O.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(O.log('Loading perspective "'.concat(c,'"')),o=f.url,a=f.locale_packs)}return{url:o,localePacks:a,updated_at:n.updated_at}}var Zc=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function qg(r,{signal:t}){let e=await(await Wr()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}async function Js(r){let e=(await import("./browser-IE62BVYL.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let n=e["enterprise/locations.json"];n&&(i.enterprise.locations=JSON.parse(Zc().decode(n)));let o=e["enterprise/categories.json"];o&&(i.enterprise.categories=JSON.parse(Zc().decode(o)))}return e["floorstack.json"]&&(i["floorstack.json"]=JSON.parse(Zc().decode(e["floorstack.json"]))),e["floor.geojson"]&&(i["floor.geojson"]=JSON.parse(Zc().decode(e["floor.geojson"]))),e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Zc().decode(e["manifest.json"]))),i}async function Z2(r,{signal:t}){try{let e=await(await Wr()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Js(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}async function $g(r){return new Promise(async(t,e)=>{try{let i=r.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:n,localePacks:o}=await NP(r,i),a=await Wr()(n).then(l=>l.arrayBuffer()),c=new Uint8Array(a);t({compressed:c,localePacks:o})}catch(i){e(i)}})}async function Jg(r,t){return new Promise(async(e,i)=>{try{let{url:n}=await GP(r,t),o=await Wr()(n).then(c=>c.arrayBuffer()),a=new Uint8Array(o);e(a)}catch(n){i(n)}})}async function GP(r,t){let e="".concat(r.baseUri?qs(r.baseUri):$s,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await Wr()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}function bh(r){var i,n,o,a,c,l,p,d,f,g,y,v,x,b,C,M,P,w;let t=new TextDecoder,e=t.decode.bind(t);try{let D={"connection.json":JSON.parse(e(r["connection.json"])),"manifest.geojson":JSON.parse(e(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(e(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(e(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(e(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":r["tileset.json"]?JSON.parse(e(r["tileset.json"])):void 0};if(r.enterprise!=null&&(D.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(D.enterprise.locations=JSON.parse(e((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(D.enterprise.categories=JSON.parse(e((a=r.enterprise)==null?void 0:a["categories.json"]))),(c=r.enterprise)!=null&&c["venue.json"]&&(D.enterprise.venue=JSON.parse(e((l=r.enterprise)==null?void 0:l["venue.json"]))),(p=r.enterprise)!=null&&p["layers.json"]&&(D.enterprise.layers=JSON.parse(e((d=r.enterprise)==null?void 0:d["layers.json"]))),(f=r.enterprise)!=null&&f["locationInstances.json"]&&(D.enterprise.locationInstances=JSON.parse(e((g=r.enterprise)==null?void 0:g["locationInstances.json"]))),(y=r.enterprise)!=null&&y["enterpriseStyles.json"]&&(D.enterprise.enterpriseStyles=JSON.parse(e((v=r.enterprise)==null?void 0:v["enterpriseStyles.json"]))),(x=r.enterprise)!=null&&x["textures.json"]&&(D.enterprise.textures=JSON.parse(e((b=r.enterprise)==null?void 0:b["textures.json"]))),(C=r.enterprise)!=null&&C["floorText.json"]&&(D.enterprise.floorText=JSON.parse(e((M=r.enterprise)==null?void 0:M["floorText.json"]))),(P=r.enterprise)!=null&&P["categoryPriorities.json"]&&(D.enterprise.categoryPriorities=JSON.parse(e((w=r.enterprise)==null?void 0:w["categoryPriorities.json"])))),r["floorstack.json"]!=null?D["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(D["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),D["floorstack.json"]==null&&D["mapstack.json"]==null&&D["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(D["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),D["floor.geojson"]==null&&D["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(D["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(D["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(D["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(D["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){D.annotation={};let _=Object.keys(r.annotation);for(let A of _){let F=A.replace(/\.json|\.geojson/g,"");D.annotation[F]=JSON.parse(e(r.annotation[A]))}}let B=Object.keys(r.space);for(let _ of B){let A=_.replace(/\.json|\.geojson/g,"");D.space[A]=JSON.parse(e(r.space[_]))}if(r.obstruction!=null){let _=Object.keys(r.obstruction);for(let A of _){let F=A.replace(/\.json|\.geojson/g,"");D.obstruction[F]=JSON.parse(e(r.obstruction[A]))}}else D.obstruction={};if(r.entrance!=null){let _=Object.keys(r.entrance);for(let A of _){let F=A.replace(/\.json|\.geojson/g,"");D.entrance[F]=JSON.parse(e(r.entrance[A]))}}else D.entrance={};if("floorImages"in r&&r.floorImages!=null){D.floorImages={};for(let _ of Object.keys(r.floorImages)){let A=_.replace(/\.json|\.geojson/g,"");D.floorImages[A]=JSON.parse(e(r.floorImages[_]))}}if("textAreas"in r&&r.textAreas!=null){D.textAreas={};for(let _ of Object.keys(r.textAreas)){let A=_.replace(/\.json|\.geojson/g,"");D.textAreas[A]=JSON.parse(e(r.textAreas[_]))}}if("facade"in r&&r.facade!=null){D.facade={};for(let _ of Object.keys(r.facade)){let A=_.replace(/\.json|\.geojson/g,"");D.facade[A]=JSON.parse(e(r.facade[_]))}}if("area"in r&&r.area!=null){D.area={};for(let _ of Object.keys(r.area)){let A=_.replace(/\.json|\.geojson/g,"");D.area[A]=JSON.parse(e(r.area[_]))}}return D}catch(D){throw O.error(D),new Error("MVF parsing failed! Probably encountered a bad file.")}}function VP(r){if(r==null||typeof r!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&t.push("styles.json"),"shapes.json"in r&&t.push("shapes.json");for(let e of t)if(r[e]==null||r[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function vh(r){return new Promise(async(t,e)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let n=(await import("./browser-IE62BVYL.js")).unzipSync(r);if(!VP(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let c of a){if(n[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){o[l[0]]=n[c];continue}if(l[0]==="image"){O.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[l[0]]==null&&(o[l[0]]={}),o[l[0]][l[1]]=n[c]}t(o)}catch(i){e(i)}})}function ca(){let r="us",t={};function e(){return WP(ZP(r),t)}return{updateByUserOption(i){var n,o;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(n=i.analytics)!=null&&n.baseUri&&(t.analyticsBaseUri=(o=i.analytics)==null?void 0:o.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?H2.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?H2.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}var X2=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"}),H2=Object.freeze({...X2,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),jP=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"}),UP=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"}),HP=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function WP(r,t){return{...r,...t}}var zP={eu:jP,us:X2,"us-staging-enterprise":UP,"us-staging-self-serve":HP};function ZP(r){return zP[r]}var Kg=r=>{var e,i;let t=Object.values((i=(e=r["floorstack.json"])!=null?e:r["mapstack.json"])!=null?i:{});return t.length===1?[]:t.filter(n=>n.type!=="Outdoor").map(n=>n.id.replace("fs_","").replace("ms_",""))};m();m();m();function Mr(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function dr(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Ks(r){return r.type==="Feature"?r.geometry:r}function Y2(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function XP(r,t,e){e===void 0&&(e={});for(var i=Mr(r),n=dr(t),o=0;o<n.length-1;o++){var a=!1;if(e.ignoreEndVertices&&(o===0&&(a="start"),o===n.length-2&&(a="end"),o===0&&o+1===n.length-1&&(a="both")),YP(n[o],n[o+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function YP(r,t,e,i,n){var o=e[0],a=e[1],c=r[0],l=r[1],p=t[0],d=t[1],f=e[0]-c,g=e[1]-l,y=p-c,v=d-l,x=f*v-g*y;if(n!==null){if(Math.abs(x)>n)return!1}else if(x!==0)return!1;if(i){if(i==="start")return Math.abs(y)>=Math.abs(v)?y>0?c<o&&o<=p:p<=o&&o<c:v>0?l<a&&a<=d:d<=a&&a<l;if(i==="end")return Math.abs(y)>=Math.abs(v)?y>0?c<=o&&o<p:p<o&&o<=c:v>0?l<=a&&a<d:d<a&&a<=l;if(i==="both")return Math.abs(y)>=Math.abs(v)?y>0?c<o&&o<p:p<o&&o<c:v>0?l<a&&a<d:d<a&&a<l}else return Math.abs(y)>=Math.abs(v)?y>0?c<=o&&o<=p:p<=o&&o<=c:v>0?l<=a&&a<=d:d<=a&&a<=l;return!1}var q2=XP;m();function qP(r,t){t===void 0&&(t={});var e=js(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return xi([i,n],t.properties,t)}var xh=qP;m();m();function $P(r,t,e){e===void 0&&(e={});var i=Mr(r),n=Mr(t),o=Kt(n[1]-i[1]),a=Kt(n[0]-i[0]),c=Kt(i[1]),l=Kt(n[1]),p=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(c)*Math.cos(l);return e2(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),e.units)}var ro=$P;function Ch(r,t){return t===void 0&&(t={}),i2(r,function(e,i){var n=i.geometry.coordinates;return e+ro(n[0],n[1],t)},0)}m();m();m();function Sh(r,t,e){if(e===void 0&&(e={}),e.final===!0)return JP(r,t);var i=Mr(r),n=Mr(t),o=Kt(i[0]),a=Kt(n[0]),c=Kt(i[1]),l=Kt(n[1]),p=Math.sin(a-o)*Math.cos(l),d=Math.cos(c)*Math.sin(l)-Math.sin(c)*Math.cos(l)*Math.cos(a-o);return Ac(Math.atan2(p,d))}function JP(r,t){var e=Sh(t,r);return e=(e+180)%360,e}m();function pa(r,t,e,i){i===void 0&&(i={});var n=Mr(r),o=Kt(n[0]),a=Kt(n[1]),c=Kt(e),l=t2(t,i.units),p=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(c)),d=o+Math.atan2(Math.sin(c)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(p)),f=Ac(d),g=Ac(p);return xi([f,g],i.properties)}m();m();function KP(r){if(!r)throw new Error("geojson is required");var t=[];return Ci(r,function(e){QP(e,t)}),aa(t)}function QP(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=dr(i);break;case"LineString":e=[dr(i)]}e.forEach(function(n){var o=e6(n,r.properties);o.forEach(function(a){a.id=t.length,t.push(a)})})}}function e6(r,t){var e=[];return r.reduce(function(i,n){var o=sn([i,n],t);return o.bbox=t6(i,n),e.push(o),n}),e}function t6(r,t){var e=r[0],i=r[1],n=t[0],o=t[1],a=e<n?e:n,c=i<o?i:o,l=e>n?e:n,p=i>o?i:o;return[a,c,l,p]}var Qg=KP;var n5=ra(r5(),1);function MD(r,t){var e={},i=[];if(r.type==="LineString"&&(r=Ng(r)),t.type==="LineString"&&(t=Ng(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var n=i5(r,t);return n&&i.push(n),aa(i)}var o=(0,n5.default)();return o.load(Qg(t)),Gg(Qg(r),function(a){Gg(o.search(a),function(c){var l=i5(a,c);if(l){var p=dr(l).join(",");e[p]||(e[p]=!0,i.push(l))}})}),aa(i)}function i5(r,t){var e=dr(r),i=dr(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=e[0][0],o=e[0][1],a=e[1][0],c=e[1][1],l=i[0][0],p=i[0][1],d=i[1][0],f=i[1][1],g=(f-p)*(a-n)-(d-l)*(c-o),y=(d-l)*(o-p)-(f-p)*(n-l),v=(a-n)*(o-p)-(c-o)*(n-l);if(g===0)return null;var x=y/g,b=v/g;if(x>=0&&x<=1&&b>=0&&b<=1){var C=n+x*(a-n),M=o+x*(c-o);return xi([C,M])}return null}var pl=MD;function ID(r,t,e){e===void 0&&(e={});var i=xi([1/0,1/0],{dist:1/0}),n=0;return Ci(r,function(o){for(var a=dr(o),c=0;c<a.length-1;c++){var l=xi(a[c]);l.properties.dist=ro(t,l,e);var p=xi(a[c+1]);p.properties.dist=ro(t,p,e);var d=ro(l,p,e),f=Math.max(l.properties.dist,p.properties.dist),g=Sh(l,p),y=pa(t,f,g+90,e),v=pa(t,f,g-90,e),x=pl(sn([y.geometry.coordinates,v.geometry.coordinates]),sn([l.geometry.coordinates,p.geometry.coordinates])),b=null;x.features.length>0&&(b=x.features[0],b.properties.dist=ro(t,b,e),b.properties.location=n+ro(l,b,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=c,i.properties.location=n),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=c+1,i.properties.location=n+d),b&&b.properties.dist<i.properties.dist&&(i=b,i.properties.index=c),n+=d}}),i}var cp=ID;function PD(r,t,e){var i=dr(e);if(Y2(e)!=="LineString")throw new Error("line must be a LineString");var n=cp(e,r),o=cp(e,t),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var c=[a[0].geometry.coordinates],l=a[0].properties.index+1;l<a[1].properties.index+1;l++)c.push(i[l]);return c.push(a[1].geometry.coordinates),sn(c,e.properties)}var V1=PD;var wD=1e-7;function j1(r){return{type:"Point",coordinates:r}}function DD(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,n=e.map(o=>cp(r,j1(o)));return i.reduce((o,a)=>{let c=V1(j1(a),n[0],r),l=V1(j1(a),n[1],r),p=Ch(c)<Ch(l)?c:l;return p.properties={...r.properties,entrances:[]},o.concat([p])},[])}function U1(r,t){return t.reduce((e,i)=>{let n={epsilon:wD},o=e.obstructions.findIndex(c=>q2(xh(i),c,n)),a=e.obstructions[o];if(a){let[c,l]=DD(a,i);e.entrances.push(i),e.obstructions.splice(o,1,c,l)}return e},{obstructions:[r],entrances:[]})}m();m();m();var pp=class pp{constructor(t,e,i){u(this,"__type",pp.__type);u(this,"id",De());u(this,"latitude");u(this,"longitude");u(this,"floorId");u(this,"verticalOffset");var n;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(n=t.verticalOffset)!=null?n:0;else{if(e==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=e,this.floorId=i,this.verticalOffset=0}}static is(t){return t.__type===pp.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};u(pp,"__type","coordinate");var H1=pp,ae=H1;m();var ut=class{constructor(t){u(this,"id");this.id=t}};var wi,jt,fa,co,up=class up extends ut{constructor(e,i){super(i.mvfData.properties.id);u(this,"__type",up.__type);S(this,wi);S(this,jt,{});S(this,fa);S(this,co);I(this,wi,e),I(this,fa,i.floorId),I(this,co,i.mvfData)}static is(e){return e.__type===up.__type}get locations(){return s(this,jt).locations?s(this,jt).locations:(s(this,jt).locations=(s(this,wi).locationIdsByNodeId[this.id]||[]).map(e=>s(this,wi).getById("enterprise-location",e)).filter(Boolean),s(this,jt).locations)}get space(){var e;return s(this,wi).getById("space",(e=s(this,wi).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=s(this,wi).getById("floor",s(this,fa));if(e==null)throw new Error("Floor ".concat(s(this,fa)," not found!"));return e}get coordinate(){if(s(this,jt).coordinate==null){let[e,i]=s(this,co).geometry.coordinates;s(this,jt).coordinate=new ae(i,e,s(this,fa))}return s(this,jt).coordinate}get externalId(){var e;return(e=s(this,co).properties.externalId)!=null?e:""}get neighbors(){if(s(this,jt).neighbours==null){let e=s(this,co).properties.neighbors.map(i=>{let n=s(this,wi).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});s(this,jt).neighbours=e}return s(this,jt).neighbours}get geoJSON(){return{...s(this,co),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(s(this,jt)))delete s(this,jt)[e]}};wi=new WeakMap,jt=new WeakMap,fa=new WeakMap,co=new WeakMap,u(up,"__type","node");var W1=up,po=W1;m();m();m();m();var dp,hn,xf=class xf extends ut{constructor(e){super(String(De()));S(this,dp,{});S(this,hn);I(this,hn,e.mvfData)}static is(e){return e.__type===xf.__type}get url(){return s(this,hn).url}get name(){if("displayName"in s(this,hn))return s(this,hn).displayName;if("label"in s(this,hn))return s(this,hn).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,dp)))delete s(this,dp)[e]}};dp=new WeakMap,hn=new WeakMap,u(xf,"__type","hyperlink");var z1=xf,ma=z1;m();m();function hp(r){return typeof r=="string"?r:r.id}function X1(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}var Z1=8,Di=r=>typeof r=="number"?r.toFixed(Z1):X1(r)?r[1].toFixed(Z1)+"-"+r[0].toFixed(Z1):r.map(t=>Di(t)).join("-"),ED=r=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,e=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(r)||e.test(r)},Cf=r=>{if(!ED(r))return null;let t="";r.startsWith("https://")?(t="https://",r=r.slice(8)):r.startsWith("http://")&&(t="http://",r=r.slice(7));let[e,i,n]=r.split("/");return{origin:t+e,mapId:i,fileName:n}};var fp,uo,ga,Sf=class Sf extends ut{constructor(e){super(String(De()));S(this,fp,{});S(this,uo);S(this,ga);I(this,uo,e.mvfData),I(this,ga,e.mapData)}static is(e){return e.__type===Sf.__type}get url(){let e=s(this,uo).url;if(s(this,ga).tokenManager==null)return e;let i=Cf(s(this,uo).url);if(i==null)return e;let n=i.mapId;try{if(s(this,ga).tokenManager.isEnterpriseMode())return e;let o=s(this,ga).tokenManager.getSasToken(n).token;if(o==null||o==="")throw new Error("SAS token empty!");return"".concat(e,"?").concat(o)}catch(o){return O.error("Error getting SAS token for image",{error:o,url:e}),e}}get name(){return s(this,uo).altText}get altText(){return s(this,uo).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,fp)))delete s(this,fp)[e]}};fp=new WeakMap,uo=new WeakMap,ga=new WeakMap,u(Sf,"__type","image");var Y1=Sf,ya=Y1;m();var ba,Xr=class{constructor(t,e){u(this,"id");S(this,ba);this.id=t}get geoJSONBoundingBox(){return s(this,ba)?s(this,ba):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(I(this,ba,js(this.geoJSON)),s(this,ba))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};ba=new WeakMap;var ul,Yr,fn,Tt=class extends Xr{constructor(e,i){super(i.properties.id,e);S(this,ul);S(this,Yr);S(this,fn,{});I(this,ul,e),I(this,Yr,i)}get externalId(){var e;return(e=s(this,Yr).properties.externalId)!=null?e:""}get name(){var i,n,o,a,c;let e="";return"details"in s(this,Yr).properties||(e=(i=s(this,Yr).properties.externalId)!=null?i:""),e===""&&(e=(o=(n=s(this,Yr).properties.details)==null?void 0:n.name)!=null?o:""),e===""&&(e=(c=(a=this.locationProfiles.find(l=>l.name&&l.name.length>0))==null?void 0:a.name)!=null?c:""),e}get description(){var i,n,o,a;let e=(n=(i=s(this,Yr).properties.details)==null?void 0:i.description)!=null?n:"";return e===""&&(e=(a=(o=this.locationProfiles.find(c=>c.description&&c.description.length>0))==null?void 0:o.description)!=null?a:""),e}get images(){var i,n,o,a,c;if(s(this,fn).images!=null)return s(this,fn).images;let e=(o=(n=(i=s(this,Yr).properties.details)==null?void 0:i.images)==null?void 0:n.map(l=>new ya({mvfData:l,mapData:s(this,ul)})))!=null?o:[];return(e==null||e.length===0)&&(e=(c=(a=this.locationProfiles.find(l=>l.images.length>0))==null?void 0:a.images)!=null?c:[]),s(this,fn).images=e,e}get links(){var i,n,o,a,c;if(s(this,fn).links!=null)return s(this,fn).links;let e=(o=(n=(i=s(this,Yr).properties.details)==null?void 0:i.links)==null?void 0:n.map(l=>new ma({mvfData:l})))!=null?o:[];return(e==null||e.length===0)&&(e=(c=(a=this.locationProfiles.find(l=>l.links.length>0))==null?void 0:a.links)!=null?c:[]),s(this,fn).links=e,e}get locationProfiles(){var e;return(e=s(this,ul).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}};ul=new WeakMap,Yr=new WeakMap,fn=new WeakMap;var gp,va,dl,hl,mp=class mp extends Tt{constructor(e,i){super(e,i.mvfData);u(this,"__type",mp.__type);S(this,gp);S(this,va);S(this,dl,{});S(this,hl);I(this,gp,e),I(this,va,i.floorId),I(this,hl,i.mvfData)}static is(e){return e.__type===mp.__type}get center(){var e;if(s(this,dl).center==null){let[i,n]=(e=s(this,hl).properties.center)!=null?e:[0,0];s(this,dl).center=new ae(n,i,s(this,va))}return s(this,dl).center}get floor(){let e=s(this,gp).getById("floor",s(this,va));if(e==null)throw new Error("Floor ".concat(s(this,va)," not found!"));return e}get geoJSON(){return{...s(this,hl),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};gp=new WeakMap,va=new WeakMap,dl=new WeakMap,hl=new WeakMap,u(mp,"__type","area");var q1=mp,ho=q1;m();var xa,mn,Ca,fl,yp=class yp extends Tt{constructor(e,i){super(e,i.mvfData);u(this,"__type",yp.__type);S(this,xa);S(this,mn);S(this,Ca);S(this,fl);I(this,mn,{}),I(this,fl,i.mvfData),I(this,xa,e),I(this,Ca,i.floorId)}static is(e){return e.__type===yp.__type}get floor(){let e=s(this,xa).getById("floor",s(this,Ca));if(e==null)throw new Error("Floor ".concat(s(this,Ca)," not found!"));return e}get center(){if(s(this,mn).center==null){let[[e,i],[n,o]]=s(this,fl).geometry.coordinates,a=(e+n)/2,c=(i+o)/2;s(this,mn).center=new ae(c,a,s(this,Ca))}return s(this,mn).center}get isExterior(){var n;let e=s(this,xa).obstructionIdByEntranceId[this.id],i=s(this,xa).getMVFFeatureById("obstruction",e);return(n=i==null?void 0:i.properties.footprintComponent)!=null?n:!1}get geoJSON(){return{...s(this,fl),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,mn)))delete s(this,mn)[e]}};xa=new WeakMap,mn=new WeakMap,Ca=new WeakMap,fl=new WeakMap,u(yp,"__type","door");var $1=yp,Ei=$1;m();var fo,Sa,fr,_i,bp=class bp extends Tt{constructor(e,i){super(e,i.mvfData);u(this,"__type",bp.__type);S(this,fo);S(this,Sa);S(this,fr,{});S(this,_i);I(this,fo,e),I(this,Sa,i.floorId),I(this,_i,i.mvfData)}getMvfData(){return s(this,_i)}static is(e){return e.__type===bp.__type}get type(){return OD(s(this,_i).properties.kind)}get locations(){if(s(this,fr).locations)return s(this,fr).locations;s(this,fr).locations=[];let e=s(this,fo).mvfLocationsBySpaceId[s(this,_i).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let n=s(this,fo).getById("enterprise-location",i.id);n&&s(this,fr).locations.push(n)}return s(this,fr).locations}get floor(){let e=s(this,fo).getById("floor",s(this,Sa));if(e==null)throw new Error("Floor ".concat(s(this,Sa)," not found!"));return e}get doors(){return s(this,_i).properties.destinationNodes.reduce((e,i)=>{let n=s(this,fo).doorsByNodeId[i];return n&&e.push(n),e},[])}get center(){var e;if(s(this,fr).center==null){let[i,n]=(e=s(this,_i).properties.center)!=null?e:[0,0];s(this,fr).center=new ae(n,i,s(this,Sa))}return s(this,fr).center}get geoJSON(){return{...s(this,_i),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,fr)))delete s(this,fr)[e]}};fo=new WeakMap,Sa=new WeakMap,fr=new WeakMap,_i=new WeakMap,u(bp,"__type","space");var J1=bp,_D=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function OD(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return _D.includes(t)?t:"room"}var vt=J1;m();var Pr,Re,wr,xp,Q1,vp=class vp extends Xr{constructor(e,i){super(i.mvfData.properties.id,e);S(this,xp);u(this,"__type",vp.__type);S(this,Pr);S(this,Re,{});S(this,wr);I(this,Pr,e),I(this,wr,i.mvfData)}static is(e){return e.__type===vp.__type}get focusTarget(){return this}get name(){var e,i;return"name"in s(this,wr).properties?(i=N(this,xp,Q1).call(this,"name"))!=null?i:"":(e=s(this,wr).properties.externalId)!=null?e:""}get shortName(){var e,i;return"shortName"in s(this,wr).properties?(i=N(this,xp,Q1).call(this,"shortName"))!=null?i:"":(e=s(this,wr).properties.externalId)!=null?e:""}get externalId(){var e;return(e=s(this,wr).properties.externalId)!=null?e:""}get elevation(){return s(this,wr).properties.elevation}get spaces(){if(s(this,Re).spaces==null){let e=s(this,Pr).spaces.filter(i=>i.floor.id===this.id);s(this,Re).spaces=e}return s(this,Re).spaces}get geoJSON(){var e;return{type:"Feature",properties:null,geometry:(e=s(this,wr).geometry)!=null?e:{type:"Polygon",coordinates:[]}}}get objects(){if(s(this,Re).objects==null){let e=s(this,Pr).objects.filter(i=>i.floor.id===this.id);s(this,Re).objects=e}return s(this,Re).objects}get connections(){if(s(this,Re).connections==null){let e=s(this,Pr).connections.filter(i=>i.floors.includes(this));s(this,Re).connections=e}return s(this,Re).connections}get doors(){if(s(this,Re).doors==null){let e=s(this,Pr).doors.filter(i=>i.floor.id===this.id);s(this,Re).doors=e}return s(this,Re).doors}get annotations(){if(s(this,Re).annotations==null){let e=s(this,Pr).annotations.filter(i=>i.floor.id===this.id);s(this,Re).annotations=e}return s(this,Re).annotations}get pois(){if(s(this,Re).pois==null){let e=s(this,Pr).pointsOfInterest.filter(i=>i.floor.id===this.id);s(this,Re).pois=e}return s(this,Re).pois}get floorStack(){if(s(this,Re).floorStack==null){let e=s(this,Pr).floorStacks.find(i=>i.floors.includes(this));s(this,Re).floorStack=e}return s(this,Re).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,Re)))delete s(this,Re)[e]}};Pr=new WeakMap,Re=new WeakMap,wr=new WeakMap,xp=new WeakSet,Q1=function(e){let i=s(this,wr).properties[e];return s(this,Pr).getPropTranslation(this.__type,e,this.id,i)},u(vp,"__type","floor");var K1=vp,mr=K1;m();m();m();function Cp(r){let t;if(vt.is(r)||Ei.is(r)||gr.is(r)||ho.is(r)||qr.is(r))t=r.center;else if(mo.is(r)||go.is(r))t=r.coordinate;else if(ae.is(r))t=r;else if(po.is(r))t=r.coordinate;else if(gn.is(r))t=r.coordinates[0];else return;return t}m();m();var Ta={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},Oi="ExteriorWalls",yo="Walls",o5=0,ml="InteriorDoors",gl="ExteriorDoors",et="GeometryLayer",yn="LabelsLayer",Li="MarkersLayer",Sp="FootprintLayer",yl="OcclusionLayer",a5="ImagesLayer",Ma="FacadesLayer";var s5=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],LD={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function eb(r){var t,e;(t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)&&O.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function tb(r,t){var n,o,a,c,l,p;let e=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||t.outdoorViewToken,i={...Ta,...r,outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!e:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(c=Ta.outdoorView)==null?void 0:c.layersHiddenByGeometry,...r==null?void 0:r.outdoorView},bearing:(p=(l=r==null?void 0:r.bearing)!=null?l:t.naturalBearing)!=null?p:0,imagePlacementOptions:{...Ta.imagePlacementOptions,...r==null?void 0:r.imagePlacementOptions},multiFloorView:{...Ta.multiFloorView,...r==null?void 0:r.multiFloorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}function l5(r){let t={remove_watermark:!1};if(r)try{let e=ah(r);Object.assign(t,e.capabilities)}catch(e){O.error("Error decoding capabilities from token",e)}return t}var bo,Dr,bn,Tp=class Tp extends Tt{constructor(e,i){let n=Object.values(i.mvfDataByFloorId)[0];super(e,n);u(this,"__type",Tp.__type);S(this,bo);S(this,Dr);S(this,bn);I(this,Dr,{}),I(this,bo,e),I(this,bn,i.mvfDataByFloorId)}static is(e){return e.__type===Tp.__type}get accessible(){var e;return(e=Object.values(s(this,bn))[0].properties.accessible)!=null?e:!1}get type(){var e,i;return(i=(e=Object.values(s(this,bn))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get extra(){return Object.values(s(this,bn))[0].properties.extra}get coordinates(){return s(this,Dr).coordinates==null&&(s(this,Dr).coordinates=Object.entries(s(this,bn)).map(([e,i])=>new ae(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),s(this,Dr).coordinates}get nodes(){return Object.values(s(this,bn))[0].properties.nodes.map(e=>s(this,bo).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?s(this,bo).getById("floor",e.floorId):void 0).filter(Nc)}get locationProfiles(){var i,n,o,a,c;if(s(this,Dr).locationProfiles!=null)return s(this,Dr).locationProfiles;let e=super.locationProfiles;if(e==null||e.length===0){let l=[(n=(i=this.coordinates[0])==null?void 0:i.longitude)!=null?n:0,(a=(o=this.coordinates[0])==null?void 0:o.latitude)!=null?a:0],p=Di(l),d=(c=s(this,bo).mvfConnectionIdsByLatLon[p])!=null?c:[];for(let f of d){let g=s(this,bo).locationProfilesByAttachedFeatureId[f];if(g!=null){e=g;break}}}return s(this,Dr).locationProfiles=e!=null?e:[],e}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id),extra:this.extra}}destroy(){for(let e of Object.keys(s(this,Dr)))delete s(this,Dr)[e]}};bo=new WeakMap,Dr=new WeakMap,bn=new WeakMap,u(Tp,"__type","connection");var rb=Tp,Ia=rb;m();var Ip,Pa,vo,wa,Mp=class Mp extends Tt{constructor(e,i){super(e,i.mvfData);u(this,"__type",Mp.__type);S(this,Ip);S(this,Pa);S(this,vo,{});S(this,wa);I(this,Ip,e),I(this,Pa,i.floorId),I(this,wa,i.mvfData)}static is(e){return e.__type===Mp.__type}get type(){let e=s(this,wa).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=s(this,Ip).getById("floor",s(this,Pa));if(e==null)throw new Error("Floor ".concat(s(this,Pa)," not found!"));return e}get center(){var e;if(s(this,vo).center==null){let[i,n]=(e=s(this,wa).properties.center)!=null?e:[0,0];s(this,vo).center=new ae(n,i,s(this,Pa))}return s(this,vo).center}get geoJSON(){return{...s(this,wa),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(s(this,vo)))s(this,vo)[e]=null}};Ip=new WeakMap,Pa=new WeakMap,vo=new WeakMap,wa=new WeakMap,u(Mp,"__type","object");var ib=Mp,gr=ib;m();var wp,Da,xo,bl,Pp=class Pp extends Tt{constructor(e,i){super(e,i.mvfData);u(this,"__type",Pp.__type);S(this,wp);S(this,Da);S(this,xo,{});S(this,bl);I(this,wp,e),I(this,bl,i.mvfData),I(this,Da,i.floorId)}static is(e){return e.__type===Pp.__type}get floor(){let e=s(this,wp).getById("floor",s(this,Da));if(e==null)throw new Error("Floor ".concat(s(this,Da)," not found!"));return e}get coordinate(){var e;if(s(this,xo).coordinate==null){let[i,n]=(e=s(this,bl).geometry.coordinates)!=null?e:[0,0];s(this,xo).coordinate=new ae(n,i,s(this,Da))}return s(this,xo).coordinate}get geoJSON(){return{...s(this,bl),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in s(this,xo))s(this,xo)[e]=null}};wp=new WeakMap,Da=new WeakMap,xo=new WeakMap,bl=new WeakMap,u(Pp,"__type","point-of-interest");var nb=Pp,mo=nb;m();var Ep,Ea,Co,_a,_p,ab,Dp=class Dp extends Tt{constructor(e,i){super(e,i.mvfData);S(this,_p);u(this,"__type",Dp.__type);S(this,Ep);S(this,Ea);S(this,Co,{});S(this,_a);I(this,Ep,e),I(this,Ea,i.floorId),I(this,_a,i.mvfData)}static is(e){return e.__type===Dp.__type}get group(){return N(this,_p,ab).call(this).group}get type(){return N(this,_p,ab).call(this).type}get coordinate(){if(s(this,Co).coordinate==null){let[e,i]=s(this,_a).geometry.coordinates;s(this,Co).coordinate=new ae(i,e,s(this,Ea))}return s(this,Co).coordinate}get floor(){let e=s(this,Ep).getById("floor",s(this,Ea));if(e==null)throw new Error("Floor ".concat(s(this,Ea)," not found!"));return e}get geoJSON(){return{...s(this,_a),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(s(this,Co)))delete s(this,Co)[e]}};Ep=new WeakMap,Ea=new WeakMap,Co=new WeakMap,_a=new WeakMap,_p=new WeakSet,ab=function(){let[e,i]=s(this,_a).properties.symbolId.split("--");return{group:e,type:i}},u(Dp,"__type","annotation");var ob=Dp,go=ob;m();var So,Er,$r,vl,Lp,lb,Op=class Op extends Xr{constructor(e,i){super(i.mvfData.id,e);S(this,Lp);u(this,"__type",Op.__type);S(this,So);S(this,Er,{});S(this,$r);S(this,vl);I(this,So,e),I(this,$r,i.mvfData),I(this,vl,i.facadeId)}static is(e){return e.__type===Op.__type}get type(){return s(this,$r).type}get name(){var e;return(e=N(this,Lp,lb).call(this,"name"))!=null?e:""}get shortName(){var e;return(e=N(this,Lp,lb).call(this,"shortName"))!=null?e:""}get externalId(){var e;return(e=s(this,$r).externalId)!=null?e:""}get floors(){var e,i;if(s(this,Er).floors==null){let n=((i=(e=s(this,$r).floors)!=null?e:s(this,$r).maps)!=null?i:[]).reduce((o,a)=>{let c=s(this,So).floorsById[a];return c&&o.push(c),o},[]);n.length===0&&O.error("Floor stack ".concat(this.id," has no floors")),s(this,Er).floors=n}return s(this,Er).floors}get defaultFloor(){if(s(this,Er).defaultFloor!=null)return s(this,Er).defaultFloor;let e=s(this,$r).defaultFloor?s(this,So).getById("floor",s(this,$r).defaultFloor):void 0;return s(this,Er).defaultFloor=e||this.floors.reduce((i,n)=>Math.abs(n.elevation)<Math.abs(i.elevation)?n:i),s(this,Er).defaultFloor}get facade(){return s(this,vl)?s(this,So).facadesById[s(this,vl)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,Er)))delete s(this,Er)[e]}};So=new WeakMap,Er=new WeakMap,$r=new WeakMap,vl=new WeakMap,Lp=new WeakSet,lb=function(e){return s(this,So).getPropTranslation(this.__type,e,this.id,s(this,$r)[e])},u(Op,"__type","floor-stack");var sb=Op,Tf=sb;m();var xl,Oa,Ap,ki,kp=class kp extends Xr{constructor(e,i){super(i.mvfData.id,e);u(this,"__type",kp.__type);S(this,xl);S(this,Oa);S(this,Ap);S(this,ki,{});I(this,xl,i.mvfData),I(this,Oa,e),I(this,Ap,i.floorStackId)}static is(e){return e.__type===kp.__type}get floorStack(){return s(this,Oa).getById("floor-stack",s(this,Ap))}get spaces(){if(!s(this,ki).spaces){s(this,ki).spaces=[];for(let e of s(this,xl).spaces){let i=s(this,Oa).getById("space",e.spaceId);i&&s(this,ki).spaces.push(i)}}return s(this,ki).spaces}get center(){if(!s(this,ki).center){let e={type:"FeatureCollection",features:[]};for(let n of this.spaces){let o=s(this,Oa).mvfSpacesById[n.id];o&&e.features.push(o)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=xh(e);s(this,ki).center=new ae(i.geometry.coordinates[1],i.geometry.coordinates[0],s(this,xl).spaces[0].floorId)}return s(this,ki).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};xl=new WeakMap,Oa=new WeakMap,Ap=new WeakMap,ki=new WeakMap,u(kp,"__type","facade");var cb=kp,qr=cb;m();var kD=(r,t)=>{var l,p,d,f,g,y,v,x,b,C,M;let e={},i={},n={},o={},a={},c={};for(let P of r["location.json"]||[]){let w=new Cl(t,{mvfData:P});if(e[P.id]=w,P.externalId&&(o[P.externalId]==null&&(o[P.externalId]=[]),o[P.externalId].push(w)),P.categories)for(let B of P.categories)a[B]==null&&(a[B]=[]),a[B].push(w);let D=[...(p=(l=P.obstructions)==null?void 0:l.map(B=>B.id))!=null?p:[],...(f=(d=P.spaces)==null?void 0:d.map(B=>B.id))!=null?f:[],...(y=(g=P.annotations)==null?void 0:g.map(B=>B.id))!=null?y:[],...(v=P.connections)!=null?v:[],...(b=(x=P.entrances)==null?void 0:x.map(B=>B.id))!=null?b:[],...(M=(C=P.areas)==null?void 0:C.map(B=>B.id))!=null?M:[]];for(let B of D)B&&(c[B]==null&&(c[B]=[]),c[B].push(w))}for(let P of r["category.json"]||[]){let w=new If(t,{mvfData:P});i[P.id]=w,P.parent&&(n[P.parent]==null&&(n[P.parent]=[]),n[P.parent].push(w))}return{locationCategoriesByParentId:n,locationProfilesById:e,locationCategoriesById:i,locationProfilesByExternalId:o,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:c}},AD=(r,t,e)=>{var b,C;let i={},n={},o={},a={},c={},l={},p={},d={},f={},g={},y={},v={},x=globalThis.Object.keys(r.space);for(let M of x){let P=r.space[M];if(P!=null)for(let w of P.features){v[w.properties.id]=M,p[w.properties.id]=w;for(let D of w.properties.destinationNodes)c[D]==null&&(c[D]=[]),c[D].push(w.properties.id);if(w.properties.kind==="desk-entrance"&&(l[w.properties.externalId]==null&&(l[w.properties.externalId]=[]),l[w.properties.externalId].push(...w.properties.destinationNodes)),!["void","desk-entrance"].includes((b=w.properties.kind)!=null?b:"")){if((C=w.properties.kind)!=null&&C.includes("connection")){let D=Di(w.geometry.coordinates);g[D]==null&&(g[D]=[]),g[D].push(w.properties.id);continue}if(w.properties.kind==="poi"){let D=new mo(e,{floorId:M,mvfData:w});o[w.properties.id]=D,f[M]||(f[M]=[]),f[M].push(w),w.properties.externalId&&(a[w.properties.externalId]==null&&(a[w.properties.externalId]=[]),a[w.properties.externalId].push(D))}else{let D=new vt(e,{floorId:M,mvfData:w});i[w.properties.id]=D,w.properties.externalId&&(n[w.properties.externalId]==null&&(n[w.properties.externalId]=[]),n[w.properties.externalId].push(D)),d[M]||(d[M]=[]),d[M].push(w)}}}}for(let M in g){let P=g[M],w={};for(let B of P){let _=v[B],A=p[B],F=t==null?void 0:t["n_"+A.properties.id.split("s_")[1]];w[_]={...A,properties:{...A.properties,accessible:(F==null?void 0:F.accessible)===!0}}}let D=new Ia(e,{mvfDataByFloorId:w});y[D.id]=D}return{spacesById:i,spacesByExternalId:n,poisById:o,poisByExternalId:a,connectionsById:y,spaceIdsByDestinationNodeId:c,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:p,connectionIdsByLatLon:g,mvfSpacesByFloorId:d,mvfPoisByFloorId:f}},FD=(r,t)=>{var a,c;let e={},i={},n={},o={};for(let l of r["node.geojson"].features){n[l.properties.id]=l;let p=new po(t,{mvfData:l,floorId:(a=l.properties.floor)!=null?a:l.properties.map});e[l.properties.id]=p,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(p));let d=(c=l.properties.floor)!=null?c:l.properties.map;o[d]||(o[d]=[]),o[d].push(l)}return{nodesById:e,nodesByExternalId:i,mvfNodesById:n,mvfNodesByFloorId:o}},BD=(r,t)=>{let e={},i={},n={},o={},a=globalThis.Object.keys(r.obstruction);for(let c of a){let l=r.obstruction[c];if(l!=null)for(let p of l.features){n[p.properties.id]=p;for(let f of p.properties.entrances)o[f]=p.properties.id;if(p.properties.kind==="Wall")continue;let d=new gr(t,{floorId:c,mvfData:p});e[p.properties.id]=d,p.properties.externalId&&(i[p.properties.externalId]==null&&(i[p.properties.externalId]=[]),i[p.properties.externalId].push(d))}}return{objectsById:e,objectsByExternalId:i,mvfObstructionById:n,obstructionIdByEntranceId:o}},RD=(r,t)=>{let e={},i={},n={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let o of r["floor.geojson"].features){n[o.properties.id]=o.properties;let a=new mr(t,{mvfData:o});e[o.properties.id]=a,o.properties.externalId&&(i[o.properties.externalId]==null&&(i[o.properties.externalId]=[]),i[o.properties.externalId].push(a))}else for(let o of r["map.geojson"]){n[o.id]=o;let a=new mr(t,{mvfData:{properties:o}});e[o.id]=a}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:n}},ND=(r,t)=>{var l;let e={},i={},n={},o={},a={},c=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(c!=null)for(let p of c){let d=(l=r.facade)==null?void 0:l[p.id],f=new Tf(t,{mvfData:p,facadeId:d==null?void 0:d.id});if(e[p.id]=f,p.externalId&&(i[p.externalId]==null&&(i[p.externalId]=[]),i[p.externalId].push(f)),n[p.id]=p,d){let g=new qr(t,{mvfData:d,floorStackId:p.id});o[d.id]=g;for(let y of d.spaces)a[y.spaceId]=g}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:n,facadesById:o,facadesBySpaceId:a}},GD=(r,t)=>{let e={},i={},n=r["connection.json"].reduce((o,a)=>{a.nodes.forEach(l=>o[l]=a),e[a.id]=a;let c=t==null?void 0:t[a.nodes[0]];if(c!=null){let l=Di(c.geometry.coordinates);i[l]==null&&(i[l]=[]),i[l].push(a.id)}return o},{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:n,mvfConnectionIdsByLatLon:i}},VD=(r,t)=>{let e={},i={},n={},o={},a={},c=globalThis.Object.keys(r.entrance);for(let l of c){let p=r.entrance[l];if(p!=null)for(let d of p.features){o[d.properties.id]=d;let f=new Ei(t,{floorId:l,mvfData:d});d.properties.node&&(n[d.properties.node]=f),e[d.properties.id]=f,d.properties.externalId&&(i[d.properties.externalId]==null&&(i[d.properties.externalId]=[]),i[d.properties.externalId].push(f)),a[l]||(a[l]=[]),a[l].push(d)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:n,mvfEntrancesById:o,mvfEntrancesByFloorId:a}},jD=(r,t,e)=>{var i;if(r.textAreas!=null)for(let n in r.textAreas){let o=(i=r.textAreas[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let c=a==null?void 0:a.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let p=l.properties;p.textArea=c,p.textArea&&(p.textArea.position=a.geometry.coordinates)}}}}},UD=(r,t,e)=>{var i;if(r.floorImages!=null)for(let n in r.floorImages){let o=(i=r.floorImages[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let c=a==null?void 0:a.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let p=l.properties;p.image=c,p.image&&(p.image.position=a.geometry.coordinates)}}}}},HD=(r,t)=>{var i,n;if(((i=r.enterprise)==null?void 0:i.enterpriseStyles)==null)return;let e=(n=r.enterprise)==null?void 0:n.enterpriseStyles;for(let o in e){let a=e[o];a.geometryAnchors.forEach(c=>{let l=t[c.geometryId];if(l!=null){let p=l.properties;p.style={styleId:o,edgeOffset:a.edgeOffset}}})}},WD=(r,t,e)=>{if(!(r.enterprise==null||r.enterprise.textures==null))for(let i of r.enterprise.textures)for(let n of i.geometryAnchors){let o=t[n.geometryId]||e[n.geometryId];if(o!=null){let a=o.properties;a.textures==null&&(a.textures=[]),a.textures.push(i)}}},zD=(r,t)=>{let e={},i={},n={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n};let o=globalThis.Object.keys(r.annotation);for(let a of o){let c=r.annotation[a];if(c!=null)for(let l of c.features){i[l.properties.id]=l;let p=new go(t,{floorId:a,mvfData:l});e[l.properties.id]=p,n[a]||(n[a]=[]),n[a].push(l)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n}},ZD=(r,t)=>{let e={},i={},n={};if(r.area==null)return{areasById:e,areasByExternalId:i,mvfAreasById:n};let o=globalThis.Object.keys(r.area);for(let a of o){let c=r.area[a];if(c!=null)for(let l of c.features){n[l.properties.id]=l;let p=new ho(t,{floorId:a,mvfData:l});e[l.properties.id]=p,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(p))}}return{areasById:e,areasByExternalId:i,mvfAreasById:n}},c5=(r,t)=>{var C,M,P,w,D,B,_,A,F,G,R,z,W;let e={},i={},n={},o={},a=((M=(C=r.enterprise)==null?void 0:C.locations)!=null?M:[]).reduce((j,ee)=>(j[ee.id]=ee,j),{}),c={},l={},p={},d={},f={},g={},y=((P=r.enterprise)==null?void 0:P.venue)||{},v={},x={};for(let j of(D=(w=r.enterprise)==null?void 0:w.categories)!=null?D:[]){let ee=new Mf(t,{mvfData:j});c[j.id]=ee,j.externalId&&(l[j.externalId]==null&&(l[j.externalId]=[]),l[j.externalId].push(ee)),p[j.id]=j,j.locations.forEach(Z=>{f[Z]==null&&(f[Z]=[]),f[Z].push(j.id)})}let b={};for(let j of(_=(B=r.enterprise)==null?void 0:B.locationInstances)!=null?_:[]){let ee=a[j.parent],Z=Object.keys(ee),xe={};for(let Ie of Z)xe[Ie]=void 0;let fe={...xe,polygons:[],nodes:[],...j};b[fe.parent]==null&&(b[fe.parent]=[]),b[fe.parent].push(new gn(t,{mvfData:fe,categoryIds:((F=(A=r.enterprise)==null?void 0:A.categoryPriorities)==null?void 0:F[fe.id])||f[fe.id],parentId:j.parent})),v[fe.id]=j}for(let j in r.space){let ee=r.space[j];if(ee!=null)for(let Z of ee.features)for(let xe of Z.properties.destinationNodes)x[xe]==null&&(x[xe]=[]),x[xe].push(Z.properties.id)}for(let j of(R=(G=r.enterprise)==null?void 0:G.locations)!=null?R:[]){let ee=new gn(t,{mvfData:j,categoryIds:((W=(z=r.enterprise)==null?void 0:z.categoryPriorities)==null?void 0:W[j.id])||f[j.id],locationInstances:b[j.id]});n[j.id]=ee,j.externalId&&(o[j.externalId]==null&&(o[j.externalId]=[]),o[j.externalId].push(ee)),j.nodes.forEach(Z=>{g[Z.id]==null&&(g[Z.id]=[]),g[Z.id].push(j.id)});for(let Z of j.polygons)d[Z.id]==null&&(d[Z.id]=[]),d[Z.id].push(j)}if(t.enterpriseMode===!0){for(let j in t.mvfConnectionsById){let ee={},Z=t.mvfConnectionsById[j];for(let xe of t.mvfConnectionsById[j].nodes){let fe=t.nodesById[xe];fe!=null&&(ee[fe.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[fe.coordinate.longitude,fe.coordinate.latitude]},properties:{id:j,externalId:Z.externalId,kind:"enterprise."+Z.type,destinationNodes:[],flags:"",type:Z.type,nodes:Z.nodes,accessible:Z.accessible,extra:Z.extra,details:Z.details}})}Object.keys(ee).length>0&&(e[j]=new Ia(t,{mvfDataByFloorId:ee}),Z.externalId&&(i[Z.externalId]==null&&(i[Z.externalId]=[]),i[Z.externalId].push(e[j])))}t.connectionsById=e}return{spaceIdsByNodeId:x,connectionsByExternalId:i,locationIdsByNodeId:g,mvfLocationsBySpaceId:d,mvfLocationsById:a,mvfCategoriesById:p,locationsById:n,locationsByExternalId:o,locationInstancesById:v,categoriesById:c,categoriesByExternalId:l,venue:y}},p5=(r,t)=>{let{nodesById:e,nodesByExternalId:i,mvfNodesById:n,mvfNodesByFloorId:o}=FD(r,t),{mvfConnectionsById:a,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:l}=GD(r,n),{spacesById:p,spacesByExternalId:d,spaceIdsByDestinationNodeId:f,poisById:g,poisByExternalId:y,mvfSpacesById:v,objectEntranceNodeIdsByObstructionId:x,connectionsById:b,connectionIdsByLatLon:C,mvfSpacesByFloorId:M,mvfPoisByFloorId:P}=AD(r,c,t),{objectsById:w,objectsByExternalId:D,mvfObstructionById:B,obstructionIdByEntranceId:_}=BD(r,t),{floorsById:A,floorsByExternalId:F,mvfFloorsById:G}=RD(r,t),{floorStacksById:R,floorStacksByExternalId:z,mvfFloorStacksById:W,facadesById:j,facadesBySpaceId:ee}=ND(r,t),{doorsById:Z,doorsByExternalId:xe,doorsByNodeId:fe,mvfEntrancesById:Ie,mvfEntrancesByFloorId:_e}=VD(r,t),{annotationsById:cr,mvfAnnotationsById:_t,mvfAnnotationsByFloorId:at}=zD(r,t),{areasById:Qe,areasByExternalId:pr,mvfAreasById:Rr}=ZD(r,t);UD(r,v,B),jD(r,v,B),HD(r,v),WD(r,v,B);let{locationCategoriesByParentId:me,locationProfilesById:be,locationCategoriesById:qe,locationProfilesByExternalId:gt,locationProfilesByCategoryId:st,locationProfilesByAttachedFeatureId:en}=kD(r,t);return{spacesById:p,spacesByExternalId:d,nodesById:e,nodesByExternalId:i,objectsById:w,objectsByExternalId:D,floorsById:A,floorsByExternalId:F,floorStacksById:R,floorStacksByExternalId:z,facadesById:j,facadesBySpaceId:ee,connectionsById:b,doorsById:Z,doorsByExternalId:xe,doorsByNodeId:fe,poisById:g,poisByExternalId:y,annotationsById:cr,areasById:Qe,areasByExternalId:pr,spaceIdsByDestinationNodeId:f,objectEntranceNodeIdsByObstructionId:x,obstructionIdByEntranceId:_,connectionIdsByLatLon:C,locationProfilesById:be,locationCategoriesById:qe,locationProfilesByExternalId:gt,locationProfilesByCategoryId:st,locationCategoriesByParentId:me,mvfSpacesById:v,mvfNodesById:n,mvfObstructionById:B,mvfFloorsById:G,mvfFloorStacksById:W,mvfConnectionsById:a,mvfConnectionsByNodeId:c,mvfEntrancesById:Ie,mvfAnnotationsById:_t,mvfNodesByFloorId:o,mvfSpacesByFloorId:M,mvfPoisByFloorId:P,mvfAreasById:Rr,mvfEntrancesByFloorId:_e,mvfAnnotationsByFloorId:at,locationProfilesByAttachedFeatureId:en,mvfConnectionIdsByLatLon:l}};m();var XD=new Set(["polygons"]),Jr,Ue,er,Bp,Fp=class Fp extends ut{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",Fp.__type);u(this,"description");u(this,"name","");u(this,"amenity");u(this,"externalId","");u(this,"extra");u(this,"gallery");u(this,"instances");u(this,"logo");u(this,"operationHours");u(this,"phone");u(this,"picture");u(this,"shortName");u(this,"showFloatingLabelWhenImagePresent");u(this,"showLogo");u(this,"siblingGroups");u(this,"social");u(this,"sortOrder",-1);u(this,"states");u(this,"tags");u(this,"type","");S(this,Jr);S(this,Ue,{});S(this,er);S(this,Bp);I(this,Jr,e),I(this,er,i.mvfData),I(this,Bp,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let n in i.mvfData)!XD.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(i.parentId){let o=s(this,Jr).locationsById[i.parentId];return s(this,er)[n]!=null?s(this,Jr).getPropTranslation(this.__type,n,s(this,er).id,s(this,er)[n]):s(this,Jr).getPropTranslation(this.__type,n,s(this,er).id,o[n])}return s(this,Jr).getPropTranslation(this.__type,n,s(this,er).id,s(this,er)[n])}})}static is(e){return e.__type===Fp.__type}get focusTarget(){return this.spaces}get categories(){return s(this,Ue).categories?s(this,Ue).categories:(s(this,Ue).categories=(s(this,Bp).map(e=>s(this,Jr).getById("enterprise-category",e))||[]).filter(Boolean),s(this,Ue).categories)}get coordinates(){if(s(this,Ue).coordinates)return s(this,Ue).coordinates;s(this,Ue).coordinates=[];for(let e=0;e<this.nodes.length;e++)s(this,Ue).coordinates.push(this.nodes[e].coordinate);return s(this,Ue).coordinates}get nodes(){if(s(this,Ue).nodes)return s(this,Ue).nodes;s(this,Ue).nodes=[];for(let e=0;e<s(this,er).nodes.length;e++){let i=s(this,Jr).getById("node",s(this,er).nodes[e].id);i&&s(this,Ue).nodes.push(i)}return s(this,Ue).nodes}get spaces(){if(s(this,Ue).spaces)return s(this,Ue).spaces;s(this,Ue).spaces=[];for(let e=0;e<s(this,er).polygons.length;e++){let i=s(this,Jr).getById("space",s(this,er).polygons[e].id);i&&s(this,Ue).spaces.push(i)}return s(this,Ue).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Ue)))delete s(this,Ue)[e]}};Jr=new WeakMap,Ue=new WeakMap,er=new WeakMap,Bp=new WeakMap,u(Fp,"__type","enterprise-location");var pb=Fp,gn=pb;m();var YD=new Set,La,Ut,Ai,Rp=class Rp extends ut{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",Rp.__type);u(this,"name","");u(this,"color");u(this,"externalId","");u(this,"extra");u(this,"icon");u(this,"iconFromDefaultList");u(this,"sortOrder",-1);u(this,"picture");S(this,La);S(this,Ut,{});S(this,Ai);I(this,La,e),I(this,Ai,i.mvfData);for(let n in i.mvfData)!YD.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,La).getPropTranslation(this.__type,n,s(this,Ai).id,s(this,Ai)[n])}})}static is(e){return e.__type===Rp.__type}get children(){if(s(this,Ut).children)return s(this,Ut).children;s(this,Ut).children=[];for(let e=0;e<s(this,Ai).children.length;e++){let i=s(this,La).getById("enterprise-category",s(this,Ai).children[e]);i&&s(this,Ut).children.push(i)}return s(this,Ut).children}get locations(){if(s(this,Ut).locations)return s(this,Ut).locations;s(this,Ut).locations=[];for(let e=0;e<s(this,Ai).locations.length;e++){let i=s(this,La).getById("enterprise-location",s(this,Ai).locations[e]);i&&s(this,Ut).locations.push(i)}return s(this,Ut).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Ut)))delete s(this,Ut)[e]}};La=new WeakMap,Ut=new WeakMap,Ai=new WeakMap,u(Rp,"__type","enterprise-category");var ub=Rp,Mf=ub;m();var qD=new Set,Gp,Vp,Np=class Np extends ut{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",Np.__type);u(this,"countrycode");u(this,"externalId","");u(this,"defaultLanguage",{code:"en",name:"English"});u(this,"defaultMap");u(this,"extra");u(this,"icon");u(this,"languages",[]);u(this,"links",[]);u(this,"logo");u(this,"mappedinWebUrl");u(this,"slug","");u(this,"topLocations");u(this,"tzid");S(this,Gp,{});S(this,Vp);I(this,Vp,i.mvfData);for(let n in i.mvfData)!qD.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(e){return e.__type===Np.__type}get name(){var e;return(e=s(this,Vp).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Gp)))delete s(this,Gp)[e]}};Gp=new WeakMap,Vp=new WeakMap,u(Np,"__type","enterprise-venue");var db=Np,hb=db;m();function fb(r){var n,o,a,c,l,p;let t=((o=(n=r.enterprise)==null?void 0:n.locations)==null?void 0:o.reduce((d,f)=>(d[f.id]=f,d),{}))||{};for(let d of((a=r.enterprise)==null?void 0:a.locationInstances)||[])t[d.id]=d;let e={};for(let d of r["floorstack.json"]||[])e[d.id]=d;let i={};for(let d of((c=r["floor.geojson"])==null?void 0:c.features)||[])d.properties&&d.properties.id&&(i[d.properties.id]=d.properties);return{type:"downloaded",data:r,optimized:{"enterprise-location":t,"enterprise-category":((p=(l=r.enterprise)==null?void 0:l.categories)==null?void 0:p.reduce((d,f)=>(d[f.id]=f,d),{}))||{},"floor-stack":e,floor:i}}}function u5(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}function d5(r){let t=r.split("?")[1];return!!(t!=null&&t.includes("sv="))}m();m();m();m();m();m();m();var ka=class{constructor({origin:t,destination:e,distance:i=0,angle:n=0,pathWeight:o=0,multiplicativeDistanceWeightScaling:a=!0}){u(this,"origin");u(this,"destination");u(this,"distance");u(this,"angle");u(this,"weight");if(this.origin=t,this.destination=e,this.distance=i,this.angle=n,this.weight=o||0,a?t.properties.floor===e.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===e.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};m();m();m();function vn(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=Mr(r),n=Ks(t),o=n.type,a=t.bbox,c=n.coordinates;if(a&&$D(i,a)===!1)return!1;o==="Polygon"&&(c=[c]);for(var l=!1,p=0;p<c.length&&!l;p++)if(h5(i,c[p][0],e.ignoreBoundary)){for(var d=!1,f=1;f<c[p].length&&!d;)h5(i,c[p][f],!e.ignoreBoundary)&&(d=!0),f++;d||(l=!0)}return l}function h5(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,o=t.length-1;n<t.length;o=n++){var a=t[n][0],c=t[n][1],l=t[o][0],p=t[o][1],d=r[1]*(a-l)+c*(l-r[0])+p*(r[0]-a)===0&&(a-r[0])*(l-r[0])<=0&&(c-r[1])*(p-r[1])<=0;if(d)return!e;var f=c>r[1]!=p>r[1]&&r[0]<(l-a)*(r[1]-c)/(p-c)+a;f&&(i=!i)}return i}function $D(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}m();m();function xn([r,t],[e,i]){let n=t-i,o=r-e;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}m();var JD=63710088e-1;function Kr(r,t){let[e,i]=r.map(d=>d*Math.PI/180),[n,o]=t.map(d=>d*Math.PI/180),a=o-i,c=n-e,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return JD*p}m();m();function Pf(r,t,e,i){let[n,o]=r,[a,c]=t,[l,p]=e,[d,f]=i;if(o===c&&n===a||p===f&&l===d)return null;let g=(d-l)*(c-o)-(f-p)*(a-n);if(g===0)return null;let y=((f-p)*(n-l)-(d-l)*(o-p))/g,v=((c-o)*(n-l)-(a-n)*(o-p))/g;if(y<0||y>1||v<0||v>1)return null;let x=o+y*(c-o);return[n+y*(a-n),x]}m();function mb(r,t,e,i){let n=pa(r,e/1e3,i),o=pa(t,e/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}m();function gb(r){let t=r*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}var f5=111e3;function m5(r,t,e=[],i=0){let n=!0,o=r.geometry.coordinates,a=t.geometry.coordinates,c=gb(xn(o,a)-Math.PI/2),l=gb(xn(o,a)+Math.PI/2),p=i/f5,d=i/(f5*Math.cos(o[1]*Math.PI/180)),f=Math.min(o[1],a[1])-p,g=Math.max(o[1],a[1])+p,y=Math.min(o[0],a[0])-d,v=Math.max(o[0],a[0])+d;for(let x of e)if(!(Math.max(x[0][1],x[1][1])<f||Math.min(x[0][1],x[1][1])>g||Math.max(x[0][0],x[1][0])<y||Math.min(x[0][0],x[1][0])>v)){if(i>0){let b=mb(o,a,i,c),C=mb(o,a,i,l);if(Pf(b[0],b[1],x[0],x[1])||Pf(C[0],C[1],x[0],x[1])){n=!1;return}}else if(Pf(o,a,x[0],x[1])){n=!1;return}}return n}var Aa,Mt,yb,g5,y5,b5,v5,x5,C5,Df,wf=class{constructor({nodes:t,groupBy:e,multiplicativeDistanceWeightScaling:i}){S(this,Mt);u(this,"edges",{});u(this,"nodesById");u(this,"nodesByGroup",new Map);S(this,Aa);S(this,Df,(t,e)=>{let i=0;for(let n of e)(!n[s(this,Aa)]||n[s(this,Aa)]===t.properties[s(this,Aa)])&&vn(t.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i});I(this,Aa,e);let{features:n}=t;this.nodesById=N(this,Mt,g5).call(this,n),N(this,Mt,y5).call(this),N(this,Mt,b5).call(this,n,e,{multiplicativeDistanceWeightScaling:i})}getShortestEuclideanDistance(t,e){return e.reduce((i,n)=>{let o=Kr(t.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,disabledConnectionNodeIds:n,zones:o}){let a=N(this,Mt,yb).call(this,t),c=N(this,Mt,yb).call(this,e);if(a.length===0||c.length===0)return[];let{frontier:l,cameFrom:p,costSoFar:d}=N(this,Mt,v5).call(this,a,c);for(;l.length>0;){let f=l.shift();if(!f)break;if(N(this,Mt,x5).call(this,f.origin,c))return N(this,Mt,C5).call(this,p,f.origin.properties.id);for(let g of this.edges[f.origin.properties.id]){if(n!=null&&n.has(g.origin.properties.id)&&g.destination.properties.map!==g.origin.properties.map)continue;let y=d[f.origin.properties.id]+g.weight+s(this,Df).call(this,g.destination,o);if(!(y===1/0||i!=null&&i.has(g.destination.properties.id))&&(d[g.destination.properties.id]==null||y<d[g.destination.properties.id])){let v=y+this.getShortestEuclideanDistance(g.destination,c);d[g.destination.properties.id]=y,p[g.destination.properties.id]=g,l.push({origin:g.destination,priority:v})}}l.sort((g,y)=>g.priority-y.priority)}return[]}};Aa=new WeakMap,Mt=new WeakSet,yb=function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},g5=function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},y5=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]))},b5=function(t,e,i){t.forEach(n=>{let o=e==="default"?e:n.properties[e];this.nodesByGroup.has(o)||this.nodesByGroup.set(o,[]),this.nodesByGroup.get(o).push(n),this.edges[n.properties.id]=n.properties.neighbors.map(({id:a,weight:c})=>{let l=this.nodesById[a],p=Kr(n.geometry.coordinates,l.geometry.coordinates),d=xn(n.geometry.coordinates,l.geometry.coordinates);return new ka({origin:n,destination:l,pathWeight:c,distance:p,angle:d,multiplicativeDistanceWeightScaling:i==null?void 0:i.multiplicativeDistanceWeightScaling})})})},v5=function(t,e){let i=[],n={},o={};return t.forEach(a=>{let c=this.getShortestEuclideanDistance(a,e);i.push({origin:a,priority:c}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,c)=>a.priority-c.priority),{frontier:i,cameFrom:n,costSoFar:o}},x5=function(t,e){return e.some(i=>i.properties.id===t.properties.id)},C5=function(t,e){let i=[],n=t[e];for(;n;)i.push(n),n=t[n.origin.properties.id];return i.reverse()},Df=new WeakMap;var KD=.4,Sl=class{constructor({nodes:t,geojsonCollection:e,groupBy:i="default",multiplicativeDistanceWeightScaling:n}){u(this,"groupBy");u(this,"graph");u(this,"geometryEdgesByMapId",new Map);u(this,"generatePath",t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<t.length;o++){let{origin:a,destination:c}=t[o],l={id:a.properties.id,angle:t[o].angle,distance:t[o].distance,destination:c.properties.id,edges:this.graph.edges[a.properties.id]};this.groupBy!=="default"&&(l.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:l})}let n={id:e.properties.id,edges:this.graph.edges[e.properties.id]};return this.groupBy!=="default"&&(n.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:n}),i});u(this,"getDistance",(t,e)=>Kr(t,e));u(this,"getAngle",(t,e)=>xn(t,e));this.groupBy=i,this.graph=new wf({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:n}),((e==null?void 0:e.features)||[]).forEach(a=>{let c=null;if(a.geometry.type==="LineString"?c=a.geometry.coordinates:a.geometry.type==="Polygon"&&(c=a.geometry.coordinates.flat()),c){let l=this.groupBy==="default"?this.groupBy:a.properties[this.groupBy];this.geometryEdgesByMapId.has(l)||this.geometryEdgesByMapId.set(l,[]),c.forEach((p,d)=>{this.geometryEdgesByMapId.get(l).push([p,c[d+1]||c[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:n,disabledConnectionNodeIds:o,simplify:a,multiplicativeDistanceWeightScaling:c}){var f,g;let l=(f=a==null?void 0:a.enabled)!=null?f:!0,p=t!=null?t:[],d=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:p,excludedNodeIds:new Set(n),disabledConnectionNodeIds:new Set(o)});return d.length===0?{type:"FeatureCollection",features:[]}:(l&&(d=this.simplifyAllSteps(d,(g=a==null?void 0:a.bufferRadius)!=null?g:KD,c)),this.generatePath(d))}simplifyAllSteps(t,e,i){var p,d;let n=[],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 g=t[f-1].origin.properties[this.groupBy],y=(p=this.geometryEdgesByMapId.get(g))!=null?p:[];n.push(...this.simplifySteps(o,y,e,i)),o=[t[f]]}else o.push(t[f]);let a=t[t.length-1],c=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],l=(d=this.geometryEdgesByMapId.get(c))!=null?d:[];return n.push(...this.simplifySteps(o,l,e,i)),n}simplifySteps(t,e,i,n){if(t.length<3)return t;let o=[t[0]],a=1;for(let c=a+2;c<t.length;c++)if(t[a].origin.properties.preventSmoothing||!m5(t[a].origin,t[c].origin,e,i)){let l=c-1;o.push(new ka({...t[a],destination:t[l].origin,distance:Kr(t[a].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:xn(t[a].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),a=l}return o.push(new ka({...t[a],destination:t[t.length-1].origin,distance:Kr(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:xn(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:n}),t[t.length-1]),o}};m();function _r(r){return r.verticalOffset===0?[r.longitude,r.latitude]:[r.longitude,r.latitude,r.verticalOffset]}function QD(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}var bb=(r,t)=>{let e=QD(t),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of r){let o=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((c,l)=>(e.has(l)&&c.push(e.get(l)),c),[]);if(a.length){let{entrances:c,obstructions:l}=U1(n,a);o=l.map(p=>p.geometry.coordinates),i.entrances.features.push(...c)}i.walls.geometry.coordinates.push(...o)}return i};function S5(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}function T5(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}function Ef(r,t){var i,n;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function vb(r,t){var i,n;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function M5(r,t){var i,n;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity),r.flipImageToFaceCamera!==void 0&&(e.flipImageToFaceCamera=r.flipImageToFaceCamera)),e}function I5(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function P5(r,t){let e="Left";return r<=-Math.PI/4?e="Right":r<=-t?e="SlightRight":r<=t?e="Straight":r<=Math.PI/4?e="SlightLeft":e="Left",e}function w5(r){let t={};for(let e in r){let i=r[e];if(i!=null){if(i.id=e,"polygons"in i)for(let n of i.polygons)t[n]=i;else if("lineStrings"in i)for(let n of i.lineStrings)t[n]=i;else if("points"in i)for(let n of i.points)t[n]=i}}return t}function _f(r,t){return r.reduce((e,i)=>{let n=t[i.properties.id];if(n==null)return e;if("textures"in i.properties&&Array.isArray(i.properties.textures)&&i.properties.textures.length>0){let o={...n,id:n.id+"-textures"};e.set(o,[i])}else e.has(n)||e.set(n,[]),e.get(n).push(i);return e},new Map)}function Tl(r,t={}){var n,o,a,c,l,p,d;let e={...r,flipImageToFaceCamera:(n=t==null?void 0:t.flipImagesToFaceCamera)!=null?n:!0},i=(a=(o=t==null?void 0:t.style)==null?void 0:o.shading)!=null?a:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(l=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let f=(d=(p=t==null?void 0:t.style)==null?void 0:p.wallTopColor)!=null?d:t==null?void 0:t.wallTopColor;f!=null&&(e.topColor=f)}return e}var D5=(r,t)=>{var n;let i=((n=t.currentMap)==null?void 0:n.currentFloor).layers.get(et);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(yo);case"exterior-walls":return i==null?void 0:i.layers.get(Oi);case"interior-doors":return i==null?void 0:i.layers.get(ml);case"exterior-doors":return i==null?void 0:i.layers.get(gl);default:return typeof r=="string"?r:r.id}};function xb(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}function Of(r){return r.bbox?r.bbox:js(r)}function E5(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1]),Math.max(r[2],t[2]),Math.max(r[3],t[3])]}function _5(r){return[...new Set(r)]}function Cb(r,t,e){return r.floorId&&t.has(r.floorId)?t.get(r.floorId):e}function Ml(r){if(vt.is(r)||gr.is(r))return r.id}function O5(r,t,e){var o,a,c,l,p,d;let i=r.coordinates.length===2,n=!0;if(i&&r.coordinates[0].floorId!=null&&r.coordinates[1].floorId!=null){let f=t==null?void 0:t.getById("floor",r.coordinates[0].floorId),g=t==null?void 0:t.getById("floor",r.coordinates[1].floorId);f&&g&&(n=((a=(o=e.getState(f))==null?void 0:o.visible)!=null?a:!0)&&((l=(c=e.getState(g))==null?void 0:c.visible)!=null?l:!0))}else{let f=r.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",r.coordinates[0].floorId):void 0;n=f&&(d=(p=e.getState(f))==null?void 0:p.visible)!=null?d:!0}return n}var L5=Math.PI*.1,tt,Ft,Ht,Fa,Ba,Cn,Ra,Pl,Or,k5,Il,A5,Af=class{constructor(t,e,i,n){S(this,Or);S(this,tt,{});S(this,Ft);S(this,Ht);S(this,Fa);S(this,Ba);S(this,Cn);S(this,Ra);S(this,Pl);I(this,Ft,e),I(this,Ht,t.features),I(this,Fa,i),I(this,Ba,n)}get path(){return s(this,Ht).map(t=>s(this,Ft).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(s(this,tt).departure)return s(this,tt).departure;let t=s(this,Ht)[0].properties.id,e=s(this,Fa)[0];if(s(this,Fa).length>1){for(let i of s(this,Fa))if(jp(i,s(this,Ft)).includes(t)){e=i;break}}return s(this,tt).departure=e,e}get destination(){if(s(this,tt).destination)return s(this,tt).destination;let t=s(this,Ht)[s(this,Ht).length-1].properties.id,e=s(this,Ba)[0];if(s(this,Ba).length>1){for(let i of s(this,Ba))if(jp(i,s(this,Ft)).includes(t)){e=i;break}}return s(this,tt).destination=e,e}get coordinates(){return s(this,tt).coordinates?s(this,tt).coordinates:(s(this,tt).coordinates=s(this,Ht).map(t=>new ae(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),s(this,tt).coordinates)}get distance(){return s(this,tt).distance?s(this,tt).distance:(s(this,tt).distance=s(this,Ht).reduce((t,e)=>t+(e.properties.distance||0),0),s(this,tt).distance)}get instructions(){if(s(this,Ht).length<2)return[];if(s(this,tt).instructions)return s(this,tt).instructions;let t=[],e=0;for(let i=0;i<s(this,Ht).length;i++){let n=s(this,Ht)[i],o=s(this,Ht)[i-1],a=s(this,Ht)[i+1],c=new ae(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),l=N(this,Or,k5).call(this,{prevDirection:o,direction:n,nextDirection:a});e+=(o==null?void 0:o.properties.distance)||0;for(let p of l)p&&(t.push({action:p,distance:e,coordinate:c,node:s(this,Ft).getById("node",n.properties.id)}),e=0)}return s(this,tt).instructions=t,s(this,tt).instructions}};tt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,Fa=new WeakMap,Ba=new WeakMap,Cn=new WeakMap,Ra=new WeakMap,Pl=new WeakMap,Or=new WeakSet,k5=function(t){var v,x;let{prevDirection:e,direction:i,nextDirection:n}=t,o=e&&s(this,Ft).getById("floor",e.properties.groupBy),a=s(this,Ft).getById("floor",i.properties.groupBy),c=n&&s(this,Ft).getById("floor",n.properties.groupBy),l=[];e||l.push({type:"Departure"});let p=s(this,Ft).getMVFFeatureByNodeId("connection",i.properties.id),d=p?s(this,Ft).getById("connection",p.id):void 0,f=p&&p.nodes.length>1,g=s(this,Ft).enterpriseMode&&(!i.properties.destination||!(p!=null&&p.nodes.includes(i.properties.destination))||!(p!=null&&p.nodes.includes(i.properties.id)));if(p&&!(!f||g))if(!s(this,Cn)||s(this,Cn)==="exit")l.push(N(this,Or,Il).call(this,"TakeConnection",a,c,d,p)),I(this,Cn,"take"),I(this,Ra,d),I(this,Pl,p);else{let b=s(this,Ft).getMVFFeatureByNodeId("connection",(v=e==null?void 0:e.properties.id)!=null?v:""),C=s(this,Ft).getById("connection",(x=b==null?void 0:b.id)!=null?x:"");l.push(N(this,Or,Il).call(this,"ExitConnection",a,o,C,b)),I(this,Cn,"exit"),I(this,Ra,d),I(this,Pl,p)}else s(this,Cn)==="take"?(l.push(N(this,Or,Il).call(this,"ExitConnection",a,o,s(this,Ra),s(this,Pl))),I(this,Cn,"exit"),I(this,Ra,d)):c&&a.id!==c.id?l.push(N(this,Or,Il).call(this,"TakeConnection",a,c,d)):o&&o.id!==a.id?l.push(N(this,Or,Il).call(this,"ExitConnection",a,o,d)):l.push(N(this,Or,A5).call(this,e,i));return n||l.push({type:"Arrival"}),l},Il=function(t,e,i,n,o){var l,p;let a="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let d=e.elevation-i.elevation;d>0?a="down":d<0&&(a="up")}let c=(p=(l=n==null?void 0:n.type)!=null?l:o==null?void 0:o.type)!=null?p:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:a,connection:n,connectionType:c}},A5=function(t,e){let i=e.properties.edges;if(!i||i.filter(a=>a.destination.properties.id!==(t==null?void 0:t.properties.id)&&a.destination.properties.id!==e.properties.destination).length===0)return null;let o=t?-I5(t.properties.angle,e.properties.angle):0;return Math.abs(o)>=L5?{type:"Turn",bearing:P5(o,L5),referencePosition:"At"}:null};var Ff=class{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:n,multiplicativeDistanceWeightScaling:o}){u(this,"navigator");u(this,"connections");u(this,"getDirections",(t,e,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:c}}=i,l=t.flatMap(v=>jp(v,n)),p=e.flatMap(v=>jp(v,n)),d=this.getExcludedNodeIds(i.excludedConnections).filter(v=>!l.includes(v)&&!p.includes(v)),f=this.getDisabledConnectionNodeIds(o).filter(v=>!l.includes(v)&&!p.includes(v)),g=this.navigator.getDirections({zones:i.zones.map(v=>{var x;return{geometry:v.geometry,cost:v.cost,map:(x=v.floor)==null?void 0:x.id}}),originIds:l,destinationNodeIds:p,excludedNodeIds:d,disabledConnectionNodeIds:f,simplify:{enabled:a,bufferRadius:c},multiplicativeDistanceWeightScaling:!n.enterpriseMode});this.addCoordinateDirections(g,t,e);let y=new Af(g,n,t,e);if(!(y.distance===0&&new Set([...l,...p]).size===l.length+p.length))return y});u(this,"getExcludedNodeIds",t=>{if(t.length===0)return[];let e=new Set(t.map(i=>i.id));return this.connections.reduce((i,n)=>e.has(n.id)?i.concat(n.nodes):i,[])});u(this,"getDisabledConnectionNodeIds",t=>t===!1?[]:this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]));u(this,"addCoordinateDirections",(t,[e],[i])=>{if(t.features.length){if(ae.is(e)){let n=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,n)}if(ae.is(i)){let n=this.createDirectionFeature(i,0,0),o=t.features[t.features.length-1];o.properties.distance=this.navigator.getDistance(o.geometry.coordinates,[i.longitude,i.latitude]),o.properties.angle=this.navigator.getAngle(o.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(n)}}});u(this,"createDirectionFeature",(t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i,edges:[]}}));this.navigator=new Sl({nodes:t,geojsonCollection:this.createCollection(e),groupBy:n,multiplicativeDistanceWeightScaling:o}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,n])=>e.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};function jp(r,t){var e,i,n,o;if(Cl.is(r))return r.navigationTarget.flatMap(a=>jp(a,t));if(go.is(r)){let a=t.Query.nearest(r,{types:["node"]});return(e=a==null?void 0:a[0])!=null&&e.feature.id?[a[0].feature.id]:[]}else if(ae.is(r)){let a=t.Query.nearest(r,{types:["node"]});return(i=a==null?void 0:a[0])!=null&&i.feature.id?[a[0].feature.id]:[]}else if(mo.is(r)){let a=t.Query.nearest(r,{types:["node"]});return(n=a==null?void 0:a[0])!=null&&n.feature.id?[a[0].feature.id]:[]}else if(Ei.is(r)){let a=t==null?void 0:t.getMVFFeatureById("entrance",r.id);return a!=null&&a.properties.node?[a==null?void 0:a.properties.node]:[]}else if(ho.is(r)){let a=t==null?void 0:t.getMVFFeatureById("area",r.id);return(o=a==null?void 0:a.properties.destinationNodes)!=null?o:[]}else if(vt.is(r)){let a=t==null?void 0:t.getMVFFeatureById("space",r.id);return a==null?[]:a.properties.destinationNodes}else{if(Ia.is(r))return r.coordinates.reduce((a,c)=>{var p;let l=t.Query.nearest(c,{types:["node"]});return(p=l==null?void 0:l[0])!=null&&p.feature.id&&a.push(l[0].feature.id),a},[]);if(gr.is(r)){let a=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return a!=null?a:[]}else return qr.is(r)?r.spaces.flatMap(a=>{var c,l;return(l=(c=t==null?void 0:t.getMVFFeatureById("space",a.id))==null?void 0:c.properties.destinationNodes)!=null?l:[]}).filter(a=>typeof a=="string"):gn.is(r)?r.nodes.map(a=>a.id):po.is(r)?[r.id]:[]}}m();m();m();m();m();m();function F5(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return B5(this.cover(t,e),t,e,r)}function B5(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var n,o=r._root,a={data:i},c=r._x0,l=r._y0,p=r._x1,d=r._y1,f,g,y,v,x,b,C,M;if(!o)return r._root=a,r;for(;o.length;)if((x=t>=(f=(c+p)/2))?c=f:p=f,(b=e>=(g=(l+d)/2))?l=g:d=g,n=o,!(o=o[C=b<<1|x]))return n[C]=a,r;if(y=+r._x.call(null,o.data),v=+r._y.call(null,o.data),t===y&&e===v)return a.next=o,n?n[C]=a:r._root=a,r;do n=n?n[C]=new Array(4):r._root=new Array(4),(x=t>=(f=(c+p)/2))?c=f:p=f,(b=e>=(g=(l+d)/2))?l=g:d=g;while((C=b<<1|x)===(M=(v>=g)<<1|y>=f));return n[M]=o,n[C]=a,r}function R5(r){var t,e,i=r.length,n,o,a=new Array(i),c=new Array(i),l=1/0,p=1/0,d=-1/0,f=-1/0;for(e=0;e<i;++e)isNaN(n=+this._x.call(null,t=r[e]))||isNaN(o=+this._y.call(null,t))||(a[e]=n,c[e]=o,n<l&&(l=n),n>d&&(d=n),o<p&&(p=o),o>f&&(f=o));if(l>d||p>f)return this;for(this.cover(l,p).cover(d,f),e=0;e<i;++e)B5(this,a[e],c[e],r[e]);return this}m();function N5(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(e))n=(e=Math.floor(r))+1,o=(i=Math.floor(t))+1;else{for(var a=n-e||1,c=this._root,l,p;e>r||r>=n||i>t||t>=o;)switch(p=(t<i)<<1|r<e,l=new Array(4),l[p]=c,c=l,a*=2,p){case 0:n=e+a,o=i+a;break;case 1:e=n-a,o=i+a;break;case 2:n=e+a,i=o-a;break;case 3:e=n-a,i=o-a;break}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=i,this._x1=n,this._y1=o,this}m();function G5(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}m();function V5(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]]}m();m();function xt(r,t,e,i,n){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=n}function j5(r,t,e){var i,n=this._x0,o=this._y0,a,c,l,p,d=this._x1,f=this._y1,g=[],y=this._root,v,x;for(y&&g.push(new xt(y,n,o,d,f)),e==null?e=1/0:(n=r-e,o=t-e,d=r+e,f=t+e,e*=e);v=g.pop();)if(!(!(y=v.node)||(a=v.x0)>d||(c=v.y0)>f||(l=v.x1)<n||(p=v.y1)<o))if(y.length){var b=(a+l)/2,C=(c+p)/2;g.push(new xt(y[3],b,C,l,p),new xt(y[2],a,C,b,p),new xt(y[1],b,c,l,C),new xt(y[0],a,c,b,C)),(x=(t>=C)<<1|r>=b)&&(v=g[g.length-1],g[g.length-1]=g[g.length-1-x],g[g.length-1-x]=v)}else{var M=r-+this._x.call(null,y.data),P=t-+this._y.call(null,y.data),w=M*M+P*P;if(w<e){var D=Math.sqrt(e=w);n=r-D,o=t-D,d=r+D,f=t+D,i=y.data}}return i}m();function U5(r){if(isNaN(d=+this._x.call(null,r))||isNaN(f=+this._y.call(null,r)))return this;var t,e=this._root,i,n,o,a=this._x0,c=this._y0,l=this._x1,p=this._y1,d,f,g,y,v,x,b,C;if(!e)return this;if(e.length)for(;;){if((v=d>=(g=(a+l)/2))?a=g:l=g,(x=f>=(y=(c+p)/2))?c=y:p=y,t=e,!(e=e[b=x<<1|v]))return this;if(!e.length)break;(t[b+1&3]||t[b+2&3]||t[b+3&3])&&(i=t,C=b)}for(;e.data!==r;)if(n=e,!(e=e.next))return this;return(o=e.next)&&delete e.next,n?(o?n.next=o:delete n.next,this):t?(o?t[b]=o:delete t[b],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[C]=e:this._root=e),this):(this._root=o,this)}function H5(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}m();function W5(){return this._root}m();function z5(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}m();function Z5(r){var t=[],e,i=this._root,n,o,a,c,l;for(i&&t.push(new xt(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,o=e.x0,a=e.y0,c=e.x1,l=e.y1)&&i.length){var p=(o+c)/2,d=(a+l)/2;(n=i[3])&&t.push(new xt(n,p,d,c,l)),(n=i[2])&&t.push(new xt(n,o,d,p,l)),(n=i[1])&&t.push(new xt(n,p,a,c,d)),(n=i[0])&&t.push(new xt(n,o,a,p,d))}return this}m();function X5(r){var t=[],e=[],i;for(this._root&&t.push(new xt(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var n=i.node;if(n.length){var o,a=i.x0,c=i.y0,l=i.x1,p=i.y1,d=(a+l)/2,f=(c+p)/2;(o=n[0])&&t.push(new xt(o,a,c,d,f)),(o=n[1])&&t.push(new xt(o,d,c,l,f)),(o=n[2])&&t.push(new xt(o,a,f,d,p)),(o=n[3])&&t.push(new xt(o,d,f,l,p))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}m();function Y5(r){return r[0]}function q5(r){return arguments.length?(this._x=r,this):this._x}m();function $5(r){return r[1]}function J5(r){return arguments.length?(this._y=r,this):this._y}function Up(r,t,e){var i=new Sb(t==null?Y5:t,e==null?$5:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}function Sb(r,t,e,i,n,o){this._x=r,this._y=t,this._x0=e,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}function K5(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}var Wt=Up.prototype=Sb.prototype;Wt.copy=function(){var r=new Sb(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=K5(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var n=0;n<4;++n)(i=t.source[n])&&(i.length?e.push({source:i,target:t.target[n]=new Array(4)}):t.target[n]=K5(i));return r};Wt.add=F5;Wt.addAll=R5;Wt.cover=N5;Wt.data=G5;Wt.extent=V5;Wt.find=j5;Wt.remove=U5;Wt.removeAll=H5;Wt.root=W5;Wt.size=z5;Wt.visit=Z5;Wt.visitAfter=X5;Wt.x=q5;Wt.y=J5;var yr,To,Bf=class{constructor(t){S(this,yr,{});S(this,To);I(this,To,t)}getTreeByType(t,e,i){var a;if(s(this,yr)[t]||(s(this,yr)[t]={}),s(this,yr)[t][e]&&s(this,yr)[t][e][i])return s(this,yr)[t][e][i];s(this,yr)[t][e]||(s(this,yr)[t][e]={}),s(this,yr)[t][e][i]||(s(this,yr)[t][e][i]=Up());let n=s(this,yr)[t][e][i];n.x(c=>c.geometry.coordinates[1]),n.y(c=>c.geometry.coordinates[0]);let o=[];switch(t){case"node":o=((a=s(this,To).directions.navigator.graph.nodesByGroup.get(i))==null?void 0:a.filter(c=>c.properties.neighbors.length>0))||[];break;case"point-of-interest":o=s(this,To).mvfPoisByFloorId[i]||[];break;case"door":o=s(this,To).mvfEntrancesByFloorId[i]||[];break;case"annotation":o=s(this,To).mvfAnnotationsByFloorId[i]||[];break}return(o==null?void 0:o.length)>0&&n.addAll(o),n}};yr=new WeakMap,To=new WeakMap;m();var Pe;(function(r){r.assertEqual=n=>n;function t(n){}r.assertIs=t;function e(n){throw new Error}r.assertNever=e,r.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},r.getValidEnumValues=n=>{let o=r.objectKeys(n).filter(c=>typeof n[n[c]]!="number"),a={};for(let c of o)a[c]=n[c];return r.objectValues(a)},r.objectValues=n=>r.objectKeys(n).map(function(o){return n[o]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},r.find=(n,o)=>{for(let a of n)if(o(a))return a},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(Pe||(Pe={}));var Mb;(function(r){r.mergeShapes=(t,e)=>({...t,...e})})(Mb||(Mb={}));var Y=Pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Mo=r=>{switch(typeof r){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return isNaN(r)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":return Array.isArray(r)?Y.array:r===null?Y.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Y.promise:typeof Map<"u"&&r instanceof Map?Y.map:typeof Set<"u"&&r instanceof Set?Y.set:typeof Date<"u"&&r instanceof Date?Y.date:Y.object;default:return Y.unknown}},U=Pe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),eE=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),br=class r extends Error{constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let e=t||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(e(a));else{let c=i,l=0;for(;l<a.path.length;){let p=a.path[l];l===a.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(e(a))):c[p]=c[p]||{_errors:[]},c=c[p],l++}}};return n(this),i}static assert(t){if(!(t instanceof r))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},i=[];for(let n of this.issues)n.path.length>0?(e[n.path[0]]=e[n.path[0]]||[],e[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:e}}get formErrors(){return this.flatten()}};br.create=r=>new br(r);var El=(r,t)=>{let e;switch(r.code){case U.invalid_type:r.received===Y.undefined?e="Required":e="Expected ".concat(r.expected,", received ").concat(r.received);break;case U.invalid_literal:e="Invalid literal value, expected ".concat(JSON.stringify(r.expected,Pe.jsonStringifyReplacer));break;case U.unrecognized_keys:e="Unrecognized key(s) in object: ".concat(Pe.joinValues(r.keys,", "));break;case U.invalid_union:e="Invalid input";break;case U.invalid_union_discriminator:e="Invalid discriminator value. Expected ".concat(Pe.joinValues(r.options));break;case U.invalid_enum_value:e="Invalid enum value. Expected ".concat(Pe.joinValues(r.options),", received '").concat(r.received,"'");break;case U.invalid_arguments:e="Invalid function arguments";break;case U.invalid_return_type:e="Invalid function return type";break;case U.invalid_date:e="Invalid date";break;case U.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(e='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(e="".concat(e," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?e='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?e='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):Pe.assertNever(r.validation):r.validation!=="regex"?e="Invalid ".concat(r.validation):e="Invalid";break;case U.too_small:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):e="Invalid input";break;case U.too_big:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?e="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):e="Invalid input";break;case U.custom:e="Invalid input";break;case U.invalid_intersection_types:e="Intersection results could not be merged";break;case U.not_multiple_of:e="Number must be a multiple of ".concat(r.multipleOf);break;case U.not_finite:e="Number must be finite";break;default:e=t.defaultError,Pe.assertNever(r)}return{message:e}},tT=El;function tE(r){tT=r}function Rf(){return tT}var Nf=r=>{let{data:t,path:e,errorMaps:i,issueData:n}=r,o=[...e,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let c="",l=i.filter(p=>!!p).slice().reverse();for(let p of l)c=p(a,{data:t,defaultError:c}).message;return{...n,path:o,message:c}},rE=[];function X(r,t){let e=Rf(),i=Nf({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===El?void 0:El].filter(n=>!!n)});r.common.issues.push(i)}var Bt=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let i=[];for(let n of e){if(n.status==="aborted")return ce;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,e){let i=[];for(let n of e){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return r.mergeObjectSync(t,i)}static mergeObjectSync(t,e){let i={};for(let n of e){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return ce;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},ce=Object.freeze({status:"aborted"}),Dl=r=>({status:"dirty",value:r}),zt=r=>({status:"valid",value:r}),Ib=r=>r.status==="aborted",Pb=r=>r.status==="dirty",zp=r=>r.status==="valid",Zp=r=>typeof Promise<"u"&&r instanceof Promise;function Gf(r,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(r):i?i.value:t.get(r)}function rT(r,t,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,e):n?n.value=e:t.set(r,e),e}var te;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(te||(te={}));var Hp,Wp,kr=class{constructor(t,e,i,n){this._cachedPath=[],this.parent=t,this.data=e,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Q5=(r,t)=>{if(zp(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new br(r.common.issues);return this._error=e,this._error}}};function de(r){if(!r)return{};let{errorMap:t,invalid_type_error:e,required_error:i,description:n}=r;if(t&&(e||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(a,c)=>{var l,p;let{message:d}=r;return a.code==="invalid_enum_value"?{message:d!=null?d:c.defaultError}:typeof c.data>"u"?{message:(l=d!=null?d:i)!==null&&l!==void 0?l:c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:(p=d!=null?d:e)!==null&&p!==void 0?p:c.defaultError}},description:n}}var he=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Mo(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Mo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Bt,ctx:{common:t.parent.common,data:t.data,parsedType:Mo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Zp(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let i=this.safeParse(t,e);if(i.success)return i.data;throw i.error}safeParse(t,e){var i;let n={common:{issues:[],async:(i=e==null?void 0:e.async)!==null&&i!==void 0?i:!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Mo(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Q5(n,o)}async parseAsync(t,e){let i=await this.safeParseAsync(t,e);if(i.success)return i.data;throw i.error}async safeParseAsync(t,e){let i={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Mo(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(Zp(n)?n:Promise.resolve(n));return Q5(i,o)}refine(t,e){let i=n=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(n):e;return this._refinement((n,o)=>{let a=t(n),c=()=>o.addIssue({code:U.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,e){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof e=="function"?e(i,n):e),!1))}_refinement(t){return new vr({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Lr.create(this,this._def)}nullable(){return Bi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mn.create(this,this._def)}promise(){return wo.create(this,this._def)}or(t){return Wa.create([this,t],this._def)}and(t){return za.create(this,t,this._def)}transform(t){return new vr({...de(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new $a({...de(this._def),innerType:this,defaultValue:e,typeName:se.ZodDefault})}brand(){return new Xp({typeName:se.ZodBranded,type:this,...de(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new Ja({...de(this._def),innerType:this,catchValue:e,typeName:se.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Yp.create(this,t)}readonly(){return Ka.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iE=/^c[^\s-]{8,}$/i,nE=/^[0-9a-z]+$/,oE=/^[0-9A-HJKMNP-TV-Z]{26}$/,aE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sE=/^[a-z0-9_-]{21}$/i,lE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Tb,uE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dE=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,hE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iT="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fE=new RegExp("^".concat(iT,"$"));function nT(r){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?t="".concat(t,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}function mE(r){return new RegExp("^".concat(nT(r),"$"))}function oT(r){let t="".concat(iT,"T").concat(nT(r)),e=[];return e.push(r.local?"Z?":"Z"),r.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(e.join("|"),")"),new RegExp("^".concat(t,"$"))}function gE(r,t){return!!((t==="v4"||!t)&&uE.test(r)||(t==="v6"||!t)&&dE.test(r))}var Io=class r extends he{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Y.string){let o=this._getOrReturnCtx(t);return X(o,{code:U.invalid_type,expected:Y.string,received:o.parsedType}),ce}let i=new Bt,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),X(n,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),X(n,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,c=t.data.length<o.value;(a||c)&&(n=this._getOrReturnCtx(t,n),a?X(n,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&X(n,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")cE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"email",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Tb||(Tb=new RegExp(pE,"u")),Tb.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"emoji",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")aE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"uuid",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")sE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"nanoid",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")iE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"cuid",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")nE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"cuid2",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")oE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"ulid",code:U.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),X(n,{validation:"url",code:U.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"regex",code:U.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),X(n,{code:U.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),X(n,{code:U.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),X(n,{code:U.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?oT(o).test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{code:U.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?fE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{code:U.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?mE(o).test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{code:U.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?lE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"duration",code:U.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?gE(t.data,o.version)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"ip",code:U.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?hE.test(t.data)||(n=this._getOrReturnCtx(t,n),X(n,{validation:"base64",code:U.invalid_string,message:o.message}),i.dirty()):Pe.assertNever(o);return{status:i.value,value:t.data}}_regex(t,e,i){return this.refinement(n=>t.test(n),{validation:e,code:U.invalid_string,...te.errToObj(i)})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...te.errToObj(t)})}url(t){return this._addCheck({kind:"url",...te.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...te.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...te.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...te.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...te.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...te.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...te.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...te.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...te.errToObj(t)})}datetime(t){var e,i;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(e=t==null?void 0:t.offset)!==null&&e!==void 0?e:!1,local:(i=t==null?void 0:t.local)!==null&&i!==void 0?i:!1,...te.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...te.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...te.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...te.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...te.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...te.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...te.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...te.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...te.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...te.errToObj(e)})}nonempty(t){return this.min(1,te.errToObj(t))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};Io.create=r=>{var t;return new Io({checks:[],typeName:se.ZodString,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...de(r)})};function yE(r,t){let e=(r.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=e>i?e:i,o=parseInt(r.toFixed(n).replace(".","")),a=parseInt(t.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}var Na=class r extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Y.number){let o=this._getOrReturnCtx(t);return X(o,{code:U.invalid_type,expected:Y.number,received:o.parsedType}),ce}let i,n=new Bt;for(let o of this._def.checks)o.kind==="int"?Pe.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:U.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:U.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:U.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?yE(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),X(i,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:U.not_finite,message:o.message}),n.dirty()):Pe.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,te.toString(e))}gt(t,e){return this.setLimit("min",t,!1,te.toString(e))}lte(t,e){return this.setLimit("max",t,!0,te.toString(e))}lt(t,e){return this.setLimit("max",t,!1,te.toString(e))}setLimit(t,e,i,n){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:te.toString(n)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:te.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:te.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:te.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Pe.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(e===null||i.value>e)&&(e=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(e)&&Number.isFinite(t)}};Na.create=r=>new Na({checks:[],typeName:se.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...de(r)});var Ga=class r extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Y.bigint){let o=this._getOrReturnCtx(t);return X(o,{code:U.invalid_type,expected:Y.bigint,received:o.parsedType}),ce}let i,n=new Bt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:U.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:U.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),X(i,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):Pe.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,te.toString(e))}gt(t,e){return this.setLimit("min",t,!1,te.toString(e))}lte(t,e){return this.setLimit("max",t,!0,te.toString(e))}lt(t,e){return this.setLimit("max",t,!1,te.toString(e))}setLimit(t,e,i,n){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:te.toString(n)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:te.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};Ga.create=r=>{var t;return new Ga({checks:[],typeName:se.ZodBigInt,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...de(r)})};var Va=class extends he{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Y.boolean){let i=this._getOrReturnCtx(t);return X(i,{code:U.invalid_type,expected:Y.boolean,received:i.parsedType}),ce}return zt(t.data)}};Va.create=r=>new Va({typeName:se.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...de(r)});var ja=class r extends he{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Y.date){let o=this._getOrReturnCtx(t);return X(o,{code:U.invalid_type,expected:Y.date,received:o.parsedType}),ce}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return X(o,{code:U.invalid_date}),ce}let i=new Bt,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),X(n,{code:U.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),X(n,{code:U.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):Pe.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:te.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:te.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};ja.create=r=>new ja({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:se.ZodDate,...de(r)});var _l=class extends he{_parse(t){if(this._getType(t)!==Y.symbol){let i=this._getOrReturnCtx(t);return X(i,{code:U.invalid_type,expected:Y.symbol,received:i.parsedType}),ce}return zt(t.data)}};_l.create=r=>new _l({typeName:se.ZodSymbol,...de(r)});var Ua=class extends he{_parse(t){if(this._getType(t)!==Y.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:U.invalid_type,expected:Y.undefined,received:i.parsedType}),ce}return zt(t.data)}};Ua.create=r=>new Ua({typeName:se.ZodUndefined,...de(r)});var Ha=class extends he{_parse(t){if(this._getType(t)!==Y.null){let i=this._getOrReturnCtx(t);return X(i,{code:U.invalid_type,expected:Y.null,received:i.parsedType}),ce}return zt(t.data)}};Ha.create=r=>new Ha({typeName:se.ZodNull,...de(r)});var Po=class extends he{constructor(){super(...arguments),this._any=!0}_parse(t){return zt(t.data)}};Po.create=r=>new Po({typeName:se.ZodAny,...de(r)});var Tn=class extends he{constructor(){super(...arguments),this._unknown=!0}_parse(t){return zt(t.data)}};Tn.create=r=>new Tn({typeName:se.ZodUnknown,...de(r)});var Qr=class extends he{_parse(t){let e=this._getOrReturnCtx(t);return X(e,{code:U.invalid_type,expected:Y.never,received:e.parsedType}),ce}};Qr.create=r=>new Qr({typeName:se.ZodNever,...de(r)});var Ol=class extends he{_parse(t){if(this._getType(t)!==Y.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:U.invalid_type,expected:Y.void,received:i.parsedType}),ce}return zt(t.data)}};Ol.create=r=>new Ol({typeName:se.ZodVoid,...de(r)});var Mn=class r extends he{_parse(t){let{ctx:e,status:i}=this._processInputParams(t),n=this._def;if(e.parsedType!==Y.array)return X(e,{code:U.invalid_type,expected:Y.array,received:e.parsedType}),ce;if(n.exactLength!==null){let a=e.data.length>n.exactLength.value,c=e.data.length<n.exactLength.value;(a||c)&&(X(e,{code:a?U.too_big:U.too_small,minimum:c?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&e.data.length<n.minLength.value&&(X(e,{code:U.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&e.data.length>n.maxLength.value&&(X(e,{code:U.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),e.common.async)return Promise.all([...e.data].map((a,c)=>n.type._parseAsync(new kr(e,a,e.path,c)))).then(a=>Bt.mergeArray(i,a));let o=[...e.data].map((a,c)=>n.type._parseSync(new kr(e,a,e.path,c)));return Bt.mergeArray(i,o)}get element(){return this._def.type}min(t,e){return new r({...this._def,minLength:{value:t,message:te.toString(e)}})}max(t,e){return new r({...this._def,maxLength:{value:t,message:te.toString(e)}})}length(t,e){return new r({...this._def,exactLength:{value:t,message:te.toString(e)}})}nonempty(t){return this.min(1,t)}};Mn.create=(r,t)=>new Mn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...de(t)});function wl(r){if(r instanceof tr){let t={};for(let e in r.shape){let i=r.shape[e];t[e]=Lr.create(wl(i))}return new tr({...r._def,shape:()=>t})}else return r instanceof Mn?new Mn({...r._def,type:wl(r.element)}):r instanceof Lr?Lr.create(wl(r.unwrap())):r instanceof Bi?Bi.create(wl(r.unwrap())):r instanceof Fi?Fi.create(r.items.map(t=>wl(t))):r}var tr=class r extends he{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=Pe.objectKeys(t);return this._cached={shape:t,keys:e}}_parse(t){if(this._getType(t)!==Y.object){let p=this._getOrReturnCtx(t);return X(p,{code:U.invalid_type,expected:Y.object,received:p.parsedType}),ce}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Qr&&this._def.unknownKeys==="strip"))for(let p in n.data)a.includes(p)||c.push(p);let l=[];for(let p of a){let d=o[p],f=n.data[p];l.push({key:{status:"valid",value:p},value:d._parse(new kr(n,f,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof Qr){let p=this._def.unknownKeys;if(p==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(p==="strict")c.length>0&&(X(n,{code:U.unrecognized_keys,keys:c}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:p._parse(new kr(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let d of l){let f=await d.key,g=await d.value;p.push({key:f,value:g,alwaysSet:d.alwaysSet})}return p}).then(p=>Bt.mergeObjectSync(i,p)):Bt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(t){return te.errToObj,new r({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,i)=>{var n,o,a,c;let l=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,e,i).message)!==null&&a!==void 0?a:i.defaultError;return e.code==="unrecognized_keys"?{message:(c=te.errToObj(t).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(t){return new r({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new r({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:se.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new r({...this._def,catchall:t})}pick(t){let e={};return Pe.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(e[i]=this.shape[i])}),new r({...this._def,shape:()=>e})}omit(t){let e={};return Pe.objectKeys(this.shape).forEach(i=>{t[i]||(e[i]=this.shape[i])}),new r({...this._def,shape:()=>e})}deepPartial(){return wl(this)}partial(t){let e={};return Pe.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];t&&!t[i]?e[i]=n:e[i]=n.optional()}),new r({...this._def,shape:()=>e})}required(t){let e={};return Pe.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])e[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Lr;)o=o._def.innerType;e[i]=o}}),new r({...this._def,shape:()=>e})}keyof(){return aT(Pe.objectKeys(this.shape))}};tr.create=(r,t)=>new tr({shape:()=>r,unknownKeys:"strip",catchall:Qr.create(),typeName:se.ZodObject,...de(t)});tr.strictCreate=(r,t)=>new tr({shape:()=>r,unknownKeys:"strict",catchall:Qr.create(),typeName:se.ZodObject,...de(t)});tr.lazycreate=(r,t)=>new tr({shape:r,unknownKeys:"strip",catchall:Qr.create(),typeName:se.ZodObject,...de(t)});var Wa=class extends he{_parse(t){let{ctx:e}=this._processInputParams(t),i=this._def.options;function n(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return e.common.issues.push(...c.ctx.common.issues),c.result;let a=o.map(c=>new br(c.ctx.common.issues));return X(e,{code:U.invalid_union,unionErrors:a}),ce}if(e.common.async)return Promise.all(i.map(async o=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await o._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let l of i){let p={...e,common:{...e.common,issues:[]},parent:null},d=l._parseSync({data:e.data,path:e.path,parent:p});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(o)return e.common.issues.push(...o.ctx.common.issues),o.result;let c=a.map(l=>new br(l));return X(e,{code:U.invalid_union,unionErrors:c}),ce}}get options(){return this._def.options}};Wa.create=(r,t)=>new Wa({options:r,typeName:se.ZodUnion,...de(t)});var Sn=r=>r instanceof Za?Sn(r.schema):r instanceof vr?Sn(r.innerType()):r instanceof Xa?[r.value]:r instanceof Ya?r.options:r instanceof qa?Pe.objectValues(r.enum):r instanceof $a?Sn(r._def.innerType):r instanceof Ua?[void 0]:r instanceof Ha?[null]:r instanceof Lr?[void 0,...Sn(r.unwrap())]:r instanceof Bi?[null,...Sn(r.unwrap())]:r instanceof Xp||r instanceof Ka?Sn(r.unwrap()):r instanceof Ja?Sn(r._def.innerType):[],Vf=class r extends he{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Y.object)return X(e,{code:U.invalid_type,expected:Y.object,received:e.parsedType}),ce;let i=this.discriminator,n=e.data[i],o=this.optionsMap.get(n);return o?e.common.async?o._parseAsync({data:e.data,path:e.path,parent:e}):o._parseSync({data:e.data,path:e.path,parent:e}):(X(e,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,i){let n=new Map;for(let o of e){let a=Sn(o.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let c of a){if(n.has(c))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(c)));n.set(c,o)}}return new r({typeName:se.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:n,...de(i)})}};function wb(r,t){let e=Mo(r),i=Mo(t);if(r===t)return{valid:!0,data:r};if(e===Y.object&&i===Y.object){let n=Pe.objectKeys(t),o=Pe.objectKeys(r).filter(c=>n.indexOf(c)!==-1),a={...r,...t};for(let c of o){let l=wb(r[c],t[c]);if(!l.valid)return{valid:!1};a[c]=l.data}return{valid:!0,data:a}}else if(e===Y.array&&i===Y.array){if(r.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<r.length;o++){let a=r[o],c=t[o],l=wb(a,c);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return e===Y.date&&i===Y.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}var za=class extends he{_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=(o,a)=>{if(Ib(o)||Ib(a))return ce;let c=wb(o.value,a.value);return c.valid?((Pb(o)||Pb(a))&&e.dirty(),{status:e.value,value:c.data}):(X(i,{code:U.invalid_intersection_types}),ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};za.create=(r,t,e)=>new za({left:r,right:t,typeName:se.ZodIntersection,...de(e)});var Fi=class r extends he{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==Y.array)return X(i,{code:U.invalid_type,expected:Y.array,received:i.parsedType}),ce;if(i.data.length<this._def.items.length)return X(i,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ce;!this._def.rest&&i.data.length>this._def.items.length&&(X(i,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let o=[...i.data].map((a,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new kr(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>Bt.mergeArray(e,a)):Bt.mergeArray(e,o)}get items(){return this._def.items}rest(t){return new r({...this._def,rest:t})}};Fi.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fi({items:r,typeName:se.ZodTuple,rest:null,...de(t)})};var jf=class r extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==Y.object)return X(i,{code:U.invalid_type,expected:Y.object,received:i.parsedType}),ce;let n=[],o=this._def.keyType,a=this._def.valueType;for(let c in i.data)n.push({key:o._parse(new kr(i,c,i.path,c)),value:a._parse(new kr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Bt.mergeObjectAsync(e,n):Bt.mergeObjectSync(e,n)}get element(){return this._def.valueType}static create(t,e,i){return e instanceof he?new r({keyType:t,valueType:e,typeName:se.ZodRecord,...de(i)}):new r({keyType:Io.create(),valueType:t,typeName:se.ZodRecord,...de(e)})}},Ll=class extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==Y.map)return X(i,{code:U.invalid_type,expected:Y.map,received:i.parsedType}),ce;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([c,l],p)=>({key:n._parse(new kr(i,c,i.path,[p,"key"])),value:o._parse(new kr(i,l,i.path,[p,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of a){let p=await l.key,d=await l.value;if(p.status==="aborted"||d.status==="aborted")return ce;(p.status==="dirty"||d.status==="dirty")&&e.dirty(),c.set(p.value,d.value)}return{status:e.value,value:c}})}else{let c=new Map;for(let l of a){let p=l.key,d=l.value;if(p.status==="aborted"||d.status==="aborted")return ce;(p.status==="dirty"||d.status==="dirty")&&e.dirty(),c.set(p.value,d.value)}return{status:e.value,value:c}}}};Ll.create=(r,t,e)=>new Ll({valueType:t,keyType:r,typeName:se.ZodMap,...de(e)});var kl=class r extends he{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==Y.set)return X(i,{code:U.invalid_type,expected:Y.set,received:i.parsedType}),ce;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(X(i,{code:U.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),e.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(X(i,{code:U.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),e.dirty());let o=this._def.valueType;function a(l){let p=new Set;for(let d of l){if(d.status==="aborted")return ce;d.status==="dirty"&&e.dirty(),p.add(d.value)}return{status:e.value,value:p}}let c=[...i.data.values()].map((l,p)=>o._parse(new kr(i,l,i.path,p)));return i.common.async?Promise.all(c).then(l=>a(l)):a(c)}min(t,e){return new r({...this._def,minSize:{value:t,message:te.toString(e)}})}max(t,e){return new r({...this._def,maxSize:{value:t,message:te.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};kl.create=(r,t)=>new kl({valueType:r,minSize:null,maxSize:null,typeName:se.ZodSet,...de(t)});var Uf=class r extends he{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Y.function)return X(e,{code:U.invalid_type,expected:Y.function,received:e.parsedType}),ce;function i(c,l){return Nf({data:c,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Rf(),El].filter(p=>!!p),issueData:{code:U.invalid_arguments,argumentsError:l}})}function n(c,l){return Nf({data:c,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Rf(),El].filter(p=>!!p),issueData:{code:U.invalid_return_type,returnTypeError:l}})}let o={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof wo){let c=this;return zt(async function(...l){let p=new br([]),d=await c._def.args.parseAsync(l,o).catch(y=>{throw p.addIssue(i(l,y)),p}),f=await Reflect.apply(a,this,d);return await c._def.returns._def.type.parseAsync(f,o).catch(y=>{throw p.addIssue(n(f,y)),p})})}else{let c=this;return zt(function(...l){let p=c._def.args.safeParse(l,o);if(!p.success)throw new br([i(l,p.error)]);let d=Reflect.apply(a,this,p.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new br([n(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new r({...this._def,args:Fi.create(t).rest(Tn.create())})}returns(t){return new r({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,i){return new r({args:t||Fi.create([]).rest(Tn.create()),returns:e||Tn.create(),typeName:se.ZodFunction,...de(i)})}},Za=class extends he{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};Za.create=(r,t)=>new Za({getter:r,typeName:se.ZodLazy,...de(t)});var Xa=class extends he{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return X(e,{received:e.data,code:U.invalid_literal,expected:this._def.value}),ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};Xa.create=(r,t)=>new Xa({value:r,typeName:se.ZodLiteral,...de(t)});function aT(r,t){return new Ya({values:r,typeName:se.ZodEnum,...de(t)})}var Ya=class r extends he{constructor(){super(...arguments),Hp.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),i=this._def.values;return X(e,{expected:Pe.joinValues(i),received:e.parsedType,code:U.invalid_type}),ce}if(Gf(this,Hp,"f")||rT(this,Hp,new Set(this._def.values),"f"),!Gf(this,Hp,"f").has(t.data)){let e=this._getOrReturnCtx(t),i=this._def.values;return X(e,{received:e.data,code:U.invalid_enum_value,options:i}),ce}return zt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return r.create(t,{...this._def,...e})}exclude(t,e=this._def){return r.create(this.options.filter(i=>!t.includes(i)),{...this._def,...e})}};Hp=new WeakMap;Ya.create=aT;var qa=class extends he{constructor(){super(...arguments),Wp.set(this,void 0)}_parse(t){let e=Pe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==Y.string&&i.parsedType!==Y.number){let n=Pe.objectValues(e);return X(i,{expected:Pe.joinValues(n),received:i.parsedType,code:U.invalid_type}),ce}if(Gf(this,Wp,"f")||rT(this,Wp,new Set(Pe.getValidEnumValues(this._def.values)),"f"),!Gf(this,Wp,"f").has(t.data)){let n=Pe.objectValues(e);return X(i,{received:i.data,code:U.invalid_enum_value,options:n}),ce}return zt(t.data)}get enum(){return this._def.values}};Wp=new WeakMap;qa.create=(r,t)=>new qa({values:r,typeName:se.ZodNativeEnum,...de(t)});var wo=class extends he{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Y.promise&&e.common.async===!1)return X(e,{code:U.invalid_type,expected:Y.promise,received:e.parsedType}),ce;let i=e.parsedType===Y.promise?e.data:Promise.resolve(e.data);return zt(i.then(n=>this._def.type.parseAsync(n,{path:e.path,errorMap:e.common.contextualErrorMap})))}};wo.create=(r,t)=>new wo({type:r,typeName:se.ZodPromise,...de(t)});var vr=class extends he{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:a=>{X(i,a),a.fatal?e.abort():e.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let a=n.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async c=>{if(e.value==="aborted")return ce;let l=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return l.status==="aborted"?ce:l.status==="dirty"||e.value==="dirty"?Dl(l.value):l});{if(e.value==="aborted")return ce;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?ce:c.status==="dirty"||e.value==="dirty"?Dl(c.value):c}}if(n.type==="refinement"){let a=c=>{let l=n.refinement(c,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?ce:(c.status==="dirty"&&e.dirty(),a(c.value),{status:e.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?ce:(c.status==="dirty"&&e.dirty(),a(c.value).then(()=>({status:e.value,value:c.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!zp(a))return a;let c=n.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>zp(a)?Promise.resolve(n.transform(a.value,o)).then(c=>({status:e.value,value:c})):a);Pe.assertNever(n)}};vr.create=(r,t,e)=>new vr({schema:r,typeName:se.ZodEffects,effect:t,...de(e)});vr.createWithPreprocess=(r,t,e)=>new vr({schema:t,effect:{type:"preprocess",transform:r},typeName:se.ZodEffects,...de(e)});var Lr=class extends he{_parse(t){return this._getType(t)===Y.undefined?zt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Lr.create=(r,t)=>new Lr({innerType:r,typeName:se.ZodOptional,...de(t)});var Bi=class extends he{_parse(t){return this._getType(t)===Y.null?zt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Bi.create=(r,t)=>new Bi({innerType:r,typeName:se.ZodNullable,...de(t)});var $a=class extends he{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return e.parsedType===Y.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};$a.create=(r,t)=>new $a({innerType:r,typeName:se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...de(t)});var Ja=class extends he{_parse(t){let{ctx:e}=this._processInputParams(t),i={...e,common:{...e.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zp(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new br(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new br(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ja.create=(r,t)=>new Ja({innerType:r,typeName:se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...de(t)});var Al=class extends he{_parse(t){if(this._getType(t)!==Y.nan){let i=this._getOrReturnCtx(t);return X(i,{code:U.invalid_type,expected:Y.nan,received:i.parsedType}),ce}return{status:"valid",value:t.data}}};Al.create=r=>new Al({typeName:se.ZodNaN,...de(r)});var bE=Symbol("zod_brand"),Xp=class extends he{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return this._def.type._parse({data:i,path:e.path,parent:e})}unwrap(){return this._def.type}},Yp=class r extends he{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?ce:o.status==="dirty"?(e.dirty(),Dl(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?ce:n.status==="dirty"?(e.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,e){return new r({in:t,out:e,typeName:se.ZodPipeline})}},Ka=class extends he{_parse(t){let e=this._def.innerType._parse(t),i=n=>(zp(n)&&(n.value=Object.freeze(n.value)),n);return Zp(e)?e.then(n=>i(n)):i(e)}unwrap(){return this._def.innerType}};Ka.create=(r,t)=>new Ka({innerType:r,typeName:se.ZodReadonly,...de(t)});function sT(r,t={},e){return r?Po.create().superRefine((i,n)=>{var o,a;if(!r(i)){let c=typeof t=="function"?t(i):typeof t=="string"?{message:t}:t,l=(a=(o=c.fatal)!==null&&o!==void 0?o:e)!==null&&a!==void 0?a:!0,p=typeof c=="string"?{message:c}:c;n.addIssue({code:"custom",...p,fatal:l})}}):Po.create()}var vE={object:tr.lazycreate},se;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(se||(se={}));var xE=(r,t={message:"Input not instance of ".concat(r.name)})=>sT(e=>e instanceof r,t),lT=Io.create,cT=Na.create,CE=Al.create,SE=Ga.create,pT=Va.create,TE=ja.create,ME=_l.create,IE=Ua.create,PE=Ha.create,wE=Po.create,DE=Tn.create,EE=Qr.create,_E=Ol.create,OE=Mn.create,LE=tr.create,kE=tr.strictCreate,AE=Wa.create,FE=Vf.create,BE=za.create,RE=Fi.create,NE=jf.create,GE=Ll.create,VE=kl.create,jE=Uf.create,UE=Za.create,HE=Xa.create,WE=Ya.create,zE=qa.create,ZE=wo.create,eT=vr.create,XE=Lr.create,YE=Bi.create,qE=vr.createWithPreprocess,$E=Yp.create,JE=()=>lT().optional(),KE=()=>cT().optional(),QE=()=>pT().optional(),e_={string:r=>Io.create({...r,coerce:!0}),number:r=>Na.create({...r,coerce:!0}),boolean:r=>Va.create({...r,coerce:!0}),bigint:r=>Ga.create({...r,coerce:!0}),date:r=>ja.create({...r,coerce:!0})},t_=ce,E=Object.freeze({__proto__:null,defaultErrorMap:El,setErrorMap:tE,getErrorMap:Rf,makeIssue:Nf,EMPTY_PATH:rE,addIssueToContext:X,ParseStatus:Bt,INVALID:ce,DIRTY:Dl,OK:zt,isAborted:Ib,isDirty:Pb,isValid:zp,isAsync:Zp,get util(){return Pe},get objectUtil(){return Mb},ZodParsedType:Y,getParsedType:Mo,ZodType:he,datetimeRegex:oT,ZodString:Io,ZodNumber:Na,ZodBigInt:Ga,ZodBoolean:Va,ZodDate:ja,ZodSymbol:_l,ZodUndefined:Ua,ZodNull:Ha,ZodAny:Po,ZodUnknown:Tn,ZodNever:Qr,ZodVoid:Ol,ZodArray:Mn,ZodObject:tr,ZodUnion:Wa,ZodDiscriminatedUnion:Vf,ZodIntersection:za,ZodTuple:Fi,ZodRecord:jf,ZodMap:Ll,ZodSet:kl,ZodFunction:Uf,ZodLazy:Za,ZodLiteral:Xa,ZodEnum:Ya,ZodNativeEnum:qa,ZodPromise:wo,ZodEffects:vr,ZodTransformer:vr,ZodOptional:Lr,ZodNullable:Bi,ZodDefault:$a,ZodCatch:Ja,ZodNaN:Al,BRAND:bE,ZodBranded:Xp,ZodPipeline:Yp,ZodReadonly:Ka,custom:sT,Schema:he,ZodSchema:he,late:vE,get ZodFirstPartyTypeKind(){return se},coerce:e_,any:wE,array:OE,bigint:SE,boolean:pT,date:TE,discriminatedUnion:FE,effect:eT,enum:WE,function:jE,instanceof:xE,intersection:BE,lazy:UE,literal:HE,map:GE,nan:CE,nativeEnum:zE,never:EE,null:PE,nullable:YE,number:cT,object:LE,oboolean:QE,onumber:KE,optional:XE,ostring:JE,pipeline:$E,preprocess:qE,promise:ZE,record:NE,set:VE,strictObject:kE,string:lT,symbol:ME,transformer:eT,tuple:RE,undefined:IE,union:AE,unknown:DE,void:_E,NEVER:t_,ZodIssueCode:U,quotelessJson:eE,ZodError:br});var r_=E.object({limit:E.enum(["same-floor","same-elevation"]).optional(),radius:E.number().optional(),types:E.array(E.enum(["node","point-of-interest"])).min(1)}),Ri,$p,qp=class{constructor(t){S(this,Ri);S(this,$p);I(this,Ri,t),I(this,$p,new Bf(s(this,Ri)))}nearest(t,e){try{r_.parse(e)}catch(a){O.error(a);return}let i=Cp(t);if(!i)return;let n=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let a of s(this,Ri).getByType("floor-stack")){let c=a.defaultFloor;c&&n.push(c.id)}else if(e.limit==="same-elevation"){let a=s(this,Ri).floorsById[i.floorId];if(a){let c=a==null?void 0:a.elevation;c&&(n=s(this,Ri).getByType("floor-stack").map(l=>{var p;return(p=l.floors.find(d=>d.elevation===c))==null?void 0:p.id}).filter(Boolean))}}let o=[];for(let a of _5(e.types))for(let c of n){let l=s(this,$p).getTreeByType(a,s(this,Ri).mapName,c).find(i.latitude,i.longitude,e.radius);if(l){let p=s(this,Ri).getById(a,l==null?void 0:l.properties.id);p&&o.push({distance:Kr([i.longitude,i.latitude],l.geometry.coordinates),feature:p})}}return o.sort((a,c)=>a.distance-c.distance)}};Ri=new WeakMap,$p=new WeakMap;m();m();var Jp,Hf=class{constructor(t){S(this,Jp);I(this,Jp,t||[])}get raw(){return s(this,Jp)}};Jp=new WeakMap;var It,q,Be,Kp=class Kp extends ut{constructor(e,i){super(i.mvfData.id);u(this,"__type",Kp.__type);u(this,"id","loc_");u(this,"name","");u(this,"externalId");u(this,"description");u(this,"logo");u(this,"phone");u(this,"social",[]);u(this,"images",[]);u(this,"links",[]);u(this,"website");u(this,"icon");S(this,It);S(this,q,{});S(this,Be);I(this,It,e),I(this,Be,i.mvfData);for(let n in i.mvfData)n==="links"?this.links=i.mvfData.links.map(o=>new ma({mvfData:o})):n==="pictures"?this.images=i.mvfData.pictures.map(o=>{var a;return o.url?new ya({mvfData:{...o,url:(a=o.url)!=null?a:""},mapData:s(this,It)}):void 0}).filter(o=>o!=null):n==="website"?i.mvfData.website&&(this.website=new ma({mvfData:i.mvfData.website})):n==="icon"?i.mvfData.icon&&(this.icon=new ya({mvfData:{url:i.mvfData.icon},mapData:s(this,It)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Be)[n]}})}static is(e){return e.__type===Kp.__type}get spaces(){if(s(this,q).spaces)return s(this,q).spaces;if(s(this,Be).spaces==null)return s(this,q).spaces=[],s(this,q).spaces;s(this,q).spaces=[];for(let e=0;e<s(this,Be).spaces.length;e++){let i=s(this,It).getById("space",s(this,Be).spaces[e].id);i&&s(this,q).spaces.push(i)}return s(this,q).spaces}get points(){if(s(this,q).points)return s(this,q).points;if(s(this,Be).spaces==null)return s(this,q).points=[],s(this,q).points;s(this,q).points=[];for(let e=0;e<s(this,Be).spaces.length;e++){let i=s(this,It).getById("point-of-interest",s(this,Be).spaces[e].id);i&&s(this,q).points.push(i)}return s(this,q).points}get doors(){if(s(this,q).doors)return s(this,q).doors;if(s(this,Be).entrances==null)return s(this,q).doors=[],s(this,q).doors;s(this,q).doors=[];for(let e=0;e<s(this,Be).entrances.length;e++){let i=s(this,It).getById("door",s(this,Be).entrances[e].id);i&&s(this,q).doors.push(i)}return s(this,q).doors}get connections(){var i;if(s(this,q).connections)return s(this,q).connections;if(s(this,Be).connections==null)return s(this,q).connections=[],s(this,q).connections;let e=new Set;for(let n=0;n<s(this,Be).connections.length;n++){let o=s(this,Be).connections[n],a=s(this,It).mvfConnectionsById[o],l=(a==null?[]:a.nodes).map(p=>s(this,It).getById("node",p)).filter(Boolean);for(let p of l){if(p==null)continue;let d=Di([p.coordinate.longitude,p.coordinate.latitude]),g=((i=s(this,It).connectionSpaceIdsByLatLon[d])!=null?i:[]).map(y=>s(this,It).connectionsById[y]).filter(y=>y!=null);for(let y of g)e.add(y)}}return s(this,q).connections=Array.from(e),s(this,q).connections}get annotations(){if(s(this,q).annotations)return s(this,q).annotations;if(s(this,Be).annotations==null)return s(this,q).annotations=[],s(this,q).annotations;s(this,q).annotations=[];for(let e=0;e<s(this,Be).annotations.length;e++){let i=s(this,It).getById("annotation",s(this,Be).annotations[e].id);i&&s(this,q).annotations.push(i)}return s(this,q).annotations}get categories(){return s(this,q).categories?s(this,q).categories:s(this,Be).categories==null?(s(this,q).categories=[],s(this,q).categories):(s(this,q).categories=s(this,Be).categories.map(e=>s(this,It).getById("location-category",e)).filter(e=>e!=null),s(this,q).categories)}get mapObjects(){return s(this,q).mapObjects?s(this,q).mapObjects:s(this,Be).obstructions==null?(s(this,q).mapObjects=[],s(this,q).mapObjects):(s(this,q).mapObjects=s(this,Be).obstructions.map(e=>s(this,It).getById("object",e.id)).filter(e=>e!=null),s(this,q).mapObjects)}get areas(){return s(this,q).areas?s(this,q).areas:s(this,Be).areas==null?(s(this,q).areas=[],s(this,q).areas):(s(this,q).areas=s(this,Be).areas.map(e=>s(this,It).getById("area",e.id)).filter(e=>e!=null),s(this,q).areas)}get focusTarget(){if(s(this,q).focusTarget)return s(this,q).focusTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);return s(this,q).focusTarget=e,e}get openingHours(){var e;return s(this,q).openingHours?s(this,q).openingHours:(s(this,q).openingHours=new Hf((e=s(this,Be).openingHoursSpecification)!=null?e:[]),s(this,q).openingHours)}get navigationTarget(){if(s(this,q).navigationTarget)return s(this,q).navigationTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);for(let i of this.points)e.push(i.focusTarget);return s(this,q).navigationTarget=e,e}toJSON(){return{id:this.id,name:this.name}}};It=new WeakMap,q=new WeakMap,Be=new WeakMap,u(Kp,"__type","location-profile");var Db=Kp,Cl=Db;m();var Do,rr,Qa,Qp=class Qp extends ut{constructor(e,i){super(i.mvfData.id);u(this,"__type",Qp.__type);u(this,"id","cat_");u(this,"name","");u(this,"icon","");S(this,Do);S(this,rr,{});S(this,Qa);I(this,Do,e),I(this,Qa,i.mvfData);for(let n in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Qa)[n]}})}static is(e){return e.__type===Qp.__type}get parent(){return s(this,rr).parent?s(this,rr).parent:(s(this,rr).parent=s(this,Qa).parent?s(this,Do).getById("location-category",s(this,Qa).parent):void 0,s(this,rr).parent)}get children(){return s(this,rr).children?s(this,rr).children:(s(this,rr).children=s(this,Do).locationCategoriesByParentId[this.id]||[],s(this,rr).children)}get locationProfiles(){if(s(this,rr).locationProfiles)return s(this,rr).locationProfiles;let e=[];for(let i of s(this,Do).locationProfilesByCategoryId[this.id]||[]){let n=s(this,Do).getById("location-profile",i.id);n&&e.push(n)}return s(this,rr).locationProfiles=e,e}toJSON(){return{id:this.id,name:this.name}}};Do=new WeakMap,rr=new WeakMap,Qa=new WeakMap,u(Qp,"__type","location-category");var Eb=Qp,If=Eb;var re,Wf,uT,Fl,Bl=class extends oe{constructor(e,i){var c,l,p,d,f;super();S(this,Wf);u(this,"Analytics");S(this,re,{});u(this,"Query");u(this,"mvf");u(this,"outdoorViewToken");u(this,"spaceIdsByDestinationNodeId");u(this,"objectEntranceNodeIdsByObstructionId");u(this,"obstructionIdByEntranceId");u(this,"venue");u(this,"tokenManager");u(this,"directions");u(this,"enterpriseMode",!1);u(this,"nodesById");u(this,"spacesById");u(this,"floorsById");u(this,"floorStacksById");u(this,"facadesById");u(this,"facadesBySpaceId");u(this,"connectionsById");u(this,"objectsById");u(this,"doorsById");u(this,"pointsOfInterestById");u(this,"annotationsById");u(this,"areasById");u(this,"locationProfilesById");u(this,"locationCategoriesById");u(this,"locationProfilesByExternalId");u(this,"locationsById");u(this,"locationProfilesByCategoryId");u(this,"locationCategoriesByParentId");u(this,"categoriesById");u(this,"doorsByNodeId");u(this,"mvfLocationsBySpaceId");u(this,"locationIdsByNodeId");u(this,"spaceIdsByNodeId");u(this,"mvfAnnotationsById");u(this,"mvfConnectionsById");u(this,"mvfConnectionsByNodeId");u(this,"mvfConnectionIdsByLatLon");u(this,"mvfEntrancesById");u(this,"mvfNodesById");u(this,"mvfObstructionById");u(this,"mvfSpacesById");u(this,"mvfFloorsById");u(this,"mvfFloorStacksById");u(this,"mvfAreasById");u(this,"connectionSpaceIdsByLatLon");u(this,"locationProfilesByAttachedFeatureId");u(this,"spacesByExternalId");u(this,"nodesByExternalId");u(this,"objectsByExternalId");u(this,"poisByExternalId");u(this,"floorsByExternalId");u(this,"floorStacksByExternalId");u(this,"doorsByExternalId");u(this,"areasByExternalId");u(this,"connectionsByExternalId");u(this,"locationsByExternalId");u(this,"categoriesByExternalId");u(this,"mvfNodesByFloorId");u(this,"mvfSpacesByFloorId");u(this,"mvfPoisByFloorId");u(this,"mvfEntrancesByFloorId");u(this,"mvfAnnotationsByFloorId");u(this,"localePacksUrls");u(this,"currentLanguage");u(this,"languagePacks",{});u(this,"tilesets",{});u(this,"binaryBundle");u(this,"envControl");u(this,"getMapDataOptions");S(this,Fl);u(this,"getDirectionsMultiDestination",(e,i,n)=>this.getDirections(e,i,{...n,multiDestination:!0}));u(this,"getDirections",(e,i,n)=>{let{accessible:o=!1,smoothing:a=!0,multiDestination:c=!1}=n||{},l=typeof a=="object"?a.enabled:a,p=typeof a=="object"?a.radius:void 0,d=(n==null?void 0:n.zones)||[],f={accessible:o,zones:d,smoothing:{enabled:l!=null?l:!0,radius:p!=null?p:.75},excludedConnections:(n==null?void 0:n.excludedConnections)||[]};if(c&&Array.isArray(i)){let g=Array.isArray(e)?e:[e],y=[];for(let v of i){let x=Array.isArray(v)?v:[v],b=this.directions.getDirections(g,x,f,this);if(!b){O.error("getDirections failed due to missing directions for one of the segments");return}g=x,y.push(b)}return y}else{let g=Array.isArray(e)?e:[e],y=Array.isArray(i)?i:[i];if(Array.isArray(y[0])){O.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&y[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,y[0].id),this.directions.getDirections(g,y,f,this)}});u(this,"transformImageRequest",async e=>{var n;if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!u5(e))return{url:e};if(d5(e))return{url:e};let i=Cf(e);if(!i)return{url:e};try{let o=await((n=this.tokenManager)==null?void 0:n.getSasTokensAsync()),a=o==null?void 0:o[i.mapId];if(a==null)throw new Error("SAS token not found");let[c]=e.split("?");return{url:"".concat(c,"?").concat(a.token)}}catch(o){return O.error("Failed to append SAS token to image request. Requests for private images may fail.",o),{url:e}}});let n=(c=i==null?void 0:i.env)!=null?c:ca();if(this.envControl=n,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new Ys,this.localePacksUrls=(l=i==null?void 0:i.localePacksUrls)!=null?l:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.getMapDataOptions=i==null?void 0:i.getMapDataOptions,((p=e["tileset.json"])==null?void 0:p.default)!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,n.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let g of e["tileset.json"].others)this.tilesets[g.key]=g;this.enterpriseMode=(d=i==null?void 0:i.enterprise)!=null?d:!1,this.tokenManager=i==null?void 0:i.tokenManager;let o=p5(e,this);this.nodesById=o.nodesById,this.spacesById=o.spacesById,this.floorsById=o.floorsById,this.floorStacksById=o.floorStacksById,this.facadesById=o.facadesById,this.facadesBySpaceId=o.facadesBySpaceId,this.connectionsById=o.connectionsById,this.objectsById=o.objectsById,this.doorsById=o.doorsById,this.pointsOfInterestById=o.poisById,this.annotationsById=o.annotationsById,this.areasById=o.areasById,this.locationProfilesById=o.locationProfilesById,this.locationCategoriesById=o.locationCategoriesById,this.locationProfilesByCategoryId=o.locationProfilesByCategoryId,this.locationCategoriesByParentId=o.locationCategoriesByParentId,this.spacesByExternalId=o.spacesByExternalId,this.nodesByExternalId=o.nodesByExternalId,this.objectsByExternalId=o.objectsByExternalId,this.floorsByExternalId=o.floorsByExternalId,this.locationProfilesByExternalId=o.locationProfilesByExternalId,this.floorStacksByExternalId=o.floorStacksByExternalId,this.poisByExternalId=o.poisByExternalId,this.doorsByExternalId=o.doorsByExternalId,this.areasByExternalId=o.areasByExternalId,this.mvfAnnotationsById=o.mvfAnnotationsById,this.mvfConnectionsById=o.mvfConnectionsById,this.mvfConnectionsByNodeId=o.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=o.mvfConnectionIdsByLatLon,this.mvfEntrancesById=o.mvfEntrancesById,this.mvfNodesById=o.mvfNodesById,this.mvfObstructionById=o.mvfObstructionById,this.mvfSpacesById=o.mvfSpacesById,this.mvfFloorsById=o.mvfFloorsById,this.mvfFloorStacksById=o.mvfFloorStacksById,this.mvfNodesByFloorId=o.mvfNodesByFloorId,this.mvfSpacesByFloorId=o.mvfSpacesByFloorId,this.mvfPoisByFloorId=o.mvfPoisByFloorId,this.mvfEntrancesByFloorId=o.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=o.mvfAnnotationsByFloorId,this.mvfAreasById=o.mvfAreasById,this.doorsByNodeId=o.doorsByNodeId,this.spaceIdsByDestinationNodeId=o.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=o.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=o.obstructionIdByEntranceId;let a=c5(e,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.mvfLocationsBySpaceId=a.mvfLocationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=o.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=o.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.connectionsByExternalId=a.connectionsByExternalId,this.locationsByExternalId=a.locationsByExternalId,this.categoriesByExternalId=a.categoriesByExternalId,a.venue.name!=null){this.venue=new hb(this,{mvfData:a.venue});let g={};for(let y in a.mvfLocationsById)g[y]=a.mvfLocationsById[y];for(let y in a.locationInstancesById)g[y]=a.locationInstancesById[y];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":g,"enterprise-category":a.mvfCategoriesById,"floor-stack":o.mvfFloorStacksById,floor:o.mvfFloorsById}},(f=i==null?void 0:i.languagePacks)==null||f.forEach(({language:y,localePack:v})=>{this.languagePacks[y.code]=fb(v)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new qp(this),this.directions=new Ff({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let e=this;return{get baseUri(){var i;return e.envControl.getBaseUri((i=e.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new ae(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?e:0}get spaces(){return s(this,re).spaces==null&&(s(this,re).spaces=globalThis.Object.values(this.spacesById)),s(this,re).spaces}get objects(){return s(this,re).objects==null&&(s(this,re).objects=globalThis.Object.values(this.objectsById)),s(this,re).objects}get connections(){return s(this,re).connections==null&&(s(this,re).connections=globalThis.Object.values(this.connectionsById)),s(this,re).connections}get floors(){return s(this,re).floors==null&&(s(this,re).floors=globalThis.Object.values(this.floorsById)),s(this,re).floors}get floorStacks(){return s(this,re).floorStacks==null&&(s(this,re).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,re).floorStacks}get facades(){return s(this,re).facades==null&&(s(this,re).facades=globalThis.Object.values(this.facadesById)),s(this,re).facades}get doors(){return s(this,re).doors==null&&(s(this,re).doors=globalThis.Object.values(this.doorsById)),s(this,re).doors}get pointsOfInterest(){return s(this,re).pointsOfInterest==null&&(s(this,re).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,re).pointsOfInterest}get annotations(){return s(this,re).annotations==null&&(s(this,re).annotations=globalThis.Object.values(this.annotationsById)),s(this,re).annotations}get areas(){return s(this,re).areas==null&&(s(this,re).areas=globalThis.Object.values(this.areasById)),s(this,re).areas}get nodes(){return s(this,re).nodes==null&&(s(this,re).nodes=globalThis.Object.values(this.nodesById)),s(this,re).nodes}get locations(){return s(this,re).locations==null&&(s(this,re).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,re).categories==null&&(s(this,re).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return s(this,re).locationProfiles==null&&(s(this,re).locationProfiles=globalThis.Object.values(this.locationProfilesById)),s(this,re).locationProfiles}get locationCategories(){return s(this,re).locationCategories==null&&(s(this,re).locationCategories=globalThis.Object.values(this.locationCategoriesById)),s(this,re).locationCategories}get mvfFloors(){return s(this,re).mvfFloors==null&&(s(this,re).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,re).mvfFloors}get mvfFloorStacks(){return s(this,re).mvfFloorStacks==null&&(s(this,re).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,re).mvfFloorStacks}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(e,i){switch(e){case"location-profile":return this.locationProfilesById[i];case"location-category":return this.locationCategoriesById[i];case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":let n=this.connectionsById[i];return n==null&&(n=N(this,Wf,uT).call(this,this.mvfConnectionsById[i])),n;case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:return}}getByExternalId(e,i){var n,o,a,c,l,p,d,f,g,y,v,x;switch(e){case"location-profile":return(n=this.locationProfilesByExternalId[i])!=null?n:[];case"location-category":return[];case"space":return(o=this.spacesByExternalId[i])!=null?o:[];case"floor":return(a=this.floorsByExternalId[i])!=null?a:[];case"floor-stack":return(c=this.floorStacksByExternalId[i])!=null?c:[];case"node":return(l=this.nodesByExternalId[i])!=null?l:[];case"door":return(p=this.doorsByExternalId[i])!=null?p:[];case"connection":return(d=this.connectionsByExternalId[i])!=null?d:[];case"object":return(f=this.objectsByExternalId[i])!=null?f:[];case"point-of-interest":return(g=this.poisByExternalId[i])!=null?g:[];case"area":return(y=this.areasByExternalId[i])!=null?y:[];case"enterprise-location":return(v=this.locationsByExternalId[i])!=null?v:[];case"enterprise-category":return(x=this.categoriesByExternalId[i])!=null?x:[];default:return[]}}getMapDataById(e){var i,n,o,a,c,l,p,d,f,g;return(g=(f=(d=(p=(l=(c=(a=(o=(n=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?n:this.floorStacksById[e])!=null?o:this.facadesById[e])!=null?a:this.nodesById[e])!=null?c:this.doorsById[e])!=null?l:this.connectionsById[e])!=null?p:this.objectsById[e])!=null?d:this.pointsOfInterestById[e])!=null?f: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,n,o){var l,p;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,c=(p=(l=this.languagePacks[a])==null?void 0:l.optimized)==null?void 0:p[e];if(c){let d=c[n];if(d!=null&&d[i]!==void 0)return d[i]}return o}async changeLanguage(e){var c;let i=e.toLowerCase();if(!i){O.error("language code must be defined");return}if(!this.currentLanguage){O.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(c=this.venue)==null?void 0:c.languages.find(({code:l})=>l.toLowerCase()===i.toLowerCase());if(!o){O.warn("language not found");return}if(n===o.code)return;let a=this.languagePacks[o.code];if(!a){let l=this.localePacksUrls[o.code];if(!l){O.error("locale packs url not found for ".concat(o.code));return}s(this,Fl)&&s(this,Fl).abort();let p=new AbortController;I(this,Fl,p);let d;try{d=await Z2(l,{signal:p.signal})}catch(f){O.error("failed downloading language pack",f);return}if(!d||p.signal.aborted)return;a=fb(d),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let n=Cp(e),o=Cp(i);return Kr([n.longitude,n.latitude],[o.longitude,o.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var n;let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let c=await qg(this.localePacksUrls[a.code],{signal:o.signal}),l=await Js(c);l&&i.push({language:{code:a.code,name:a.name},localePack:l})}}catch(c){O.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var n;if(!this.binaryBundle){O.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let c=await qg(this.localePacksUrls[a.code],{signal:o.signal});c&&i.push({language:{code:a.code,name:a.name},localePack:c})}}catch(c){O.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(s(this,re)))s(this,re)[e]=null}};re=new WeakMap,Wf=new WeakSet,uT=function(e){var c;let i=(c=e==null?void 0:e.nodes)==null?void 0:c[0],n=this.getById("node",i);if(n==null)return;let o=Di([n.coordinate.longitude,n.coordinate.latitude]),a=this.connectionSpaceIdsByLatLon[o];return a==null?void 0:a.map(l=>this.connectionsById[l]).find(l=>l!=null)},Fl=new WeakMap;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 dT="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 hT=!1;function fT(){hT=!0}function mT(){return hT}var zf=class{constructor(t){u(this,"backgroundAlpha",1);u(this,"backgroundColor",new Oe);u(this,"width",0);u(this,"height",0);u(this,"options",{});u(this,"renderer");u(this,"enabledLayers",new Set([0,1]));u(this,"handleWebGLContextCreationError",t=>{var e,i;(i=(e=this.options).onWebGLContextCreationError)==null||i.call(e,t)});u(this,"handleWebGLContextLost",t=>{var e,i;(i=(e=this.options).onWebGLContextLost)==null||i.call(e,t)});u(this,"handleWebGLContextRestored",t=>{var e,i;(i=(e=this.options).onWebGLContextRestored)==null||i.call(e,t)});var e,i,n,o,a;try{this.options=t,mT()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Oe,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 Xv({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 Oe((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(i=t.backgroundAlpha)!=null?i:1}catch(c){O.error(c),t.onWebGLRendererError&&t.onWebGLRendererError(c)}(n=this.domElement())==null||n.addEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(a=this.domElement())==null||a.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,e,i,n,o;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t)),(i=this.domElement())==null||i.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(n=this.domElement())==null||n.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(o=this.domElement())==null||o.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,e){if(this.renderer){this.renderer.state.reset();for(let i of this.enabledLayers.values())e.layers.enable(i);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){T.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}};m();m();var gT='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';m();m();m();m();m();function yT(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}m();function bT(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}m();function vT(r,t){let e=t.x,i=t.y,n=t.x+t.w,o=t.y+t.h,a=r.x,c=r.y,l=r.x+r.w,p=r.y+r.h;return e<l&&a<n&&i<p&&c<o}m();function In(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}m();var dt=class{constructor(t,e,i,n,o){u(this,"x");u(this,"y");u(this,"w");u(this,"h");u(this,"userData");this.userData=typeof o>"u"?null:o,this.x=t,this.y=e,this.w=i,this.h=n}contains(t){return t===this?!1:yT(this,t)}intersects(t){return vT(this,t)}intersectsPoint(t){return bT(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var Ni=class r{constructor(t,e){u(this,"topLeft");u(this,"topRight");u(this,"bottomLeft");u(this,"bottomRight");u(this,"divided",!1);u(this,"boundary");u(this,"capacity",16);u(this,"objects",[]);u(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:n}=this.boundary;this.topLeft=new r(new dt(t,e,i/2,n/2),this),this.topRight=new r(new dt(t+i/2,e,i/2,n/2),this),this.bottomLeft=new r(new dt(t,e+n/2,i/2,n/2),this),this.bottomRight=new r(new dt(t+i/2,e+n/2,i/2,n/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(In(e,this.topLeft.queryRect(t)),In(e,this.topRight.queryRect(t)),In(e,this.bottomLeft.queryRect(t)),In(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(In(e,this.topLeft.queryPoint(t)),In(e,this.topRight.queryPoint(t)),In(e,this.bottomLeft.queryPoint(t)),In(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()}};m();m();var xT=["","","low","medium","high","always-visible"];function CT(r){return Math.min(5,Math.max(2,r))}function Rl(r){if(typeof r=="number")return CT(r);let t=xT.indexOf(r);return t===-1?3:t}function eu(r){let t=CT(r);return xT[t]}function TT(r,t,e){let i,n,o,a=null,c=0;e||(e={});let l=function(){c=e.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)};return function(){let p=Date.now();!c&&e.leading===!1&&(c=p);let d=t-(p-c);return i=globalThis,n=arguments,d<=0||d>t?(a&&(clearTimeout(a),a=null),c=p,o=r.apply(i,n),a||(i=n=null)):!a&&e.trailing!==!1&&(a=setTimeout(l,d)),o}}var es=!1,_b="",n_=150,Zf=class extends oe{constructor(e,i,n=_b?new Worker(_b):new Worker(URL.createObjectURL(new Blob([gT],{type:"text/javascript"})))){super();u(this,"worker");u(this,"debugContext");u(this,"debugCanvas");u(this,"collidersDirty",!0);u(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);u(this,"visibleCollidersQTree",new Ni(new dt(0,0,0,0)));u(this,"interactiveCollidersQTree",new Ni(new dt(0,0,0,0)));u(this,"coreState");u(this,"postMessage");u(this,"showCollisionBoxes",()=>{es=!0,this.debugCanvas.style.display="block"});u(this,"hideCollisionBoxes",()=>{es=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});u(this,"currentMsgId","");u(this,"working",!1);u(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});u(this,"componentArray",[]);u(this,"update",(e,i,n="bottom-left",o=!1)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let l of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(l);p&&(c=p.components[0],this.componentArray.push(c))}this.resize(e,i,n),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(c=>c.collisionDirty===!0);a&&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(o&&!a);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=l.bboxes,this.packedMessage[0][c][1]=l.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=l.rank===5?1:0,this.packedMessage[0][c][3]=l.x,this.packedMessage[0][c][4]=l.y,this.packedMessage[0][c][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=l.lockedToStrategyIndex}this.working||this.postMessage()});u(this,"resolve",e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,n=-1,o,a,c;es&&(this.visibleCollidersQTree=new Ni(new dt(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Ni(new dt(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let p=this.componentArray[l];i[l]!=null&&(n=i[l][0],o=i[l][2],p.offscreen=i[l][1]===1,n!==-1&&o!=null?(c=new dt(o.x,o.y,o.w,o.h,{entityId:p.id}),es&&this.visibleCollidersQTree.insert(c),a=this.coreState.geometry2DMap.get(p.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new dt(o.x,o.y,o.w,o.h,{entityId:p.id})),(p.canShow===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),n!==-1&&n!==p.currentStrategyIndex&&(p.activeBoundingBox=c,p.onStrategySelected(n))):((p.canShow===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),n!==-1&&n!==p.currentStrategyIndex&&p.onStrategySelected(n)))}es&&this.drawDebug(),this.publish("visibility-changed")});u(this,"drawDebug",()=>{es&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});u(this,"destroy",()=>{this.worker.terminate()});this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=TT(this._postMessage,n_,!1),es?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,i,n){this.packedMessage[6]=n,this.packedMessage[5]=i,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};function Ob(r){_b=r}m();m();m();m();var Xf=class{constructor(t){u(this,"type");u(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},Yf=class{constructor(){u(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};m();function MT(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 Te&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}var Nl,ru=class extends oe{constructor(e,i,n,o,a){super();u(this,"raycaster",new bi);u(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});u(this,"coreState");u(this,"camera");u(this,"worldPlane");u(this,"_quadtree",new Ni(new dt(0,0,0,0)));u(this,"_container");u(this,"lastPointerEvent");u(this,"cursor","grab");u(this,"touchesCount",0);u(this,"isUserInteracting");u(this,"hasTouched",!1);S(this,Nl);u(this,"onPointerMoveRaf",e=>{this.lastPointerEvent=e,s(this,Nl)&&cancelAnimationFrame(s(this,Nl)),I(this,Nl,requestAnimationFrame(()=>{this.onPointerMove(e)}))});u(this,"onPointerMove",e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()});u(this,"tapsControl",new Yf);u(this,"onPointerDown",e=>{e.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new Xf(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))});u(this,"clickTimeout");u(this,"onPointerUp",e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())});u(this,"dirty3D",!0);u(this,"cachedHitBoxes",{entities:[],groups:[]});u(this,"ndcPoint",new ie);u(this,"debugPanel");this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=e,this.coreState=i,this.worldPlane=o,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}getThreeDIntersectsFromXY(e){return this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(n=>{var o,a;return((o=n.object)==null?void 0:o.name)==="worldPlane"||((a=n.object)==null?void 0:a.visible)})}getGroupContainerIntersectsFromXY(e){this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0);let i=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(o=>o.object.visible),n;return i!=null&&i.length>0&&(n=MT(i)),n}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:n,entity2D:o,position:a,groupContainers:c}=this.intersect(i);(this.detect3DEntityHover(n)||this.detect2DEntityHover(o)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=n,this.state.lastHover=n,this.state.hovered2DEntity=o,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:c})),this.handleCursor()}handleCursor(){var a;let e=!!(this.state.hovered3DEntity&&((a=this.state.hovered3DEntity)!=null&&a.components[2])||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=l_(e,n,i);this.cursor!==o&&(this.cursor=o,o==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),(e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path"||(e==null?void 0:e.type)==="custom-geometry"?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var b,C,M,P,w;let i=[e.offsetX,e.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(D=>D.intersectsPoint(i)),a=this.coreState.containerOffset[0],c=this.coreState.containerOffset[1];this.ndcPoint.x=(e.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-a)/this._container.clientHeight)*2+1;let l=this.getThreeDIntersectsFromXY(this.ndcPoint),p=(b=l[0])==null?void 0:b.point,d=[],f=[];for(let D of l.filter(B=>B.object.name!=="worldPlane"))D.object instanceof ue&&D.object.material.depthTest===!1?d.push(D):f.push(D);let g=(M=(C=d[0])!=null?C:f[0])!=null?M:void 0,y,v;if(g!=null){if(y=p_(g.object,this.coreState.geometry3DMap),!y){let D=(P=g==null?void 0:g.instanceId)!=null?P:g==null?void 0:g.batchId;y=D!=null&&(g!=null&&g.object.userData.entities)?this.coreState.geometry3DMap.get(g==null?void 0:g.object.userData.entities[D]):this.coreState.geometry3DMap.get(g==null?void 0:g.object.userData.entityId)}y!=null&&y.components[2]&&(v=y)}let x=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((w=o==null?void 0:o.userData)==null?void 0:w.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:v,position:p,groupContainers:x}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&PT(this.state.lastHover,!1,this.coreState),e&&PT(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!$v(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var n,o,a;this.queueDebugMessage("CLICK \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var n,o,a;this.queueDebugMessage("HOVER \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var o;let n=document.createElement("pre");n.style.maxWidth="300px",n.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",n.style.backgroundColor=i,n.textContent=e,(o=this.debugPanel)==null||o.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};Nl=new WeakMap;function PT(r,t,e){var a;let i=r.components[2];i&&i.hover!==!0&&(i.hover=t?"user-interaction":!1,i.dirty=!0);let n=(a=r.components[0].textMesh)==null?void 0:a.userData.entityId;if(!n)return;let o=e.geometry3DMap.get(n);(o==null?void 0:o.type)==="text3d"&&(o.components[1].hoverByPolygon=t,o.components[1].dirty=!0)}function l_(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}function c_(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof Qn)return;if(t.userData.isSingleModel)return t;t=t.parent}}function p_(r,t){let e=c_(r);return e?t.get(e.userData.entityId):void 0}m();var rM=ra(Hb());var lu=4,iL=8,nL="0.6",tM="low-priority-pin",Wb=E.object({rank:E.union([E.enum(["low","medium","high","always-visible"]),E.number()]).optional(),interactive:E.union([E.boolean(),E.literal("pointer-events-auto")]).optional(),id:E.string().optional(),anchor:E.union([E.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),E.array(E.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:E.boolean().optional(),zIndex:E.number().optional(),lowPriorityPin:E.object({enabled:E.boolean().optional(),size:E.number().positive().optional(),color:E.string().optional()}).optional()});function iM(r,t,e){E.array(E.number()).min(2).max(3).parse(r),E.string().parse(t),Wb.parse(e)}var oL=Object.freeze({enabled:!0,size:iL,color:"#666"}),Ul=class Ul{constructor(t,e={}){u(this,"id");u(this,"type","marker");u(this,"rank",0);u(this,"initialRank",0);u(this,"activeAnchor","center");u(this,"pointerEvents","none");u(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...oL}});u(this,"projection",new ie);u(this,"enabled",!0);u(this,"canShow",!1);u(this,"visible",!0);u(this,"isOccluded",!1);u(this,"offscreen",!1);u(this,"strategyIndex",-1);u(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});u(this,"dimensions",{width:0,height:0});u(this,"markerContainer");u(this,"containerEl");u(this,"contentEl",null);u(this,"contentHtml","");u(this,"style",{top:"0px",left:"0px"});u(this,"dirty",!1);u(this,"attachedDirty",!0);u(this,"collisionDirty",!0);u(this,"visibilityNeedsUpdate","show");u(this,"animation",null);u(this,"currentStrategyIndex",-1);u(this,"onStrategySelected",(t,e=!1)=>{var n,o;if(this.currentStrategyIndex===t&&!e)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",tM);let a=this.options.lowPriorityPin,c=a.size,l=a.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(c,"px")),this.markerContainer.style.setProperty("--pin-color",l),this.markerContainer.style.opacity=nL,this.style.top=-c/2+"px",this.style.left=-c/2+"px"}else{this.activeAnchor=(o=(n=this.strategies[t])==null?void 0:n.name)!=null?o:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:a,height:c}=this.dimensions,l=-c/2+"px",p=-a/2+"px";switch(this.style.top=l,this.style.left=p,this.activeAnchor){case"top":{this.style.top=-c+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-a+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-c+"px",this.style.left=-a+"px";break}case"top-right":{this.style.top=-c+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-a+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=l,this.style.left=p}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left});u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var i,n,o;if(this.id=(e==null?void 0:e.id)||De(),this.options=(0,rM.default)(this.options,e),typeof e.rank=="string")this.rank=Rl(e.rank);else if(e.rank!=null&&e.rank>0)this.rank=e.rank;else{let a=Math.trunc(T.env.NODE_ENV==="test"?Ul.testId:Ul.testId*10)/10;Ul.testId+=.001,this.rank=a}typeof e.interactive=="string"&&(this.pointerEvents=e.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(i=this.markerContainer.firstElementChild)!=null?i:null,this.contentEl=(o=(n=this.markerContainer.firstElementChild)==null?void 0:n.firstElementChild)!=null?o:null}updateDimensions(t,e){if(t!=null&&e!=null)this.dimensions={width:t,height:e};else{let{width:i,height:n}=this.markerContainer.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var o;let{width:t,height:e}=this.dimensions;if(t===0||e===0)return[];let n=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(a=>({name:a,getBoundingBox:()=>{let c=e/2,l=e/2,p=t/2,d=t/2;switch(a){case"top":{c=e,l=0;break}case"bottom":{c=0,l=e;break}case"left":{p=t,d=0;break}case"right":{p=0,d=t;break}case"top-left":{c=e,p=t,l=0,d=0;break}case"top-right":{c=e,d=t,l=0,p=0;break}case"bottom-left":{l=e,p=t,c=0,d=0;break}case"bottom-right":{l=e,d=t,c=0,p=0;break}}return[c+lu,l+lu,p+lu,d+lu]}}));if((o=this.options.lowPriorityPin)!=null&&o.enabled){let a={name:tM,getBoundingBox:()=>{let c=Math.max(2,lu/2);return[this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c]}};n.push(a)}return n}toPackedMessage(t=!1){var i;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let e=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&e&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,e&&this.currentStrategyIndex!==((i=this.packedMessage.bboxes[0])==null?void 0:i[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&e?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return(t=this.options.lowPriorityPin)!=null&&t.enabled?Array.isArray(this.options.anchor)?this.options.anchor.length:1:-1}destroy(){}};u(Ul,"testId",0);var Vi=Ul;m();m();m();m();m();var Hl=class{constructor(){u(this,"hover",!1);u(this,"dirty",!1)}};m();m();function im(r){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},im(r)}var aL=/^\s+/,sL=/\s+$/;function J(r,t){if(r=r||"",t=t||{},r instanceof J)return r;if(!(this instanceof J))return new J(r,t);var e=lL(r);this._originalInput=r,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||e.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}J.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,i,n,o,a,c;return e=t.r/255,i=t.g/255,n=t.b/255,e<=.03928?o=e/12.92:o=Math.pow((e+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?c=n/12.92:c=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*c},setAlpha:function(t){return this._a=pM(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=oM(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=oM(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=nM(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=nM(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return aM(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return dL(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(He(this._r,255)*100)+"%",g:Math.round(He(this._g,255)*100)+"%",b:Math.round(He(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(He(this._r,255)*100)+"%, "+Math.round(He(this._g,255)*100)+"%, "+Math.round(He(this._b,255)*100)+"%)":"rgba("+Math.round(He(this._r,255)*100)+"%, "+Math.round(He(this._g,255)*100)+"%, "+Math.round(He(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ML[aM(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+sM(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=J(t);i="#"+sM(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!e&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(i=this.toRgbString()),t==="prgb"&&(i=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(i=this.toHexString()),t==="hex3"&&(i=this.toHexString(!0)),t==="hex4"&&(i=this.toHex8String(!0)),t==="hex8"&&(i=this.toHex8String()),t==="name"&&(i=this.toName()),t==="hsl"&&(i=this.toHslString()),t==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return J(this.toString())},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(gL,arguments)},brighten:function(){return this._applyModification(yL,arguments)},darken:function(){return this._applyModification(bL,arguments)},desaturate:function(){return this._applyModification(hL,arguments)},saturate:function(){return this._applyModification(fL,arguments)},greyscale:function(){return this._applyModification(mL,arguments)},spin:function(){return this._applyModification(vL,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(SL,arguments)},complement:function(){return this._applyCombination(xL,arguments)},monochromatic:function(){return this._applyCombination(TL,arguments)},splitcomplement:function(){return this._applyCombination(CL,arguments)},triad:function(){return this._applyCombination(lM,[3])},tetrad:function(){return this._applyCombination(lM,[4])}};J.fromRatio=function(r,t){if(im(r)=="object"){var e={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?e[i]=r[i]:e[i]=cu(r[i]));r=e}return J(r,t)};function lL(r){var t={r:0,g:0,b:0},e=1,i=null,n=null,o=null,a=!1,c=!1;return typeof r=="string"&&(r=DL(r)),im(r)=="object"&&(Dn(r.r)&&Dn(r.g)&&Dn(r.b)?(t=cL(r.r,r.g,r.b),a=!0,c=String(r.r).substr(-1)==="%"?"prgb":"rgb"):Dn(r.h)&&Dn(r.s)&&Dn(r.v)?(i=cu(r.s),n=cu(r.v),t=uL(r.h,i,n),a=!0,c="hsv"):Dn(r.h)&&Dn(r.s)&&Dn(r.l)&&(i=cu(r.s),o=cu(r.l),t=pL(r.h,i,o),a=!0,c="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=pM(e),{ok:a,format:r.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}function cL(r,t,e){return{r:He(r,255)*255,g:He(t,255)*255,b:He(e,255)*255}}function nM(r,t,e){r=He(r,255),t=He(t,255),e=He(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,c=(i+n)/2;if(i==n)o=a=0;else{var l=i-n;switch(a=c>.5?l/(2-i-n):l/(i+n),i){case r:o=(t-e)/l+(t<e?6:0);break;case t:o=(e-r)/l+2;break;case e:o=(r-t)/l+4;break}o/=6}return{h:o,s:a,l:c}}function pL(r,t,e){var i,n,o;r=He(r,360),t=He(t,100),e=He(e,100);function a(p,d,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?p+(d-p)*6*f:f<1/2?d:f<2/3?p+(d-p)*(2/3-f)*6:p}if(t===0)i=n=o=e;else{var c=e<.5?e*(1+t):e+t-e*t,l=2*e-c;i=a(l,c,r+1/3),n=a(l,c,r),o=a(l,c,r-1/3)}return{r:i*255,g:n*255,b:o*255}}function oM(r,t,e){r=He(r,255),t=He(t,255),e=He(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,c=i,l=i-n;if(a=i===0?0:l/i,i==n)o=0;else{switch(i){case r:o=(t-e)/l+(t<e?6:0);break;case t:o=(e-r)/l+2;break;case e:o=(r-t)/l+4;break}o/=6}return{h:o,s:a,v:c}}function uL(r,t,e){r=He(r,360)*6,t=He(t,100),e=He(e,100);var i=Math.floor(r),n=r-i,o=e*(1-t),a=e*(1-n*t),c=e*(1-(1-n)*t),l=i%6,p=[e,a,o,o,c,e][l],d=[c,e,e,a,o,o][l],f=[o,o,c,e,e,a][l];return{r:p*255,g:d*255,b:f*255}}function aM(r,t,e,i){var n=[ti(Math.round(r).toString(16)),ti(Math.round(t).toString(16)),ti(Math.round(e).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function dL(r,t,e,i,n){var o=[ti(Math.round(r).toString(16)),ti(Math.round(t).toString(16)),ti(Math.round(e).toString(16)),ti(uM(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function sM(r,t,e,i){var n=[ti(uM(i)),ti(Math.round(r).toString(16)),ti(Math.round(t).toString(16)),ti(Math.round(e).toString(16))];return n.join("")}J.equals=function(r,t){return!r||!t?!1:J(r).toRgbString()==J(t).toRgbString()};J.random=function(){return J.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function hL(r,t){t=t===0?0:t||10;var e=J(r).toHsl();return e.s-=t/100,e.s=nm(e.s),J(e)}function fL(r,t){t=t===0?0:t||10;var e=J(r).toHsl();return e.s+=t/100,e.s=nm(e.s),J(e)}function mL(r){return J(r).desaturate(100)}function gL(r,t){t=t===0?0:t||10;var e=J(r).toHsl();return e.l+=t/100,e.l=nm(e.l),J(e)}function yL(r,t){t=t===0?0:t||10;var e=J(r).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),J(e)}function bL(r,t){t=t===0?0:t||10;var e=J(r).toHsl();return e.l-=t/100,e.l=nm(e.l),J(e)}function vL(r,t){var e=J(r).toHsl(),i=(e.h+t)%360;return e.h=i<0?360+i:i,J(e)}function xL(r){var t=J(r).toHsl();return t.h=(t.h+180)%360,J(t)}function lM(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=J(r).toHsl(),i=[J(r)],n=360/t,o=1;o<t;o++)i.push(J({h:(e.h+o*n)%360,s:e.s,l:e.l}));return i}function CL(r){var t=J(r).toHsl(),e=t.h;return[J(r),J({h:(e+72)%360,s:t.s,l:t.l}),J({h:(e+216)%360,s:t.s,l:t.l})]}function SL(r,t,e){t=t||6,e=e||30;var i=J(r).toHsl(),n=360/e,o=[J(r)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,o.push(J(i));return o}function TL(r,t){t=t||6;for(var e=J(r).toHsv(),i=e.h,n=e.s,o=e.v,a=[],c=1/t;t--;)a.push(J({h:i,s:n,v:o})),o=(o+c)%1;return a}J.mix=function(r,t,e){e=e===0?0:e||50;var i=J(r).toRgb(),n=J(t).toRgb(),o=e/100,a={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return J(a)};J.readability=function(r,t){var e=J(r),i=J(t);return(Math.max(e.getLuminance(),i.getLuminance())+.05)/(Math.min(e.getLuminance(),i.getLuminance())+.05)};J.isReadable=function(r,t,e){var i=J.readability(r,t),n,o;switch(o=!1,n=EL(e),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o};J.mostReadable=function(r,t,e){var i=null,n=0,o,a,c,l;e=e||{},a=e.includeFallbackColors,c=e.level,l=e.size;for(var p=0;p<t.length;p++)o=J.readability(r,t[p]),o>n&&(n=o,i=J(t[p]));return J.isReadable(r,i,{level:c,size:l})||!a?i:(e.includeFallbackColors=!1,J.mostReadable(r,["#fff","#000"],e))};var zb=J.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ML=J.hexNames=IL(zb);function IL(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}function pM(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function He(r,t){PL(r)&&(r="100%");var e=wL(r);return r=Math.min(t,Math.max(0,parseFloat(r))),e&&(r=parseInt(r*t,10)/100),Math.abs(r-t)<1e-6?1:r%t/parseFloat(t)}function nm(r){return Math.min(1,Math.max(0,r))}function xr(r){return parseInt(r,16)}function PL(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}function wL(r){return typeof r=="string"&&r.indexOf("%")!=-1}function ti(r){return r.length==1?"0"+r:""+r}function cu(r){return r<=1&&(r=r*100+"%"),r}function uM(r){return Math.round(parseFloat(r)*255).toString(16)}function cM(r){return xr(r)/255}var ei=function(){var r="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",e="(?:"+t+")|(?:"+r+")",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Dn(r){return!!ei.CSS_UNIT.exec(r)}function DL(r){r=r.replace(aL,"").replace(sL,"").toLowerCase();var t=!1;if(zb[r])r=zb[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=ei.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=ei.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=ei.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=ei.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=ei.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=ei.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=ei.hex8.exec(r))?{r:xr(e[1]),g:xr(e[2]),b:xr(e[3]),a:cM(e[4]),format:t?"name":"hex8"}:(e=ei.hex6.exec(r))?{r:xr(e[1]),g:xr(e[2]),b:xr(e[3]),format:t?"name":"hex"}:(e=ei.hex4.exec(r))?{r:xr(e[1]+""+e[1]),g:xr(e[2]+""+e[2]),b:xr(e[3]+""+e[3]),a:cM(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=ei.hex3.exec(r))?{r:xr(e[1]+""+e[1]),g:xr(e[2]+""+e[2]),b:xr(e[3]+""+e[3]),format:t?"name":"hex"}:!1}function EL(r){var t,e;return r=r||{level:"AA",size:"small"},t=(r.level||"AA").toUpperCase(),e=(r.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:t,size:e}}var n0=ra(i0());var a0=E.object({rank:E.union([E.enum(["low","medium","high","always-visible"]),E.number()]).optional(),interactive:E.boolean().optional(),appearance:E.object({margin:E.number().min(6).optional(),text:E.object({numLines:E.number().optional(),lineHeight:E.number().optional(),size:E.number().optional(),maxWidth:E.number().optional(),foregroundColor:E.string().optional(),backgroundColor:E.string().optional()}).optional(),marker:E.object({size:E.number().optional(),foregroundColor:E.object({active:E.string().optional(),inactive:E.string().optional()}).optional(),backgroundColor:E.object({active:E.string().optional(),inactive:E.string().optional()}).optional()}).optional()}).optional()});function zM(r,t,e){E.array(E.number()).min(2).max(3).parse(r),E.string().parse(t),a0.parse(e||{})}var Xl={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},CA={lightOnDark:{...Xl,text:{...Xl.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Xl.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Xl,text:{...Xl.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Xl.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},SA="LOW_PRIORITY",UM=4,TA=6,MA=20,IA=2.5,PA=2,wA="cover",DA=-1/0,HM=6.5,WM={heightAbovePolygon:0,appearance:CA.darkOnLight};var Yl=class Yl{constructor(t,e,i){u(this,"lines",0);u(this,"id");u(this,"rank");u(this,"type","label");u(this,"initialRank");u(this,"contextConfigured",!1);u(this,"fillText");u(this,"newStyle",{});u(this,"opacity",0);u(this,"visibilityNeedsUpdate",!1);u(this,"text");u(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});u(this,"projection",new ie);u(this,"labelCacheId");u(this,"_cache",{});u(this,"appearance");u(this,"options");u(this,"visible",!0);u(this,"enabled",!0);u(this,"isOccluded",!1);u(this,"offscreen",!1);u(this,"canShow",!1);u(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});u(this,"dimensions",{width:0,height:0});u(this,"currentStrategyIndex",-1);u(this,"totalMarkerSize",0);u(this,"dirty",!0);u(this,"attachedDirty",!0);u(this,"collisionDirty",!0);u(this,"lastTextAlign");u(this,"imageHash");u(this,"markerSize",0);u(this,"iconVisible",!1);u(this,"dp");u(this,"animate",!0);u(this,"onStrategySelected",t=>{if(this.currentStrategyIndex===t)return;let e=this.strategies[t];e&&e.onStrategySelected(this),this.currentStrategyIndex=t;let i=this.style;this.style=this.newStyle,this.newStyle=i});u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=e.id)!=null?o:De(),this.options=(0,n0.default)({},e,WM),this.text=t,this.dp=(c=1)=>c*i.pixelRatio,typeof e.rank=="string")this.rank=Rl(e.rank),this.initialRank=this.rank;else if(e.rank!=null&&e.rank>0)this.rank=e.rank,this.initialRank=e.rank;else{let c=Math.trunc(T.env.NODE_ENV==="test"?Yl.testId:Yl.testId*10)/10;Yl.testId+=.001,this.rank=c,this.initialRank=c}let n=(0,n0.default)({},this.options.appearance,WM.appearance);this.appearance={margin:n.margin,text:{lineHeight:n.text.lineHeight,numLines:n.text.numLines,size:n.text.size,maxWidth:n.text.maxWidth,foregroundColor:n.text.foregroundColor,backgroundColor:n.text.backgroundColor},marker:{foregroundColor:{active:n.marker.foregroundColor.active,inactive:n.marker.foregroundColor.inactive||J(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||J(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||MA,iconPadding:(a=n.marker.iconPadding)!=null?a:PA,iconFit:n.marker.iconFit||wA,iconOverflow:n.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:n.marker.iconVisibleAtZoomLevel==null?DA:n.marker.iconVisibleAtZoomLevel}}}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(HM),this.totalMarkerSize=Math.ceil((this.markerSize+IA)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:e}=this.dimensions,{margin:i}=this.appearance,n=Math.max(TA,i),o=this.iconVisible?n/2:0,a=this.iconVisible?this.totalMarkerSize:HM,c=[{name:"RIGHT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,e);return[l/2+n,l/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+t+n]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=this.totalMarkerSize/2+UM,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,e);return[l/2+n,l/2+n,this.totalMarkerSize/2+t+n,this.totalMarkerSize/2+n]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=-t-this.totalMarkerSize/2-UM,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let l=this.dp();return[e+this.totalMarkerSize/2/l+n,this.totalMarkerSize/2+n,t/2+n,t/2+n]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-e-this.totalMarkerSize/2,this.newStyle.left=-t/2}},{name:SA,getBoundingBox:()=>[a/2+o,a/2+o,a/2+o,a/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:c}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var e;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((e=this.packedMessage.bboxes[0])==null?void 0:e[4])){let i=this.packedMessage.bboxes.findIndex(n=>n[4]===this.currentStrategyIndex);if(i!==-1){let n=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(n)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let n=this.strategies[i];i===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...n.getBoundingBox(),i]):this.packedMessage.bboxes.push([...n.getBoundingBox(),i])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};u(Yl,"testId",0);var o0=Yl,ji=o0;m();m();var hm=class extends oe{constructor(e,i){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"textSet",new Set);u(this,"batchedTextMap",new Map);u(this,"debugTextAreaMesh",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}remove(e){this.textSet.delete(e)}update(e){var c,l,p;let i,n,o,a=[];for(let d of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(d),(i==null?void 0:i.type)==="text3d"){n=i.components[0],o=i.components[1];let f=(c=n.mesh)==null?void 0:c.parent;if(!f||!(f instanceof Te)||!(n instanceof Eo))continue;if("textArea"in n.feature.properties&&n.mesh!=null&&n.polygonEntityId!=null&&n.textMesh==null&&n.mesh.parent!=null&&((p=(l=n.feature.properties)==null?void 0:l.textArea)==null?void 0:p.position)!=null){if(this.textSet.has(n.polygonEntityId))continue;this.textSet.add(n.polygonEntityId),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,ql().then(({BatchedText:v})=>{let x=new v;return x.type="batchedtext",f.add(x),x}));let y=this.batchedTextMap.get(f);if(!y)throw new Error("batched text required");a.push(ZM({entityId:d,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:y,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(n.mesh!=null&&n.textMesh==null&&n.mesh.parent!=null){if(this.textSet.has(d.toString()))continue;this.textSet.add(d.toString()),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,ql().then(({BatchedText:v})=>{let x=new v;return x.type="batchedtext",f.add(x),x}));let y=this.batchedTextMap.get(f);if(!y)throw new Error("batched text required");a.push(ZM({entityId:d,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:y,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let g=this.batchedTextMap.get(f);n.textMesh&&g&&n.polygonEntityId!=null&&Promise.all([g,Promise.resolve({meshComponent:n,styleComponent:o})]).then(([y,{meshComponent:v,styleComponent:x}])=>{let{textMesh:b}=v;if(y&&b){let C=p0(y,b);v.visible&&!C?y.add(b):!v.visible&&C&&y.remove(b)}x.flipToFaceCamera&&this.flipIfNeeded(v,e)})}return Promise.all(a)}flipIfNeeded(e,i){let n=e.textMesh;if(!n)return!1;let o=n.rotation.z,a=Hg(o+i);a>Math.PI/2&&a<3*Math.PI/2&&(n.rotation.z=Hg(o+Math.PI))}showTextAreaMesh(){let e,i;for(let n of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(n),(e==null?void 0:e.type)==="text3d"&&(i=e.components[0],"textArea"in i.feature.properties)){let o=i.feature.properties.textArea;if(!o)continue;let a=new Vr(o.maxWidth,o.maxHeight),c=new ue(a,new lt({color:"pink"})),{textMesh:l}=i;if(!l)continue;let p=this.convertTo3DMapPosition(o.position,mu);c.position.copy(p),c.position.z=l.position.z-.1,c.rotation.z=l.rotation.z,s0.identity(),s0.makeRotationAxis(new K(0,0,1),l.userData.rotationZ),mu.set(o.maxWidth/2,0,0),mu.applyMatrix4(s0),c.position.x-=mu.x,c.position.y-=mu.y,this.rendererState.entityScene.add(c),this.debugTextAreaMesh.set(n,c)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(e=>{this.rendererState.entityScene.remove(e)}),this.debugTextAreaMesh.clear(),this.publish("render")}};function c0(r){ql().then(({configureTroikaTextBuilder:t})=>{t({useWorker:r})})}var s0=new Nr,mu=new K,l0;async function XM(r){let{preloadFont:t}=await ql();return t(r)}function ql(){return l0||(l0=import("./text3d-3PC3DCSJ.js").then(r=>r)),l0}async function ZM({entityId:r,textComponent:t,styleComponent:e,convertTo3DMapPosition:i,batchedMeshPromise:n,rendererState:o,type:a="text-area"}){return Promise.all([ql(),Promise.resolve({entityId:r,meshComponent:t,styleComponent:e})]).then(([{createTroikaTextPoint:c,createTroikaTextArea:l},p])=>a==="text-area"?l(p.entityId,p.meshComponent,p.styleComponent,i):c(p.entityId,p.meshComponent,p.styleComponent,i)).catch(c=>{O.warn("Trouble creating text: ",c)}).then(c=>{if(!(c!=null&&c.text))return;let l=[Promise.resolve(c.text),n,Promise.resolve()];if(t.polygonEntityId){let p=o.geometry3DMap.get(t.polygonEntityId);if((p==null?void 0:p.type)==="geometry"){let d=p.components[0],f=p.components[1];d.textMesh=c.text,d.mesh!=null&&(c.text.position.z=f.altitude+f.height+EA)}}else l[2]=ql().then(({syncText:p})=>p(c.text));return Promise.all(l)}).then(c=>{if(!c)return;let[l,p]=c;p.add(l),t.batchedText||(t.batchedText=p)})}function p0(r,t){return r._members.has(t)}var EA=.5;var _A=E.object({visible:E.boolean(),color:E.string(),flipToFaceCamera:E.boolean(),font:E.string().optional(),fontSize:E.number(),margin:E.union([E.number(),E.tuple([E.number(),E.number(),E.number(),E.number()])]),outlineColor:E.string(),outlineOpacity:E.number(),outlineBlur:E.union([E.number(),E.string()]),outlineWidth:E.number(),outlineOffsetX:E.number(),outlineOffsetY:E.number(),strokeWidth:E.number(),maxWidth:E.number().optional(),maxHeight:E.number().optional(),strokeOpacity:E.number(),strokeColor:E.string(),fillOpacity:E.number(),hoverColor:E.string().optional(),id:E.union([E.string(),E.number()]),type:E.literal("text3d"),position:E.tuple([E.number(),E.number(),E.number()]),content:E.string()}),YM=_A.partial().omit({id:!0,type:!0}).strict(),qM=YM.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),$M=E.object({appearance:YM.optional(),parentId:E.string().optional()}).strict(),Eo=class{constructor(t){u(this,"mesh",new Ur);u(this,"textMesh");u(this,"type","text3d");u(this,"feature");u(this,"parent");u(this,"batchedText");u(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?p0(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};m();var $l=class{constructor(t){u(this,"color");u(this,"dirty",!0);u(this,"visible",!0);u(this,"edgeColors");u(this,"geometry");u(this,"ranges");u(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};m();m();m();var fm=class extends Nv{constructor(e){let i=e,n=3,o=n*4;super(new Float32Array(e*o),n,e,th,Ev);u(this,"_width");u(this,"_height");u(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(e,i,n){let o=this.image.data,a=e*this._width;o[a]=i.r,o[a+1]=i.g,o[a+2]=i.b,o[a+3]=0,o[a+4]=n.r,o[a+5]=n.g,o[a+6]=n.b,o[a+7]=0,this.needsUpdate=!0}getColor(e){let i=this.image.data,n=e*this._width,o=new Oe(i[n],i[n+1],i[n+2]),a=new Oe(i[n+4],i[n+5],i[n+6]);return{color:o,topColor:a}}setTexture(e,i,n){let o=this.image.data,a=e*this._width;o[a+8]=i?1:0,o[a+9]=n?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};var JM="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";var KM="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of `==` comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var kA=-.05,AA=1,as=class extends jr{constructor(e,i,n=1){super(e);u(this,"propertiesTexture");u(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});u(this,"colorSpace",rn);u(this,"showTextures",e=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,i,n),this.needsUpdate=!0)});this.propertiesTexture=new fm(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,c=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,d=this.uniforms.uTexture,f=this.uniforms.uRepeatYFactor,g=this.uniforms.uBlendTexture;this.uniforms=o.uniforms,o.vertexShader=JM,o.fragmentShader=KM,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:c,uGradientStart:l,uMinSideAlpha:{value:kA},uMaxSideAlpha:{value:AA},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:d,uRepeatYFactor:f,uBlendTexture:g})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(e){e!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=e,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(e){e.wrapS=mi,e.wrapT=mi,e.colorSpace=this.colorSpace,this.uniforms.uTexture.value=e}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(e){e.wrapS=mi,e.wrapT=mi,e.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=e}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(e){e!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=e,this.colorSpace=e?_v:rn,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(e,i,n){this.uniforms.uGradientStart.value=e,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(e,i,n){this.propertiesTexture.setColor(e,i,n)}getColor(e){return this.propertiesTexture.getColor(e)}hideTextures(e){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,!1,!1),this.needsUpdate=!0)}removeSideTexture(e){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(e,!1,i),this.needsUpdate=!0}}removeTopTexture(e){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(e,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};m();function QM(r,t){var c,l,p;let e=0;for(let d of r)e+=((l=(c=d.components[0])==null?void 0:c.geometry)==null?void 0:l.attributes.position.count)||0;let i=new Oe(t.color),n;n=new as({color:i,side:t.side==="back"?Pv:t.side==="front"?eh:tn,opacity:(p=t.opacity)!=null?p:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},r.length);let o=new ph(r.length,e,0,n),a;for(let d of r)a=d.components[0],!(!(a instanceof Ze)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.addInstance(a.instanceIndex),o.userData.entities[a.instanceIndex]=d.id,n instanceof as&&n.setColor(a.instanceIndex,i,t.topColor?new Oe(t.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}function mm(r){return J(r).darken(30).toRgbString()}function eI(r,t,e,i){if(t.length<1)return;r.boundingBox||r.computeBoundingBox();let n=r.boundingBox,o=r.getAttribute("position"),a=r.getAttribute("normal"),c=r.getAttribute("uv"),l,p;r.index?(l=r.index.count/3,p=function(P,w){return r.index.getX(P*3+w)}):(l=o.count/3,p=function(P,w){return P*3+w});let d=new Nr;d.makeRotationFromQuaternion(new kc().setFromEuler(new nn(0,0,e/180*Math.PI)));let f=t.find(P=>P.face==="top"),g;f&&(g={min:i(f.bounds[1],f.bounds[0],0),max:i(f.bounds[3],f.bounds[2],n.max.z)});let y=t.find(P=>P.face==="side"),v;if(y&&(v={min:i(y.bounds[1],y.bounds[0],0),max:i(y.bounds[3],y.bounds[2],n.max.z)}),!(!v&&!g))for(let P=0;P<l;++P){let w=a.getX(p(P,0))+a.getX(p(P,1))+a.getX(p(P,2)),D=a.getY(p(P,0))+a.getY(p(P,1))+a.getY(p(P,2)),B=a.getZ(p(P,0))+a.getZ(p(P,1))+a.getZ(p(P,2)),_=Math.abs(w),A=Math.abs(D),F=Math.abs(B);var x,b;_<=A&&_<=F?(x="x",A<=F?b="y":b="z"):A<=_&&A<=F?(x="y",_<=F?b="x":b="z"):(x="z",_<=A?b="x":b="y"),x==="z"&&(x=b,b="z");let G,R,z,W,j,ee;if(b==="z"||x==="z"){if(!y||!v)continue;G=y.repeat.u,R=y.repeat.v,z=y.offset.u,W=y.offset.v,j=y.rotation,ee=v}else{if(!f||!g)continue;G=f.repeat.u,R=f.repeat.v,z=f.offset.u,W=f.offset.v,j=(360-e+f.rotation)%360,ee=g}let{min:Z,max:xe}=ee,fe=new on;fe.position.set(Z.x,Z.y,0),fe.updateMatrix(),fe.updateMatrixWorld();let Ie=Z.clone().applyMatrix4(d),_e=xe.clone().applyMatrix4(d),cr=Math.abs(_e.x-Ie.x),_t=Math.abs(_e.y-Ie.y),at=new K(cr,_t,xe.z).applyMatrix4(fe.matrixWorld),Qe=Math.abs(at[x]-Z[x]),pr=Math.abs(at[b]-Z[b]),Rr=j*Math.PI/180||0,me=Math.cos(Rr),be=Math.sin(Rr),qe=fe.matrixWorld.clone().invert(),gt=new kc().setFromEuler(new nn(0,0,e/180*Math.PI));for(let st=0;st<3;st++){let hi=new K(o.getX(p(P,st)),o.getY(p(P,st)),o.getZ(p(P,st))).applyMatrix4(qe);hi.applyQuaternion(gt);let fi=hi.applyMatrix4(fe.matrixWorld),Vt=fi.x,Kn=fi.y,_c=fi.z;var C,M;x==="x"?C=G*(Vt-Z[x])/Qe+z:x==="y"?C=G*(Kn-Z[x])/Qe+z:C=G*(_c-Z[x])/Qe+z,b==="x"?M=R*(Vt-Z[b])/pr+W:b==="y"?M=R*(Kn-Z[b])/pr+W:M=R*(_c-Z[b])/pr+W,C-=.5,M-=.5;let Oc=C*me-M*be+.5,Lc=C*be+M*me+.5;c.setX(p(P,st),Oc),c.setY(p(P,st),Lc)}}}m();var Jl=class{constructor(){u(this,"focusMesh");u(this,"dirty",!0)}};function wt(r,t,e){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container"||r.type==="custom-geometry")return t===!0?(r instanceof sa&&r.components[1]===void 0?(r.components[1]=new Hl,r.components[1].dirty=!0):r instanceof we&&r.components[2]===void 0?(r.components[2]=new Hl,r.components[2].dirty=!0):r instanceof Te&&r.components[1]===void 0&&(r.components[1]=new Hl,r.components[1].dirty=!0),!0):(r instanceof sa?r.components[1]=void 0:r instanceof we?r.components[2]=void 0:r instanceof Te&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let i;for(let n of r.userData.entities3D.values())i=e.geometry3DMap.get(n),wt(i,t,e);return!0}}return!1}function tI(r,t,e){if(!(!(e!=null&&e.color)&&!("topColor"in e))){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let i,n,o=r.components[0];for(let a of r.userData.entities3D.values())if(i=t.geometry3DMap.get(a),i){n=i.components[1],n.color===o.color&&(n.initialColor=e.color||o.color,n.color=e.color||o.color,n.dirty=!0);let c=i.components[3];c&&(c.color=mm(n.color||o.color),c.dirty=!0),n.topColor===o.topColor&&(n.topColor=e.topColor||o.topColor,n.dirty=!0)}return e.color!==void 0&&(o.color=e.color,o.dirty=!0),"topColor"in e&&(o.topColor=e.topColor,o.dirty=!0),!0}return!1}}function rI(r,t){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let e=r.components[0];return e.shading=e.shading||{},e.shading&&(t.start!==e.shading.start||t.end!==e.shading.end||t.intensity!==e.shading.intensity)&&(Object.assign(e.shading,t),r.userData.shadingDirty=!0),!0}return!1}function iI(r,t){t!==void 0&&r.type==="geometry"&&(t.showImage!==void 0&&(r.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}function d0(r,t,e){if(e!==void 0){if(r.type==="geometry"){let i=r.components[1];if(i.height!==e)return i.height=e,i.dirty=!0,r.components[3]&&(r.components[3].dirty=!0),!0}else if(r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=t.geometry3DMap.get(n),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.height===i.height&&(o.components[1].height=e,o.components[1].dirty=!0),o.components[3]&&(o.components[3].dirty=!0))}return r.components[0].height=e,!0}}return!1}function h0(r,t){t!==void 0&&(r.type==="path"||r.type==="geometry")&&(t.initialColor!==void 0&&(r.components[1].initialColor=t.initialColor),t.color!==void 0&&t.color!==r.components[1].color&&(r.components[1].color=t.color,r.components[3]&&(r.components[3].color=t.color,r.components[3].dirty=!0)),"topColor"in t&&(r.components[1].topColor=t.topColor),r.components[1].dirty=!0)}function f0(r,t,e){t!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(e(t[1],t[0],t[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(e(t[1],t[0],t[2]||0)))}function m0(r,t){var e;return t!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==t&&r.parentObject3D instanceof Te?((e=r.parentObject3D)==null||e.removeEntity(r),t.addEntity(r),!0):!1}function nI(r,t){t!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==t&&(r.components[0].enabled=t)}function oI(r,t,e){if(t!==void 0&&r.type==="marker"){let i=r.components[0];if(t.contentHTML!==void 0)return i.containerEl.innerHTML=t.contentHTML,i.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(i.options.anchor=t.anchor,i.collisionDirty=!0),t.dynamicResize!==void 0)return i.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{Wb.parse(t.options||{})}catch(n){return O.error(n),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(i.pointerEvents="auto",wt(r,!1,e)):(i.pointerEvents="none",wt(r,t.options.interactive,e))),aI(r,t.options.rank),!0}}return!1}function aI(r,t){return t!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Rl(t),!0):!1}function sI(r,t,e){var i,n,o,a,c;if(t!==void 0&&r.type==="label"){let l=r.components[0];t.text!==void 0&&(l.text=t.text,l.dirty=!0);try{a0.parse(t.options||{})}catch(p){O.error(p);return}((i=t.options)==null?void 0:i.appearance)!==void 0&&Object.keys((n=t.options)==null?void 0:n.appearance).length>0&&(g2(l.appearance,((o=t.options)==null?void 0:o.appearance)||{}),l.dirty=!0),wt(r,(a=t.options)==null?void 0:a.interactive,e),aI(r,(c=t.options)==null?void 0:c.rank)}}function lI(r,t){t!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=t,r.components[1].dirty=!0)}function cI(r,t){if(t!==void 0){let e=r.components[2];if(r.type==="geometry"&&e!=null)return e.hover=t,e.dirty=!0,!0}return!1}function g0(r,t){t!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=t)}function Ui(r,t,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){r.components[1].visible=e,r.components[1].dirty=!0;let i=r.components[3];i&&(i.visible=e,i.dirty=!0)}else r.type==="geometry-group"?r.setVisible(e):r.type==="group-container"?(r.setVisible(e),e===!1&&r.traverse(i=>{if(i instanceof o2){let n=t.geometry2DMap.get(i.userData.entityId);if(n){let o=n.components[0];o instanceof ji&&(o.canShow=e)}}})):r.type==="label"&&(r.components[0].visible=e);return!0}return!1}function y0(r,t,e){if(e!==void 0){if(r.type==="geometry-group"){let i=r.components[0];if(i.opacity!==e){for(let n of r.userData.entities3D.values()){let o=t.geometry3DMap.get(n),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],(!a.opacity||a.opacity===i.opacity)&&(a.opacity=e,a.dirty=!0))}return r.setOpacity(e),i.opacity=e,!0}}else if(r.type==="group-container"&&r.opacity!==e){r.setOpacity(e);let i=1;return r.parent instanceof Te&&(i=r.parent.opacity),pI(r,t,i),!0}}return!1}function pI(r,t,e=1){if(r.type==="group-container"&&"children"in r&&r.children.length>0){let i=e*r.opacity;r.userData.computedOpacity=i;for(let n of r.children)(n instanceof Ot&&n.type==="geometry-group"||n instanceof Te&&n.type==="group-container")&&pI(n,t,i)}else if(r.type==="geometry-group")for(let i of r.userData.entities3D.values()){let n=t.geometry3DMap.get(i),o;((n==null?void 0:n.type)==="geometry"||(n==null?void 0:n.type)==="model")&&(o=n.components[1],o.dirty=!0)}}function uI(r,t){if(t!==void 0&&r.type==="geometry-group"){let e=r.components[0];(t==null?void 0:t.texture)!=null&&e.texture!==(t==null?void 0:t.texture)&&(e.texture=t.texture,e.dirty=!0),(t==null?void 0:t.topTexture)!=null&&e.topTexture!==(t==null?void 0:t.topTexture)&&(e.topTexture=t.topTexture,e.dirty=!0)}}function dI(r,t){if(r.type==="geometry"){let e=!1,i=r.components[1];if((t==null?void 0:t.texture)!=null&&i.texture!==(t==null?void 0:t.texture)&&(i.texture=t.texture,e=!0),(t==null?void 0:t.topTexture)!=null&&i.topTexture!==(t==null?void 0:t.topTexture)&&(i.topTexture=t.topTexture,e=!0),e&&r.components[0]instanceof Ze){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}function hI(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.opacity!==t){e.opacity=t;let i=r.components[0],n=r.components[3];n&&(n.dirty=!0),i.detached===!1&&(i.detached=!0,i.dirty=!0),t===0?e.visible=!1:e.visible=!0,e.dirty=!0;let o=r.parentObject3D;return(o==null?void 0:o.type)==="geometry-group"&&(o.userData.shadingDirty=!0),!0}}return!1}function gm(r,t){if(t!==void 0)if(r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=t,r.components[1].dirty=!0;else{if(r.type==="group-container"&&r.altitude!==t)return r.setAltitude(t),!0;if(r.type==="geometry-group")return r.setAltitude(t),!0}return!1}function ym(r,t,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)for(let i of r.userData.entities3D.values()){let n=t.geometry3DMap.get(i);n instanceof we&&ym(n,t,e)}else if(r.type==="geometry"){let i=r.components[3],n=r.components[1];!i&&e===!0?r.components[3]=new $l(n.color):i&&(i.visible=e,i.dirty=!0)}return!0}return!1}function b0(r,t){if(t!==void 0){if(r.type==="geometry"){let e=r.components[0];if(r.type==="geometry"&&e&&e instanceof Ze&&e.focusable!==t)return e.focusable=t,!0}else if(r.type==="group-container"){let e=r.components[2]!==void 0;if(t===!0&&!e)return r.components[2]=new Jl,!0;if(t===!1&&e)return r.components[2]=void 0,!0}}return!1}function fI(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.renderOrder!==t){e.renderOrder=t;let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),i.imageMesh&&(i.imageMesh.renderOrder=t+1),e.dirty=!0,!0}}return!1}function mI(r,t,e){let{visible:i,color:n}=e;if(r.type!=="path")return;let o=r.components[0];i!=null&&Ui(r,t,i),n!=null&&h0(r,{color:n}),Object.assign(o,v0(e)),d2(e)||(o.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(o.dirty=!0),(e.nearZoomLevel!=null||e.farZoomLevel!=null)&&(o.dirty=!0))}function v0(r){return ur(r,BA)}var BA=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel"];function gI(r){if(!(r instanceof we&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var bm=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function yI(r,t,e){Ui(r,t,e.visible);let i=r.components[1],n=ur(e,bm);"margin"in e&&O.warn("update to margin is not supported atm"),"content"in e&&O.warn("content update is not supported atm");try{qM.parse(n)}catch(o){O.error(o);return}Object.keys(n).length>0&&(Object.assign(i,n),i.dirty=!0)}var RA=["color","material","opacity","verticalOffset","rotation","position","scale"];function bI(r,t){let e=ur(t,RA),i=r.components[1],n=r.components[0];Object.keys(e).length>0&&(e.material&&(i.material=e.material),e.opacity!=null&&(i.opacity=e.opacity,e.opacity===0?i.visible=!1:i.visible=!0,i.dirty=!0),e.verticalOffset!=null&&(i.verticalOffset=e.verticalOffset),e.color!=null&&(i.color=e.color),e.position!=null&&(n.feature.geometry.coordinates=e.position,n.positionDirty=!0),e.rotation!=null&&(i.rotation=e.rotation),e.scale!=null&&(i.scale=e.scale),i.dirty=!0)}var ss,Hi,vm,_o,vI,yu,xm,xI,CI,bu,Cm,vu,xu,Sm,gu=class{constructor(t){S(this,_o);S(this,ss,null);S(this,Hi);u(this,"getCurrentSceneGLTF",async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await N(this,_o,vI).call(this),n=s(this,vm).call(this,e),o=await i.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),a;if(o instanceof ArrayBuffer)a=new Blob([o],{type:"application/octet-stream"});else{let c=JSON.stringify(o,null,2);a=new Blob([c],{type:"text/plain"})}return a});S(this,vm,t=>{let{scale:e,light:i,onlyVisible:n}=t,o=new Qn,a=new yt().setFromObject(s(this,Hi).entityScene);if(s(this,yu).call(this,s(this,Hi).entityScene,o,n),i){let c=new oh(16777215,.3*Math.PI);c.position.set(0,Math.max(a.max.x,a.max.y)*e*.5,a.max.y*e*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),o.add(c)}return o});S(this,yu,(t,e,i)=>{t.material&&(t instanceof rh?N(this,_o,xI).call(this,t).forEach(n=>e.add(n)):t instanceof Ns&&e.add(N(this,_o,CI).call(this,t))),t.children.forEach(n=>{(!i||n.visible)&&s(this,yu).call(this,n,e,i)})});S(this,xm,(t,e,i)=>{let n=new Uv({color:new Oe(t),metalness:0});return n.opacity=e,n.transparent=i,n});S(this,bu,t=>{let{geometry:e,material:i,position:n,rotation:o,quaternion:a,scale:c}=t;if(!(e!=null&&e.isBufferGeometry))return t;let l=e.attributes.position,p=e.attributes.normal,d=e.attributes.uv;return s(this,Cm).call(this,l,p),s(this,xu).call(this,n,c,o,a),d&&s(this,Sm).call(this,d),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=tn),t});S(this,Cm,(t,e)=>{let i=new K,n=new K;for(let o=0;o<t.count;o++)i.fromBufferAttribute(t,o),s(this,vu).call(this,i),t.setXYZ(o,i.x,i.y,i.z),e&&(n.fromBufferAttribute(e,o),s(this,vu).call(this,n),e.setXYZ(o,n.x,n.y,n.z))});S(this,vu,t=>{let e=t.y;t.y=t.z,t.z=-e});S(this,xu,(t,e,i,n)=>{let o=t.y;t.y=t.z,t.z=-o;let a=e.y;if(e.y=e.z,e.z=a,i instanceof nn)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let c=n.y;n.set(n.x,n.z,-c,n.w)}});S(this,Sm,t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),n=t.getY(e);t.setXY(e,i,n)}});I(this,Hi,t),s(this,Hi).entityScene=t.entityScene,s(this,Hi).geometry3DMap=t.geometry3DMap}destroy(){I(this,ss,null)}};ss=new WeakMap,Hi=new WeakMap,vm=new WeakMap,_o=new WeakSet,vI=async function(){if(!s(this,ss)){let{GLTFExporter:t}=await import("./GLTFExporter-33O74ZRA.js");I(this,ss,new t)}return s(this,ss)},yu=new WeakMap,xm=new WeakMap,xI=function(t){var a,c;let e=[],n=((a=t.userData)!=null&&a.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(l=>s(this,Hi).geometry3DMap.get(l)),o=new Map;return n.forEach(l=>{var y;if(!l||!(l instanceof we))return;let p=l.components[1],d=l.components[2];if(!p.visible||p instanceof Si&&p.opacity===0||p instanceof Rc||p instanceof fh)return;let f=d!=null&&d.hover?p.hoverColor||s(this,Hi).hoverColor:p.color,g="".concat(f,"-").concat(p.opacity,"-").concat(Number(p.visible));o.has(g)||o.set(g,[]),(y=o.get(g))==null||y.push(l)}),o.forEach((l,p)=>{let[d,f,g]=p.split("-"),y=l.reduce((C,M)=>{if(M.type==="custom-geometry")return C;let P=M.components[0];return"geometry"in P&&P.geometry instanceof Bv&&C.push(P.geometry),C},[]),v=s(this,xm).call(this,d,Number(f),t.material.transparent),x=Tr(y,!0),b=new ue(x,v);b.position.copy(t.position),b.rotation.copy(t.rotation),b.scale.copy(t.scale),b.visible=!!g,s(this,xu).call(this,b.position,b.scale,b.rotation,b.quaternion),e.push(s(this,bu).call(this,b))}),e},CI=function(t){let e=t.geometry.clone(),i=t.material,n=new lt({color:i.color,side:tn});n.opacity=i.opacity,n.transparent=i.transparent;let o=new Ns(e,n);return o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o.visible=t.visible,s(this,bu).call(this,o)},bu=new WeakMap,Cm=new WeakMap,vu=new WeakMap,xu=new WeakMap,Sm=new WeakMap;m();m();m();var S0=ra(OI());function LI(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}LI.prototype=Error.prototype;S0.default.Error=function(r){throw new LI(r)};var ft=S0.default;var _B="gray",OB=.1,Tu=100,T0=new ft.ClipperOffset;function LB(r,t){T0.Clear(),t/=2;let e=r.map(n=>({X:n.x*Tu,Y:n.y*Tu}));T0.AddPath(e,ft.JoinType.jtMiter,ft.EndType.etClosedPolygon);let i=new ft.Paths;return T0.Execute(i,t*Tu),i.length?i.map(o=>o.map(a=>({x:a.X/Tu,y:a.Y/Tu}))):[r]}function Dm(r,t,e){var g,y,v,x,b;let{color:i=_B,opacity:n=1,altitude:o=0,height:a=OB}=e||{};Array.isArray(n)&&(n=1);let c={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o},center:{x:0,y:0,z:(a+o)/2}},p=r.geometry.coordinates[0].map(C=>{let M=t(C[1],C[0]);return c.min.x=Math.min(c.min.x,M.x),c.min.y=Math.min(c.min.y,M.y),c.max.x=Math.max(c.max.x,M.x),c.max.y=Math.max(c.max.y,M.y),M});((y=(g=r.properties)==null?void 0:g.style)==null?void 0:y.edgeOffset)!=null&&r.properties.style.edgeOffset!==0||((v=r.properties)==null?void 0:v.image)!=null?p=LB(p,((b=(x=r.properties)==null?void 0:x.style)==null?void 0:b.edgeOffset)||0):p=[p];let d=[];for(let C of p){let M=new gi;M.moveTo(C[0].x,C[0].y),C.slice(1).forEach(B=>M.lineTo(B.x,B.y)),M.lineTo(C[0].x,C[0].y);let P=r.geometry.coordinates.slice(1);M.holes=P.map(B=>{let _=B.map(F=>t(F[1],F[0])),A=new to;return A.moveTo(_[0].x,_[0].y),_.slice(1).forEach(F=>A.lineTo(F.x,F.y)),A.lineTo(_[0].x,_[0].y),A});let w={bevelEnabled:!1,depth:a},D=new yi(M,w);D.userData={style:{color:i,opacity:n}},d.push(D)}if(d.length===1)return d[0];let f=Tr(d);return f.userData={style:{color:i,opacity:n},_split:!0},f}m();var kB="gray",AB=.1;function Em(r,t,e){let{color:i=kB,opacity:n=1,altitude:o=0,height:a=AB}=e||{};Array.isArray(n)&&(n=1);let c={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},l={bevelEnabled:!1,depth:a},p=[];r.geometry.coordinates.forEach(f=>{let g=new gi,y=f[0].map(b=>{let C=t(b[1],b[0]);return c.min.x=Math.min(c.min.x,C.x),c.min.y=Math.min(c.min.y,C.y),c.max.x=Math.max(c.max.x,C.x),c.max.y=Math.max(c.max.y,C.y),C});g.moveTo(y[0].x,y[0].y),y.slice(1).forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(y[0].x,y[0].y);let v=f.slice(1);g.holes=v.map(b=>{let C=b.map(P=>t(P[1],P[0])),M=new to;return M.moveTo(C[0].x,C[0].y),C.slice(1).forEach(P=>M.lineTo(P.x,P.y)),M.lineTo(C[0].x,C[0].y),M});let x=new yi(g,l);p.push(x)});let d=Tr(p);return d.translate(0,0,o||0),d.userData={style:{color:i,opacity:n}},d}m();var FB="gray",M0=new ft.ClipperOffset,Xt=100;function kI(r,t,e){let{color:i=FB,opacity:n=1,width:o=1,join:a="round",cap:c="round",height:l=.01,altitude:p=0}=e||{};Array.isArray(n)&&(n=0);let d=[];for(let x=0;x<r.geometry.coordinates.length-1;x++){let b=t(r.geometry.coordinates[x][1],r.geometry.coordinates[x][0]),C=t(r.geometry.coordinates[x+1][1],r.geometry.coordinates[x+1][0]);d.push([b,C])}M0.AddPaths(d.map(x=>x.map(b=>({X:b.x*Xt,Y:b.y*Xt}))),a==="round"?ft.JoinType.jsRound:a==="miter"?ft.JoinType.jsMiter:ft.JoinType.jsSquare,c==="round"?ft.EndType.etOpenRound:c==="butt"?ft.EndType.etOpenButt:ft.EndType.etOpenSquare);let f=new ft.PolyTree;M0.Execute(f,o/2*Xt);let g=[],y={bevelEnabled:!1,depth:l};for(let x of f.m_AllPolys){let b=new gi;if(x.IsHole())continue;let C=x.m_polygon;b.moveTo(C[0].X/Xt,C[0].Y/Xt),C.slice(1).forEach(M=>b.lineTo(M.X/Xt,M.Y/Xt)),b.lineTo(C[0].X/Xt,C[0].Y/Xt),b.holes=x.m_Childs.map(M=>{let P=new to,w=M.m_polygon;return P.moveTo(w[0].X/Xt,w[0].Y/Xt),w.slice(1).forEach(D=>P.lineTo(D.X/Xt,D.Y/Xt)),P.lineTo(w[0].X/Xt,w[0].Y/Xt),P}),g.push(new yi(b,y))}let v=Tr(g);return v.translate(0,0,p||0),v.userData={style:{color:i,opacity:n}},M0.Clear(),v}m();var Yt=100,BB=.22,RB=.01;function AI(r,t,e={}){let{width:i=BB,height:n=RB,color:o="gray",opacity:a=1,altitude:c=0}=e,l={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+n}},p={bevelEnabled:!1,depth:n},d=new ft.ClipperOffset,f=r.geometry.coordinates.map(x=>x.map(b=>t(b[1],b[0])));d.AddPaths(f.map(x=>x.map(b=>({X:b.x*Yt,Y:b.y*Yt}))),ft.JoinType.jsMiter,ft.EndType.etOpenRound);let g=new ft.PolyTree;d.Execute(g,i/2*Yt);let y=[];for(let x of g.m_AllPolys){let b=new gi;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 C=x.m_polygon;b.moveTo(C[0].X/Yt,C[0].Y/Yt),C.slice(1).forEach(M=>b.lineTo(M.X/Yt,M.Y/Yt)),b.lineTo(C[0].X/Yt,C[0].Y/Yt),b.holes=x.m_Childs.map(M=>{let P=new to,w=M.m_polygon;return P.moveTo(w[0].X/Yt,w[0].Y/Yt),w.slice(1).forEach(D=>P.lineTo(D.X/Yt,D.Y/Yt)),P.lineTo(w[0].X/Yt,w[0].Y/Yt),P}),y.push(new yi(b,p))}let v=Tr(y);return v.translate(0,0,c||0),v.userData={style:{color:o,opacity:a}},d.Clear(),v}m();m();var ec=E.object({type:E.enum(["Point"]),coordinates:E.array(E.number()).min(2).max(3)});var NB=E.object({rotation:E.array(E.number()).length(3).optional(),altitude:E.number().optional(),scale:E.array(E.number()).length(3).optional(),interactive:E.boolean().optional(),verticalOffset:E.number().optional(),id:E.union([E.number(),E.string()]).optional()}),GB=E.object({type:E.enum(["Feature"]),geometry:ec,properties:NB}),VB=E.object({type:E.enum(["FeatureCollection"]),features:E.array(GB)}),jB=E.object({color:E.string()}),UB=E.object({url:E.string(),color:E.string().optional(),opacity:E.number().optional(),material:E.record(E.string(),jB).optional()});function BI(r,t,e){E.union([E.number(),E.string()]).parse(r),VB.parse(t),UB.parse(e)}var Mu,Iu,ko=class{constructor(t){u(this,"mesh");u(this,"type","model");u(this,"positionDirty",!0);u(this,"outline");u(this,"geometry");u(this,"material");u(this,"feature");u(this,"instanceIndex",-1);u(this,"visible",!0);u(this,"color",new Oe);u(this,"position",new K);S(this,Mu,0);S(this,Iu,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return s(this,Mu)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,Mu,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(ge.degToRad(t[0]),ge.degToRad(t[1]),ge.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return s(this,Iu)}set opacity(t){var e,i,n;if(this.mesh){if(this.mesh.children[0]instanceof eo){for(let o of this.mesh.children)if(o instanceof eo){((e=o.userData)==null?void 0:e.originalOpacity)===void 0&&(o.userData.originalOpacity=o.material.opacity);let a=Ti(t,0,(i=o.userData)==null?void 0:i.originalOpacity,0,1);o.material.opacity=a,o.material.transparent=a<1,o.material.needsUpdate=!0}}else(n=this.mesh)==null||n.traverse(o=>{o instanceof ue&&o.material&&(Array.isArray(o.material)?o.material.forEach(a=>{FI(a,t)}):FI(o.material,t))});I(this,Iu,t)}}};Mu=new WeakMap,Iu=new WeakMap;function FI(r,t){r.opacity!==t&&(t===1?(r.opacity=1,r.transparent=!1):(r.opacity=t,r.transparent=!0),r.needsUpdate=!0)}m();function _m(r){var c,l;let t=r.components[0],e=r.components[1];e.opacity!=null&&e.opacity!==t.opacity&&(t.opacity=e.opacity);let i=e.material,n=e.color;if(i||n){let p=HB(n,i);(c=t.mesh)==null||c.traverse(d=>{d instanceof ue&&d.material&&(Array.isArray(d.material)?d.material.forEach(f=>{p[f.name]?f.color.set(p[f.name].color):f.color.set(n)}):p[d.material.name]?d.material.color.set(p[d.material.name].color):d.material.color.set(n))})}let o=(l=t.feature.geometry.coordinates[2])!=null?l:0,a=e.verticalOffset+o;t.altitude!==a&&(t.altitude=a),e.visible!==t.visible&&(t.visible=e.visible),e.rotation&&t.setRotation(e.rotation),e.scale&&t.setScale(e.scale)}function HB(r,t){let e={};if(r&&Object.assign(e,{Default:{color:r},Fabric:{color:r},Mpdn_Logo:{color:r},CouchLogo:{color:r}}),t)for(let i in t)t[i].color&&(e[i]?e[i].color=t[i].color:e[i]={color:t[i].color});return e}function RI(r,t){var a,c;let e=r.components[0],n=(a=r.components[1].verticalOffset)!=null?a:0,o=e.feature.geometry.coordinates.slice();o[2]=((c=o[2])!=null?c:0)+n,e.mesh?e.mesh.position.copy(t(o)):e.position.copy(t(o))}function WB(r){let{color:t,opacity:e,topColor:i,texture:n,topTexture:o}=r;return"".concat(t).concat(e).concat(i||"").concat(n||"").concat(o||"")}var zB=1e4,Om=class extends oe{constructor(e,i){super();u(this,"state");u(this,"convertTo3DMapPosition");u(this,"loader");u(this,"optimizePromise",[]);this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:e}=await import("./GLTFLoader-TFEUICFY.js");return this.loader=new e,this.loader}createEntityFromFeature(e,i,n){var c,l;let o=new Ze(i),a=new we(o,new Si({...n,url:(l=(c=i.properties)==null?void 0:c.image)==null?void 0:l.path}));return n!=null&&n.outline&&(a.components[3]=new $l(mm(n.color))),a.id=e,a}createModelFromFeature(e,i,n){let o=new ko(i),a={...n};i.properties.verticalOffset!=null&&(a.verticalOffset=i.properties.verticalOffset),i.properties.rotation!=null&&(a.rotation=i.properties.rotation),i.properties.scale!=null&&(a.scale=i.properties.scale);let c=new fh(a),l=new we(o,c);return l.id=e,l}populateEntityMesh(e,i){let n=e.components[0];n.geometry=i,n.currentHeight=e.components[1].height,n.dirty=!1}async populateModelGroup(e,i,n){let o=new Nr,a=new nn,c=new kc,l=new K,p=new Ur,d=await this.getGLTFLoader(),f=new Promise(g=>{d.load(i,y=>{"entities3D"in n.userData&&(n.userData.entities3D.size>1?y.scene.traverse(v=>{let x=v;if("isMesh"in x&&x.isMesh===!0){let b=new eo(x.geometry,x.material,e.size);b.userData={entities:{}},p.add(b),n.add(p)}}):(y.scene.traverse(v=>{"isMesh"in v&&v.isMesh===!0&&(v.position.set(0,0,0),v.rotation.set(0,0,0),v.scale.set(1,1,1),v.updateMatrix())}),p.add(y.scene),n.add(p),p.userData.isSingleModel=!0,p.userData.entityId=e.values().next().value,p.userData.type="model")),g()})});return this.optimizePromise.push(f.then(()=>{var v,x,b,C,M,P,w,D,B,_,A,F;let g=0,y;for(let G of e.values()){if(y=this.state.geometry3DMap.get(G),!y||(y==null?void 0:y.type)!=="model")continue;let R=y.components[0],z=y.components[1],W=y.components[0].feature;R.mesh=p,R.instanceIndex=g,_m(y),y.components[1].dirty=!1;let{x:j,y:ee}=this.convertTo3DMapPosition(W.geometry.coordinates[1],W.geometry.coordinates[0],0);R.position.set(j,ee,R.altitude),a.set(ge.degToRad((x=(v=z.rotation)==null?void 0:v[0])!=null?x:Zs[0]),ge.degToRad((C=(b=z.rotation)==null?void 0:b[1])!=null?C:Zs[1]),ge.degToRad((P=(M=z.rotation)==null?void 0:M[2])!=null?P:Zs[2])),l.set((D=(w=z.scale)==null?void 0:w[0])!=null?D:zs[0],(_=(B=z.scale)==null?void 0:B[1])!=null?_:zs[1],(F=(A=z.scale)==null?void 0:A[2])!=null?F:zs[2]),c.setFromEuler(a),o.compose(R.position,c,l),p.children.forEach(Z=>{!y||(y==null?void 0:y.type)!=="model"||!(Z instanceof eo)||(Z.setMatrixAt(g,o),Z.userData.entities[g]=y.id)}),R.mesh.userData.isSingleModel&&(R.mesh.matrix.copy(o),R.mesh.matrix.decompose(R.mesh.position,R.mesh.quaternion,R.mesh.scale)),g++}this.publish("model-loaded")})),p}populateEntityGroup(e){var c;let i,n,o,a;for(let l of e.values())a=this.state.geometry3DMap.get(l),a.components[0]instanceof Ze&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=Dm(n,this.convertTo3DMapPosition,o),(c=n.properties)!=null&&c.textures&&n.properties.textures.length>0&&eI(i,n.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=Em(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=kI(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=AI(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof Ot||e instanceof Te)){for(let a of e.children)this.optimize(a);if(e instanceof Te||e.userData.dirty===!1)return;let n={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(a){O.warn(a)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let o=0;if(e.userData.dirty){let a=0,c;for(let l of e.userData.entities3D.values()){c=this.state.geometry3DMap.get(l);let p=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let d=c.components[1];a++,a>=zB&&(a=0,o++);let f=WB(d)+o;n[f]===void 0&&(n[f]={style:d,entities:[]}),n[f].entities.push(c)}else p&&"mesh"in p&&p.mesh&&((i=p.mesh)==null?void 0:i.parent)!==e&&e.add(p.mesh)}for(let l in n){let p=QM(n[l].entities,n[l].style);e.add(p),e.userData.dirty=!1}for(let l of e.userData.entities3D.values())if(c=this.state.geometry3DMap.get(l),c!=null&&c.entities2D.size>0)for(let p of c.entities2D.values())p&&(c.attach(p),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};m();var Lm=class{constructor(t,e){u(this,"state");u(this,"dirty",!0);u(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let i=t.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let i=t.components[0];i instanceof Vi&&i.enabled&&i.markerContainer&&!this.domTree.contains(i.markerContainer)&&(i.markerContainer.userData={entityId:t.id},this.domTree.appendChild(i.markerContainer),i.updateDimensions())}this.dirty=!1}}};m();var km=class{constructor(t,e){u(this,"state");u(this,"project");this.state=t,this.project=e}update(){let t,e=0,i,n;for(let o of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(o),t){n=t.components[0];let a=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(a instanceof we)if(this.state.geometry3DIdsInScene.has(a.id)){i=a.components[1],n=t.components[0],(i.dirty||t.components[0].attachedDirty)&&(e=i.height,t.setAltitude(e));let c=i.visible&&i.opacity>0;n.visible!==c&&(n.visible=c)}else n.visible===!0&&(n.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};m();m();var ZB=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}}}(),NI=({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let c="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=ZB(i);l.font=c;let p=[],d=r.split(" "),f=0,g=0,y=0;for(;g<d.length;){let C=d[g];if(f===n&&f>0){p[f-1]+="...";break}if(p[f]==null&&(p[f]=C,g++),d.length===1){p[f]=C;break}if(d[g]==null)break;let{width:M}=l.measureText(p[f]+" "+d[g]);M<=e*i?(p[f]+=" "+d[g],g++):f++}p.forEach(C=>{let{width:M}=l.measureText(C);y=Math.max(M,y)});let v=t*i*o,x=p.length*v;return{maxWidth:y,maxHeight:x,lines:p.length,draw:(C,M,P)=>{p.length===1?(a.strokeText&&C.strokeText(p[0],M,P),C.fillText(p[0],M,P)):(a.strokeText&&(C.strokeText(p[0],M,P-v/2),C.strokeText(p[1],M,P+v/2)),C.fillText(p[0],M,P-v/2),C.fillText(p[1],M,P+v/2))}}};m();function GI(r){let t=new Image;return r&&(/<svg[\s\S]*>/i.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}var XB=3.5,YB=2.5,qB=2,$B=5,Pu=2.5;var Am=class extends oe{constructor(e,i,n){super();u(this,"dirty",!1);u(this,"state");u(this,"colliderContext");u(this,"colliderCanvas");u(this,"transformRequestFunc");u(this,"transformRequest",async e=>this.transformRequestFunc?await this.transformRequestFunc(e):{url:e});u(this,"pinCache",{});u(this,"imageCache",{});u(this,"imagePromiseCache",{});u(this,"imageDimensionsCache",{});u(this,"textCache",{});u(this,"update",e=>{let i=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let n,o,a,c,l,p,d;for(let f of this.state.geometry2DIdsInScene)if(d=this.state.geometry2DMap.get(f),d!=null&&(p=d.components[0],p instanceof ji&&!d.disposed)){if(l=p.appearance.marker.iconVisibleAtZoomLevel,p.appearance.marker.icon!=null&&l&&e>=l!==p.iconVisible&&(p.iconVisible=e>=l,p.dirty=!0),(p.dirty||this.dirty)&&p.calculateMarkerSize(),o=p.appearance.marker.foregroundColor,a=p.appearance.marker.backgroundColor,c=Vs(p.markerSize,2),n="".concat(o.active,"-").concat(o.inactive,"-").concat(a.active,"-").concat(a.inactive,"-").concat(c,"-").concat(p.iconVisible),p.labelCacheId=n,this.pinCache[n]||this.prepare(p,n,this.colliderContext),p.appearance.marker.icon&&(!p.imageHash||p.dirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.dirty||this.dirty){p.collisionDirty=!0,this.textCache[p.id]={};let{textDrawFn:g,width:y,height:v}=this.processText(p.text,p.appearance.text.size,p.appearance.text.maxWidth,p.appearance.text.numLines,p.appearance.text.lineHeight);["left","center","right"].forEach(b=>{this.textCache[p.id][b]=this.textToCanvas(g,p.appearance.text.size,b,y,v,p.appearance.text.foregroundColor,p.appearance.text.backgroundColor)}),p.dimensions={width:Math.ceil(y/i),height:Math.ceil(v/i)},p.currentStrategyIndex===-1&&(p.currentStrategyIndex=0);let x=p.strategies[p.currentStrategyIndex];if(x){x.onStrategySelected(p);let b=p.style;p.style=p.newStyle,p.newStyle=b}}p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,n,this.colliderContext),p.dirty=!1}this.dirty=!1});u(this,"processText",(e,i,n,o,a)=>{let c=this.state.pixelRatio,{draw:l,maxWidth:p,maxHeight:d}=NI({text:e,size:i,pixelRatio:c,maxWidth:n,maxLines:o,lineHeight:a});return{textDrawFn:l,width:p+Pu*c*2,height:d+Pu*c*2}});u(this,"textToCanvas",(e,i,n,o,a,c,l)=>{let p=this.state.pixelRatio,d,f=o,g=a;window.OffscreenCanvas!=null&&!u2()?d=new OffscreenCanvas(f,g):(d=document.createElement("canvas"),d.width=f,d.height=g,d.style.width=f+"px",d.style.height=g+"px");let y=d.getContext("2d",{willReadFrequently:!0});if(!y)return;y.textAlign=n,y.font="bold ".concat(i*p,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),y.textBaseline="middle",y.lineJoin="miter",y.miterLimit=2,y.strokeStyle="white",y.lineWidth=Pu*p,y.fillStyle=c,y.strokeStyle=l;let v=n==="left"?0:n==="center"?f/2:f-Pu*p/2;return e(y,v,(g+Pu*p/2)/2),d});u(this,"cacheImage",e=>{if(!e.appearance.marker.icon)return;let i=b2(e.appearance.marker.icon);this.imagePromiseCache[i]||(this.imagePromiseCache[i]=new Promise(n=>{this.transformRequest(e.appearance.marker.icon).then(o=>{let a=GI(o.url);a.onload=()=>{this.imageCache[i]=a,this.publish("img:loaded"),n(a)}})})),e.imageHash!==i&&(e.imageHash=i,this.imagePromiseCache[i].then(()=>{e.dirty=!0}))});u(this,"createPinCanvas",(e,i,n,o)=>{let a,c=this.state.pixelRatio,l=e.totalMarkerSize*2*c;window.OffscreenCanvas!=null?a=new OffscreenCanvas(l,l):(a=document.createElement("canvas"),a.width=l,a.height=l,a.style.width=l/c+"px",a.style.height=l/c+"px");let p=a.getContext("2d");return p.shadowColor="rgba(0,0,0,0.3)",p.shadowOffsetY=qB*c,p.shadowBlur=$B*c,p.beginPath(),p.arc(l/2,l/2,i/2+YB*c/2,0,2*Math.PI),p.fillStyle=n,p.fill(),p.beginPath(),p.arc(l/2,l/2,i/2,0,2*Math.PI),p.shadowColor="transparent",p.fillStyle=o,p.fill(),a});u(this,"prepare",(e,i,n)=>{let o=this.state.pixelRatio;n.lineWidth=4*o;let a=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active),c=this.createPinCanvas(e,e.iconVisible?e.markerSize:XB*o,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[i]=[a,c]});this.state=e,this.colliderCanvas=i,this.colliderContext=i.getContext("2d"),this.transformRequestFunc=n}draw(e,i,n){var p,d;if(!e.canShow||!e.visible)return;n.save(),n.globalAlpha=e.opacity;let o=this.state.pixelRatio,a=e.projection.x*o,c=e.projection.y*o,l=e.style.pinVisibility===1?this.pinCache[i][0]:this.pinCache[i][1];if(n.drawImage(l,a-e.totalMarkerSize*o,c-e.totalMarkerSize*o),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imageCache[e.imageHash]){let f=this.imageCache[e.imageHash],g=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*o,y=e.appearance.marker.iconFit,v=g,x=g,b="".concat(e.imageHash,"_").concat(y);if(this.imageDimensionsCache[b])v=this.imageDimensionsCache[b].width,x=this.imageDimensionsCache[b].height;else{let C=f.width*o,M=f.height*o;if(y==="contain"){let P=Math.sqrt(C**2+M**2),w=g/P;v=C*w,x=M*w}if(y==="cover"){let P=g/C,w=g/M,D=Math.max(P,w);v=C*D,x=M*D}}n.save(),n.beginPath(),n.arc(a,c,g/2,0,2*Math.PI),n.closePath(),((d=(p=e==null?void 0:e.appearance)==null?void 0:p.marker)==null?void 0:d.iconOverflow)!=="visible"&&n.clip(),n.drawImage(f,a-v/2,c-x/2,v,x),n.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left&&e.style.top&&n.drawImage(this.textCache[e.id][e.style.textAlign],a+e.style.left*o,c+e.style.top*o),n.restore()}};m();m();var us=class us{constructor(){u(this,"loader");this.loader=new Gs}static getInstance(){return us.instance||(us.instance=new us),us.instance}getLoader(){return this.loader}load(t){return new Promise((e,i)=>{this.loader.load(t,e,void 0,i)})}};u(us,"instance");var I0=us,Ao=I0.getInstance();function JB(r,t){let e=r.components[2],i=r.components[1];return e!=null&&e.hover?[i.hoverColor||t,i.hoverColor||t]:[i.color,i.topColor||i.color]}var ds,wu,Fm=class extends oe{constructor(e,i){super();S(this,ds);u(this,"state");u(this,"convertTo3DMapPosition");u(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=i,this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,n){var o;if(i.texture!==e.texture&&i.texture!==""&&N(this,ds,wu).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&N(this,ds,wu).call(this,i.topTexture,e,"topTexture"),(e.texture==null||e.topTexture==null)&&Array.isArray((o=e.feature.properties)==null?void 0:o.textures)&&e.feature.properties.textures.length>0)for(let a of e.feature.properties.textures)a.face==="top"&&e.topTexture!==a.path?N(this,ds,wu).call(this,a.path,e,"topTexture"):a.face==="side"&&e.texture!==a.path&&N(this,ds,wu).call(this,a.path,e,"texture"),e.blendTexture=!0;(e.texture!=null||e.topTexture!=null)&&(n!=null&&n.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var o,a,c,l,p,d,f,g;let e,i,n;for(let y of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(y),n instanceof Ot&&n.type==="geometry-group"){let v=n.components[0];if(n.userData.shadingDirty){let x=n.userData.entities3D.values().next().value;if(x==null)continue;let b=this.state.geometry3DMap.get(x);b instanceof we&&(b.type==="geometry"||b.type==="custom-geometry")&&(e=b.components[0],n.userData.shadingDirty&&v.shading&&this.setShading(e,v.shading));let C,M;for(let P of n.userData.entities3D.values())C=this.state.geometry3DMap.get(P),M=C.components[0],C.type==="geometry"&&M.detached&&n.userData.shadingDirty&&v.shading&&this.setShading(M,v.shading);n.userData.shadingDirty=!1}if(v.dirty){let x=n.getfirstChildEntityId();if(x){let C=this.state.geometry3DMap.get(x),M=C==null?void 0:C.components[0];M instanceof Ze&&this.processTextures(M,v)}let b=v.opacity*la(n);n.getOpacity()!==b&&n.setOpacity(b),v.dirty=!1}}else if(n&&(n.type==="geometry"||n.type==="custom-geometry")&&((o=n.components[1])!=null&&o.dirty||(a=n.components[2])!=null&&a.dirty)){let v=n.components[0],x=n.components[1];i=n.components[2];let b=JB(n,this.state.hoverColor);if(v.setColor(b[0],b[1]),x.visible!==v.visible&&(v.visible=x.visible,v instanceof Ze&&v.textMesh)){let M=this.state.geometry3DMap.get(v.textMesh.userData.entityId);(M==null?void 0:M.type)==="text3d"&&M.components[0].polygonEntityId!=null&&(M.components[0].visible=x.visible)}x.altitude!==v.altitude&&(v.altitude=x.altitude);let C=x.opacity*la(n);C!==v.opacity&&(v.opacity=C),x.renderOrder!==v.renderOrder&&(v.renderOrder=x.renderOrder),x.dirty=!1,v instanceof Ze&&this.processTextures(v,x,i),n.components[2]&&(n.components[2].dirty=!1)}else if((n==null?void 0:n.type)==="model")n.components[1].dirty&&(_m(n),n.components[1].dirty=!1),n.components[0].positionDirty&&(RI(n,this.convertTo3DMapPosition),n.components[0].positionDirty=!1);else if((n==null?void 0:n.type)==="image"&&((c=n.components[1])!=null&&c.dirty)){e=n.components[0];let v=n.components[1];v.visible!==e.visible&&(e.visible=v.visible),v.dirty=!1}else if((n==null?void 0:n.type)==="text3d"&&((l=n.components[1])!=null&&l.dirty)&&n.components[0].polygonEntityId!=null){e=n.components[0];let v=n.components[1];v.visible!=null&&v.visible!==e.visible&&(e.visible=v.visible);let{textMesh:x}=e;if(x){Object.assign(x,v.getState());let b=(p=v.hoverColor)!=null?p:this.state.text3dHoverColor;x.color=v.hoverByPolygon?b:(d=v.color)!=null?d:Ws.color,x.outlineColor=v.hoverByPolygon?b:(f=v.outlineColor)!=null?f:Ws.outlineColor,x.strokeColor=v.hoverByPolygon?b:(g=v.strokeColor)!=null?g:Ws.strokeColor}v.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};ds=new WeakSet,wu=async function(e,i,n){if(!(!e||!i.showTextures))if(this.textureLoadingCache.has(e)){n==="topTexture"?i.topTexture=await this.textureLoadingCache.get(e):i.texture=await this.textureLoadingCache.get(e),i.showTextures();return}else{let o=new Promise((a,c)=>{Ao.getLoader().load(e,l=>{n==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),a(l)},void 0,()=>{O.error("Failed to load texture: ".concat(e)),c("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,o)}};m();var Bm=class extends oe{constructor(e){super();u(this,"state");u(this,"animating",new Map);u(this,"isAnimating",!1);u(this,"startTime",-1);u(this,"showDuration",300);u(this,"hideDuration",250);u(this,"update",()=>{this.animating.clear();let e,i;for(let n of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i instanceof ji&&(i.visibilityNeedsUpdate==="show"?(i.canShow=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")});u(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[n,o]]of this.animating.entries()){let a=o===1?this.showDuration:this.hideDuration,c=(e-this.startTime)/a;i.opacity=Ti(c,0,1,n,o,o===0?v2:x2),e-this.startTime>=a&&(o===1?i.canShow=!0:o===0&&(i.canShow=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};m();var Rm=class extends oe{constructor(e,i,n,o,a,c,l){super();u(this,"state");u(this,"renderer");u(this,"mode");u(this,"scene");u(this,"cameraObject");u(this,"viewCamera");u(this,"systems");u(this,"needs2DRecompute",!1);u(this,"twoDdirty",!0);u(this,"threeDdirty",!0);u(this,"frameId",null);u(this,"twoDFrameId",null);u(this,"animationFrameId",null);u(this,"nextFrame",null);u(this,"update",(e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)==null)return Promise.resolve();if(e){let n=this.commitRenderState();return this.paint(),n}else return this.frameId?Promise.resolve():new Promise(n=>{this.frameId=requestAnimationFrame(()=>{var o,a;return((o=this.renderer)==null?void 0:o.renderer)==null?n():this.mode==="standalone"?(a=this.commitRenderState())==null?void 0:a.then(()=>{this.paint(),n()}):n()})})});u(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});u(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});u(this,"updateEntities2D",()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})});u(this,"commitRenderState",()=>{try{let e=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),m2(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(),f2(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let i=this.systems.meshOptimizationSystem.update();i&&e.push(i),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let n=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!n)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(e)}catch(e){O.error("Render failed: ",e)}});this.renderer=e,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=c,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};m();var KB=E.object({interactive:E.boolean().optional(),id:E.string().optional(),nearRadius:E.number().optional(),farRadius:E.number().optional(),accentColor:E.string().optional(),displayArrowsOnPath:E.boolean().optional(),animateArrowsOnPath:E.boolean().optional(),nearZoomLevel:E.number().optional(),farZoomLevel:E.number().optional()}),QB=E.object({type:E.enum(["Feature"]),geometry:ec,properties:E.object({parentId:E.any().optional()})});function VI(r,t){E.object({features:E.array(QB)}).parse(r),KB.parse(t)}var Du,Fo=class{constructor(t,e){u(this,"type","path");u(this,"mesh",new Ur);u(this,"material");u(this,"geometry");u(this,"outline");u(this,"feature");u(this,"options");u(this,"nearRadius",.2);u(this,"farRadius",.4);u(this,"nearZoomLevel");u(this,"farZoomLevel");u(this,"nearZoomAltitude");u(this,"farZoomAltitude");u(this,"accentColor","blue");u(this,"completeFraction",1);u(this,"altitudeAdjustment",1);u(this,"displayArrowsOnPath",!1);u(this,"animateArrowsOnPath",!1);u(this,"isVertical",!1);u(this,"dirty",!0);u(this,"materialDirty",!0);u(this,"position",new K);S(this,Du,0);var i,n,o,a,c;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(n=e==null?void 0:e.nearRadius)!=null?n:this.nearRadius,this.farRadius=(o=e==null?void 0:e.farRadius)!=null?o:this.farRadius,this.nearZoomLevel=e==null?void 0:e.nearZoomLevel,this.farZoomLevel=e==null?void 0:e.farZoomLevel,this.displayArrowsOnPath=(a=e==null?void 0:e.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(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 s(this,Du)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,Du,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Du=new WeakMap;m();var Nm=class{constructor(t){u(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Te&&t.components[0]){let i=t.components[0];if(i.dirty){for(let n of t.children)(n instanceof Ot||n instanceof Te)&&(n.userData.entityId!==t.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};m();m();m();var rt=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-rt.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?rt.Bounce.In(r*2)*.5:rt.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}}}}),Eu=function(){return performance.now()},w0=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,o=e;n<o.length;n++){var a=o[n];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var o=n[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=Eu()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var o=this._tweens[i[n]],a=!e;o&&o.update(t,a)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),tc={Linear:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=tc.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[n],r[n+1>e?e:n+1],i-n)},Bezier:function(r,t){for(var e=0,i=r.length-1,n=Math.pow,o=tc.Utils.Bernstein,a=0;a<=i;a++)e+=n(1-t,i-a)*n(t,a)*r[a]*o(i,a);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=tc.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(n=Math.floor(i=e*(1+t))),o(r[(n-1+e)%e],r[n],r[(n+1)%e],r[(n+2)%e],i-n)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[n?n-1:0],r[n],r[e<n+1?e:n+1],r[e<n+2?e:n+2],i-n)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=tc.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,n){var o=(e-r)*.5,a=(i-t)*.5,c=n*n,l=n*c;return(2*t-2*e+o+a)*l+(-3*t+3*e-2*o-a)*c+o*n+t}}},jI=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),P0=new w0,nr=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=rt.Linear.None,this._interpolationFunction=tc.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=jI.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=P0,P0.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=Eu()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var o in this._valuesEnd)n[o]=this._valuesEnd[o];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,n,o){for(var a in i){var c=t[a],l=Array.isArray(c),p=l?"array":typeof c,d=!l&&Array.isArray(i[a]);if(!(p==="undefined"||p==="function")){if(d){var f=i[a];if(f.length===0)continue;for(var g=[c],y=0,v=f.length;y<v;y+=1){var x=this._handleRelativeValue(c,f[y]);if(isNaN(x)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(x)}d&&(i[a]=g)}if((p==="object"||l)&&c&&!d){e[a]=l?[]:{};var b=c;for(var C in b)e[a][C]=b[C];n[a]=l?[]:{};var f=i[a];if(!this._isDynamic){var M={};for(var C in f)M[C]=f[C];i[a]=f=M}this._setupProperties(b,e[a],f,n[a],o)}else(typeof e[a]>"u"||o)&&(e[a]=c),l||(e[a]*=1),d?n[a]=i[a].slice().reverse():n[a]=e[a]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=Eu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=Eu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=rt.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=tc.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,n;if(t===void 0&&(t=Eu()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,c=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),l=this._duration+this._repeat*c,p=function(){if(i._duration===0||a>l)return 1;var x=Math.trunc(a/c),b=a-x*c,C=Math.min(b/i._duration,1);return C===0&&a===i._duration?1:C},d=p(),f=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),this._duration===0||a>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((a-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=g);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var y=0,v=this._chainedTweens.length;y<v;y++)this._chainedTweens[y].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,n){for(var o in i)if(e[o]!==void 0){var a=e[o]||0,c=i[o],l=Array.isArray(t[o]),p=Array.isArray(c),d=!l&&p;d?t[o]=this._interpolationFunction(c,n):typeof c=="object"&&c?this._updateProperties(t[o],a,c,n):(c=this._handleRelativeValue(a,c),typeof c=="number"&&(t[o]=a+(c-a)*n))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var xte=jI.nextId,Wi=P0,Cte=Wi.getAll.bind(Wi),Ste=Wi.removeAll.bind(Wi),Tte=Wi.add.bind(Wi),Mte=Wi.remove.bind(Wi),Ite=Wi.update.bind(Wi);m();m();m();var UI=(r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,HI=(r,t)=>new ie(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),D0=(r,t)=>Math.atan2(t.y-r.y,t.x-r.x),_u=(r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),E0=(r,t)=>new ie((r.x+t.x)/2,(r.y+t.y)/2),_0=r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t};var Gm=class{constructor(t,e){u(this,"input1");u(this,"input2");u(this,"lastAngle");u(this,"lastDistance");u(this,"totalDistance");u(this,"first");u(this,"second");this.input1=t,this.input2=e,this.lastAngle=D0(t,e),this.lastDistance=_u(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=_u(t,e);this.input1=t,this.input2=e;let n=D0(t,e);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(_u(this.first,t)+_u(this.second,e))/2,this.first=E0(this.first,t),this.second=E0(this.second,e)}};m();var Ou=class{constructor(t,e,i){u(this,"touch");u(this,"camera");u(this,"cameraPlane");u(this,"viewCoordinate");u(this,"snapHolderMatrix");u(this,"snapCamera");u(this,"cameraPosition");u(this,"raycaster");u(this,"worldCoordinate");u(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=i,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new ie(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new bi,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=e&&e.length>0?e[0].point:null,this.snapshotted=!0}updateAnchorState(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var i,n;let t=new ie(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(t,this.snapCamera);let e=(n=this.raycaster)==null?void 0:n.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};var Fr={};MP(Fr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>tR,CLIPPING_RADIUS:()=>Lu,CONTROL_OPTIONS:()=>eR,DEFAULT_ANIMATION_DURATION:()=>F0,DEFAULT_BEARING:()=>aR,DEFAULT_MAX_ZOOM_LEVEL:()=>nR,DEFAULT_MIN_ZOOM_LEVEL:()=>B0,DEFAULT_PITCH:()=>oR,DEFAULT_ZOOM_LEVEL:()=>iR,EVENTS:()=>Hm,MAPLIBRE_TILE_SIZE:()=>Vm,MAX_LAT:()=>L0,MAX_MERCATOR_ZOOM_LEVEL:()=>Um,MIN_LAT:()=>O0,MIN_MERCATOR_ZOOM_LEVEL:()=>jm,ROOM_MERCATOR_ZOOM_LEVEL:()=>rR,TWO_PI:()=>k0,WHEEL_ZOOM_MULTIPLIER:()=>A0,ZRANGE:()=>rc});m();var Vm=512,O0=-85.051129,L0=85.051129,Lu=1e4,eR={chain:"chain",cancel:"cancel"},k0=Math.PI*2,rc=100,A0=1e4,jm=0,Um=24,tR=17,rR=20,F0=200,Hm=["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"],iR=18,B0=12,nR=22,oR=0,aR=0;m();function WI(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}function We(r){for(let t=r.children.length-1;t>=0;t--)We(r.children[t]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(t){WI(t)}):"material"in r&&typeof r.material<"u"&&WI(r.material)}var Wm=!1,sR=!1;var zm,hs=class extends oe{constructor(e,i,n,o,a){super();u(this,"dirty",!1);u(this,"zoomDirty",!1);u(this,"rotationDirty",!1);u(this,"panDirty",!1);S(this,zm,B0);u(this,"zoomSpeed",5);u(this,"rotateSpeed",100);u(this,"enabled",!0);u(this,"enableZoom",!0);u(this,"enablePan",!0);u(this,"enablePedestal",!1);u(this,"maxPedestal",1/0);u(this,"minPedestal",0);u(this,"enableRotate",!0);u(this,"minZoomAltitude",0);u(this,"maxZoomAltitude",1/0);u(this,"ignoreZoomLimits",!1);u(this,"zoomFactor",1);u(this,"panBounds",{min:new K(1/0,1/0),max:new K(-1/0,-1/0),center:new K(0,0,0),radius:1/0});u(this,"minTilt",0);u(this,"maxTilt",1.2);u(this,"MOUSE_BUTTONS",{ORBIT:Qd.RIGHT,ZOOM:Qd.MIDDLE,PAN:Qd.LEFT});u(this,"camera");u(this,"scene");u(this,"renderer");u(this,"elevation");u(this,"orbit");u(this,"cameraPlane");u(this,"raycaster",new bi);u(this,"rendererState");u(this,"options");u(this,"state",-1);u(this,"intersection");u(this,"viewState",null);u(this,"tweens",new Map);u(this,"clock",new Wv(!0));u(this,"coords",{mouse:new ie,rotateStart:new ie,rotateEnd:new ie,rotateDelta:new ie,panStart:new K,panCameraStart:new K,panEnd:new K,panDelta:new K,initialShiftPos:new ie,initialPedestal:0,floorAnchor:new K});u(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});u(this,"scrollTimer",null);u(this,"lastWheelTime",0);u(this,"resetZoom",!1);u(this,"zoomStart");u(this,"pedestalScaleFactor",1);u(this,"isUserZooming",!1);u(this,"stayInsideBounds",!0);u(this,"userInteracting",!1);u(this,"cameraMoving",!1);u(this,"lastCameraMoveTime",Date.now());u(this,"raycastToFloor",e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new K});u(this,"isUserInteracting",()=>this.userInteracting);u(this,"getPosition",()=>new K(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));u(this,"getPedestal",()=>this.orbit.position.z);u(this,"pan",(e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))});u(this,"postRender",()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))});u(this,"isCameraMoving",()=>this.cameraMoving);u(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);u(this,"setPosition",(e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)});u(this,"updateCameraPosition",(e,i)=>{let n=e-this.panBounds.center.x,o=i-this.panBounds.center.y,a=Math.sqrt(n*n+o*o);if(this.stayInsideBounds&&a>this.panBounds.radius){let c=Math.atan2(o,n),l={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=e,this.orbit.position.y=i});u(this,"tilt",e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")});u(this,"zoomIn",(e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},e,i,n)});u(this,"zoomOut",(e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},e,i,n)});u(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));u(this,"cancelAnimation",()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)});u(this,"animateCamera",(e,i,n,o,a,c)=>{let l={interruptible:!0,...c},p={},d={},f=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(p.x=f.x,d.x=e.position.x),e.position.y!==void 0&&(p.y=f.y,d.y=e.position.y),e.position.z!==void 0&&(p.z=f.z,d.z=e.position.z)),e.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.zoom=e.zoom:d.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:P,end:w}=lh(this.getRotation(),e.rotation);p.rotation=P,d.rotation=w}e.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.tilt=e.tilt:d.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==d.zoom,y=p.rotation!==d.rotation,v=p.tilt!==d.tilt,x=new nr(p).to(d,T.env.TESTING?0:i).onUpdate(P=>{this.setMulti({x:P.x,y:P.y,z:P.z},P.zoom,P.rotation,P.tilt)}).onComplete(()=>{this.completeTween(x),this.publish("multi-end",{zooming:g,rotating:y,tilting:v}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,x.state=7,this.publish("multi-start",{zooming:g,rotating:y,tilting:v})),this.publish("change")});this.rendererState.tweenGroup.add(x);let b=Array.from(this.tweens.entries()),C=b[b.length-1],M=!1;return C!=null&&(C[1].interruptible?(typeof C[1].cancelledCallback=="function"&&C[1].cancelledCallback(),this.completeTween(C[0])):(M=!0,C[0].chain(x))),this.tweens.set(x,{cancelledCallback:a,interruptible:l.interruptible}),n?x.easing(n):x.easing(rt.Quadratic.In),!e.doNotAutoStart&&!M&&(x.start(),this.publish("change")),x.cameraAnimation=!0,x});u(this,"setMulti",(e,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),c=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),c=!0)),c&&this.publish("position-updated");let l={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;p!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Lu&&(this.camera.near=i-Lu,this.camera.far=i+Lu):(this.camera.near=i/rc,this.camera.far=i*rc),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(l.rotating=!0,this.orbit.rotation.z=-n,this.publish("rotation-updated")),o!==void 0&&!isNaN(o)){let p=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;p!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)});u(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);u(this,"getZoomScaledMax",()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)});u(this,"setRotation",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=-(e%k0);n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0});u(this,"setZoomAltitude",e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(e,this.getZoomScaledMin()),this.getZoomScaledMax()):e;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/rc,this.camera.far=i*rc,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});u(this,"setZoomLevel",e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))});u(this,"getZoomAltitude",()=>this.camera.position.z);u(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));u(this,"setTilt",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0});u(this,"getTilt",()=>this.elevation.rotation.x);u(this,"setCameraPlaneElevation",e=>{this.cameraPlane.position.z=e});u(this,"zoom",e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")});u(this,"getProjectionScaleFactor",(e,i,n)=>Wg(e,i,n));u(this,"update",()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});u(this,"setPedestal",(e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)});u(this,"dispose",()=>{for(let e of Hm)e.endsWith("start")?(this.off(e,this.setCameraMoving),e.startsWith("user")&&this.off(e,this.setUserInteracting)):(e.endsWith("end")||e.endsWith("cancel"))&&(this.off(e,this.unsetCameraMoving),e.startsWith("user")&&this.off(e,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)});u(this,"createCameraPlane",()=>{let e=Wm?2e3:1e10,i=Wm?100:1,n=new Vr(e,e,i,i),o=new lt({color:0,wireframe:Wm,visible:Wm}),a=new ue(n,o);return this.scene.add(a),a});u(this,"addEventListeners",()=>{let{domElement:e}=this.renderer;for(let i of Hm)i.endsWith("start")?(this.on(i,this.setCameraMoving),i.startsWith("user")&&this.on(i,this.setUserInteracting)):(i.endsWith("end")||i.endsWith("cancel"))&&(this.on(i,this.unsetCameraMoving),i.startsWith("user")&&this.on(i,this.unsetUserInteracting));e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)});u(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});u(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeEventListeners",()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"onContextMenu",e=>{e.preventDefault()});u(this,"onMouseUp",()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}});u(this,"onMouseMove",e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)});u(this,"onTouchStart",e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new Gm(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});u(this,"onTouchMove",e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let i={...this.touch.inputs.first},n={...this.touch.inputs.second},o=new ie(this.touch.touches[0].x,this.touch.touches[0].y),a=new ie(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<o.y&&n.y<a.y,l=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(l||c)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}});u(this,"onTouchEnd",e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}});u(this,"handleTouchMovePan",e=>{let i=Object.hasOwn(e,"x")?new ie(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panEnd.set(n.x,n.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});u(this,"handleTouchStartDolly",()=>{let e=this.touch.touches[0].x-this.touch.touches[1].x,i=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let n=new ie(this.touch.touches[0].x-e/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Ou(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Ou(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")});u(this,"handleMouseMovePan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});u(this,"handleTouchStartTilt",e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});u(this,"handleTouchMovePedestal",e=>{this.handleMouseMovePedestal(e.touches[0])});u(this,"handleTouchMoveTilt",e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)});u(this,"handleTouchMoveDolly",()=>{let e=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)});u(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});u(this,"handleTouchStartPan",e=>{let i=Object.hasOwn(e,"x")?new ie(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")});u(this,"handleTouchStartPedestal",e=>{this.handleMouseDownPedestal(e.touches[0])});u(this,"onMouseDown",e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}});u(this,"onMouseWheel",e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))});u(this,"handleMouseWheel",e=>{if(this.publish("zoom-start"),!this.canScrollZoom(e)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),n=i-_0(e)*i/A0*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let o=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-o),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")});u(this,"setCameraFromTransformMatrix",e=>{this.orbit.updateMatrixWorld();let i=new nn;i.setFromRotationMatrix(e,"ZYX");let n=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new K(0,0,1);a.applyEuler(i),a.setLength(n);let c=new K;c.setFromMatrixPosition(e),c.sub(a),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-o)});u(this,"makeTransformFromTouchAnchors",(e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=e.worldCoordinate,a=i.worldCoordinate,c=e.reUnproject(),l=i.reUnproject();if(!c||!l||!o||!a)return null;let p=e.viewCoordinate,d=i.viewCoordinate,f=a.x-o.x,g=a.y-o.y,y=Math.atan2(g,f),v=l.x-c.x,x=l.y-c.y,b=Math.atan2(x,v),C=UI(y,b),M=new Nr;M.makeRotationZ(-C);let P=M.clone();P.multiply(e.snapHolderMatrix);let w=(CP,SP,TP)=>CP.elements[(SP-1)*4+TP-1],D=w(n,1,1)*w(P,1,1)-p.x*w(n,3,4)*w(P,3,1),B=w(n,1,1)*w(P,1,2)-p.x*w(n,3,4)*w(P,3,2),_=w(n,1,1)*w(P,1,3)-p.x*w(n,3,4)*w(P,3,3),A=o.x*D+o.y*B+o.z*_,F=w(n,2,2)*w(P,2,1)-p.y*w(n,3,4)*w(P,3,1),G=w(n,2,2)*w(P,2,2)-p.y*w(n,3,4)*w(P,3,2),R=w(n,2,2)*w(P,2,3)-p.y*w(n,3,4)*w(P,3,3),z=o.x*F+o.y*G+o.z*R,W=w(n,1,1)*w(P,1,1)-d.x*w(n,3,4)*w(P,3,1),j=w(n,1,1)*w(P,1,2)-d.x*w(n,3,4)*w(P,3,2),ee=w(n,1,1)*w(P,1,3)-d.x*w(n,3,4)*w(P,3,3),Z=a.x*W+a.y*j+a.z*ee,xe=w(n,2,2)*w(P,2,1)-d.y*w(n,3,4)*w(P,3,1),fe=w(n,2,2)*w(P,2,2)-d.y*w(n,3,4)*w(P,3,2),Ie=w(n,2,2)*w(P,2,3)-d.y*w(n,3,4)*w(P,3,3),_e=a.x*xe+a.y*fe+a.z*Ie,cr=Math.abs(W-D),_t=Math.abs(j-B),at=Math.abs(ee-_),Qe=Math.abs(W-F),pr=Math.abs(j-G),Rr=Math.abs(ee-R),me=Math.abs(xe-D),be=Math.abs(fe-B),qe=Math.abs(Ie-_),gt=Math.abs(xe-F),st=Math.abs(fe-G),en=Math.abs(Ie-R),hi=Math.min(cr+_t+at,Qe+pr+Rr),fi=Math.min(me+be+qe,gt+st+en);hi<fi&&(W=xe,j=fe,ee=Ie,Z=_e);let Vt=F*_-D*R,Kn=G*_-B*R,_c=z*_-A*R,Oc=W*R-F*ee,Lc=j*R-G*ee,Cv=Z*R-z*ee,gP=(Cv*Kn-_c*Lc)/(Oc*Kn-Vt*Lc),yP=(Cv*Vt-_c*Oc)/(Lc*Vt-Kn*Oc),Sv=G*D-B*F,bP=R*D-_*F,vP=z*D-A*F,Tv=j*F-G*W,xP=ee*F-R*W,Mv=((Z*F-z*W)*Sv-vP*Tv)/(xP*Sv-bP*Tv),Kd=P.clone();return Kd.elements[12]=gP,Kd.elements[13]=yP,Kd.elements[14]=Mv,Mv>0?Kd:null});u(this,"updateTouchOrigin",()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top});u(this,"touchToScene",e=>{this.touch.touches=[];for(let i=0,n=e.touches.length;i<n;i++){let o=e.touches[i],a=HI(o,this.touch.origin);this.touch.touches.push(new ie(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});u(this,"canScrollZoom",e=>{let i=_0(e),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())});u(this,"mouseToScene",e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse});u(this,"getMousePos",e=>({x:e.offsetX,y:e.offsetY}));u(this,"handleMouseDownRotate",e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});u(this,"handleMouseDownPan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")});u(this,"handleMouseDownPedestal",e=>{let i=new ie(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=Wg(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});u(this,"handleMouseMovePedestal",e=>{let i={x:e.clientX,y:e.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)});u(this,"handleMouseMoveRotate",e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")});u(this,"publishUserZoomDebounced",Hs(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));u(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});u(this,"setCameraMoving",()=>{this.cameraMoving=!0});u(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});u(this,"setUserInteracting",()=>{this.userInteracting=!0});u(this,"unsetUserInteracting",()=>{this.userInteracting=!1});u(this,"publishPedestalChangeEvent",e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});u(this,"convertAltitudeToZoomLevel",e=>{let[,i]=this.center,o=e*2*Math.tan(ge.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ge.degToRad(i))*2*Math.PI*kg/o;return ge.clamp(Math.log2(a/512),jm,Um)});u(this,"convertZoomLevelToAltitude",e=>{let[,i]=this.center,n=ge.clamp(e,jm,Um),o=Math.pow(2,n),a=ge.clamp(i,O0,L0),c=o*512;return Math.cos(ge.degToRad(a))*Math.PI*2*kg/c*this.options.canvasHeight/2/Math.tan(ge.degToRad(this.camera.fov)/2)});u(this,"completeTween",e=>{e.isPlaying()&&e.stop(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)});u(this,"debugContainer",new on);this.camera=e,this.renderer=n,this.rendererState=o,this.scene=i,this.options=a,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return s(this,zm)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,i),n=Math.max(n,e),(n-e)/(i-e)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var o,a,c,l;let e=this.getPosition(),{lat:i,lon:n}=uh((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(l=(c=this.rendererState.center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[n,i]}setCenter(e,i){var a,c,l,p;let{x:n,y:o}=dh((c=(a=this.rendererState.center)==null?void 0:a[1])!=null?c:0,(p=(l=this.rendererState.center)==null?void 0:l[0])!=null?p:0,i,e);this.setPosition(n,o)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}getCameraFrameForCoordinates(e,i){let n=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,o=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,a=this.options.canvasWidth,c=this.options.canvasHeight,l=this.getRotation(),p=this.getTilt(),d=this.getPosition();this.setRotation(i.rotation||l,!0),this.setTilt(i.tilt||p,!0);let f=zI(e,{canvasWidth:a,canvasHeight:c,paddingOption:i.padding,verticalPadding:i.verticalPadding,minZoom:n,maxZoom:o,position:d,camera:this.camera,orbit:this.orbit});return this.setRotation(l,!0),this.setTilt(p,!0),{center:f.position,zoomLevel:this.convertAltitudeToZoomLevel(f.zoom)}}focusOn(e,i){if(sR){this.debugContainer&&We(this.debugContainer);let b=new Gr(4,4,4),C=new lt({color:65280,depthTest:!1}),M=new eo(b,C,e.length),P=new Nr;e.forEach((w,D)=>{P.setPosition(w),M.setMatrixAt(D,P)}),M.instanceMatrix.needsUpdate=!0,this.debugContainer.add(M),this.scene.add(this.debugContainer)}let n=i.curve,o=i.callback,a=i.cancelledCallback,c=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,l=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,d=this.options.canvasHeight,f;i.duration!==void 0?f=i.duration:T.env.TESTING==="true"?f=0:f=F0;let g=i.padding,y=this.getRotation(),v=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let x=zI(e,{canvasHeight:d,paddingOption:g,canvasWidth:p,minZoom:c,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:i.verticalPadding});this.setRotation(y),this.setTilt(v),this.animateCamera({position:x.position,tilt:i.tilt,rotation:i.rotation,zoom:x.zoom},f,n,o,a,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};zm=new WeakMap,u(hs,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function zI(r,{canvasWidth:t,orbit:e,paddingOption:i,verticalPadding:n=0,canvasHeight:o,minZoom:a,maxZoom:c,camera:l,position:p}){let d={zoom:a,position:p};if(r.length===0)return d;for(let Vt of hs.CAMERA_FRAME_PADDING_SIDES)typeof i[Vt]!="number"&&(i[Vt]=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 d;e.updateMatrixWorld();let g=l.matrixWorldInverse,y=l.fov*(Math.PI/180)/2,v=y,b=Math.atan(Math.tan(y)*(t/o)),C=new K(1/0,1/0,1/0),M=new K(-1/0,-1/0,-1/0),P=new yt,w=new K;for(let Vt=0,Kn=r.length;Vt<Kn;Vt++)w.copy(r[Vt]),P.expandByPoint(w),w.applyMatrix4(g),C.min(w),M.max(w),w.copy(r[Vt]),w.z-=n,w.applyMatrix4(g),C.min(w),M.max(w),w.copy(r[Vt]),w.z+=n,w.applyMatrix4(g),C.min(w),M.max(w);let D=M.x-C.x,B=M.y-C.y,_=t-f.left-f.right,A=o-f.top-f.bottom,F=(M.x+C.x)/2,G=(M.y+C.y)/2,R=D/_,z=B/A,W=a,j=c,ee=W*Math.tan(b)*2,Z=j*Math.tan(b)*2,xe=ee/t,fe=Z/t,Ie=Math.max(R,z);Ie=ge.clamp(Ie,xe,fe);let _e=_*Ie,cr=A*Ie,_t={min:{x:F-_e/2-f.left*Ie,y:G-cr/2-f.bottom*Ie},max:{x:F+_e/2+f.right*Ie,y:G+cr/2+f.top*Ie}},at=(_t.min.x+_t.max.x)/2,Qe=(_t.min.y+_t.max.y)/2,pr=P.getCenter(new K),Rr=Math.abs(at-_t.min.x),me=Math.abs(Qe-_t.min.y),be=Rr/Math.tan(b),qe=me/Math.tan(v),gt=new K;gt.set(at,Qe,M.z+Math.max(be,qe)),gt.applyMatrix4(l.matrixWorld);let st=new K;st.set(at,Qe,M.z),st.applyMatrix4(l.matrixWorld);let en=new K().subVectors(st,gt),hi=(pr.z-gt.z)/en.z,fi=new K().copy(gt).add(en.clone().multiplyScalar(hi));return st.set(fi.x,fi.y,fi.z),gt.sub(st),{position:fi,zoom:gt.length()}}m();var lR=300,ku,Au,Zm=class{constructor(t){u(this,"state");S(this,ku,new K);S(this,Au,new K);this.state=t}update(t){var n;let e,i;this.state.cameraObject.getWorldPosition(s(this,Au));for(let o of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i&&"containerEl"in i&&i.markerContainer!=null)){if(i.visibilityNeedsUpdate!==!1&&(i.visibilityNeedsUpdate==="show"?i.canShow=!0:i.canShow=!1),(i.canShow&&i.visible===!0||((n=i.animation)==null?void 0:n.pending)===!0)&&!i.offscreen)if(i.options.zIndex!=null)i.markerContainer.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.options.zIndex,"px)");else{e.object3d.getWorldPosition(s(this,ku));let a=s(this,Au).distanceTo(s(this,ku));i.markerContainer.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-a,"px)")}if(i.canShow===!0&&i.visible===!0?i.markerContainer.style.pointerEvents=t?"none":i.pointerEvents:i.markerContainer.style.pointerEvents="none",i.currentStrategyIndex===-1&&i.visible&&i.visibilityNeedsUpdate==="show")continue;i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.visibilityNeedsUpdate==="show"&&(i.markerContainer.style.opacity="0"),i.animation&&i.animation.cancel(),i.animation=i.markerContainer.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:lR,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};ku=new WeakMap,Au=new WeakMap;m();var Xm=class{constructor(){u(this,"percentExpanded",0);u(this,"activeId","");u(this,"gap",20);u(this,"dirty",!0)}};m();var Ym=class extends oe{constructor(e,i){super();u(this,"state");u(this,"dirty",!0);u(this,"domTree");u(this,"observers",new Map);u(this,"updateDimensions",e=>{e.forEach(i=>{var a;let o=(a=i.target.parentElement)==null?void 0:a.getAttribute("data-marker-id");if(o){let c=this.state.geometry2DMap.get(o),l=c==null?void 0:c.components[0];c&&l instanceof Vi&&(l.updateDimensions(i.contentRect.width,i.contentRect.height),l.collisionDirty=!0)}}),this.publish("dimensions-update")});this.state=e,this.domTree=i}setupObserver(){var n;if(this.observers){for(let o of this.observers.values())o.disconnect();this.observers.clear()}let e,i;for(let o of this.domTree.children){let a=o.getAttribute("data-marker-id");if(a!=null&&(e=this.state.geometry2DMap.get(a),i=e.components[0],(n=i.options)!=null&&n.dynamicResize)){let c=new ResizeObserver(this.updateDimensions);c.observe(i.containerEl),this.observers.set(o.userData.entityId,c)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};m();var cR=0,pR=90,uR=(T.env.NODE_ENV==="test",!1),Ln={linear:rt.Linear.None,"ease-in":rt.Quadratic.In,"ease-out":rt.Quadratic.Out,"ease-in-out":rt.Quadratic.InOut},dR=-50,Q,le,Bo,Fu,Bu,N0,qm=class{constructor(t,e,i){S(this,Bu);S(this,Q);S(this,le);S(this,Bo);S(this,Fu);I(this,Q,t),I(this,le,e),I(this,Bo,i),s(this,le).cameraSystem.on("pedestal-change",({pedestal:n})=>{s(this,Q).map&&(s(this,Q).map.transform.elevation=n,s(this,Q).map.transform.minElevationForCurrentTile=dR,s(this,Q).map.triggerRepaint()),s(this,le).cameraSystem.setCameraPlaneElevation(n)})}get center(){return s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?s(this,Q).map.getCenter().toArray():s(this,le).cameraSystem.center}setCenter(t){var e;if(s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map){(e=s(this,Q).map)==null||e.setCenter(t),s(this,le).interactionSystem.handleHover();return}s(this,le).cameraSystem.setCenter(t[0],t[1]),s(this,le).interactionSystem.handleHover()}get zoomLevel(){var t;return s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?(t=s(this,Q).map)==null?void 0:t.getZoom():s(this,le).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map&&((e=s(this,Q).map)==null||e.setZoom(t)),s(this,le).cameraSystem.setZoomLevel(vi(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return s(this,le).cameraSystem.isAnimating}cancelAnimation(){s(this,le).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,le).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,le).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){s(this,le).panBoundsSystem.autoMinZoomLevel=t,t&&(s(this,le).panBoundsSystem.dirty=!0,s(this,le).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,le).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var n;e&&this.setAutoMinZoomLevel(!1);let i=vi(t,Fr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Fr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));s(this,le).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=s(this,Q).map)==null||n.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=vi(t,this.minZoomLevel,Fr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Fr.MAX_MERCATOR_ZOOM_LEVEL,"."));s(this,le).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=s(this,Q).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?(t=s(this,Q).map)==null?void 0:t.getMaxPitch():ge.radToDeg(s(this,le).cameraSystem.maxTilt)}get minPitch(){var t;return s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?(t=s(this,Q).map)==null?void 0:t.getMinPitch():ge.radToDeg(s(this,le).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(cR,t);(i=s(this,Q).map)==null||i.setMinPitch(e),s(this,le).cameraSystem.minTilt=ge.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(pR,t);(i=s(this,Q).map)==null||i.setMaxPitch(e),s(this,le).cameraSystem.maxTilt=ge.degToRad(e)}get bearing(){var t;return s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?(t=s(this,Q).map)==null?void 0:t.getBearing():ge.radToDeg(s(this,le).cameraSystem.getRotation())}setBearing(t){var e;if(s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map){(e=s(this,Q).map)==null||e.setBearing(t);return}s(this,le).cameraSystem.setRotation(ge.degToRad(t))}get pitch(){var t;return s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?(t=s(this,Q).map)==null?void 0:t.getPitch():ge.radToDeg(s(this,le).cameraSystem.getTilt())}setPitch(t){var e;if(s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map){(e=s(this,Q).map)==null||e.setPitch(t);return}s(this,le).cameraSystem.setTilt(ge.degToRad(vi(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return s(this,le).cameraSystem.getPedestal()}setElevation(t){s(this,le).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return s(this,Fu)&&s(this,Fu).stop(),new Promise(i=>{var o;let n=s(this,le).cameraSystem.getPosition();n.z=t,s(this,le).cameraSystem.animateCamera({position:n},(e==null?void 0:e.duration)||300,Ln[(e==null?void 0:e.easing)||"ease-in-out"],i,i,{interruptible:(o=e==null?void 0:e.interruptible)!=null?o:!0})})}get insetsPadding(){return s(this,Bo).insetsPadding}get panMode(){return s(this,le).cameraSystem.enablePan===!1&&s(this,le).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(s(this,le).cameraSystem.enablePan=!0,s(this,le).cameraSystem.enablePedestal=!1):(s(this,le).cameraSystem.enablePan=!1,s(this,le).cameraSystem.enablePedestal=!0))}setInsetPadding(t){s(this,Bo).insetsPadding=Object.assign({},Fc,t)}animateTo(t){var a,c,l,p,d,f;if(s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map)return(f=s(this,Q).map)==null||f.flyTo({center:(a=t.center)!=null?a:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(l=t.bearing)!=null?l:this.bearing,pitch:(p=t.pitch)!=null?p:this.pitch,duration:(d=t.duration)!=null?d:600}),Promise.resolve();let e=t.center?s(this,Q).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?s(this,le).cameraSystem.convertZoomLevelToAltitude(vi(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,n=t.bearing!==void 0?ge.degToRad(t.bearing):void 0,o=t.pitch!==void 0?ge.degToRad(vi(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(g=>{var y;s(this,le).cameraSystem.animateCamera({position:e,zoom:i,rotation:n,tilt:o},t.duration||0,Ln[t.easing||"ease-in-out"],()=>{s(this,le).interactionSystem.handleHover(),g()},g,{interruptible:(y=t==null?void 0:t.interruptible)!=null?y:!0})})}getCameraFrameForCoordinates(t,e){let i=N(this,Bu,N0).call(this,e||{},()=>Promise.resolve()),{pointCloud:n}=ZI(t,s(this,Q),s(this,Bo).geometry3DMap);if(n.length===0)return O.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:o,zoomLevel:a}=s(this,le).cameraSystem.getCameraFrameForCoordinates(n,i);return{center:s(this,Q).convert3DMapPositionToCoordinate(o),zoomLevel:a}}focusOn(t,e){var a,c,l,p;let{pointCloud:i,geoBounds:n,firstPosition:o}=ZI(t,s(this,Q),s(this,Bo).geometry3DMap);return i.length===0?(O.error("No valid coordinates found in targets:",t),Promise.resolve()):s(this,Q).mode==="outdoors-overlay"&&s(this,Q).map?(i.length===1&&o?(a=s(this,Q).map)==null||a.flyTo({center:[o[0],o[1]],duration:(e==null?void 0:e.duration)||s(this,Q).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?s(this,Q).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,Q).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||s(this,Q).map.getMaxZoom()}):(uR&&hR(s(this,Q),n),(p=s(this,Q).map)==null||p.fitBounds(n,{duration:(c=e==null?void 0:e.duration)!=null?c:Fr.DEFAULT_ANIMATION_DURATION,bearing:(e==null?void 0:e.bearing)===void 0?s(this,Q).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,Q).map.getPitch():e==null?void 0:e.pitch,maxZoom:(l=e==null?void 0:e.maxZoomLevel)!=null?l:s(this,Q).map.getMaxZoom()})),s(this,le).interactionSystem.handleHover(),Promise.resolve()):new Promise(d=>{s(this,le).cameraSystem.focusOn(i,N(this,Bu,N0).call(this,e||{},d))})}};Q=new WeakMap,le=new WeakMap,Bo=new WeakMap,Fu=new WeakMap,Bu=new WeakSet,N0=function(t,e){var i;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:s(this,le).cameraSystem.convertZoomLevelToAltitude(vi(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:s(this,le).cameraSystem.convertZoomLevelToAltitude(vi(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({},Fc,t==null?void 0:t.padding):this.insetsPadding,curve:Ln[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ge.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ge.degToRad(vi(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:()=>{s(this,le).interactionSystem.handleHover(),e()},cancelledCallback:e,interruptible:(i=t==null?void 0:t.interruptible)!=null?i:!0,verticalPadding:t==null?void 0:t.verticalPadding}};function R0(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}function ZI(r,t,e){var c;let i=[],n=[1/0,1/0,-1/0,-1/0],o=null;if(!r||!Array.isArray(r)||r.length===0)return{pointCloud:i,geoBounds:n,firstPosition:o};let a=t.getSystems().renderSystem;(a.threeDdirty||a.twoDdirty)&&t.renderSync();for(let l of r)if(typeof l=="string"){let p=e.get(l);if(!p){O.error("Entity not found with id:",l);continue}let d=new yt;p2(t,"userData"in p&&(c=p.userData.entityId)!=null?c:p.id,i,d,p instanceof Te?p.position.z:void 0);let f=t.convert3DMapPositionToCoordinate(d.min),g=t.convert3DMapPositionToCoordinate(d.max);R0(n,f),R0(n,g),o||(o=t.convert3DMapPositionToCoordinate(d.getCenter(new K)))}else i.push(t.convertTo3DMapPosition(l[1],l[0],l[2]||0)),R0(n,l),o||(o=l);return{pointCloud:i,geoBounds:n,firstPosition:o}}function hR(r,t){var i,n,o,a;let e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(i=r.map)!=null&&i.getLayer("bounds-outline")&&r.map.removeLayer("bounds-outline"),(n=r.map)!=null&&n.getSource("bounds-source")&&r.map.removeSource("bounds-source"),(o=r.map)==null||o.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}}),(a=r.map)==null||a.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}m();var XI="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 YI="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 qI=4.291666666666667,$I=15,JI=25,KI=43/60;m();var QI=["horizontal","icon"],gR=new Map([[QI[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>'],[QI[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>']]),yR=/<svg([^>]*)>/g;function e7(r,t,e,i){let n=gR.get(r);return n?n.replace(yR,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var t7=!1,Ae,kn,ic,Rt,qt,fs,ri,zi,$m=class extends oe{constructor(e,i,n){super();S(this,Ae,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},interactive:!0,visible:!0});S(this,kn);S(this,ic);S(this,Rt);S(this,qt);S(this,fs);S(this,ri,0);S(this,zi,0);u(this,"dirty",!0);u(this,"getPositionAlignedCanvasCoordinates",(e,i)=>({"top-left":{x:0,y:0},"top-right":{x:e,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:e,y:i},center:{x:e/2,y:i/2},top:{x:e/2,y:0},bottom:{x:e/2,y:i},left:{x:0,y:i/2},right:{x:e,y:i/2}})[s(this,Ae).position]);u(this,"getPositionAlignedPadding",()=>{var n,o,a,c;let e=s(this,Ae).padding;if(typeof e=="number")return{"top-left":{x:e,y:e},"top-right":{x:-e,y:e},"bottom-left":{x:e,y:-e},"bottom-right":{x:-e,y:-e},center:{x:0,y:0},top:{x:0,y:e},bottom:{x:0,y:-e},left:{x:e,y:0},right:{x:-e,y:0}}[s(this,Ae).position];let i={top:(n=e.top)!=null?n:0,right:(o=e.right)!=null?o:0,bottom:(a=e.bottom)!=null?a:0,left:(c=e.left)!=null?c:0};return{x:i.left-i.right,y:i.top-i.bottom}});n&&Object.entries(n).forEach(([o,a])=>{a!==void 0&&(s(this,Ae)[o]=a)}),I(this,ic,e),I(this,kn,i)}get color(){return s(this,Ae).color==="light"?"white":"#293136"}get iconName(){return s(this,Ae).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,Ae).iconOnly?$I:75}get defaultWidth(){return s(this,Ae).iconOnly?JI:150}get aspectRatio(){return s(this,Ae).iconOnly?KI:qI}get options(){return{...s(this,Ae)}}set options(e){var i;I(this,Ae,{padding:e.padding||s(this,Ae).padding,position:e.position||s(this,Ae).position,iconOnly:e.iconOnly||s(this,Ae).iconOnly,color:e.color||s(this,Ae).color,scale:e.scale||s(this,Ae).scale,onClick:s(this,Ae).onClick,interactive:(i=e.interactive)!=null?i:s(this,Ae).interactive,visible:e.visible||s(this,Ae).visible})}get icon(){return e7(this.iconName,this.color,s(this,ri)*s(this,kn).pixelRatio,s(this,zi)*s(this,kn).pixelRatio)}setSize(e,i){s(this,qt)&&(s(this,qt).uniforms.uSize.value.x=e,s(this,qt).uniforms.uSize.value.y=i)}setXY(e,i){s(this,qt)&&(s(this,qt).uniforms.uSize.value.w=e,s(this,qt).uniforms.uSize.value.z=i)}get width(){return s(this,ri)}get height(){return s(this,zi)}getPositionAlignedOffset(e,i){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-e,y:-i},center:{x:-(e/2),y:-(i/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-e,y:-(i/2)}}[s(this,Ae).position]}insertIntoQuadTree(e){s(this,fs)!=null&&typeof s(this,Ae).onClick=="function"&&s(this,Ae).interactive&&e.insert(s(this,fs))}resize(e,i){if(s(this,Ae).visible!==!0)return;let n=this.getPositionAlignedCanvasCoordinates(e,i),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,ri),s(this,zi)),c=Math.min(e-s(this,ri),Math.max(0,n.x+o.x+a.x)),l=Math.min(i-s(this,zi),Math.max(0,n.y+o.y+a.y));this.setSize(s(this,ri)/e,s(this,zi)/i),this.setXY(c/e,l/i),I(this,fs,new dt(c,l,s(this,ri),s(this,zi),{entityId:"watermark"}))}update(){this.dirty&&s(this,Ae).visible===!0&&(I(this,ri,Math.min(s(this,kn).canvasWidth,Math.max(this.minWidth,this.defaultWidth*s(this,Ae).scale))),I(this,zi,s(this,ri)/this.aspectRatio),Ao.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(I(this,qt,new ia({uniforms:{uTexture:{value:e},uSize:{value:new kv(0,0,0,0)},uOpacity:{value:.7}},vertexShader:XI,fragmentShader:YI,depthWrite:!1,depthTest:!1,defines:{debug:t7},wireframe:t7,transparent:!0,visible:!0})),s(this,Rt))s(this,Rt).material=s(this,qt),s(this,Rt).material.needsUpdate=!0;else{let i=new Vr(2,2,1,1);I(this,Rt,new ue(i,s(this,qt))),s(this,Rt).position.set(0,0,-1),s(this,Rt).frustumCulled=!1,s(this,Rt).renderOrder=999;let n=new Gr(1,1,1),o=new ue(n,new lt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.frustumCulled=!1,o.layers.set(1),s(this,Rt).add(o),s(this,ic).add(s(this,Rt))}this.resize(s(this,kn).canvasWidth,s(this,kn).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){s(this,Rt)&&(s(this,ic).remove(s(this,Rt)),We(s(this,Rt))),I(this,Rt,void 0),s(this,qt)&&s(this,qt).dispose(),I(this,qt,void 0),I(this,fs,void 0)}};Ae=new WeakMap,kn=new WeakMap,ic=new WeakMap,Rt=new WeakMap,qt=new WeakMap,fs=new WeakMap,ri=new WeakMap,zi=new WeakMap;m();var Jm=100,xR=!1,Qm=class extends oe{constructor(e,i){super();u(this,"currentTotalBoundingBox");u(this,"state");u(this,"cameraSystem");u(this,"debugMesh",null);u(this,"dirty",!0);u(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new yt,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new K(0,0,0),new K(Jm*2,Jm*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Jm)));let e=new yt().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(e);let i=e.getSize(new K),n=Math.max(i.x,i.y,i.z);for(let a of this.state.geometry2DMap.values())a.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(a.position),a.positionDirty=!1);let o=Km.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(n,Jm)).getBoundingSphere(CR).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new K),min:Km.min,max:Km.max,radius:o},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,xR&&this.state.entityScene.parent instanceof Qn){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new on,this.debugMesh.add(new ue(new nh(this.cameraSystem.panBounds.radius),new lt({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let a=new K;Km.getSize(a);let c=new Gr(a.x,a.y,a.z),l=new lt({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new ue(c,l);p.position.copy(this.currentTotalBoundingBox.getCenter(new K)),this.debugMesh.add(p)}}}},Km=new yt,CR=new Fv;m();var r7="\xA9 Mappedin",SR="https://info.mappedin.com/feedback",V0=["top-left","top-right","bottom-left","bottom-right"],TR=640,MR=()=>"<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>",G0={custom:[],position:"bottom-right",feedback:!0},eg=class{constructor(t){u(this,"controlContainerEl");u(this,"controlPositions");u(this,"compact");u(this,"attribContainerEl");u(this,"attribInnerEl");u(this,"attribButtonEl");u(this,"feedbackLinkEl");u(this,"attribHTML",r7);u(this,"customAttributions",[]);u(this,"toggleAttribution",t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))});this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=V0.reduce((e,i)=>{let n=document.createElement("div");return n.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(n),e[i]=n,e},{})}addAttributionControl(t=G0){var n;let e=t.position&&V0.includes(t.position)?t.position:G0.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=MR(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((n=t.feedback)!=null?n:G0.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=SR,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=[r7],i=t.style.sourceCaches;for(let n in i){let o=i[n];if(o.used||o.usedForTerrain){let a=o.getSource();a.attribution&&e.indexOf(a.attribution)<0&&e.push(a.attribution)}}e=e.filter(n=>String(n).trim()),e=e.filter((n,o)=>{for(let a=o+1;a<e.length;a++)if(e[a].indexOf(n)>=0)return!1;return!0}),this.attribHTML=e.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=TR||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}};m();var Ru,nc=class{constructor(t,e){u(this,"mesh");u(this,"type","custom-geometry");u(this,"dirty",!0);u(this,"feature");u(this,"builder");u(this,"outline");u(this,"color",new Oe);S(this,Ru,0);this.mesh=new Ur,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){O.warn("TODO: implement custom geometry opacity")}get opacity(){return O.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return s(this,Ru)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,Ru,t))}get renderOrder(){return O.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){O.warn("TODO: implement custom geometry render order")}};Ru=new WeakMap;m();var tg=class{constructor(t,e){u(this,"state");u(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(t=n.components[0],e=n.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};m();m();function i7(r){return r.children.some(t=>t.userData.isOutline)}var wR=80,ms,oc,ig,ng,rg=class{constructor(t){u(this,"rendererState");u(this,"outlineOpacitiesDirty",!0);S(this,ms,!0);S(this,oc,-1/0);S(this,ig,new Map);S(this,ng,new Fg({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:eh}));this.rendererState=t}get geometries3DDirty(){return s(this,ms)}set geometries3DDirty(t){I(this,ms,t)}update(t,e=!0){let i;if(this.geometries3DDirty){for(let o of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(o),i instanceof Ot&&i.components[0].outline&&i.visible&&!i7(i)&&i.userData.entities3D.size>0)for(let a of i.userData.entities3D.values()){let c=this.rendererState.geometry3DMap.get(a),l=[];if(c instanceof we&&c.type==="geometry"&&c.components[3]&&c.components[3].dirty===!0&&c.components[0].geometry!=null&&c.components[0].material!=null){let x=c.components[0].geometry;if(!x)return null;l.push([c.components[3],new Bg(x,wR)])}let p=Tr(l.map(x=>x[1]),!1);if(p==null)continue;let d=p.getAttribute("position"),f=new Float32Array(d.count*4),g=new an(f,4);p.setAttribute("color",g);let y=0;for(let x=0;x<l.length;x++){let[b,C]=l[x],M=C.getAttribute("position").count;b.edgeColors=g,b.geometry=p,b.ranges={count:M,start:y},y+=M,C.dispose()}let v=new Ns(p,s(this,ng));v.userData.isOutline=!0,i.add(v)}I(this,ms,!1),this.outlineOpacitiesDirty=!0}for(let o of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(o);if(a instanceof we&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].geometry!=null&&a.components[0].material!=null&&a.parentObject3D instanceof Ot){let c=a.components[3].geometry;if(!c)continue;let l=a.components[3];if(!l)continue;let p=l.edgeColors;if(!p)continue;let d=new Oe(l.color);for(let x=0;x<l.ranges.count;x++){let b=l.ranges.start+x;p.setXYZ(b,d.r,d.g,d.b)}let f=a.components[1].height,y=c.getAttribute("position").array,v=-1/0;for(let x=0;x<l.ranges.count;x++){let C=(l.ranges.start+x)*3,M=y[C+2];v=Math.max(v,M)}for(let x=0;x<l.ranges.count;x++){let C=(l.ranges.start+x)*3,M=y[C+2];Math.abs(M-v)<1e-4&&(y[C+2]=Math.max(f,2e-4))}c.attributes.color.needsUpdate=!0,c.attributes.position.needsUpdate=!0,l.dirty=!1}}let n=e?Ti(t,16,19,0,1):s(this,oc);if((n!==s(this,oc)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let o of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(o),(i==null?void 0:i.type)==="geometry"&&i.components[0]instanceof Ze){let a=i.components[3];if(a&&a.edgeColors&&a.geometry){let c=a.visible,l=Math.min(n,c?i.components[1].opacity*la(i):0);if(a.currentOpacity!==l){for(let p=0;p<a.ranges.count;p++){let d=a.ranges.start+p;a.edgeColors.setW(d,l)}a.geometry.attributes.color.needsUpdate=!0}}}}I(this,oc,n),I(this,ms,!1),this.outlineOpacitiesDirty=!1}destroy(){s(this,ig).clear()}};ms=new WeakMap,oc=new WeakMap,ig=new WeakMap,ng=new WeakMap;m();m();var og=class extends ue{constructor(){super(...arguments);u(this,"userData",{entityId:""})}},DR=E.object({flipImageToFaceCamera:E.boolean().optional(),url:E.string()}),ER=E.object({type:E.enum(["Feature"]),properties:E.object({width:E.number(),height:E.number(),rotation:E.number().min(0).max(360).optional(),verticalOffset:E.number().optional()}),geometry:ec});function n7(r,t,e){E.union([E.number(),E.string()]).parse(r),ER.parse(t),DR.parse(e)}var ag=class{constructor(t){u(this,"mesh",new Ur);u(this,"imageMesh");u(this,"outline");u(this,"type","image");u(this,"instanceIndex",-1);u(this,"geometry");u(this,"material");u(this,"feature");u(this,"position",new K);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)}};m();function j0(r,t){return{x:r.x*Math.cos(t)-r.y*Math.sin(t),y:r.x*Math.sin(t)+r.y*Math.cos(t)}}function _R(r,t){return r.map(e=>j0(e,t))}function OR(r){let t=1/0,e=1/0,i=-1/0,n=-1/0;for(let o of r)t=Math.min(t,o.x),e=Math.min(e,o.y),i=Math.max(i,o.x),n=Math.max(n,o.y);return{minX:t,minY:e,maxX:i,maxY:n}}function LR(r,t){let e=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let o=t[i].x,a=t[i].y,c=t[n].x,l=t[n].y;a>r.y!=l>r.y&&r.x<(c-o)*(r.y-a)/(l-a)+o&&(e=!e)}return e}function o7(r,t,e,i,n){for(let o=0;o<n;o++)for(let a=0;a<i;a++)if(r[e+o][t+a]!==1)return!1;return!0}function kR(r,t,e){let i=r.maxX-r.minX,n=r.maxY-r.minY,o,a,c={...r};return i/n>t?(a=n/e,o=a*t,c.minX+=(i-o*e)/2):(o=i/e,a=o/t,c.minY+=(n-a*e)/2),{dx:o,dy:a,gridBounds:c}}function AR(r,t,e,i,n){let o=Array(e).fill(0).map(()=>Array(e).fill(0));for(let a=0;a<e;a++)for(let c=0;c<e;c++){let l={x:t.minX+c*i,y:t.minY+a*n};LR(l,r)&&(o[a][c]=1)}return o}function FR(r,t){let e=Array(t).fill(0).map(()=>Array(t).fill(0));for(let i=0;i<t;i++)for(let n=0;n<t;n++)if(r[i][n]===1){let o=0;for(let a=1;a<=Math.min(t-n,t-i)&&o7(r,n,i,a,a);a++)o=a;e[i][n]=o}return e}function BR(r,t,e,i,n,o){let a=0,c=0,l=0;for(let p=0;p<i;p++)for(let d=0;d<i;d++)if(r[p][d]===1){let f=Math.pow(t[p][d],2),g=e.minX+d*n,y=e.minY+p*o;a+=f,c+=g*f,l+=y*f}return{x:c/a,y:l/a}}function RR(r,t,e,i,n,o,a){let c=-1/0,l=null,p=r.length,d=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let f=0;f<p;f++)for(let g=0;g<p;g++)if(r[f][g]===1)for(let y=1;y<=p-g;y++){let v=y;if(!(v>p-f)&&o7(r,g,f,y,v)){let x=y*v,b=t.minX+(g+y/2)*e,C=t.minY+(f+v/2)*i,M={x:b,y:C},w=Math.sqrt(Math.pow(M.x-n.x,2)+Math.pow(M.y-n.y,2))/d,D=x*(1-o)-w*o*x;D>c&&(c=D,l={center:M,width:y*e*a,height:y*i*a})}}return l}function U0(r,t,e,i={}){let{scaleFactor:n=.9,centerPriority:o=.5,resolution:a=100,minimumSizeRatio:c=.5}=i,l=Yv(e),p=r.width/r.height,d=_R(t,l),f=OR(d),{dx:g,dy:y,gridBounds:v}=kR(f,p,a),x=AR(d,v,a,g,y),b=FR(x,a),C=BR(x,b,v,a,g,y),M=RR(x,v,g,y,C,o,n);return!M||M.width<r.width*c||M.height<r.height*c?r:{...M,center:j0(M.center,-l),rotation:e,polygonCenter:j0(C,-l)}}var Nu=Math.PI*2,NR=Math.PI/2,GR=Math.PI*1.5,VR=Vs(NR,2),jR=Vs(GR,2),UR=.01,a7=!1,sg=class extends oe{constructor(e,i,n=0,o=0,a={}){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"initialBearing",0);u(this,"naturalBearing",0);u(this,"imagePlacementOptions");u(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i,this.initialBearing=n,this.naturalBearing=o,this.imagePlacementOptions=a}createImageMesh(e,i,n,o=0,a,c){var v,x,b;let l={width:n.width,height:n.height,center:this.convertTo3DMapPosition(a),rotation:(v=n.rotation)!=null?v:0},p=(x=this.imagePlacementOptions.mode)!=null?x:"default",d=(()=>{switch(p){case"fit-nearest-90":let C=(this.initialBearing-this.naturalBearing+360)%180;return C>=45&&C<=135?U0(l,c,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return U0(l,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if(a7&&d.polygonCenter){let C=new ue(new nh(1),new jr({color:65280}));C.position.set(d.polygonCenter.x,d.polygonCenter.y,o),this.rendererState.entityScene.add(C)}let f=new jr({transparent:!0,depthWrite:!1,side:tn}),g=new Vr(d.width,d.height),y=new og(g);if(y.visible=!1,(b=this.getOrDownloadImage(i))==null||b.then(C=>{f.map=C,f.needsUpdate=!0,f.map.colorSpace=rn,y.visible=!0,this.publish("image-loaded")}),y.userData.entityId=e,y.material=f,a7){let C=new ue(new Vr(n.width,n.height),new jr({color:"gray"}));y.add(C);let M=new Zv;y.add(M),M.scale.set(10,10,10)}return y.position.set(d.center.x,d.center.y,o+UR),y.rotation.z=(-ge.degToRad(d.rotation)+Nu)%Nu,y}getOrDownloadImage(e){var i;if(this.imageLoadingCache.has(e))return(i=this.imageLoadingCache.get(e))==null?void 0:i.promise;{let n=new Promise(o=>{Ao.getLoader().load(e,a=>{let c=this.imageLoadingCache.get(e);c&&!c.loaded&&(c.loaded=!0),o(a)})});return this.imageLoadingCache.set(e,{loaded:!1,promise:n}),n}}flipIfNeeded(e,i){if(e.imageMesh==null)return;let n=-i,o=e.imageMesh.rotation.z,a=Vs((o-n+Nu)%Nu,2);a>VR&&a<jR&&(e.imageMesh.rotation.z=(o+Math.PI)%Nu)}update(e){var a,c,l,p,d;let i,n,o;for(let f of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(f),(i==null?void 0:i.type)==="image"){if(n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null){let g=this.convertTo3DMapPosition(n.feature.geometry.coordinates),y={x:g.x,y:g.y};n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates,[y]),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)}n.imageMesh&&o.flipImageToFaceCamera&&this.flipIfNeeded(n,e)}else if((i==null?void 0:i.type)==="geometry"){if(n=i.components[0],o=i.components[1],o.showImage&&((a=n.feature.properties)!=null&&a.image)&&n.imageMesh==null&&n.visible&&n.mesh!=null&&n.mesh.parent!=null&&((c=n.feature.properties)==null?void 0:c.image.position)!=null&&n.feature.geometry.coordinates!=null&&n.feature.geometry.coordinates.length>0){let g=n.feature.geometry.coordinates[0].map(v=>{let x=this.convertTo3DMapPosition(v);return{x:x.x,y:x.y}}),y=this.createImageMesh(f,(l=n.feature.properties)==null?void 0:l.image.path,(p=n.feature.properties)==null?void 0:p.image,o.height,(d=n.feature.properties)==null?void 0:d.image.position,g);n.mesh.parent.add(y),n.imageMesh=y}if(n.imageMesh){if(!n.visible)n.imageMesh.visible=!1;else if(o.showImage&&!n.imageMesh.visible)if(o.url){let g=this.imageLoadingCache.get(o.url);g&&g.loaded&&(n.imageMesh.visible=!0)}else n.imageMesh.visible=!0;else!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1);o.flipImageToFaceCamera&&this.flipIfNeeded(n,e)}}}};m();var HR=250,Ro,lg=class extends oe{constructor(e,i){super();u(this,"cameraDirty",!0);u(this,"focusablesDirty",!0);u(this,"state");u(this,"camera");u(this,"debugEl",null);u(this,"raycasters",[]);u(this,"collisions",new Map);u(this,"focusableEntities",new Set);u(this,"debugRaycasters",!1);S(this,Ro);u(this,"update",(e=!1,i=Date.now())=>{e||Date.now()-i>HR||(s(this,Ro)&&cancelAnimationFrame(s(this,Ro)),I(this,Ro,requestAnimationFrame(()=>{this.updateRaf()})))});this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new ie(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new ie(e.x/1.2,e.y/1.2),n=new ie(e.x+(e.x-i.x),i.y),o=new ie(i.x,e.y+(e.y-i.y)),a=new ie(n.x,o.y),c=new ie(e.x,e.y/1.5),l=new ie(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,n,o,a].map((p,d)=>{if(this.debugRaycasters){let x=document.createElement("div");x.style.position="absolute",x.style.top=p.y+"px",x.style.left=p.x+"px",x.style.width="10px",x.style.height="10px",x.style.backgroundColor="red",this.debugEl.append(x)}let f=p.x/this.state.canvasWidth*2-1,g=-(p.y/this.state.canvasHeight)*2+1,y=new ie(f,g),v=new bi;return v.setFromCamera(y,this.camera),[v,y,d===0?10:d<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null){if(i.type==="group-container"&&i.components[2]!==void 0&&i.components[2]instanceof Jl){let o=i.components[2];if(o.dirty===!0||o.focusMesh==null){o.focusMesh&&We(o.focusMesh);let a=new yt;a.setFromObject(i);let c=new Gr(a.max.x-a.min.x,a.max.y-a.min.y,a.max.z-a.min.z),l=new lt({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),p=new ue(c,l);p.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,(a.min.z+a.max.z)/2),p.userData={entityId:i.userData.entityId},o.focusMesh=p,i.add(p),i.components[2].dirty=!1}this.focusableEntities.add(o.focusMesh)}else if(i.components[0]&&i.components[0]instanceof Ze&&i.components[0].focusable&&i.components[0].geometry!=null&&(e=i.components[0],e instanceof Ze&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let o=new ue(e.geometry);o.userData={entityId:i.id},e.focusMesh=o}this.focusableEntities.add(e.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[i,n]of this.raycasters)i.setFromCamera(n,this.camera);for(let[i,n,o]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var l;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let p=c.object.userData.entityId,d=(l=this.collisions.get(p))!=null?l:0;this.collisions.set(p,d+o)}});let e=Array.from(this.collisions,([i,n])=>({entityId:i,weight:n})).sort((i,n)=>n.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){s(this,Ro)&&cancelAnimationFrame(s(this,Ro)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Ro=new WeakMap;m();m();m();m();function cg(r,t){t===void 0&&(t={});var e=Ks(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return WR(e,t);case"MultiPolygon":return zR(e,t);default:throw new Error("invalid poly")}}function WR(r,t){t===void 0&&(t={});var e=Ks(r),i=e.coordinates,n=t.properties?t.properties:r.type==="Feature"?r.properties:{};return s7(i,n)}function zR(r,t){t===void 0&&(t={});var e=Ks(r),i=e.coordinates,n=t.properties?t.properties:r.type==="Feature"?r.properties:{},o=[];return i.forEach(function(a){o.push(s7(a,n))}),aa(o)}function s7(r,t){return r.length>1?Kv(r,t):sn(r[0],t)}function ZR(r,t){var e=!0;return Ci(r,function(i){Ci(t,function(n){if(e===!1)return!1;e=XR(i.geometry,n.geometry)})}),e}function XR(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!JR(r.coordinates,t.coordinates);case"LineString":return!l7(t,r);case"Polygon":return!vn(r,t)}break;case"LineString":switch(t.type){case"Point":return!l7(r,t);case"LineString":return!YR(r,t);case"Polygon":return!c7(t,r)}break;case"Polygon":switch(t.type){case"Point":return!vn(t,r);case"LineString":return!c7(r,t);case"Polygon":return!qR(t,r)}}return!1}function l7(r,t){for(var e=0;e<r.coordinates.length-1;e++)if($R(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}function YR(r,t){var e=pl(r,t);return e.features.length>0}function c7(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var n=i[e];if(vn(n,r))return!0}var o=pl(t,cg(r));return o.features.length>0}function qR(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var n=i[e];if(vn(n,t))return!0}for(var o=0,a=t.coordinates[0];o<a.length;o++){var c=a[o];if(vn(c,r))return!0}var l=pl(cg(r),cg(t));return l.features.length>0}function $R(r,t,e){var i=e[0]-r[0],n=e[1]-r[1],o=t[0]-r[0],a=t[1]-r[1],c=i*a-n*o;return c!==0?!1:Math.abs(o)>=Math.abs(a)?o>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:a>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}function JR(r,t){return r[0]===t[0]&&r[1]===t[1]}var p7=ZR;function H0(r,t){var e=!1;return Ci(r,function(i){Ci(t,function(n){if(e===!0)return!0;e=!p7(i.geometry,n.geometry)})}),e}var u7=20,No,gs,ys,ug,Gu,pg=class{constructor(t){u(this,"dirty",!0);u(this,"map");u(this,"stylesheetId","");u(this,"userHiddenLayers",new Set);u(this,"hiddenLayersInStyle",new Set);u(this,"centerPoint");u(this,"bbox");u(this,"polygons");u(this,"handleRender",async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(s(this,No)&&(s(this,ug).call(this),I(this,No,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),e=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(e.length>0){for(let i of e)this.expr.push(["!=",["id"],i.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(i=>{this.map.setFilter(i,["all",...this.expr])}),this.expr=[],I(this,No,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){I(this,No,!0);for(let e=0;e<t.length;e+=u7){let i=t.slice(e,e+u7);s(this,gs).push(()=>{for(let n of i)if(n.geometry!=null&&"coordinates"in n.geometry){if(this.polygons==null)return;let o;if(n.geometry.type==="Polygon"?o=ch(n.geometry.coordinates):n.geometry.type==="MultiPolygon"&&(o=Qv(n.geometry.coordinates)),!o)continue;for(let a of this.polygons)if(H0(a,o)){this.expr.push(["!=",["id"],n.id]);continue}}})}s(this,Gu).call(this)}}}});u(this,"expr",[]);S(this,No,!1);S(this,gs,[]);S(this,ys,null);S(this,ug,()=>{s(this,ys)&&(globalThis.cancelAnimationFrame(s(this,ys)),I(this,ys,null)),I(this,gs,[])});S(this,Gu,()=>{let t=s(this,gs).pop();typeof t=="function"&&(t(),s(this,gs).length>0&&I(this,ys,globalThis.requestAnimationFrame(s(this,Gu)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(e=>{this.map.setFilter(e,["all",...this.expr])}),this.dirty=!1),this.expr=[],I(this,No,!1)});u(this,"handleStyleChange",t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}});t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,e,i){this.bbox=t,this.polygons=e.reduce((n,o)=>{if(o.geometry.type==="Polygon"){let a=ch(o.geometry.coordinates);n.push(a)}else o.geometry.type==="MultiPolygon"&&n.push(...o.geometry.coordinates.map(a=>ch(a)));return n},[]);for(let n of i)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};No=new WeakMap,gs=new WeakMap,ys=new WeakMap,ug=new WeakMap,Gu=new WeakMap;m();m();m();var W0="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 z0='#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 d7="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 tN=new Gs;function h7(r,t,e){let{nearRadius:i,farRadius:n,accentColor:o,completeFraction:a,isVertical:c}=t,{color:l}=e,p=!0,d=0,f=1/0,g=t.displayArrowsOnPath,y=!c,v=!0,x=g,b=i/2+rN,C=0;r[0].z+=b;for(let me=1;me<r.length;++me){r[me].z+=b;let be=r[me].x-r[me-1].x,qe=r[me].z-r[me-1].z;if(c)C+=Math.sqrt(be*be+qe*qe);else{let gt=r[me].y-r[me-1].y;C+=Math.sqrt(be*be+gt*gt+qe*qe)}}if(!c){let me=r[0],be=r[r.length-1];r.push(be.clone().setZ(be.z-.01)),r.unshift(me.clone().setZ(me.z-.01))}let M=new Lv;x&&(M=tN.load(d7),M.colorSpace=rn);let P=new Oe(l),w=new Oe(o),D={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new ie(1,1)},cameraParameters:{type:"v2",value:new ie(d,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:P},pathLength:{type:"f",value:C},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:n},nearZoom:{type:"f",value:d},farZoom:{type:"f",value:f},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:M},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:y?.05:1},showPulse:{type:"b",value:v},opacityMultiplier:{type:"f",value:1}},B=new Vv(r);B.curveType="catmullrom",B.tension=0;let _=30,A=8,F=_*r.length,G=new jv(B,F,i,A,!1),R=new Float32Array(G.attributes.position.count);for(let me=r.length;me<R.length;me++)R[me]=me;G.setAttribute("vertexIndex",new an(R,1));let z=new Float32Array(G.attributes.position.count),W=new an(z,1);for(let me=0;me<=F;me++)for(let be=0;be<=A;++be)W.setX(me*(A+1)+be,me/F);G.setAttribute("pathDistance",W);let j=new Float32Array(G.attributes.normal.count*3),ee=new an(j,3);for(let me=0;me<F;me++){let be=G.tangents[me];for(let qe=0;qe<=A;++qe)ee.setXYZ(me*(A+1)+qe,be.x,be.y,be.z)}G.setAttribute("pathTangent",ee);let Z=new Float32Array(G.attributes.normal.count*3),xe=new an(Z,3);for(let me=0;me<F;me++){let be=G.tangents[me];var fe,Ie,_e;c?(fe=be.x*be.y,Ie=-1+be.y*be.y,_e=be.z*be.y):(fe=-be.x*be.z,Ie=-be.y*be.z,_e=1-be.z*be.z);let qe=Math.sqrt(fe*fe+Ie*Ie+_e*_e);qe===0&&(qe=1);let gt=fe/qe,st=Ie/qe,en=_e/qe;for(let hi=0;hi<=A;++hi)xe.setXYZ(me*(A+1)+hi,gt,st,en)}G.setAttribute("pathNormal",xe);let cr=new ia({uniforms:D,vertexShader:W0,fragmentShader:z0});cr.transparent=!0,cr.alphaTest=.5,D.resolution.value.x=1,D.resolution.value.y=1,D.vertexes.value=R.length,D.arrowTexture.value.wrapS=mi,D.arrowTexture.value.wrapT=mi,D.arrowTexture.value.anisotropy=16,D.complete.value=a;let _t=new ue(G,cr),at=_t.clone(),Qe={...D,opacityMultiplier:{type:"f",value:.25}};Qe.complete.value=1,at.material=new ia({uniforms:Qe,vertexShader:W0,fragmentShader:z0}),at.material.transparent=!0,at.material.alphaTest=.5,at.material.depthWrite=!1,at.material.depthTest=!1,at.renderOrder=1,Qe.resolution.value.x=1,Qe.resolution.value.y=1,Qe.vertexes.value=R.length,Qe.arrowTexture.value.wrapS=mi,Qe.arrowTexture.value.wrapT=mi,Qe.arrowTexture.value.anisotropy=16,Qe.complete.value=a,_t.userData=at.userData=t.mesh.userData;let pr=t.mesh;pr.add(_t),pr.add(at),G.computeBoundingBox();let Rr=new K;return G.boundingBox.getCenter(Rr),{mesh:pr,material:cr,center:Rr}}var rN=.15;var Vu=class extends oe{constructor(e,i,n,o){super();u(this,"rendererState");u(this,"altitudeDirty",!0);u(this,"convertTo3DMapPosition");u(this,"getParentContainer");u(this,"convertZoomLevelToAltitude");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=n,this.convertZoomLevelToAltitude=o}update(e,i,n){let o,a=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(c),o&&o.type==="path"&&o.components[0].type==="path"){let l=o.components[0],p=o.components[1],d=l.isVertical&&this.altitudeDirty;if(!(l instanceof Fo))continue;if(l.dirty||d){if(l.mesh.parent!=null)for(let g=l.mesh.children.length-1;g>=0;g--)We(l.mesh.children[0]);let f=[];if(l.feature.features.forEach(g=>{let y=g.geometry.coordinates[2]||0,v;if(g.properties.parentId&&(v=this.getParentContainer(g.properties.parentId,!0),v!=null&&v.altitude!=null&&(y+=v.altitude,l.isVertical=!0)),!g.properties.parentId||v!=null&&v.visible){let x=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],y);f.push(x)}}),f.length>1){let{mesh:g,material:y,center:v}=h7(f,l,{color:p.color});l.mesh=g,l.material=y,l.position=v}l.dirty&&(l.nearZoomLevel!=null&&(l.nearZoomAltitude=this.convertZoomLevelToAltitude(l.nearZoomLevel)),l.farZoomLevel!=null&&(l.farZoomAltitude=this.convertZoomLevelToAltitude(l.farZoomLevel))),l.dirty=!1}p.dirty&&(l.mesh.children.forEach(f=>{f.material.uniforms.color.value.set(p.color),f.material.needsUpdate=!0}),l.mesh.position.z=p.altitude,p.dirty=!1),l.material&&(l.mesh.children.forEach(f=>{var y,v;let g=f.material.uniforms;g.nearZoom.value=(y=l.nearZoomAltitude)!=null?y:e,g.farZoom.value=(v=l.farZoomAltitude)!=null?v:i,g.cameraParameters.value.x=n,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),f.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(f=>{f.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,f.material.needsUpdate=!0}),a=!0),l.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};m();var mt,ac,An,dg=class{constructor(t){u(this,"rendererState");u(this,"dirty",!1);S(this,mt);S(this,ac);S(this,An);this.rendererState=t}updateOne(t){if(t instanceof we&&t.components[0]instanceof Ze&&t.components[1]instanceof Si&&t.parentObject3D instanceof Ot&&(I(this,mt,t.components[0]),I(this,An,t.components[1]),s(this,mt).detached&&s(this,mt).dirty&&s(this,mt).geometry!=null&&s(this,mt).material!=null)){I(this,ac,t.parentObject3D),s(this,mt).visible=!1;let e=new Oe(s(this,An).color),i=s(this,An).opacity*la(t),n=new as({color:e,side:tn,opacity:i!=null?i:1,transparent:i!==void 0?i<1:!1},1,s(this,mt).material.repeatYFactor),o=new ph(1,s(this,mt).geometry.attributes.position.count||0,0,n),a=o.addGeometry(s(this,mt).geometry);o.addInstance(a),o.userData={entities:{0:t.id},detached:!0},s(this,mt).instanceIndex=a,s(this,mt).material.setColor(s(this,mt).instanceIndex,e,s(this,An).topColor?new Oe(s(this,An).topColor):e),s(this,mt).mesh=o,s(this,mt).material=n,s(this,ac).add(o),s(this,mt).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){I(this,mt,void 0),I(this,ac,void 0),I(this,An,void 0)}};mt=new WeakMap,ac=new WeakMap,An=new WeakMap;m();m();function f7(r,t,e){var i;if(r.geometry!=null){let n=t||1e-4,o=n/r.currentHeight,a=n/e;r.geometry.scale(1,1,o),r.material&&(r.material.repeatYFactor=a),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=n}}var bs,Go,hg=class{constructor(t){u(this,"rendererState");u(this,"dirty",!1);S(this,bs);S(this,Go);this.rendererState=t}updateOne(t){var e;t instanceof we&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(I(this,bs,t.components[0]),I(this,Go,t.components[1]),t.type==="geometry"&&s(this,Go).height!==s(this,bs).currentHeight&&f7(s(this,bs),s(this,Go).height,s(this,Go).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){I(this,bs,void 0),I(this,Go,void 0)}};bs=new WeakMap,Go=new WeakMap;m();var iN={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},fg=class{constructor(t){u(this,"state",iN);u(this,"core");this.core=t}update(t){let e={};for(let[i,n]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=n,e[i]=n);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};m();var ju=9,nN=!1,m7=.1;function oN(r,t,e){for(let i=0;i<t;i++){let n=(e&16711680)>>16,o=(e&65280)>>8,a=e&255;r[i*3]=n/255,r[i*3+1]=o/255,r[i*3+2]=a/255}}var mg=class{constructor(t,e,i){u(this,"state");u(this,"renderer");u(this,"renderService");u(this,"pickingTexture");u(this,"pickingMaterial");u(this,"pixelBuffer");u(this,"width",0);u(this,"height",0);u(this,"scale",1/2);u(this,"color",1);u(this,"convertTo3DMapPosition");u(this,"destroyed",!1);u(this,"enabled",!1);u(this,"backgroundId",16777215);u(this,"resize",()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new Av(this.width,this.height,{format:th,type:Dv,internalFormat:"RGBA"})});u(this,"shouldShowByXY",(t,e,i)=>{if(this.pixelBuffer==null)return!1;let n=t+(this.height-e-1)*this.width,o=this.pixelBuffer[n*4],a=this.pixelBuffer[n*4+1],c=this.pixelBuffer[n*4+2],l=o<<16|a<<8|c;return l===i||l===this.backgroundId});u(this,"activeOccluders",new Set);u(this,"update",()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,e;for(let n of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(n);if(o&&o instanceof Te&&o.userData.occluderFeature!=null&&o.userData.occluderId!=null&&(this.activeOccluders.add(o.userData.occluderId),o.userData.occluderDirty)){if(t=o.userData.occluderFeature,t.geometry.type==="Polygon"){let a=Dm(t,this.convertTo3DMapPosition,{color:"white",height:m7});e=this.createOccluderMesh(a,o.userData.occluderId),o.add(e)}else if(t.geometry.type==="MultiPolygon"){let a=Em(t,this.convertTo3DMapPosition,{color:"white",height:m7});e=this.createOccluderMesh(a,o.userData.occluderId),o==null||o.add(e)}o.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let i=new Oe(this.backgroundId);this.renderer.setClearColor(i),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(ju),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(ju),nN?this.renderService.enabledLayers.add(ju):this.renderService.enabledLayers.delete(ju),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let n of this.state.geometry2DIdsInScene){let o=this.state.geometry2DMap.get(n);if(o&&(o==null?void 0:o.occluderId)!=null&&this.activeOccluders.has(o==null?void 0:o.occluderId)){let a=o.components[0].projection,c=Math.floor(a.x*this.scale),l=Math.floor(a.y*this.scale),p=this.shouldShowByXY(c,l,o.occluderId);o.components[0].isOccluded=!p}}})});if(this.state=t,this.convertTo3DMapPosition=e,(i==null?void 0:i.renderer)==null)throw new Error("No Renderer");this.renderService=i,this.renderer=i.renderer,this.resize(),this.pickingMaterial=new ia({glslVersion:Ov,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,e){let i=t.attributes.position,n=new Float32Array(i.count*3);oN(n,i.count,e),t.setAttribute("color",new an(n,3))}createOccluderMesh(t,e){let i=new ue(t,this.pickingMaterial);return i.layers.set(ju),this.applyId(i.geometry,e),i.userData.occluderId=e,i}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};var g7=new bi;var{DEFAULT_PITCH:$0,DEFAULT_BEARING:J0,DEFAULT_ZOOM_LEVEL:K0,DEFAULT_MIN_ZOOM_LEVEL:aN,DEFAULT_MAX_ZOOM_LEVEL:sN}=Fr,lN=ge.radToDeg(.6435011087932844),Je,Xe,vs,Uu,sc,Vo,xs,lc,Dt,X0,k,ke,ii,Ye,Zi,Ct,L,Hu,nt,Fe,y7,b7,v7,jo,Wu,zu,Zu,Xu,gg,Yu,qu,$u,cc,Y0,Cs,Ju,$t,Jt,q0,pc,Ku,Z0=class extends oe{constructor(e,i={}){var g,y,v,x,b,C,M,P,w,D,B;super();S(this,Dt);u(this,"options");u(this,"container");u(this,"Debug");S(this,Je);S(this,Xe);S(this,vs);S(this,Uu);S(this,sc);S(this,Vo);S(this,xs);S(this,lc);u(this,"rendererDomElement");S(this,k,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Te("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Fc,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new w0,cameraObject:new Ag,naturalBearing:0,containerOffset:[0,0]});u(this,"camera");S(this,ke);S(this,ii);S(this,Ye);S(this,Zi);S(this,Ct);S(this,L,{});S(this,Hu,window.matchMedia("screen and (min-resolution: 2dppx)"));u(this,"map");S(this,nt,()=>{s(this,L).renderSystem.twoDdirty=!0});S(this,Fe,()=>{s(this,L).renderSystem.threeDdirty=!0});S(this,jo,"standalone");S(this,Wu,e=>Math.trunc(e*10)/10);S(this,zu,()=>{s(this,L).twoDDrawSystem.dirty=!0,N(this,Dt,X0).call(this,Us()),s(this,L).watermarkSystem.dirty=!0,s(this,L).occlusion2DSystem.resize(),this.render()});S(this,Zu,()=>{s(this,Xu).call(this)});S(this,Xu,(e,i)=>{let n=e!=null?e:this.rendererDomElement.clientWidth,o=i!=null?i:this.rendererDomElement.clientHeight;if(n===0||o===0)return;s(this,k).canvasWidth=n,s(this,k).canvasHeight=o,N(this,Dt,X0).call(this,Us()),s(this,cc).call(this),N(this,Dt,v7).call(this),s(this,L).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,L).cameraSystem.dirty=!0,s(this,L).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,L).htmlControlsSystem.resize(this.canvasWidth),s(this,L).geometryInFocusSystem.resize(),s(this,L).occlusion2DSystem.resize();let{top:a,left:c}=this.container.getBoundingClientRect();s(this,k).containerOffset=[a,c],this.publish("resize"),this.render()});S(this,gg,()=>{this.renderSync()});S(this,Yu,new K);S(this,qu,(e,i)=>{let n=this.mode==="standalone"?s(this,Xe):this.viewCamera;if(s(this,Xe).position.z+this.camera.elevation>i.z){s(this,Yu).copy(i);let o=s(this,Yu).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,c=(-o.y+1)/2*this.canvasHeight-0/2,l=s(this,Wu).call(this,a),p=s(this,Wu).call(this,c);e.x=l,e.y=p}else e.x=-1e3,e.y=-1e3});S(this,$u,(e,i)=>{s(this,Ct).setBufferSize(e,i),s(this,Xe).aspect=e/i,s(this,Xe).updateProjectionMatrix(),s(this,Xe).updateMatrixWorld(!0),s(this,sc).x=e,s(this,sc).y=i});S(this,cc,()=>{var a;let e=s(this,k).canvasWidth=this.rendererDomElement.clientWidth,i=s(this,k).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(e*this.resolutionScale),o=Math.floor(i*this.resolutionScale);s(this,$u).call(this,n,o),(a=this.map)==null||a.resize(),s(this,k).shouldMeasureCanvas=!1});u(this,"getParentContainer",(e,i=!0)=>{if(!e)return i?s(this,k).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let n=s(this,k).geometry3DMap.get(e);return n instanceof Te?n:(O.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?s(this,k).entityScene:void 0)}else if(e.type==="group-container"){let n=s(this,k).geometry3DMap.get(e.id);if(n instanceof Te)return n}return i?s(this,k).entityScene:void 0});u(this,"showCollisionBoxes",()=>{s(this,L).collisionSystem.showCollisionBoxes(),this.render()});u(this,"hideCollisionBoxes",()=>{s(this,L).collisionSystem.hideCollisionBoxes(),this.render()});u(this,"projectScreenXYToCoordinate",(e,i,n=!1)=>{var g,y;let o=s(this,k).containerOffset[0],a=s(this,k).containerOffset[1],c=(e-a)/s(this,k).canvasWidth*2-1,l=-((i-o)/s(this,k).canvasHeight)*2+1,p=new ie(c,l),d,f;if(n)g7.setFromCamera(p,s(this,Xe)),d=(g=g7.intersectObject(s(this,Vo),!1)[0])==null?void 0:g.point;else{let v=s(this,L).interactionSystem.getThreeDIntersectsFromXY(p);d=(y=v==null?void 0:v[0])==null?void 0:y.point,f=s(this,L).interactionSystem.getGroupContainerIntersectsFromXY(p)}if(d)return{coordinate:this.convert3DMapPositionToCoordinate(d),groupContainers:f}});u(this,"projectCoordinateToScreenXY",e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n=new ie;return s(this,qu).call(this,n,i),{x:n.x,y:n.y}});u(this,"convert3DMapPositionToCoordinate",e=>{var o,a,c,l;let{lat:i,lon:n}=uh((a=(o=s(this,k).center)==null?void 0:o[1])!=null?a:0,(l=(c=s(this,k).center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[n,i,e.z]});u(this,"setBackgroundColor",(e,i)=>{s(this,Ct).setBackgroundColor(e,i)});u(this,"getMetresPerPixel",()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i,!0),o=this.projectScreenXYToCoordinate(e,i,!0);return n==null||o==null?void 0:sh(n.coordinate,o.coordinate)/e});u(this,"hideOutdoorLayersUnderPoint",(e,i)=>{!this.map||(i==null?void 0:i.length)===0||(s(this,L).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())});u(this,"hideOutdoorLayersIntersectingPolygons",(e,i,n)=>{s(this,L).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,n),this.render()});S(this,Cs,new Gv);S(this,Ju,new Nr);u(this,"render",()=>{var e;if(((e=s(this,L))==null?void 0:e.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return s(this,L).renderSystem.update()});u(this,"renderSync",()=>s(this,L).renderSystem.update(!0));S(this,$t,Hs(()=>{this.publish("user-interaction-start",void 0)},0,!0));S(this,Jt,Hs(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));u(this,"on",(e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&T.env.NODE_ENV!=="test"&&(O.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))});u(this,"off",(e,i)=>{super.off(e,i)});u(this,"getCursor",()=>s(this,L).interactionSystem.getCursor());u(this,"destroy",()=>{var e;s(this,L)&&(s(this,L).cameraSystem.off("user-dolly-start",s(this,$t)),s(this,L).cameraSystem.off("user-pan-start",s(this,$t)),s(this,L).cameraSystem.off("user-rotate-start",s(this,$t)),s(this,L).cameraSystem.off("user-zoom-start",s(this,$t)),s(this,L).cameraSystem.off("user-tilt-start",s(this,$t)),s(this,L).cameraSystem.off("user-pedestal-start",s(this,$t)),s(this,L).cameraSystem.off("user-dolly-end",s(this,Jt)),s(this,L).cameraSystem.off("user-pan-end",s(this,Jt)),s(this,L).cameraSystem.off("user-rotate-end",s(this,Jt)),s(this,L).cameraSystem.off("user-zoom-end",s(this,Jt)),s(this,L).cameraSystem.off("user-tilt-end",s(this,Jt)),s(this,L).cameraSystem.off("user-pedestal-end",s(this,Jt)),s(this,L).renderSystem.off("measure-canvas",s(this,cc)),s(this,L).meshOptimizationSystem.off("geometry-2d-added",this.render),s(this,L).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),s(this,nt).call(this),s(this,Fe).call(this),this.renderSync(),s(this,L).renderSystem.destroy(),s(this,L).cameraSystem.off("change",this.render),s(this,L).pathSystem.off("animate:path",this.render),s(this,L).cameraSystem.dispose(),s(this,L).exporterSystem.destroy(),s(this,L).outdoorLayersSystem.destroy(),s(this,L).drawSystem.destroy(),window.removeEventListener("resize",s(this,Zu),!1),s(this,Hu).removeEventListener("change",s(this,zu)),s(this,xs)&&s(this,xs).disconnect(),this._subscribers={},s(this,Ct).destroy(),(e=s(this,Je))==null||e.traverse(i=>{We(i),"dispose"in i&&typeof i.dispose=="function"&&i.dispose()}),I(this,Je,void 0),s(this,L).htmlControlsSystem.destroy(),s(this,L).collisionSystem.destroy(),s(this,L).interactionSystem.destroy(),s(this,L).domMutationSystem.destroy(),s(this,L).geometryInFocusSystem.destroy(),I(this,L,void 0),s(this,jo)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(s(this,Zi)),this.container.removeChild(s(this,ke)),I(this,Ct,void 0))});S(this,pc,new K);S(this,Ku,new K);if(s(this,k).naturalBearing=(g=i.naturalBearing)!=null?g:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(I(this,jo,i.mode),this.map=i.map),s(this,k).entityScene.addEventListener("childadded",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),s(this,k).entityScene.addEventListener("childremoved",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),s(this,k).geometry3DMap.set(s(this,k).entityScene.userData.entityId,s(this,k).entityScene),i.center&&(s(this,k).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,N(this,Dt,y7).call(this),N(this,Dt,b7).call(this),s(this,L).htmlControlsSystem=new eg(this.container),s(this,jo)!=="outdoors-overlay"&&s(this,L).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),T.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),I(this,Ct,new zf({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(y=i.gl)==null?void 0:y.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:_=>{var A;(A=i.onWebGLContextRestored)==null||A.call(i,_),s(this,nt).call(this),s(this,Fe).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(v=i.backgroundAlpha)!=null?v:1})),I(this,Je,new Qn),s(this,Je).add(s(this,k).entityScene);let n=window.__THREE_DEVTOOLS__;T.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Je)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Ct)}))),I(this,Xe,new Ag(lN,this.aspect,50,1e5)),s(this,k).cameraObject=s(this,Xe),I(this,Uu,new Rv),s(this,Xe).renderOrder=999;let o=new on;o.add(s(this,Xe)),I(this,lc,new on),s(this,lc).add(o),s(this,Je).add(s(this,lc)),s(this,Xe).updateProjectionMatrix(),s(this,Xe).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=s(this,Ct).domElement(),I(this,sc,new ie);let a=new Vr(1e6,1e6),c=new lt({color:0,visible:!1});I(this,Vo,new ue(a,c)),s(this,Vo).name="worldPlane",s(this,Je).add(s(this,Vo)),(x=i.gl)!=null&&x.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,Zu),!1),s(this,Hu).addEventListener("change",s(this,zu)),typeof ResizeObserver=="function"&&((b=T.env)==null?void 0:b.NODE_ENV)!=="test"&&(I(this,xs,new ResizeObserver(s2(_=>{s(this,Xu).call(this,_[0].contentRect.width,_[0].contentRect.height)},50))),(C=s(this,xs))==null||C.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(P=globalThis.MappedinDebug)!=null&&P.TEST_IOS?"1920px":"100%",T.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),s(this,k).canvasWidth=this.rendererDomElement.clientWidth,s(this,k).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,p=this.canvasHeight;s(this,L).watermarkSystem=new $m(s(this,Xe),s(this,k),i==null?void 0:i.watermark),s(this,L).watermarkSystem.on("texture-loaded",this.render),s(this,k).shouldMeasureCanvas=!0,s(this,k).pixelRatio=this.resolutionScale,s(this,$u).call(this,Math.floor(l*this.resolutionScale),Math.floor(p*this.resolutionScale));let d=new oh(16777215,.3*Math.PI);d.position.set(-150,-150,350),s(this,Je).add(d);let f=new Hv(16777215,.741*Math.PI);s(this,Je).add(f),s(this,L).cameraSystem=new hs(s(this,Xe),s(this,Je),s(this,Ct).renderer,s(this,k),{mode:this.mode,canvasHeight:p,canvasWidth:l}),s(this,L).cameraSystem.on("user-dolly-start",s(this,$t)),s(this,L).cameraSystem.on("user-pan-start",s(this,$t)),s(this,L).cameraSystem.on("user-rotate-start",s(this,$t)),s(this,L).cameraSystem.on("user-zoom-start",s(this,$t)),s(this,L).cameraSystem.on("user-tilt-start",s(this,$t)),s(this,L).cameraSystem.on("user-pedestal-start",s(this,$t)),s(this,L).cameraSystem.on("user-dolly-end",s(this,Jt)),s(this,L).cameraSystem.on("user-pan-end",s(this,Jt)),s(this,L).cameraSystem.on("user-rotate-end",s(this,Jt)),s(this,L).cameraSystem.on("user-zoom-end",s(this,Jt)),s(this,L).cameraSystem.on("user-tilt-end",s(this,Jt)),s(this,L).cameraSystem.on("user-pedestal-end",s(this,Jt)),s(this,L).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,L).geometryInFocusSystem&&(s(this,L).geometryInFocusSystem.cameraDirty=!0),this.render()}),s(this,L).pathSystem=new Vu(s(this,k),this.convertTo3DMapPosition,this.getParentContainer,s(this,L).cameraSystem.convertZoomLevelToAltitude),s(this,L).pathSystem.on("animate:path",this.render),s(this,L).panBoundsSystem=new Qm(s(this,k),s(this,L).cameraSystem),s(this,L).panBoundsSystem.on("update",()=>{let{panBounds:_,fov:A,convertAltitudeToZoomLevel:F}=s(this,L).cameraSystem;if(s(this,L).panBoundsSystem.autoMinZoomLevel){if(_.radius<=0)return;let G=Math.min(s(this,k).canvasWidth/s(this,k).canvasHeight,1),R=A*Math.PI/180*G,z=Math.tan(R/2),{radius:W,center:j}=s(this,L).cameraSystem.panBounds,ee=W/z,Z=this.getThreeCamera().getWorldPosition(new K),xe=j.distanceTo(Z),fe=Math.abs(Z.z-j.z),Ie=ee*fe/xe,_e=F(Ie);S2(_e,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(_e)}}),this.camera=new qm(this,s(this,L),s(this,k)),this.camera.setZoomLevel((w=i.zoomLevel)!=null?w:K0),this.camera.setBearing((D=i.bearing)!=null?D:J0),this.camera.setPitch((B=i.pitch)!=null?B:$0),this.camera.setMaxZoomLevel(sN),this.camera.setMinZoomLevel(aN),s(this,L).domVisiblitySystem=new Lm(s(this,k),s(this,Zi)),s(this,L).domMutationSystem=new Ym(s(this,k),s(this,Zi)),s(this,L).domMutationSystem.on("dimensions-update",()=>{s(this,L).collisionSystem.collidersDirty=!0,this.render()}),s(this,L).domDrawSystem=new Zm(s(this,k)),s(this,L).collisionSystem=new Zf(s(this,ii),s(this,k)),s(this,L).twoDDrawSystem=new Am(s(this,k),s(this,Ye),i.transformImageRequest),s(this,L).twoDDrawSystem.on("img:loaded",this.render),s(this,L).interactionSystem=new ru(this.rendererDomElement,s(this,k),s(this,Xe),s(this,Vo),s(this,L).cameraSystem.isUserInteracting),s(this,L).interactionSystem.on("doubletap-with-onefinger",_=>{var A;this.camera.animateTo({center:(A=this.projectScreenXYToCoordinate(_.clientX,_.clientY))==null?void 0:A.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:Ug,easing:"ease-out"})}),s(this,L).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:Ug,easing:"ease-out"})}),s(this,L).interactionSystem.on("hover",this.render),s(this,L).interactionSystem.on("click",_=>{var A,F,G,R,z,W;if(((A=_.entity2D)==null?void 0:A.id)==="watermark"&&typeof s(this,L).watermarkSystem.options.onClick=="function"&&s(this,L).watermarkSystem.options.interactive){s(this,L).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(_.position),geometry:_.entity3D?[(F=_.entity3D)==null?void 0:F.id]:[],paths:((G=_.entity3D)==null?void 0:G.components[0])instanceof Fo?[_.entity3D.id]:[],markers:((R=_.entity2D)==null?void 0:R.components[0])instanceof Vi?[_.entity2D.id]:[],models:((z=_.entity3D)==null?void 0:z.components[0])instanceof ko?[_.entity3D.id]:[],labels:((W=_.entity2D)==null?void 0:W.components[0])instanceof ji?[_.entity2D.id]:[],containers:Array.isArray(_.groupContainers)?_.groupContainers.map(j=>j.userData.entityId):[],pointerEvent:_.pointerEvent})}),s(this,L).interactionSystem.on("hover",_=>{var A,F,G,R,z,W;_.position&&((A=_.entity2D)==null?void 0:A.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(_.position),geometry:_.entity3D?[(F=_.entity3D)==null?void 0:F.id]:[],paths:((G=_.entity3D)==null?void 0:G.components[0])instanceof Fo?[_.entity3D.id]:[],markers:((R=_.entity2D)==null?void 0:R.components[0])instanceof Vi?[_.entity2D.id]:[],models:((z=_.entity3D)==null?void 0:z.components[0])instanceof ko?[_.entity3D.id]:[],labels:((W=_.entity2D)==null?void 0:W.components[0])instanceof ji?[_.entity2D.id]:[],containers:Array.isArray(_.groupContainers)?_.groupContainers.map(j=>j.userData.entityId):[]})}),s(this,L).geometryInFocusSystem=new lg(s(this,k),s(this,Xe)),s(this,L).geometryInFocusSystem.on("geometry-in-focus",_=>{this.publish("geometry-in-focus",_)}),s(this,L).twoDVisiblitySystem=new Bm(s(this,k)),s(this,L).drawSystem=new Fm(s(this,k),this.convertTo3DMapPosition),s(this,L).drawSystem.on("texture-loaded",this.render),s(this,L).stackSystem=new Nm(s(this,k)),s(this,L).twoDProjectionSystem=new km(s(this,k),s(this,qu)),s(this,L).exporterSystem=new gu(s(this,k)),s(this,L).meshOptimizationSystem=new Om(s(this,k),this.convertTo3DMapPosition),s(this,L).meshOptimizationSystem.on("model-loaded",this.render),s(this,L).meshOptimizationSystem.on("geometry-2d-added",this.render),s(this,L).meshDetachmentSystem=new dg(s(this,k)),s(this,L).meshModificationSystem=new hg(s(this,k)),s(this,L).customGeometrySystem=new tg(s(this,k),this.convertTo3DMapPosition),s(this,L).outlineInterpolationSystem=new rg(s(this,k)),s(this,L).renderSystem=new Rm(s(this,Ct),s(this,k),this.mode,s(this,Je),s(this,Xe),this.viewCamera,s(this,L)),s(this,L).imageSystem=new sg(s(this,k),this.convertTo3DMapPosition,i.bearing,i.naturalBearing,i.imagePlacementOptions),s(this,L).text3DSystem=new hm(s(this,k),this.convertTo3DMapPosition),s(this,L).text3DSystem.on("render",this.render),s(this,L).imageSystem.on("image-loaded",this.render),s(this,L).renderSystem.on("pre-render",()=>this.publish("pre-render")),s(this,L).renderSystem.on("post-render",()=>this.publish("post-render")),s(this,L).renderSystem.on("measure-canvas",s(this,cc)),s(this,L).outdoorLayersSystem=new pg(this.map),s(this,L).occlusion2DSystem=new mg(s(this,k),this.convertTo3DMapPosition,s(this,Ct)),i.occlusionEnabled&&s(this,L).occlusion2DSystem.enable(),this.Debug=new fg(this),i.environment!==!1&&I(this,vs,N(this,Dt,q0).call(this)),s(this,gg).call(this)}get viewCamera(){return s(this,Uu)}get canvasWidth(){return s(this,k).canvasWidth}get canvasHeight(){return s(this,k).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:Us()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,jo)}addGroupContainer(e,i,n){if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let o=new Te(e);o.addEventListener("childadded",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),o.addEventListener("childremoved",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),(i==null?void 0:i.visible)!==void 0&&(o.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&o.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&wt(o,i.interactive,s(this,k)),(i==null?void 0:i.focusable)!==void 0&&b0(o,i.focusable),s(this,k).geometry3DMap.set(e,o);let a=this.getParentContainer(n);a instanceof Te&&a.addEntity(o),s(this,Fe).call(this),this.render()}else O.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,n){if(s(this,k).geometry3DMap.has(e))O.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let o=new Te(e);o.addEventListener("childadded",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),o.addEventListener("childremoved",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),o.components[0]=new Xm,(i==null?void 0:i.visible)!==void 0&&(o.visible=i.visible),s(this,k).geometry3DMap.set(e,o);let a=this.getParentContainer(n);a instanceof Te&&a.addEntity(o)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,n,o,a){if(s(this,k).geometry3DMap.has(e))O.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new nc(i,n),l=new we(c,new Si(o));(o==null?void 0:o.interactive)!==void 0&&wt(l,o.interactive,s(this,k)),l.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},s(this,k).geometry3DMap.set(l.id,l);let p=this.getParentContainer(a);p instanceof Te&&p.addEntity(l),s(this,Fe).call(this),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,n,o){var a,c;if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let l=new Ot(e,new Vg(n));l.addEventListener("childadded",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),l.addEventListener("childremoved",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),l.userData.dirty=!0,s(this,k).geometry3DMap.set(e,l);for(let d of i.features){if(d.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(d.geometry.type))continue;let f=(d==null?void 0:d.id)||((a=d==null?void 0:d.properties)==null?void 0:a.id)||De(),{visible:g,...y}=n||{color:n2},v=s(this,L).meshOptimizationSystem.createEntityFromFeature(f,d,{...y,outline:!0});s(this,k).geometry3DMap.set(f,v),l.userData.entities3D.add(f)}l.setVisible((c=n==null?void 0:n.visible)!=null?c:!0),(n==null?void 0:n.altitude)!=null&&l.setAltitude(n.altitude);let p=this.getParentContainer(o);p instanceof Te&&p.addEntity(l),s(this,Fe).call(this),this.render()}else O.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return s(this,L).outlineInterpolationSystem.geometries3DDirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,i){let n=this.getParentContainer(i),o=s(this,L).occlusion2DSystem.reserveOccluderId();return n==null||n.addOccluderFeature(e,o),o}addImage(e,i,n,o){try{n7(e,i,n)}catch(a){O.error(a);return}if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let a=new ag(i),c=new we(a,new Si(n));c.id=e||De(),a.mesh.userData={entityId:c.id,type:"path"},s(this,k).geometry3DMap.set(c.id,c);let l=this.getParentContainer(o);l instanceof Te&&l.addEntity(c),s(this,Fe).call(this),this.render()}else O.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,n,{parent:o,onComplete:a}={}){var c,l;try{BI(e,i,n)}catch(p){O.error(p);return}if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let p=new Ot(e,new Vg({...n,outline:!1}));p.addEventListener("childadded",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),p.addEventListener("childremoved",()=>{s(this,Fe).call(this),s(this,nt).call(this)}),s(this,k).geometry3DMap.set(e,p),p.userData.dirty=!0,p.userData.modelURL=n.url;for(let f of i.features){let g=f.id||f.properties.id||De(),y=s(this,L).meshOptimizationSystem.createModelFromFeature(g,f,n);(f.properties.interactive!==void 0||n.interactive!=null)&&wt(y,(c=f.properties.interactive)!=null?c:n.interactive,s(this,k)),s(this,k).geometry3DMap.set(g,y),p.userData.entities3D.add(g)}let d=this.getParentContainer(o);d instanceof Te&&d.addEntity(p),s(this,Fe).call(this),(l=this.render())==null||l.then(a)}else O.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,n,o){var c;let a=n==null?void 0:n.id;try{iM(e,i,n||{})}catch(l){O.error(l);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let l=N(this,Dt,Y0).call(this,e,new Vi(i,n),n==null?void 0:n.occluderId,n==null?void 0:n.verticalOffset);l.id=a||String(l.id),a=l.id,(n==null?void 0:n.interactive)!=null&&n.interactive!=="pointer-events-auto"&&wt(l,n==null?void 0:n.interactive,s(this,k));let p=typeof(n==null?void 0:n.attachTo)=="string"||typeof(n==null?void 0:n.attachTo)=="number"?s(this,k).geometry3DMap.get(n.attachTo):void 0;p instanceof we&&p.attach(l),(c=this.getParentContainer(o))==null||c.addEntity(l),this.render()}else O.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addText3D(e,i,n,o){if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let a=new Eo({...i,properties:{...i.properties,id:e,content:i.properties.text}}),c=new we(a,new Rc(n==null?void 0:n.appearance));c.id=e,a.mesh.userData.entityId=e.toString(),a.mesh.userData.type="text3d",s(this,k).geometry3DMap.set(e,c);let l=this.getParentContainer(o);l instanceof Te&&l.addEntity(c),s(this,Fe).call(this),this.render()}else O.error("Text3D with ID '".concat(e,"' already exists. The text3d cannot be added."));return{id:e,type:"text3d"}}labelText3D(e,i,n={}){var p,d;try{if(!i||!e)throw new Error("content and meshGeometryId are required");$M.parse(n)}catch(f){O.error(f);return}let o=s(this,k).geometry3DMap.get(e);if((o==null?void 0:o.type)!=="geometry"){O.error(".labelText3D failed: target incorrect");return}let a=o==null?void 0:o.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let f=s(this,k).geometry3DMap.get(a.textEntityId);if((f==null?void 0:f.type)!=="text3d"){O.error(".labelText3D failed: existing text3d not found");return}return{id:f.id,type:f.type}}let c=new Eo({type:"Feature",geometry:{coordinates:(p=a.feature.properties.textArea)==null?void 0:p.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:i,id:De()}});c.polygonEntityId=e;let l=new we(c,new Rc(n==null?void 0:n.appearance));return a.textEntityId=l.id.toString(),c.mesh.userData.entityId=l.id.toString(),c.mesh.userData.type="text3d",s(this,k).geometry3DMap.set(l.id.toString(),l),n.parentId&&((d=this.getParentContainer(n.parentId))==null||d.addEntity(l)),this.render(),{id:l.id,type:"text3d"}}addLabel2D(e,i,n,o){var c;let a=n==null?void 0:n.id;try{zM(e,i,n||{})}catch(l){O.error(l);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let l=N(this,Dt,Y0).call(this,e,new ji(i,n||{},s(this,k)),n==null?void 0:n.occluderId,n==null?void 0:n.verticalOffset);l.id=a||String(l.id),a=l.id,(n==null?void 0:n.interactive)!=null&&wt(l,n==null?void 0:n.interactive,s(this,k));let p=typeof(n==null?void 0:n.attachTo)=="string"||typeof(n==null?void 0:n.attachTo)=="number"?s(this,k).geometry3DMap.get(n.attachTo):void 0;p instanceof we&&p.attach(l),(c=this.getParentContainer(o))==null||c.addEntity(l),s(this,nt).call(this),this.render()}else O.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(e,i={},n){var l;try{VI(e,i||{})}catch(p){O.error(p);return}let o=new Fo(e,v0(i)),a=new we(o,new Si({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));a.id=(i==null?void 0:i.id)||De(),o.mesh.userData={entityId:a.id,type:"path"},s(this,k).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&wt(a,i==null?void 0:i.interactive,s(this,k));let c=this.getParentContainer(n);return c instanceof Te&&c.addEntity(a),s(this,Fe).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(e){s(this,L).watermarkSystem.options=e,s(this,L).watermarkSystem.dirty=!0,s(this,L).collisionSystem.collidersDirty=!0,this.render()}remove(e){var n;let i;if(typeof e=="string"||typeof e=="number"?(i=s(this,k).geometry2DMap.get(e),i==null&&(i=s(this,k).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=s(this,k).geometry2DMap.get(e.id),i==null&&(i=s(this,k).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")s(this,k).geometry3DMap.delete(i.id),i.object3d&&We(i.object3d);else if(i.type==="group-container"){s(this,k).geometry3DMap.delete(i.userData.entityId);for(let a of i.childrenIds.values())this.remove(a),i.userData.entities2D.delete(a);let o=i.components[2];o&&o.focusMesh&&We(o.focusMesh),We(i)}else if(i.type==="geometry-group"){s(this,k).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);We(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let o=i.components[0];if(i.entities2D.size>0){for(let a of i.entities2D.values())this.remove(a);i.removeAllEntities()}if(i.object3d&&(((n=i.parentObject3D)==null?void 0:n.type)==="geometry-group"&&i.parentObject3D.userData.entities3D.delete(i.id),We(i.object3d)),i.type==="geometry"){let a=i.components[3];a&&(a.visible=!1,a.dirty=!0)}"focusMesh"in o&&o.focusMesh!=null&&We(o.focusMesh),"textMesh"in o&&o.textMesh!=null&&this.remove(o.textMesh.userData.entityId),s(this,k).geometry3DMap.delete(i.id)}else if(i.type==="marker"||i.type==="label"){let o=i.attachedTo;if(o){let a=s(this,k).geometry3DMap.get(o);a instanceof we&&a.detach(i)}i.object3d&&We(i.object3d),i.type==="label"&&delete s(this,L).twoDDrawSystem.textCache[i.id],s(this,k).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&We(i.object3d),s(this,k).geometry3DMap.delete(i.id);else if(i.type==="text3d"){We(i.object3d);let{batchedText:o,textMesh:a,polygonEntityId:c}=i.components[0];if(a&&(o&&o.removeText(a),We(a)),c){s(this,L).text3DSystem.remove(c);let l=s(this,k).geometry3DMap.get(c);(l==null?void 0:l.type)==="geometry"&&(l.components[0].textMesh=void 0,l.components[0].textEntityId=void 0)}s(this,k).geometry3DMap.delete(i.id)}s(this,Fe).call(this),s(this,nt).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return s(this,Je)}getThreeCamera(){return s(this,Xe)}async setEnvironment(e){if(s(this,Je))if(e==="basic"){s(this,vs)||I(this,vs,N(this,Dt,q0).call(this));let i=await s(this,vs);s(this,Je).environment=i}else s(this,Je).environment=null}getEnvironment(){var e;return(e=s(this,Je))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return s(this,L).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(s(this,L).renderSystem.threeDdirty||s(this,L).renderSystem.twoDdirty)&&this.renderSync();let i=new yt;if(e==null)i.setFromObject(s(this,k).entityScene);else{let n=Bc(s(this,k),e);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof Ze?o.geometry:void 0;o.mesh instanceof rh&&a?(a.computeBoundingBox(),a.boundingBox&&i.union(a.boundingBox)):i.setFromObject(n.object3d)}else((n==null?void 0:n.type)==="geometry-group"||(n==null?void 0:n.type)==="group-container")&&(n==null?void 0:n.userData.entityId)!=null&&i.setFromObject(n)}if(na(i))return c2(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var n,o,a,c,l,p,d,f,g,y;if(e==null)return{type:"map-view",hoverColor:s(this,k).hoverColor,text3dHoverColor:s(this,k).text3dHoverColor};let i=Bc(s(this,k),e);if((i==null?void 0:i.type)==="custom-geometry"){let v=i.components[0],x=i.components[1];return{id:i.id,type:"custom-geometry",visible:x.visible,altitude:x.altitude,parent:(n=i.parentObject3D)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(v.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let v=[];for(let b of i.userData.entities3D.values()){let C=this.getState(b);((C==null?void 0:C.type)==="geometry"||(C==null?void 0:C.type)==="model")&&v.push(C)}let x=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:x.opacity,color:x.color,initialColor:x.initialColor,height:x.height,altitude:i.altitude,topColor:x.topColor,outline:x.outline,shading:x.shading,texture:x.texture,topTexture:x.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(b=>s(this,k).geometry3DMap.get(b)).every(b=>b&&b.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(b=>this.getState(b)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,opacity:i.opacity,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(v=>this.getState(v)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let v=i.components[0],x=i.object3d.parent,b=x==null?void 0:x.userData.entityId;return{id:i.id,type:"label",text:v.text||"",parent:{id:b,type:x==null?void 0:x.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:v.enabled,visible:v.visible,initialRank:eu(v.initialRank),options:{rank:eu(v.rank),appearance:v.appearance,interactive:i.components[1]!=null,verticalOffset:i.verticalOffset,attachTo:i.attachedTo}}}else if((i==null?void 0:i.type)==="marker"){let v=i.components[0],x=i.object3d.parent,b=x==null?void 0:x.userData.entityId;return{id:i.id,type:"marker",enabled:v.enabled,visible:v.visible,anchor:v.options.anchor,dynamicResize:v.options.dynamicResize,parent:{id:b,type:x==null?void 0:x.type},position:this.convert3DMapPositionToCoordinate(i.position),element:v.containerEl,initialRank:eu(v.initialRank),options:{rank:eu(v.rank),interactive:i.components[1]!=null||!1,verticalOffset:i.verticalOffset,attachTo:i.attachedTo,lowPriorityPin:v.options.lowPriorityPin}}}else if((i==null?void 0:i.type)==="geometry"){let{color:v,hoverColor:x,initialColor:b,initialTopColor:C,topColor:M}=i.components[1],P=i.components[0],w=i.components[1],D=i.components[2],B=i.components[3],_=i.parentObject3D;return{id:i.id,type:"geometry",opacity:w.opacity,initialColor:b,color:v,focusable:P.focusable,initialTopColor:C,topColor:M,hoverColor:x,hovered:!!(D!=null&&D.hover),height:w.height,visible:w.visible,outline:B==null?void 0:B.visible,showImage:w.showImage,texture:w.texture,topTexture:w.topTexture,flipImageToFaceCamera:w.flipImageToFaceCamera,parent:{id:_==null?void 0:_.userData.entityId,type:_==null?void 0:_.type},position:this.convert3DMapPositionToCoordinate(P.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let v=i.components[0],x=i.components[1],b=i.components[2];return{id:i.id,type:"model",position:v.mesh?this.convert3DMapPositionToCoordinate((o=v.mesh)==null?void 0:o.getWorldPosition(new K)):this.convert3DMapPositionToCoordinate(v.position),interactive:b!=null,material:x.material,parent:(a=i.parentObject3D)!=null&&a.parent?{id:i.parentObject3D.parent.userData.entityId,type:i.parentObject3D.parent.type}:void 0,visible:x.visible,verticalOffset:x.verticalOffset,color:x.color,opacity:x.opacity,rotation:(c=x.rotation)!=null?c:Zs,scale:(l=x.scale)!=null?l:zs}}else if((i==null?void 0:i.type)==="path"){let v=i.components[0],x=i.components[2],b=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(v.position),visible:b.visible,interactive:x!=null,completeFraction:v.completeFraction,color:b.color,accentColor:v.accentColor,nearRadius:v.nearRadius,farRadius:v.farRadius,animateArrowsOnPath:v.animateArrowsOnPath,displayArrowsOnPath:v.displayArrowsOnPath,nearZoomLevel:v.nearZoomLevel,farZoomLevel:v.farZoomLevel}}else if((i==null?void 0:i.type)==="image"){let v=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(v.position),visible:i.components[1].visible,verticalOffset:(p=v.feature.properties.verticalOffset)!=null?p:0,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"&&i.components[0]instanceof Eo&&"textArea"in i.components[0].feature.properties){gI(i);let v=i.components[0],x=i.components[1],{textMesh:b}=v,C=(d=v.mesh)==null?void 0:d.parent;C instanceof Te&&((f=C.children.find(w=>w.type==="batchedtext"))==null||f.getWorldPosition(s(this,Ku))),s(this,pc).set(0,0,0);let M=b?b.getWorldPosition(s(this,pc)):s(this,pc);return Object.assign({},Ws,x.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(M.add(s(this,Ku))),visible:(g=v.visible)!=null?g:!1,content:(y=v.feature.properties.content)!=null?y:""})}else return}}setState(e,i){var o,a;if(typeof e=="object"&&i==null){"hoverColor"in e&&(s(this,k).hoverColor=(o=e.hoverColor)!=null?o:s(this,k).hoverColor),"text3dHoverColor"in e&&(s(this,k).text3dHoverColor=(a=e.text3dHoverColor)!=null?a:s(this,k).text3dHoverColor);return}let n=Bc(s(this,k),e);if(n!=null){if(n.type==="custom-geometry"){let c=s(this,k).geometry3DMap.get(n.id);if(c instanceof we&&c.components[0]instanceof nc){let l=i;Ui(n,s(this,k),l.visible),gm(n,l.altitude),f0(n,l.position,this.convertTo3DMapPosition),m0(n,this.getParentContainer(l.parent,!1))}}else if(n.type==="path"){let c=i;wt(n,c.interactive,s(this,k))&&s(this,Fe).call(this),gm(n,c.altitude),mI(n,s(this,k),c)}else if(n.type==="model"){let c=i;wt(n,c.interactive,s(this,k))&&s(this,Fe).call(this),Ui(n,s(this,k),c.visible),bI(n,c)}else if(n.type==="group-container"){let c=i;Ui(n,s(this,k),c.visible)&&(s(this,L).outlineInterpolationSystem.outlineOpacitiesDirty=!0,s(this,L).pathSystem.altitudeDirty=!0),gm(n,c.altitude)&&(s(this,L).pathSystem.altitudeDirty=!0),wt(n,c.interactive,s(this,k))&&s(this,Fe).call(this),y0(n,s(this,k),c.opacity)&&(s(this,L).outlineInterpolationSystem.outlineOpacitiesDirty=!0)}else if(n.type==="geometry-group"){let c=i;Ui(n,s(this,k),c.visible)&&(s(this,L).outlineInterpolationSystem.outlineOpacitiesDirty=!0),tI(n,s(this,k),c),ym(n,s(this,k),c.outline),c.height!=null&&d0(n,s(this,k),c.height),c.altitude!=null&&n.setAltitude(c.altitude),uI(n,c),rI(n,c.shading),y0(n,s(this,k),c.opacity)&&(s(this,L).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wt(n,c.interactive,s(this,k))&&(s(this,Fe).call(this),s(this,nt).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Ze){let c=i;Ui(n,s(this,k),c.visible)&&(s(this,L).outlineInterpolationSystem.outlineOpacitiesDirty=!0),ym(n,s(this,k),c.outline),iI(n,c),b0(n,c.focusable)&&(s(this,L).geometryInFocusSystem.focusablesDirty=!0),fI(n,c.renderOrder)&&(s(this,L).meshDetachmentSystem.dirty=!0),hI(n,c.opacity)&&(s(this,L).meshDetachmentSystem.dirty=!0,s(this,L).outlineInterpolationSystem.outlineOpacitiesDirty=!0),g0(n,c.flipImageToFaceCamera),c.height!=null&&d0(n,s(this,k),c.height),dI(n,c)&&(s(this,L).meshDetachmentSystem.dirty=!0),h0(n,c),lI(n,c.hoverColor),wt(n,c.interactive,s(this,k)),cI(n,c.hovered)}s(this,Fe).call(this)}else if(n.type==="label"||n.type==="marker"){let c=i;sI(n,i,s(this,k)),oI(n,i,s(this,k))&&(s(this,nt).call(this),s(this,L).domMutationSystem.dirty=!0),f0(n,c.position,this.convertTo3DMapPosition),m0(n,this.getParentContainer(c.parent,!1))&&(s(this,nt).call(this),s(this,L).panBoundsSystem.dirty=!0),nI(n,c.enabled),Ui(n,s(this,k),c.visible)}else if(n.type==="image"){let c=i;Ui(n,s(this,k),c.visible),g0(n,c.flipImageToFaceCamera)}else if(n.type==="text3d"){let c=i;yI(n,s(this,k),c)}this.render()}}convertTo3DMapPosition(e,i,n=0,o){var l,p,d,f,g;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(l=e[2])!=null?l:n,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:c}=dh((d=(p=s(this,k).center)==null?void 0:p[1])!=null?d:0,(g=(f=s(this,k).center)==null?void 0:f[0])!=null?g:0,e,i);return o?(o.set(a,c,n),o):new K(a,c,n)}get backgroundColor(){return typeof s(this,Ct).backgroundColor=="string"?s(this,Ct).backgroundColor:"#".concat(s(this,Ct).backgroundColor.getHexString())}get backgroundAlpha(){return s(this,Ct).backgroundAlpha}getThreeRenderer(){return s(this,Ct)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?C2(i):void 0}isInView(e){let i=Bc(s(this,k),e);if(s(this,Ju).identity().multiply(s(this,Xe).projectionMatrix).multiply(s(this,Xe).matrixWorldInverse),s(this,Cs).setFromProjectionMatrix(s(this,Ju)),i instanceof sa)return s(this,Cs).containsPoint(i.position);if(i instanceof we){let n=i==null?void 0:i.components[0];if(n instanceof nc||n instanceof ko)return s(this,Cs).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Ze){let o=new yt(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,Cs).intersectsBox(o)}}return!1}getSystems(){return s(this,L)}getInternalState(){return s(this,k)}getTweenGroup(){return s(this,k).tweenGroup}};Je=new WeakMap,Xe=new WeakMap,vs=new WeakMap,Uu=new WeakMap,sc=new WeakMap,Vo=new WeakMap,xs=new WeakMap,lc=new WeakMap,Dt=new WeakSet,X0=function(e){var i;s(this,jo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),s(this,k).pixelRatio=this.resolutionScale},k=new WeakMap,ke=new WeakMap,ii=new WeakMap,Ye=new WeakMap,Zi=new WeakMap,Ct=new WeakMap,L=new WeakMap,Hu=new WeakMap,nt=new WeakMap,Fe=new WeakMap,y7=function(){I(this,ke,document.createElement("div")),s(this,ke).classList.add("mappedin__smart-collision-engine__container"),I(this,ii,document.createElement("canvas")),s(this,ii).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,ke)),I(this,Ye,document.createElement("canvas")),s(this,Ye).classList.add("mappedin__smart-collision-engine__container"),s(this,Ye).width=s(this,ke).clientWidth*this.resolutionScale,s(this,Ye).height=s(this,ke).clientHeight*this.resolutionScale,s(this,Ye).style.width=s(this,ke).clientWidth+"px",s(this,Ye).style.height=s(this,ke).clientHeight+"px",s(this,ke).appendChild(s(this,ii)),s(this,ke).appendChild(s(this,Ye)),s(this,ii).width=s(this,ke).clientWidth,s(this,ii).height=s(this,ke).clientHeight,s(this,Ye).width=s(this,ke).clientWidth*this.resolutionScale,s(this,Ye).height=s(this,ke).clientHeight*this.resolutionScale,s(this,Ye).style.width=s(this,ke).clientWidth+"px",s(this,Ye).style.height=s(this,ke).clientHeight+"px"},b7=function(){I(this,Zi,document.createElement("div")),s(this,Zi).classList.add("mappedin-2d-entities"),Object.assign(s(this,Zi).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,Zi))},v7=function(){s(this,Ye).width=s(this,ke).clientWidth*this.resolutionScale,s(this,Ye).height=s(this,ke).clientHeight*this.resolutionScale,s(this,Ye).style.width=s(this,ke).clientWidth+"px",s(this,Ye).style.height=s(this,ke).clientHeight+"px",s(this,ii).width=s(this,ke).clientWidth,s(this,ii).height=s(this,ke).clientHeight,s(this,Ye).width=s(this,ke).clientWidth*this.resolutionScale,s(this,Ye).height=s(this,ke).clientHeight*this.resolutionScale,s(this,Ye).style.width=s(this,ke).clientWidth+"px",s(this,Ye).style.height=s(this,ke).clientHeight+"px",s(this,L).collisionSystem.collidersDirty=!0},jo=new WeakMap,Wu=new WeakMap,zu=new WeakMap,Zu=new WeakMap,Xu=new WeakMap,gg=new WeakMap,Yu=new WeakMap,qu=new WeakMap,$u=new WeakMap,cc=new WeakMap,Y0=function(e,i,n,o){let a=new sa(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o);return a.occluderId=n!=null?n:s(this,L).occlusion2DSystem.backgroundId,s(this,k).geometry2DMap.set(a.id,a),a},Cs=new WeakMap,Ju=new WeakMap,$t=new WeakMap,Jt=new WeakMap,q0=async function(){return Ao.load(dT).then(e=>{var i;return s(this,Je)&&((i=s(this,Je).environment)==null||i.dispose(),e.mapping=wv,s(this,Je).environment=e,this.render()),e})},pc=new WeakMap,Ku=new WeakMap;var Qu=Z0;m();function cN(r,t){pN(r,t)(r.getScene(),t),uN(r,t),t.addFolder("Export").add({export:async()=>{let a=await r.getCurrentSceneGLTF({binary:!0}),c=new Blob([a],{type:"application/octet-stream"});var l=document.createElement("a");document.body.appendChild(l),l.style.display="none";let p=window.URL.createObjectURL(c);l.href=p,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(p)}},"export");let n=t.addFolder("Camera"),o={get bearing(){return r.camera.bearing},set bearing(a){r.camera.setBearing(a)},get pitch(){return r.camera.pitch},set pitch(a){r.camera.setPitch(a)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(a){r.camera.setZoomLevel(a)}};n.add(o,"bearing",-359,359,1),n.add(o,"pitch",r.camera.minPitch,r.camera.maxPitch,1),n.add(o,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}function pN(r,t){let e=t;return function i(n,o){let a=o.addFolder("".concat([n.type]," ").concat(n.id.slice(0,16)));if(o.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let c={get height(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{height:l})},set flipImageToFaceCamera(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="image"&&r.setState(n,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image")&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?l.visible:!1},set outline(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{outline:l})},get outline(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{opacity:l})},get color(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"&&l.color?J(l.color).toHexString():"#ffffff"},set color(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:l})},set interactive(l){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(r.setState(n,{interactive:l}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=r.getState(n.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(n.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{completeFraction:l})},focus:()=>{}};a.add(c,"focus").onChange(()=>{let l=r.getState(n.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))}),a.add(c,"visible"),n.type==="image"?a.add(c,"flipImageToFaceCamera"):(a.add(c,"interactive"),n.type==="path"&&a.add(c,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(c,"color"),a.add(c,"outline"))),n.type==="geometry"&&(a.add(c,"height"),a.add(c,"opacity",0,1,.1))}else if(n.type==="marker"){let c={get interactive(){var p;let l=r.getState(n.id);return(l==null?void 0:l.type)==="marker"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:l}}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},focus:()=>{}};a.add(c,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="marker"&&r.camera.focusOn([l.position])}),a.add(c,"interactive")}else if(n.type==="label"){let c={get interactive(){var p;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:l}}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get text(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l})},get"Text Color"(){var p,d;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(d=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:d.foregroundColor:"#000000"},set"Text Color"(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(n.id,{text:c.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var p,d;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(d=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:d.size:10},set"Text Size"(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var p,d;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.iconSize:10},set"Icon Size"(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var p,d,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.foregroundColor)==null?void 0:f.active:"#000000"},set"Active Foreground Color"(l){var d,f;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(f=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:f.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var p,d,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.foregroundColor)==null?void 0:f.inactive:"#000000"},set"Inactive Foreground Color"(l){var d,f;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(f=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:f.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var p,d,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.backgroundColor)==null?void 0:f.active:"#000000"},set"Active Background Color"(l){var d,f;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(f=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:f.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var p,d,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.backgroundColor)==null?void 0:f.inactive:"#000000"},set"Inactive Background Color"(l){var d,f;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(f=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:f.backgroundColor,inactive:l}}}}})},focus:()=>{}};a.add(c,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="label"&&r.camera.focusOn([l.position])}),a.add(c,"interactive"),a.add(c,"text"),a.add(c,"Text Size",10,50),a.add(c,"Icon Size",10,50),a.addColor(c,"Text Color"),a.addColor(c,"Active Background Color"),a.addColor(c,"Inactive Background Color"),a.addColor(c,"Active Foreground Color"),a.addColor(c,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let c={get opacity(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{opacity:l})},set visible(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{outline:l})},get outline(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(n,{interactive:l}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var p,d;let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(p=l.shading)==null?void 0:p.start)!=null?d:0},set shadingStart(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:l}})},get shadingEnd(){var p,d;let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(p=l.shading)==null?void 0:p.end)!=null?d:0},set shadingEnd(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:l}})},get shadingIntensity(){var p,d;let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(p=l.shading)==null?void 0:p.intensity)!=null?d:0},set shadingIntensity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{intensity:l}})}};a.add(c,"visible"),a.add(c,"opacity",0,1,.1),a.add(c,"interactive"),a.add(c,"outline"),a.add(c,"shadingStart",0,1,.1),a.add(c,"shadingEnd",0,1,.1),a.add(c,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let c={set visible(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:l}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};a.add(c,"visible"),a.add(c,"interactive")}if(a.close(),n.children)for(let c of n.children.values())i(c,a)}}function uN(r,t){let e=t.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};e.add(i,"padding",0,100,1),e.add(i,"scale",.5,1.5,.1),e.add(i,"color",["dark","light"]),e.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),e.add(i,"iconOnly"),e.onChange(()=>{r.updateWatermark(i)})}var x7="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",dN="https://auth.mappedin.com/oauth2/token";async function C7(r,t){var e,i,n,o,a;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled){let{Map:c,MercatorCoordinate:l}=await import("./outdoor-context-v4-5DHMHSDP.js"),p=t.outdoorView.headers;p==null&&(p=await y2(dN));let d=t.center||[0,0],f=new c({container:r,style:t.outdoorView.style||x7,center:d,attributionControl:!1,zoom:(i=t.zoomLevel)!=null?i:K0,pitch:(n=t.pitch)!=null?n:$0,bearing:(o=t.bearing)!=null?o:J0,transformRequest:h2(p),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Us(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=f.painter.context.gl,y=new Qu(r,{center:d,zoomLevel:f.getZoom(),pitch:f.getPitch(),bearing:f.getBearing(),gl:g,map:f,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(a=t.naturalBearing)!=null?a:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError}),v={center:f.getCenter().toArray(),zoom:f.getZoom(),bearing:f.getBearing(),pitch:f.getPitch()};f.setMinZoom(y.camera.minZoomLevel),f.setMaxZoom(y.camera.maxZoomLevel),y.on("camera-change",w=>{v.center=w.center,v.zoom=w.zoomLevel,v.bearing=w.bearing,v.pitch=w.pitch,f.jumpTo(v)});let x=l.fromLngLat(d,0),b=hh(x,y.viewCamera,y.camera,()=>{y.renderSync()});f.on("style.load",async()=>{f&&(f.addLayer(b),y.renderSync())});let C=!1,M=!1;f.on("idle",()=>{f&&(C||(y.publish("outdoor-view-loaded"),C=!0),M||(M=!0,y.publish("outdoor-style-loaded")))});let P=w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&y.getSystems().htmlControlsSystem.updateData(f)};return f.on("styledata",w=>{f&&w&&w.dataType==="style"&&w.type==="styledata"&&(M=!1),P(w)}),f.on("sourcedata",P),f.on("terrain",P),f.on("error",w=>{var D;if(((D=w.error)==null?void 0:D.url)===x7){O.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}O.warn(w)}),y}else return new Qu(r,t)}m();m();m();var Lf=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Lf||{}),kf=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(kf||{});m();m();var ed=class ed{constructor(t,e,i){u(this,"id");u(this,"text");u(this,"target");u(this,"__type",ed.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===ed.__type}get focusTarget(){return this.target.anchorTarget}};u(ed,"__type","Label");var Uo=ed;m();var Ss,td=class td{constructor(t,e,i){u(this,"id");S(this,Ss);u(this,"__type",td.__type);u(this,"contentEl");this.id=t,this.contentEl=e,I(this,Ss,i)}get target(){return s(this,Ss)}get coordinate(){return s(this,Ss).anchorTarget}static is(t){return t.__type===td.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){I(this,Ss,t)}};Ss=new WeakMap,u(td,"__type","Marker");var Fn=td;m();var nd,od,rd=class rd{constructor(t,e,i){S(this,nd);S(this,od);u(this,"target");u(this,"__type",rd.__type);I(this,nd,t),I(this,od,e),this.target=i}static is(t){return t.__type===rd.__type}get id(){return s(this,nd)}get url(){return s(this,od)}};nd=new WeakMap,od=new WeakMap,u(rd,"__type","Image");var id=rd;m();var uc,ad=class ad{constructor(t,e,i){u(this,"id");u(this,"groupId");u(this,"__type",ad.__type);S(this,uc);this.id=t,this.groupId=e,I(this,uc,i)}get target(){return s(this,uc)}static is(t){return t.__type===ad.__type}updateTarget(t){I(this,uc,t)}};uc=new WeakMap,u(ad,"__type","Model");var Ts=ad;m();var sd=class sd{constructor(t,e){u(this,"id");u(this,"coordinates");u(this,"__type",sd.__type);this.id=t,this.coordinates=e}static is(t){return t.__type===sd.__type}get focusTarget(){return this.coordinates}};u(sd,"__type","PathSegment");var dc=sd,ld=class ld{constructor(t,e,i,n){u(this,"id");u(this,"animation");u(this,"coordinates");u(this,"segments");u(this,"__type",ld.__type);this.id=t,this.animation=e,this.coordinates=i,this.segments=n.map(({id:o,coordinates:a})=>new dc(o.toString(),a))}static is(t){return t.__type===ld.__type}get focusTarget(){return this.coordinates}};u(ld,"__type","Path");var ni=ld;m();var Ho,cd=class{constructor(t){S(this,Ho);I(this,Ho,t)}get center(){return s(this,Ho).center}get bearing(){return s(this,Ho).bearing}get pitch(){return s(this,Ho).pitch}get zoomLevel(){return s(this,Ho).zoomLevel}};Ho=new WeakMap;m();var pd=class pd{constructor(t){u(this,"id");u(this,"__type",pd.__type);this.id=t}static is(t){return t.__type===pd.__type}get focusTarget(){return this}};u(pd,"__type","Shape");var Wo=pd;m();var yg=class yg{constructor(t,e){u(this,"id");u(this,"target");u(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===yg.__type}};u(yg,"__type","Text3D");var zo=yg;m();m();m();var hN=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>']]),fN=/<svg([^>]*)>/g;function S7(r,t,e){let i=hN.get(r);return i?i.replace(fN,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var mN=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 '),gN=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 '),Q0="#722ED1",ev="#1890FF",T7=({type:r="departure",color:t=ev})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?mN(t):gN(t),"\n </div>"),yN=r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},M7=({type:r="stairs",color:t=Q0,direction:e="up"})=>{let i=yN("default"),n=i/2+2,o=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(S7("connection-"+r+"-16x16","white",n)||"","\n </div>\n ").concat(o?'<div style="margin-left: -'.concat(i*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(i,"px; height: ").concat(i,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(n,"px; height: ").concat(n,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")};m();var I7=async r=>new Promise(t=>setTimeout(t,r));var bN={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},vN={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},Zo={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:bN,inactivePathOptions:vN,markerOptions:{departureColor:ev,destinationColor:Q0},animatePathDrawing:!0},Bn,oi,Rn,Se,dd,Nn,Ms,ot,ai,or,si,Xo,Ke,P7,w7,tv,bg,hc,rv,fc,ud=class{constructor(t,e,i){S(this,Ke);S(this,Bn,new Map);S(this,oi);S(this,Rn);S(this,Se,Zo);S(this,dd);S(this,Nn);S(this,Ms);S(this,ot,[]);S(this,ai);S(this,or,new Map);S(this,si,new Map);S(this,Xo,new Map);S(this,fc,t=>{var e;if((e=s(this,Se).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=s(this,Bn).get(t.markers[0]);i!=null&&i.action.toFloor&&(s(this,Se).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}))}});I(this,oi,t),I(this,dd,i),I(this,Rn,e)}get currentMap(){return s(this,dd).call(this)}get isMultiFloor(){if(!s(this,ot).length)return!1;let t=new Set;for(let e of s(this,ot))for(let i of e.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return s(this,or).get(t)}getMarkerById(t){return s(this,Bn).get(t)}get paths(){let t=new Set;return s(this,or).forEach(({path:e})=>t.add(e)),Array.from(t)}get activeDirections(){return s(this,Xo).get(s(this,ai))}get activePath(){var t;if(s(this,ai))return(t=s(this,or).get(s(this,ai).id))==null?void 0:t.path}get floorStacks(){let t=s(this,Rn).getMapData();if(!s(this,ot).length||!t)return[];let e=new Set;for(let i of s(this,ot))for(let n of i.coordinates)if(n.floorId){let o=t.getById("floor",n.floorId);o&&e.add(o.floorStack)}return Array.from(e)}get floors(){let t=s(this,Rn).getMapData();if(!s(this,ot).length||!t)return[];let e=new Set;for(let i of s(this,ot))for(let n of i.coordinates)if(n.floorId){let o=t.getById("floor",n.floorId);o&&e.add(o)}return Array.from(e)}setActivePathByIndex(t){let e=s(this,ot)[t];if(!s(this,ot).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,ot)[t]){O.warn("Direction #".concat(t," does not exist"));return}let i=s(this,si).get(e);if(!i){O.warn("The direction is not a part of muli-direcional path");return}N(this,Ke,bg).call(this,i)}setActivePath(t){if(!s(this,ot).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,Xo).get(t)){O.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}N(this,Ke,bg).call(this,t)}setActivePathByDirections(t){if(!s(this,ot).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=s(this,si).get(t);if(!e){O.warn("The direction is not a part of muli-direcional path");return}N(this,Ke,bg).call(this,e)}drawSync(t,e={}){var c,l,p;s(this,Ms)&&this.clear(),I(this,Ms,!0),N(this,Ke,tv).call(this,e);let i=Array.isArray(t)?t:[t],n=i[0],o=i[i.length-1],a=n.coordinates[0];I(this,ot,i),a.floorId&&s(this,Se).setMapToDeparture&&this.currentMap.setFloor(a.floorId),(c=s(this,Se).createMarkers)!=null&&c.departure&&N(this,Ke,hc).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let d=0;d<i.length;d++){let f=i[d],g=d?{...s(this,Se).inactivePathOptions}:{...s(this,Se).pathOptions};if(f.coordinates.length<2){O.warn("Directions must have at least 2 coordinates");return}let y=this.currentMap.Paths.add(f.coordinates,{...g,animateDrawing:s(this,Se).animatePathDrawing}),v=y.paths.map(b=>b.id.toString()),x=new ni(De(),y.animation,f.coordinates,y.paths);for(let b of v){s(this,or).set(b,{path:x,entityIds:v});let C=d?{...s(this,Se).inactivePathOptions,altitude:0}:{...s(this,Se).pathOptions,altitude:.05};s(this,oi).setState(b,C)}s(this,or).set(x.id,{path:x,entityIds:v}),s(this,si).set(f,x),s(this,Xo).set(x,f),(l=s(this,Se).createMarkers)!=null&&l.connection&&N(this,Ke,rv).call(this,f.instructions,"connection"),d===0&&(I(this,ai,s(this,si).get(s(this,ot)[0])),s(this,oi).on("click",s(this,fc)))}(p=s(this,Se).createMarkers)!=null&&p.destination&&N(this,Ke,hc).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),s(this,Rn).mapObjects.forEach(d=>{d.processFloorChange(d.currentFloorId)})}async draw(t,e={}){s(this,Nn)&&this.clear(),N(this,Ke,tv).call(this,e);let i=Array.isArray(t)?t:[t],o=i[0].coordinates[0];return I(this,ot,i),o.floorId&&s(this,Se).setMapToDeparture&&this.currentMap.setFloor(o.floorId),N(this,Ke,w7).call(this,i)}clear(){s(this,Bn).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),s(this,Bn).clear(),s(this,or).forEach(({path:t,entityIds:e})=>{s(this,or).delete(t.id),e.forEach(i=>s(this,or).delete(i)),this.currentMap.Paths.remove(e)}),s(this,Nn)&&(s(this,Nn).cancel(),I(this,Nn,void 0)),s(this,Ms)&&I(this,Ms,!1),I(this,ot,[]),s(this,si).clear(),s(this,Xo).clear(),I(this,ai,void 0),s(this,oi).off("click",s(this,fc)),s(this,Rn).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};Bn=new WeakMap,oi=new WeakMap,Rn=new WeakMap,Se=new WeakMap,dd=new WeakMap,Nn=new WeakMap,Ms=new WeakMap,ot=new WeakMap,ai=new WeakMap,or=new WeakMap,si=new WeakMap,Xo=new WeakMap,Ke=new WeakSet,P7=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},w7=function(t){let e=t[0],i=t[t.length-1],n=!1;return I(this,Nn,{promise:new Promise(async o=>{var a,c,l;if(T.env.NODE_ENV!=="test"&&await I7(500),n||!t.length){o();return}(a=s(this,Se).createMarkers)!=null&&a.departure&&N(this,Ke,hc).call(this,e.coordinates[0],"departure",e.instructions[0]);for(let p=0;p<t.length;p++){let d=t[p],f=p?{...s(this,Se).inactivePathOptions}:{...s(this,Se).pathOptions};if(d.coordinates.length<2){O.warn("Directions must have at least 2 coordinates"),o();return}let g=this.currentMap.Paths.add(d.coordinates,{...f,animateDrawing:s(this,Se).animatePathDrawing}),y=g.paths.map(x=>x.id.toString()),v=new ni(De(),g.animation,d.coordinates,g.paths);for(let x of y){s(this,or).set(x,{path:v,entityIds:y});let b=p?{...s(this,Se).inactivePathOptions,altitude:0}:{...s(this,Se).pathOptions,altitude:.05};s(this,oi).setState(x,b)}if(s(this,or).set(v.id,{path:v,entityIds:y}),s(this,si).set(d,v),s(this,Xo).set(v,d),T.env.NODE_ENV!=="test"&&await g.animation,n){o();return}(c=s(this,Se).createMarkers)!=null&&c.connection&&N(this,Ke,rv).call(this,d.instructions,"connection"),p===0&&(I(this,ai,s(this,si).get(s(this,ot)[0])),s(this,oi).on("click",s(this,fc)))}if((l=s(this,Se).createMarkers)!=null&&l.destination&&N(this,Ke,hc).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),n){o();return}s(this,Rn).mapObjects.forEach(p=>{p.processFloorChange(p.currentFloorId)}),o()}),cancel:()=>{n=!0}}),s(this,Nn).promise},tv=function(t){var e,i,n;I(this,Se,{setMapOnConnectionClick:(e=t.setMapOnConnectionClick)!=null?e:Zo.setMapOnConnectionClick,setMapToDeparture:(i=t.setMapToDeparture)!=null?i:Zo.setMapToDeparture,pathOptions:{...Zo.pathOptions,...t.pathOptions},inactivePathOptions:{...Zo.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...Zo.createMarkers,...t.createMarkers},markerOptions:{...Zo.markerOptions,...t.markerOptions},animatePathDrawing:(n=t.animatePathDrawing)!=null?n:Zo.animatePathDrawing})},bg=function(t){I(this,ai,t),s(this,ot).forEach(e=>{let i=s(this,si).get(e);if(i){let n=s(this,or).get(i.id),o=n.path.id===s(this,ai).id?{...s(this,Se).pathOptions,altitude:.05}:{...s(this,Se).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,oi).setState(a,o)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},hc=function(t,e,i){var n,o,a,c,l;if(e==="connection"&&i){let p=i.action.type==="ExitConnection"?s(this,Se).markerOptions.departureColor:s(this,Se).markerOptions.destinationColor,d;if(typeof((n=s(this,Se).createMarkers)==null?void 0:n.connection)=="function"){let g=s(this,Se).createMarkers.connection(i);s(this,oi).setState(g.id.toString(),{options:{interactive:!0}}),d={id:g.id,type:"marker"}}else d=this.currentMap.Markers.add(i.coordinate,M7({type:(a=(o=i.action.connection)==null?void 0:o.type)!=null?a:i.action.connectionType,color:p,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let f=this.currentMap.Markers.getContentEl(d.id.toString());if(!f)throw new Error("marker component should exist");s(this,Bn).set(d.id,{instruction:i,marker:new Fn(d.id.toString(),f,i.coordinate)})}else{let p=e==="departure"?s(this,Se).markerOptions.departureColor:s(this,Se).markerOptions.destinationColor,d;typeof((c=s(this,Se).createMarkers)==null?void 0:c.departure)=="function"&&e==="departure"?d={id:s(this,Se).createMarkers.departure(i).id,type:"marker"}:typeof((l=s(this,Se).createMarkers)==null?void 0:l.destination)=="function"&&e==="destination"?d={id:s(this,Se).createMarkers.destination(i).id,type:"marker"}:d=this.currentMap.Markers.add(t,T7({type:e,color:p}),{anchor:"top",rank:"always-visible"}),s(this,Bn).set(d.id,void 0)}},rv=function(t,e){t.filter(n=>N(this,Ke,P7).call(this,n.action)).forEach(n=>{N(this,Ke,hc).call(this,n.coordinate,e,n)})},fc=new WeakMap;m();m();m();var xN=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>']]),CN=/<svg([^>]*)>/g;function D7(r,t,e){let i=xN.get(r);return i?i.replace(CN,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var Is,mc,ar,iv,E7,_7,nv,O7,vg=class{constructor(t,e){S(this,ar);S(this,Is);S(this,mc);u(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});I(this,Is,t),I(this,mc,e)}auto(){let t=[],e=s(this,mc)[Object.keys(s(this,mc))[0]];return[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(i=>{if(i.__type==="connection")i.coordinates.forEach(n=>{let o=i.name||i.externalId;if(o){let a=s(this,Is).Labels.add(n,o,N(this,ar,iv).call(this,i));t.push(a)}});else{i.__type==="space"&&i.name!==""&&s(this,Is).updateState(i,{interactive:!0,hoverColor:"#F0F0F0"});let n=i.name;if(n){let o=s(this,Is).Labels.add(i,n,N(this,ar,iv).call(this,i));t.push(o)}}}),{labels:t}}};Is=new WeakMap,mc=new WeakMap,ar=new WeakSet,iv=function(t){let e=D7(N(this,ar,E7).call(this,t),"white",12);return{appearance:{text:{foregroundColor:N(this,ar,nv).call(this,t)},marker:{foregroundColor:{active:N(this,ar,nv).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:N(this,ar,O7).call(this,t)}},E7=function(t){return t.__type==="connection"?N(this,ar,_7).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},_7=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},nv=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},O7=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var xg=class{constructor(t,e){u(this,"Labels");u(this,"auto",()=>this.Labels.auto());this.Labels=new vg(t,e)}};m();var pe,fd,Gn,Cg,ov,hd=class{constructor(t){S(this,Gn);S(this,pe);S(this,fd);u(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(s(this,pe).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(s(this,pe).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(s(this,pe).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{s(this,pe).getSystems().cameraSystem.enablePan=!0,s(this,pe).getSystems().cameraSystem.enableZoom=!0,s(this,pe).getSystems().cameraSystem.enableRotate=!0},disable:()=>{s(this,pe).getSystems().cameraSystem.enablePan=!1,s(this,pe).getSystems().cameraSystem.enableZoom=!1,s(this,pe).getSystems().cameraSystem.enableRotate=!1}});u(this,"setMinPitch",t=>{s(this,pe).camera.setMinPitch(t)});u(this,"setMaxPitch",t=>{s(this,pe).camera.setMaxPitch(t)});u(this,"setMinZoomLevel",t=>{s(this,pe).camera.setMinZoomLevel(t,!0)});u(this,"setMaxZoomLevel",t=>{s(this,pe).camera.setMaxZoomLevel(t)});I(this,fd,t),I(this,pe,t.core)}setScreenOffsets(t){s(this,pe).camera.setInsetPadding(t)}get screenOffsets(){return s(this,pe).camera.insetsPadding}get panMode(){return s(this,pe).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&s(this,pe).camera.setPanMode(t)}getFocusOnTransform(t,e){var n;let i=s(this,pe).camera.getCameraFrameForCoordinates(N(this,Gn,ov).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,verticalPadding:(n=e==null?void 0:e.axisAlignedPadding)==null?void 0:n.vertical,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing});return{center:new ae(i.center[1],i.center[0]),zoomLevel:i.zoomLevel}}focusOn(t,e){var i;return s(this,pe).camera.focusOn(N(this,Gn,ov).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,verticalPadding:(i=e==null?void 0:e.axisAlignedPadding)==null?void 0:i.vertical,easing:e==null?void 0:e.easing})}animateTo(t,e){var l;let{center:i,zoomLevel:n,bearing:o,pitch:a}=t,c=i!=null?i:this.center;return s(this,pe).camera.animateTo({center:i!=null?[c.longitude,c.latitude,s(this,pe).camera.elevation]:void 0,zoomLevel:n,bearing:o,pitch:a,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:n=this.bearing,pitch:o=this.pitch}=t,a=[e.longitude,e.latitude];s(this,pe).camera.setCenter(a),s(this,pe).camera.setZoomLevel(i),s(this,pe).camera.setBearing(n),s(this,pe).camera.setPitch(o)}get center(){let t=s(this,pe).camera.center;return new ae(t[1],t[0],void 0)}setAutoMinZoomLevel(t){s(this,pe).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return s(this,pe).camera.autoMinZoomLevel}get zoomLevel(){return s(this,pe).camera.zoomLevel}get pitch(){return s(this,pe).camera.pitch}get minPitch(){return s(this,pe).camera.minPitch}get maxPitch(){return s(this,pe).camera.maxPitch}get bearing(){let t=s(this,pe).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return s(this,pe).camera.minZoomLevel}get maxZoomLevel(){return s(this,pe).camera.maxZoomLevel}setElevation(t){s(this,pe).camera.setElevation(t)}get elevation(){return s(this,pe).camera.elevation}animateElevation(t,e){return s(this,pe).camera.animateElevation(t,e)}updateFacadesInView(){s(this,pe).getSystems().geometryInFocusSystem.raycast()}};pe=new WeakMap,fd=new WeakMap,Gn=new WeakSet,Cg=function(t){var i,n,o,a,c,l;let e=s(this,pe).camera.elevation;return ae.is(t)&&t.floorId!=null?(n=(i=s(this,pe).getState(t.floorId))==null?void 0:i.altitude)!=null?n:e:mr.is(t)?(a=(o=s(this,pe).getState(t.id))==null?void 0:o.altitude)!=null?a:e:"floor"in t&&mr.is(t.floor)&&(l=(c=s(this,pe).getState(t.floor.id))==null?void 0:c.altitude)!=null?l:e},ov=function(t){var o;let e=[],n=(Array.isArray(t)?t:[t]).flatMap(a=>{var c;return(c=a==null?void 0:a.focusTarget)!=null?c:[a]});for(let a of n)if(a!=null)if(ae.is(a)){let c=N(this,Gn,Cg).call(this,a);e.push([a.longitude,a.latitude,c])}else if((a==null?void 0:a.id)!=null){let c=N(this,Gn,Cg).call(this,a);if(mr.is(a)&&((o=s(this,fd).getMapDataInternal())!=null&&o.enterpriseMode)){e.push(a.id);continue}else if("geoJSON"in a&&a.geoJSON.geometry.coordinates.length>0){r2(a.geoJSON,p=>{e.push([p[0],p[1],c])});continue}let l=s(this,pe).getBoundingArea(a.id);if(l)e.push(...l.map(p=>[p[0],p[1],c]));else if("geoJSONBoundingBox"in a){let p=N(this,Gn,Cg).call(this,a);if(a.geoJSONBoundingBox!=null){let d=[[a.geoJSONBoundingBox[0],a.geoJSONBoundingBox[1],p],[a.geoJSONBoundingBox[2],a.geoJSONBoundingBox[3],p]];e.push(...d)}}}else X1(a)&&e.push(a);return e};m();var gc,md=class{constructor({currentMapGetter:t}){S(this,gc);I(this,gc,t)}get currentMap(){return s(this,gc).call(this)}async getCurrentSceneGLTF(t){let e=s(this,gc).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(O.error("There is no map to export. Please load a map first."),new Blob)}};gc=new WeakMap;m();var Xi,yd,gd=class{constructor({currentMapGetter:t}){S(this,Xi,new Map);S(this,yd);I(this,yd,t)}get currentMap(){return s(this,yd).call(this)}getById(t){return s(this,Xi).get(t)}add(t,e,i){let n=t.anchorTarget,o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Labels.add(n,e,{...i,attachTo:Ml(t),rank:(i==null?void 0:i.rank)==null||(i==null?void 0:i.rank)==="initial"?"medium":i.rank}),c=new Uo(a.id.toString(),e,t);return s(this,Xi).set(c.id,{label:c,entityId:c.id}),c}all(t){var i;let e=[];return(i=this.currentMap)==null||i.Labels.all({onCreate:(n,o,a)=>{let c=new Uo(n.toString(),o,a);s(this,Xi).set(c.id,{label:c,entityId:c.id}),e.push(c)},labelOptions:t}),e}remove(t){var i;let e=s(this,Xi).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),s(this,Xi).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Xi).forEach(({label:e})=>{this.remove(e),t.push(e),s(this,Xi).delete(e.id.toString())}),t}};Xi=new WeakMap,yd=new WeakMap;m();m();var av={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},L7={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},k7=.5,Vn=class{constructor(t,e,i=new Map){u(this,"containerId");u(this,"layers");u(this,"renderer");this.containerId=e,this.layers=i,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}},Ps,bd=class{constructor(t,e,i,n,o,a,c,l){u(this,"id");u(this,"name");u(this,"elevation");u(this,"containerId");u(this,"externalId");u(this,"metadata");u(this,"shortName");u(this,"subtitle");u(this,"occluderId");u(this,"loaded",!1);u(this,"styleMap",{});u(this,"obstructions");u(this,"entrances");u(this,"spaces");u(this,"floorImages");u(this,"floorText");u(this,"renderer");u(this,"options");u(this,"layers",new Map);u(this,"footprint");u(this,"floorStackId");u(this,"multiFloorView");u(this,"mapDataInternal");u(this,"facadesByStyleId",new Map);S(this,Ps);u(this,"load",()=>{var n,o,a,c,l,p,d,f,g,y,v,x,b,C;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(yn,"-").concat(this.id),{},this.id);this.layers.set(yn,new Vn(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(Li,"-").concat(this.id),{},this.id);this.layers.set(Li,new Vn(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(et,"-").concat(this.id),{},this.id);if(this.layers.set(et,new Vn(this.renderer,i.id.toString())),((n=this.footprint)==null?void 0:n.geometry)!=null&&((o=this.footprint)==null?void 0:o.geometry.coordinates.length)!==0){let M=av;if(this.obstructions!=null&&this.obstructions.features.length>0){let D=this.obstructions.features.filter(B=>B.geometry.type==="LineString"&&B.properties.kind==="Wall"&&B.properties.footprintComponent===!0);D!=null&&D.length>0&&(M=this.styleMap[(a=D[0].properties)==null?void 0:a.id])}let P=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...M,height:(l=(c=this.multiFloorView)==null?void 0:c.floorHeight)!=null?l:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":M.color,renderOrder:2},this.id);this.layers.set(Sp,new Vn(this.renderer,P.id.toString()));let w=this.renderer.addGroupContainer("".concat(yl,"-").concat(this.id),{},this.id);this.layers.set(yl,new Vn(this.renderer,w.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,w.id)}if(this.spaces!=null&&this.spaces.features.length>0){let M=[],P=new Map;this.spaces.features.filter(_=>{var A;return _.geometry.type==="Polygon"&&((A=_.properties.kind)==null?void 0:A.toLowerCase())!=="void"}).forEach(_=>{var F;let A=(F=this.mapDataInternal)==null?void 0:F.facadesBySpaceId[_.properties.id];if(A){let G=P.get(A.id)||[];P.set(A.id,[...G,_])}else M.push(_)});let w=_f(M,this.styleMap),D=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),B=0;for(let[_,A]of w){let F=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(B),{features:A},Tl(_,this.options),D);B++;let G=D.id.toString();this.layers.get(et).layers.set(_.id||G,F.id.toString())}if(P.size>0){let _=this.renderer.addGroupContainer("".concat(Ma,"-").concat(this.id),{},this.id);this.layers.set(Ma,new Vn(this.renderer,_.id.toString()));for(let[A,F]of P){let G=this.renderer.addGroupContainer(A,{focusable:!0},_),R=this.renderer.addGroupContainer("".concat(A,"-geometry"),{},G),z=_f(F,this.styleMap),W=0;for(let[j,ee]of z){let Z=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(A,"-").concat(W),{features:ee},{...Tl(j,this.options),renderOrder:3},R);W++;let xe=j.id||Z.id.toString();this.layers.get(Ma).layers.set("".concat(A,"-").concat(xe),Z.id.toString()),this.facadesByStyleId.has(xe)?(p=this.facadesByStyleId.get(xe))==null||p.push(A):this.facadesByStyleId.set(xe,[A])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let M=this.obstructions.features.filter(R=>R.geometry.type==="Polygon"&&R.properties.kind==="object"),P=_f(M,this.styleMap),w=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),D=0;for(let[R,z]of P){let W=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(D),{features:z},Tl(R,this.options),w);D++;let j=w.id.toString();this.layers.get(et).layers.set(R.id||j,W.id.toString())}let B=this.obstructions.features.filter(R=>R.geometry.type==="LineString"&&R.properties.kind==="Wall"&&R.properties.footprintComponent===!1),_=this.obstructions.features.filter(R=>R.geometry.type==="LineString"&&R.properties.kind==="Wall"&&R.properties.footprintComponent===!0),A=this.entrances,F=av,G=av;if(B!=null&&B.length>0){let R=this.styleMap[(d=B[0].properties)==null?void 0:d.id];R!=null&&(F={...R}),G=F;let{walls:z,entrances:W}=bb(B,(A==null?void 0:A.features)||[]),j=Math.max(F.height-.11,k7),ee={...L7,height:j},Z=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),W,ee,i);this.layers.get(et).layers.set(ml,Z.id.toString());let xe=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[z]},Tl(F,this.options),i);this.layers.get(et).layers.set(yo,xe.id.toString())}if(_!=null&&_.length>0){let R=this.styleMap[(f=_[0].properties)==null?void 0:f.id];R!=null&&(G={...R,id:Oi});let{walls:z,entrances:W}=bb(_,(A==null?void 0:A.features)||[]),j=Math.max(G.height-.11,k7),ee={...L7,height:j},Z=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),W,ee,i);this.layers.get(et).layers.set(gl,Z.id.toString());let xe=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[z]},Tl(G,this.options),i);this.layers.get(et).layers.set(Oi,xe.id.toString())}}if(this.floorImages!=null){let M=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let P of this.floorImages.features||[])"anchorId"in P.properties||"anchorId"in P.properties&&((g=P.properties)==null?void 0:g.anchorId)==null||this.renderer.addImage(De(),P,{url:P.properties.path,flipImageToFaceCamera:(y=this.options.flipImagesToFaceCamera)!=null?y:!0},M);this.layers.set(a5,new Vn(this.renderer,M.id.toString()))}if(this.floorText!=null)for(let M of this.floorText.features||[]){let P=0;"geometryId"in M.properties?P=(x=(v=this.renderer.getState(M.properties.geometryId))==null?void 0:v.height)!=null?x:0:P=(b=M.properties.verticalOffset)!=null?b:0,this.renderer.addText3D(De(),{...M,properties:{...M.properties,verticalOffset:P}},{},this.id)}return(C=this.multiFloorView)!=null&&C.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this});var d,f,g,y;this.id=e.id,this.options=o;let p=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=p.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,a!=null&&c!=null&&(this.styleMap=c,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(d=a.floorImages)==null?void 0:d[this.id],this.floorText=(g=(f=a.enterprise)==null?void 0:f.floorText)==null?void 0:g[this.id],this.footprint=(y=a["floor.geojson"])==null?void 0:y.features.find(v=>v.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=n,this.mapDataInternal=l}get geoJSONBoundingBox(){if(s(this,Ps))return s(this,Ps);if(!this.footprint){O.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return I(this,Ps,Of(this.footprint)),s(this,Ps)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};Ps=new WeakMap;m();var lv=50,cv=!1,SN=1e3,ze,yc,Yi,li,Et,xd,qo,bc,ws,sr,uv,Ds,Cd,Sd,Td,Md,jn,R7,Id,$o,dv,N7,G7,Es,vd=class extends oe{constructor({currentMapGetter:e}){super();S(this,sr);S(this,ze);S(this,yc,0);S(this,Yi);S(this,li,!1);S(this,Et,[]);S(this,xd,0);S(this,qo,lv);S(this,bc,!1);S(this,ws,"collapsed");u(this,"expandedFactor",0);S(this,Ds,"all-floors");S(this,Cd,()=>{let e=s(this,ze).call(this);if(s(this,xd)===this.expandedFactor||e==null||!s(this,li))return;I(this,xd,this.expandedFactor);let i=Ti(this.expandedFactor,0,1,0,this.distanceBetweenFloors),o=Ti(this.expandedFactor,0,.1,0,1)===0;s(this,Et).forEach((a,c)=>{e.api.updateState(a.containerId,{visible:o?a.id===e.currentFloorId:!0,altitude:i*c})}),this.expandedFactor===0?(I(this,li,!1),e.renderer.camera.setPanMode("default"),s(this,$o)&&s(this,$o).call(this)):this.expandedFactor===1&&(I(this,li,!1),s(this,$o)&&s(this,$o).call(this))});S(this,Sd,()=>{var e,i,n;this.expanded&&I(this,yc,(i=(e=s(this,ze).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(n=s(this,ze).call(this))==null||n.renderer.on("user-interaction-end",s(this,Md))});S(this,Td,()=>{var i;let e=s(this,ze).call(this);if(e!=null&&this.expanded&&s(this,bc)&&!s(this,li)){let n=e.currentFloorId,o=[1/0,e.currentFloorId];for(let a=0;a<s(this,Et).length;a++){let c=s(this,Et)[a],l=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-a*this.distanceBetweenFloors);l<this.distanceBetweenFloors/3&&(o[0]=l,o[1]=c.id)}o[1]!==e.currentFloorId&&(e.currentFloorId=o[1],s(this,Et).forEach(a=>{e.api.updateState(a.containerId,{visible:s(this,Ds)==="all-floors"?!0:e.currentFloor.id===a.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId,previousFloorId:n}))}});S(this,Md,()=>{var i,n;let e=s(this,ze).call(this);if(this.expanded&&e&&s(this,yc)!==((i=e.renderer.camera.elevation)!=null?i:0)){let o=[1/0,e.currentFloorId,0];for(let a=0;a<s(this,Et).length;a++){let c=s(this,Et)[a],l=Math.abs(((n=e.renderer.camera.elevation)!=null?n:0)-a*this.distanceBetweenFloors);l<o[0]&&(o[0]=l,o[1]=c.id,o[2]=a*this.distanceBetweenFloors)}s(this,bc)&&N(this,sr,R7).call(this,o[2]),I(this,yc,0),e.renderer.off("user-interaction-end",s(this,Md))}});S(this,jn,null);S(this,Id,null);S(this,$o);S(this,Es);I(this,ze,e);let i=s(this,ze).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",s(this,Sd)),i.renderer.on("camera-change",s(this,Td)),i.renderer.on("pre-render",s(this,Cd)))}get state(){return s(this,ws)}get expanded(){return s(this,ws)!=="collapsed"}get distanceBetweenFloors(){if(s(this,qo)==="auto"){if(s(this,Es)!=null)return s(this,Es);let e=N(this,sr,G7).call(this);if(e)return I(this,Es,e),e}return typeof s(this,qo)=="number"?s(this,qo):lv}clearCachedFloorSeparationDistance(){I(this,Es,void 0)}get includedFloors(){var e;return(e=s(this,sr,uv))!=null&&e.api.mapData?s(this,Et).map(i=>{var n,o;return(o=(n=s(this,sr,uv))==null?void 0:n.api.mapData)==null?void 0:o.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return s(this,Ds)}setFloorVisiblityMode(e){I(this,Ds,e);let i=s(this,ze).call(this);i!=null&&s(this,Et).forEach(n=>{i.api.updateState(n.containerId,{visible:s(this,Ds)==="all-floors"?!0:i.currentFloor.id===n.id})})}changeFloorOnElevationChanges(e){I(this,bc,e)}async expand(e){var n,o,a;let i=s(this,ze).call(this);if(i!=null)return(e==null?void 0:e.distanceBetweenFloors)==="auto"?I(this,qo,"auto"):I(this,qo,(n=e==null?void 0:e.distanceBetweenFloors)!=null?n:lv),I(this,Et,(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),s(this,Et).sort((c,l)=>c.elevation-l.elevation),s(this,Et).length<=1||this.expanded===!0?Promise.resolve():(I(this,li,!0),i.api.Camera.setPanMode((o=e==null?void 0:e.cameraPanMode)!=null?o:"elevation"),this.changeFloorOnElevationChanges((a=e==null?void 0:e.changeFloorOnElevationChanges)!=null?a:!0),N(this,sr,dv).call(this,"expand",e).then(()=>{I(this,ws,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{I(this,li,!1)}))}async collapse(e){let i=s(this,ze).call(this);if(i!=null)return this.expanded===!0?(I(this,li,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),N(this,sr,dv).call(this,"collapse",e).then(()=>{I(this,ws,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{I(this,li,!1)})):Promise.resolve()}destroy(){let e=s(this,ze).call(this);e!=null&&(e.renderer.off("user-interaction-start",s(this,Sd)),e.renderer.off("camera-change",s(this,Td)),e.renderer.off("pre-render",s(this,Cd)))}};ze=new WeakMap,yc=new WeakMap,Yi=new WeakMap,li=new WeakMap,Et=new WeakMap,xd=new WeakMap,qo=new WeakMap,bc=new WeakMap,ws=new WeakMap,sr=new WeakSet,uv=function(){return s(this,ze).call(this)},Ds=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Td=new WeakMap,Md=new WeakMap,jn=new WeakMap,R7=function(e){var n,o,a;s(this,jn)&&s(this,jn).stop();let i=s(this,ze).call(this);i!=null&&(I(this,jn,new nr({elevation:(n=i.renderer.camera.elevation)!=null?n:0}).to({elevation:e},150).easing(rt.Quadratic.Out).onComplete(()=>{var c;s(this,jn)&&((c=s(this,ze).call(this))==null||c.renderer.getTweenGroup().remove(s(this,jn)))}).onUpdate(({elevation:c})=>{i.renderer.camera.setElevation(c)}).start()),(o=s(this,ze).call(this))==null||o.renderer.getTweenGroup().add(s(this,jn)),(a=s(this,ze).call(this))==null||a.renderer.render())},Id=new WeakMap,$o=new WeakMap,dv=function(e,i){var c,l,p,d;s(this,Yi)&&s(this,Yi).stop();let n=s(this,ze).call(this);if(n==null)return Promise.reject(new Error("No current map"));let o=s(this,Et).indexOf(n.currentFloor),a=(c=n.renderer.camera.elevation)!=null?c:0;return I(this,Id,new Promise(f=>{I(this,$o,f)})),I(this,Yi,new nr({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:SN).easing(Ln[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:f})=>{this.expandedFactor=f;let g=o*this.distanceBetweenFloors;n.renderer.camera.setElevation(e==="expand"?g*f:a*f)}).onComplete(()=>{var f;s(this,Yi)&&((f=s(this,ze).call(this))==null||f.renderer.getTweenGroup().remove(s(this,Yi)))}).start()),s(this,Yi).cameraAnimation=!0,(p=s(this,ze).call(this))==null||p.renderer.getTweenGroup().add(s(this,Yi)),(d=s(this,ze).call(this))==null||d.renderer.render(),s(this,Id)},N7=function(e,i,n,o){let a=pv(e,n),c=i.clone(),l=pv(c,n);if(!na(a)||!na(l))return-1;let p=0,d;cv&&o.querySelectorAll(".debug-box").forEach(g=>g.remove());do{if(p>1e4)return-1;if(p+=20,c.position.z=p,c.updateMatrixWorld(),l.makeEmpty(),pv(c,n,l),d=a.intersectsBox(l),cv){let f=B7(a,"blue",o),g=B7(l,d?"red":"green",o);f.classList.add("debug-box"),g.classList.add("debug-box")}}while(d);return p},G7=function(){let e=s(this,ze).call(this);if(!e)return;let i=e.renderer,n=i.getThreeScene();if(!e.api.mapData||!n)return;let a=s(this,Et).length>0?s(this,Et):e.currentFloorStack.floorObjects;if(a.length<2)return;let c=i.getInternalState().geometry3DMap.get(a[0].id),l=i.getInternalState().geometry3DMap.get(a[1].id);if(!c||!l)return;if(Rg(c,"group-container"),Rg(l,"group-container"),cv){let d=new yt;d.setFromObject(c);let f=new yt;if(f.setFromObject(l),c.children.forEach(M=>{M instanceof ue&&M.userData.debugBox&&We(M)}),l.children.forEach(M=>{M instanceof ue&&M.userData.debugBox&&We(M)}),!na(d)||!na(f))return;let g=new Gr(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),y=new lt({color:255,transparent:!0,opacity:.5}),v=new ue(g,y);v.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),v.userData.debugBox=!0;let x=new Gr(f.max.x-f.min.x,f.max.y-f.min.y,f.max.z-f.min.z),b=new lt({color:"cyan",transparent:!0,opacity:.5}),C=new ue(x,b);C.position.set((f.min.x+f.max.x)/2,(f.min.y+f.max.y)/2,(f.min.z+f.max.z)/2),C.userData.debugBox=!0,c.add(v),l.add(C)}let p=N(this,sr,N7).call(this,c,l,i.getThreeCamera(),i.container);if(p!==-1)return p},Es=new WeakMap;var Yo=new K,A7=new ie;function pv(r,t,e=new zv){return r.traverse(i=>{if(i instanceof ue){let o=i.geometry.attributes.position;if(t.position.distanceTo(i.position)<t.near)return;for(let c=0;c<o.count;c++)Yo.fromBufferAttribute(o,c),Yo.applyMatrix4(i.matrixWorld),Yo.applyMatrix4(t.matrixWorldInverse),Yo.applyMatrix4(t.projectionMatrix),Yo.z<1&&Yo.z>0&&(A7.set(Yo.x,Yo.y),e.expandByPoint(A7))}}),e}function F7(r,t){let e=t.clientWidth,i=t.clientHeight;return new ie((r.x+1)*e/2,(1-r.y)*i/2)}function B7(r,t,e){let i=document.createElement("div");i.style.position="absolute",i.style.border="2px solid ".concat(t),i.style.pointerEvents="none";let n=F7(new ie(r.min.x,r.min.y),e),o=F7(new ie(r.max.x,r.max.y),e);i.style.left="".concat(n.x,"px"),i.style.top="".concat(o.y,"px");let a=Math.abs(o.x-n.x),c=Math.abs(o.y-n.y);return i.style.width="".concat(a,"px"),i.style.height="".concat(c,"px"),e.appendChild(i),i}m();m();function TN(r,t){return"".concat(t," ").concat(r)}var Nt=class extends Error{constructor(t,e=Iv){super(TN(t,e)),this.name="MappedinError"}};var vc,Pd=class{constructor(t,e,i,n){u(this,"id");u(this,"externalId");u(this,"name");u(this,"type");u(this,"floorIds");u(this,"defaultFloorId");u(this,"floorObjects",[]);u(this,"floorObjectsByElevation",new Map);u(this,"metadata");u(this,"containerId");u(this,"facade");u(this,"renderer");S(this,vc);var a;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(a=t.floors)!=null?a:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=i;let o=i.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=o.id.toString(),this.facade=n}get defaultFloor(){if(s(this,vc)==null){if(this.floorObjects.length===0)throw new Nt("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),I(this,vc,t)}return s(this,vc)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){O.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(n=>{this.renderer.setState(n.spaceId,{visible:t})})}};vc=new WeakMap;m();function V7(r,t,e,i){let n={outdoorOpacity:1,floorStates:[]},o=r.sort((d,f)=>d.elevation-f.elevation),a=Math.min(0,o[0].elevation),c=o[o.length-1].elevation,l,p;for(let d=a;d<=c;d++){let f=o.find(b=>b.elevation===d);if(f==null){d>=0&&(l==null?l=d:p=d);continue}let g=0,y=d<0?Math.abs(f.elevation)*e:e,v=!1;if(l===0&&p!=null){let b=e*p;g=-b,y=b,v=!0}else if(l!=null&&p!=null){let b=l,C=r.find(P=>P.elevation===b-1),M=n.floorStates.find(P=>P.floor===C);if(M){let P=e*(p-l+2);M.state.footprint={...M.state.footprint,altitude:0,height:P,visible:!0}}}l=void 0,p=void 0;let x={floor:f,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};n.floorStates.push(x),f.id===t.id?(x.state.visible=!0,x.state.geometry.visible=!0,x.state.labels.enabled=!0,x.state.markers.enabled=!0,x.state.occlusion.enabled=!0,(f.elevation<0||v)&&(f.elevation<0&&(n.outdoorOpacity=.2),x.state.footprint.height=y,x.state.footprint.altitude=g,x.state.footprint.visible=!0)):i.includes(f.id)&&f.elevation<t.elevation?(x.state.visible=!0,x.state.geometry.visible=!0,x.state.markers.enabled=!0,x.state.occlusion.enabled=!0,x.state.footprint.visible=!0,f.elevation<0?(x.state.footprint.height=y,x.state.footprint.altitude=g,n.outdoorOpacity=.2):(x.state.footprint.height=y,x.state.footprint.altitude=g)):t.elevation>0&&f.elevation<t.elevation&&f.elevation>=0&&(x.state.visible=!0,x.state.footprint.visible=!0,x.state.footprint.height=e,x.state.footprint.altitude=g)}return n}var MN={linear:rt.Linear.None,easeIn:rt.Quadratic.In,easeOut:rt.Quadratic.Out,easeInOut:rt.Quadratic.InOut},qi,wd=class extends oe{constructor(e,i,n,o){var p,d,f,g;super();u(this,"floorStacksById",new Map);u(this,"floorsById",new Map);u(this,"currentFloorId","");u(this,"currentFloorStackId","");u(this,"outdoorFloorStacks",new Set);u(this,"id");u(this,"renderer");u(this,"api");u(this,"mvf");u(this,"options",{});u(this,"styleMap");u(this,"StackedMaps");u(this,"animations",new Map);u(this,"Models",{add:(e,i,n)=>{let{floorId:o,scale:a,...c}=n,l=o?this.floorsById.get(o):this.currentFloor,p={...c};a!=null&&(p.scale=Array.isArray(n.scale)?n.scale:[n.scale,n.scale,n.scale]);let d=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(f=>{var g;return{type:"Feature",properties:{id:De(),rotation:n.rotation,scale:p.scale,interactive:n.interactive,verticalOffset:f.verticalOffset+((g=n.verticalOffset)!=null?g:0)},geometry:{type:"Point",coordinates:_r(f)}}})},p,{parent:l.id});if(d==null)throw new Nt("error creating model");return this.renderer.getState(d).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});u(this,"Images",{add:(e,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...c}=n,l=o?this.floorsById.get(o):this.currentFloor,p={type:"Feature",properties:c,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(De(),p,{url:i,flipImageToFaceCamera:a!=null?a:!1},l.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});u(this,"Markers",{add:(e,i,n)=>{let o=Cb(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:a,...c}=n,l=c;c.rank==="initial"&&(l.rank="medium");let p=o.layers.get(Li),d=this.renderer.addMarker2D(_r(e),i,{...l,occluderId:o==null?void 0:o.occluderId,attachTo:a},p==null?void 0:p.containerId);if(!d)throw new Nt("Failed to create Marker");return d},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(e,i,n)=>{var c;let o=this.renderer.getState(e),a=n?this.floorsById.get(n):this.currentFloor;if(!o){O.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(o.type!=="marker"){O.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:(c=a==null?void 0:a.layers.get(Li))==null?void 0:c.containerId})},animateTo:(e,i,n,o)=>{let a=this.renderer.getState(e),c=n?this.floorsById.get(n):this.currentFloor;if(!a)return O.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(a.type!=="marker")return O.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(e);let p=new nr({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(MN[l.easing]).onUpdate(({lon:d,lat:f})=>{var y;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let v=(y=c==null?void 0:c.layers.get(Li))==null?void 0:y.containerId;v&&this.Markers.setPosition(e,[d,f],v)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(e,p),xb(p).then(()=>{this.animations.delete(e)})}});u(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});u(this,"Shapes",{add:(e,i,n)=>{let o=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,a=De();return this.renderer.addGeometryGroup(a,e,i,o.id),a},remove:e=>(this.renderer.remove(e.id),e.id)});u(this,"Text3D",{label:(e,i,n)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){O.warn("Enterprise mode is not enabled, skipping label creation");return}let o=j7(this.renderer,e,i,n);if(o)return{textInfo:o,target:e}},labelAll:(e={})=>{var o;if(!((o=this.api.getMapDataInternal())!=null&&o.enterpriseMode))return O.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let n=[];return i.getByType("space").forEach(a=>{var c,l;if(a.locations[0]){let p=j7(this.renderer,a,(l=(c=a.locations[0])==null?void 0:c.name)!=null?l:a.name,e);p&&n.push({textInfo:p,target:a})}}),n},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){O.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});u(this,"Labels",{all:({onCreate:e,labelOptions:i={}})=>{for(let n of Object.entries(this.mvf.space)){let[o,a]=n;a&&a.features.forEach(c=>{var x,b,C,M,P;let l=(x=this.api.getMapData())==null?void 0:x.getById("space",c.properties.id);if(!l)return;let p=(b=this.styleMap[c.properties.id])==null?void 0:b.showImage,d=(C=c.properties.details)==null?void 0:C.images,g={marker:{...p&&((M=d==null?void 0:d[0])!=null&&M.url)?{icon:d[0].url}:{},...(P=i.appearance)==null?void 0:P.marker},...i.appearance},v=(o?this.floorsById.get(o):this.currentFloor).layers.get(yn);if(c.properties.center&&l.name!==""){let w=this.renderer.addLabel2D(c.properties.center,l.name,{id:c.properties.id+"-label",...i,appearance:g,rank:i.rank,attachTo:Ml(l)},vt.is(l)?l.id:v==null?void 0:v.containerId);w&&e(w.id,l.name,l)}})}},add:(e,i,n={})=>{let{attachTo:o,...a}=n,c=Cb(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),l=c.layers.get(yn),p=this.renderer.addLabel2D(_r(e),i,{...a,occluderId:c.occluderId,attachTo:o},l==null?void 0:l.containerId);if(!p)throw new Nt("label creating failed");return p},remove:({entityId:e})=>{this.renderer.remove(e)},removeAll:()=>{}});u(this,"Paths",{add:(e,i)=>{var p;let n=(p=i==null?void 0:i.animateDrawing)!=null?p:!0,o=[],a=e[0].floorId||"root",c=0;for(let d of e){let{floorId:f="root",latitude:g,longitude:y}=d;f!==a&&(c++,a=f),o[c]==null&&o.push({floorId:f,coordinates:[]});let v=f===d.floorId?d:new ae({longitude:y,latitude:g,floorId:f});o[c].coordinates.push(v)}let l=o.reduce((d,{floorId:f,coordinates:g},y)=>{if(y!==0){let x=o[y-1],b=x.coordinates[x.coordinates.length-1],C=g[0],M=_r(b),P=_r(C),w=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:x.floorId},geometry:{type:"Point",coordinates:M}},{type:"Feature",properties:{parentId:f},geometry:{type:"Point",coordinates:P}}]},i,this.id);w&&(i!=null&&i.animateDrawing&&this.renderer.setState(w.id,{completeFraction:0}),d.push({...w,coordinates:[b,C]}))}let v=this.renderer.addPath({type:"FeatureCollection",features:g.map(x=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:_r(x)}}))},i,f);return v&&(i!=null&&i.animateDrawing&&this.renderer.setState(v.id,{completeFraction:0}),d.push({...v,coordinates:g})),d},[]);if(n){let d=[],f=this.api.getMapData();return l.forEach(g=>{var v;let y=O5(g,f,this.api);d.push(new nr({fraction:0}).to({fraction:1},y===!1?0:(v=i==null?void 0:i.drawDuration)!=null?v:1500).onUpdate(x=>{this.renderer.setState(g.id,{completeFraction:x.fraction})}))}),d.forEach((g,y)=>{y<d.length-1&&g.chain(d[y+1]),this.renderer.getTweenGroup().add(g)}),d[0].start(),this.renderer.render(),this.animations.set(l[0].id.toString(),d[0]),{paths:l,animation:xb(d[d.length-1]).then(()=>{this.animations.delete(l[0].id.toString())})}}else return{paths:l,animation:Promise.resolve()}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});S(this,qi,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=o.core,this.api=o,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=n!=null?n:{},this.StackedMaps=new vd({currentMapGetter:()=>this}),this.mvf=(p=i==null?void 0:i.mvf)!=null?p:{};let a=w5(this.mvf["styles.json"]||{});if(this.styleMap=a,I(this,qi,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...n==null?void 0:n.multiFloorView}),!i){this.id!=="outdoors-container"&&O.warn("Map (".concat(this.id,") created with no data."));let y=new Pd({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(y.id,y),this.currentFloorStackId=y.id;let v=new bd(y.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,s(this,qi),n!=null?n:{});y.addFloor(v),this.floorsById.set(v.id,v),this.setFloor(v.id);return}let c=i.getMVFFeatureByType("floor-stack");if(c==null||c.length===0)throw new Nt("MVF does not contain any Floor Stacks.");for(let y of c){let v=new Pd(y,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[y.id]);if(v.floorIds.length!==0){for(let x of v.floorIds){let b=i.getMVFFeatureById("floor",x);if(b!=null){let C=this.mvf.space[b.id],M=this.mvf.obstruction[b.id];if((C==null||C.features.length===0)&&(M==null||M.features.length===0))continue;let P=new bd(v.id,b,this.renderer,s(this,qi),n!=null?n:{},this.mvf,a,i);v.addFloor(P),this.floorsById.set(P.id,P)}}this.floorStacksById.set(y.id,v),this.currentFloorStackId||(this.currentFloorStackId=y.id)}}for(let[y]of Object.entries(i.facadesBySpaceId)){let v=i.getById("space",y);v&&(this.outdoorFloorStacks.add(v.floor.floorStack.id),(f=this.floorsById.get(v.floor.id))==null||f.setVisible(!0))}let l=(g=this.mvf.enterprise)==null?void 0:g.venue.defaultMap;if(n!=null&&n.initialFloor){let y=hp(n.initialFloor);y&&this.floorsById.has(y)?l=y:O.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);if(!e)throw new Nt('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return e}setFloorStack(e,i){if(this.currentFloorStackId===e)return;let n=this.floorStacksById.get(e);if(n==null){O.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(n.floorObjects.length===0){O.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(n.defaultFloor.id,i)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);if(!e)throw new Nt('Floor with id "'.concat(this.currentFloorId,'" not found'));return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var o,a,c,l,p;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let i=this.floorsById.get(e),n=this.floorStacksById.get(this.currentFloorStackId);if(i&&n)if(!((o=s(this,qi))!=null&&o.enabled)||i.floorStackId!==(n==null?void 0:n.id))for(let d of this.floorStacksById.values())d.floorObjects.forEach(f=>{f.id!==e&&f.setVisible(!1)});else{let d=V7(this.currentFloorStack.floorObjects,i,s(this,qi).floorHeight,((c=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:c.map(f=>f.id))||[]);(p=(l=this.api)==null?void 0:l.Outdoor)==null||p.setOpacity(d.outdoorOpacity),d.floorStates.forEach(f=>{f.floor&&this.api.updateState(f.floor.id,f.state)}),s(this,qi).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*s(this,qi).floorHeight)}}setFloor(e,i){if(this.currentFloorId===e)return;if(!this.floorsById.get(e)){O.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let o=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:o,floorId:e,reason:i}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(e),this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id,previousFloorId:o})}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};qi=new WeakMap;function j7(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}m();var ci,Ed,Dd=class{constructor({currentMapGetter:t}){S(this,ci,new Map);S(this,Ed);I(this,Ed,t)}get currentMap(){return s(this,Ed).call(this)}getById(t){return s(this,ci).get(t)}add(t,e,i){let n=t.anchorTarget;if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Markers.add(n,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1,attachTo:Ml(t)});if(a==null)throw new Error("error creating marker");let c=o.Markers.getContentEl(a.id.toString());if(!c)throw new Error("marker component should exist");let l=new Fn(a.id.toString(),c,t);return s(this,ci).set(l.id,{marker:l,entityId:a.id.toString()}),l}remove(t){var i;let e=s(this,ci).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),s(this,ci).delete(t.id.toString()))}removeAll(){let t=[];return s(this,ci).forEach(({marker:e})=>{this.remove(e),t.push(e),s(this,ci).delete(e.id.toString())}),t}setPosition(t,e){var a;let i=e.anchorTarget;if(!i){O.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){O.error("Cannot determine the current map.");return}let o=s(this,ci).get(t.id);if(!o){O.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}n.Markers.setPosition(o.entityId,_r(i),(a=i.floorId)!=null?a:n.currentFloorId),o.marker.updateTarget(e)}animateTo(t,e,i){var c;let n=e.anchorTarget;if(!n)return O.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return O.error("Cannot determine the current map."),Promise.resolve();let a=s(this,ci).get(t.id);return a?(a.marker.updateTarget(e),o.Markers.animateTo(a.entityId,_r(n),(c=n.floorId)!=null?c:o.currentFloorId,i)):(O.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};ci=new WeakMap,Ed=new WeakMap;m();var Un,Od,_d=class{constructor({currentMapGetter:t}){S(this,Un,new Map);S(this,Od);I(this,Od,t)}get currentMap(){return s(this,Od).call(this)}getById(t){return s(this,Un).get(t)}add(t,e,i){var l;let n=t.anchorTarget;if(!n)throw new Error("Target does not implement IAnchorable.");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Images.add(_r(n),e,{...i,floorId:n.floorId,verticalOffset:n.verticalOffset+((l=i.verticalOffset)!=null?l:0)});if(!a)throw new Error("image component should exist");let c=new id(a.id.toString(),e,t);return s(this,Un).set(c.id,{image:c,entityId:a.id.toString()}),c}remove(t){var i;let e=s(this,Un).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),s(this,Un).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Un).forEach(({image:e})=>{this.remove(e),t.push(e),s(this,Un).delete(e.id.toString())}),t}};Un=new WeakMap,Od=new WeakMap;m();var $i,kd,Ld=class{constructor({currentMapGetter:t}){S(this,$i,new Map);S(this,kd);I(this,kd,t)}get currentMap(){return s(this,kd).call(this)}getById(t){return s(this,$i).get(t)}add(t,e,i){let n=[t],o=n.reduce((l,p)=>{var d;return p?(l.has(p.floorId)||l.set(p.floorId,[]),(d=l.get(p.floorId))==null||d.push(p),l):(O.error("Cannot determine coordinate from options."),l)},new Map);if(!n.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let c=[];return o.forEach((l,p)=>{let d=De();a.Models.add(d,l,{...i,url:e,floorId:p}).forEach(({id:g})=>{let y=new Ts(g.toString(),d,l[0]);s(this,$i).set(y.id,{model:y,entityId:g.toString(),groupId:d}),c.push(y)})}),c[0]}remove(t){var i;let e=s(this,$i).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),s(this,$i).delete(t.id.toString()))}removeAll(){let t=[];return s(this,$i).forEach(({model:e})=>{var n;let i=s(this,$i).get(e.id);i&&(t.push(e),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),s(this,$i).delete(e.id.toString()))}),t}};$i=new WeakMap,kd=new WeakMap;m();var Ji,Fd,Ad=class{constructor({currentMapGetter:t}){S(this,Ji,new Map);S(this,Fd);I(this,Fd,t)}get currentMap(){return s(this,Fd).call(this)}getById(t){return s(this,Ji).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let n=i.Paths.add(t,e),o=n.paths.map(c=>c.id.toString()),a=new ni(De(),n.animation,t,n.paths);for(let c of o)s(this,Ji).set(c,{path:a,entityIds:o});return s(this,Ji).set(a.id,{path:a,entityIds:o}),a}remove(t){var i;let e=s(this,Ji).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),s(this,Ji).delete(t.id),e.entityIds.forEach(n=>s(this,Ji).delete(n)))}removeAll(){let t=[];return s(this,Ji).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Ji=new WeakMap,Fd=new WeakMap;m();var Q7=ra(i0(),1);m();var hv="#2266ff",IN="#808080",U7="#f5f5f5";var H7={radius:10,color:hv,inactiveColor:IN,heading:{color:hv,opacity:.7},accuracyRing:{color:hv,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};m();var W7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var z7=(r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=e/Math.tan(r/2),n=e/Math.sin(r/2),o=n+t,a=10,c=new gi;c.moveTo(-n*Math.sin(r/2),n*Math.cos(r/2)-i);for(let l=0;l<a;l++)c.lineTo(-(o*Math.sin(r/2-r/a*l)),o*Math.cos(r/2-r/a*l)-i);for(let l=0;l<a;l++)c.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/a*l)),e*Math.cos(Math.PI/-2+Math.PI/a*l));return new yi(c,{depth:.1,bevelEnabled:!1,UVGenerator:wN(t)})},fv=(r,t,e)=>{let n=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return n>1?n=1:n<0&&(n=0),new ie(0,n)},wN=r=>({generateTopUV:(t,e,i,n,o)=>{let a=e[i*3],c=e[i*3+1],l=e[n*3],p=e[n*3+1],d=e[o*3],f=e[o*3+1];return[fv(a,c,r),fv(l,p,r),fv(d,f,r)]},generateSideWallUV:()=>[new ie(0,1),new ie(0,1),new ie(0,1),new ie(0,1)]});function Z7(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}function DN([r,t],[e,i],[n,o]){let a=e-r,c=i-t,l=a**2+c**2;if(l===0)return;let p=((n-r)*a+(o-t)*c)/l,d;p<=0?d=[r,t]:p>=1?d=[e,i]:d=[r+p*a,t+p*c];let f=sh([n,o],d);return{proportion:Math.max(0,Math.min(1,p)),intersection:d,distance:f}}function X7(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,i,n=0,o=0;for(let a=0;a<r.length-1;a++){let c=r[a],l=r[a+1],p=DN(c,l,t);p!=null&&p.distance<e&&(e=p.distance,i=p.intersection,n=a,o=p.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:n,proportion:o}}function Y7(r,t){let e=new jr({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=z7(Math.PI/6,n,i);new Gs().load(W7,c=>{e.alphaMap=c,e.needsUpdate=!0});let a=new ue(o,e);return a.position.z=-.05,a.renderOrder=0,a}function q7(r,t){let e=new ih(1,1,.05,32),i=new jr({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),n=new ue(e,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}function $7(r){let t=new ih(.35,.35,.07,32),e=new jr({transparent:!0,color:U7,depthTest:!1,depthWrite:!1}),i=new ue(t,e);i.renderOrder=2;let n=new ih(.35*.8,.35*.8,.01,32),o=new jr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new ue(n,o);return a.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:i,innerMesh:a}}var eP=ra(J7(),1);var Ig="blue-dot",_s,Hn,Cr,Sr,Wn,Os,Ls,ks,it,lr,Bd,zn,Rd,Nd,Gd,Vd,Tg,Ki,Zn,Mg,As,jd,Qi,Cc=class extends oe{constructor(e,i){super();this.core=e;this.geoJSONApi=i;S(this,_s,null);u(this,"geometry");S(this,Hn);S(this,Cr);S(this,Sr);S(this,Wn);S(this,Os);S(this,Ls);S(this,ks);S(this,it,H7);S(this,lr,1);S(this,Bd);S(this,zn);u(this,"state","disabled");u(this,"following",!1);S(this,Rd,e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)});S(this,Nd,e=>{var n;let i;if(e!=null){let o=(n=this.geoJSONApi.currentMap)==null?void 0:n.currentFloorStack.floorObjectsByElevation.get(e);i=o?s(this,Rd).call(this,o.id):void 0}return i});S(this,Gd,e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,n,o,a]=e.children;if(s(this,Tg).call(this),n.scale.set(s(this,lr),s(this,lr),s(this,lr)),n.position.z=.07/2*s(this,lr),o.scale.set(s(this,lr),s(this,lr),s(this,lr)),o.position.z=.07*s(this,lr),this.state==="active"){o.material.color.set(s(this,it).color);let c=this.accuracy;c!=null?(i.visible=!0,s(this,Ls)&&s(this,Ls).stop(),I(this,Ls,new nr({scale:i.scale.x}).to({scale:c/2},150).onUpdate(({scale:p})=>{i.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(s(this,Ls))):i.visible=!1;let l=this.heading;if(l!=null){a.visible=!0,s(this,ks)&&s(this,ks).stop();let{start:p,end:d}=lh(a.rotation.z,-ge.degToRad(l));I(this,ks,new nr({rotation:p}).to({rotation:d},150).onUpdate(({rotation:f})=>{a.rotation.z=f}).start()),this.core.getTweenGroup().add(s(this,ks)),a.scale.set(s(this,lr),s(this,lr),1)}else a.visible=!1}else this.state==="inactive"&&(o.material.color.set(s(this,it).inactiveColor),a.visible=!1,i.visible=!1)});S(this,Vd,e=>{var a,c;let i;try{i=kN.parse(Z7(e,s(this,Cr)))}catch(l){s(this,Ki).call(this,"error"),O.error("BlueDot: Position parse failed",l instanceof E.ZodError?l.message:String(l)),this.publish("error");return}s(this,it).debug&&O.log("BlueDot: Parsed position",i),I(this,Sr,i),s(this,Ki).call(this,"position-update"),s(this,Wn)&&clearTimeout(s(this,Wn)),typeof s(this,it).timeout=="number"&&s(this,it).timeout<1/0&&I(this,Wn,setTimeout(()=>{s(this,it).debug&&O.log("BlueDot: Position timed out after ".concat(s(this,it).timeout,"ms")),s(this,Ki).call(this,"timeout"),this.core.render()},s(this,it).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(a=i.floor)==null?void 0:a.elevation,accuracy:i.accuracy}});let n=i.floor!=null?i.floor.id:"outdoors-container",o=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(Ig,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:o}},{setup:l=>{let p=q7(s(this,it).accuracyRing.color,s(this,it).accuracyRing.opacity),{outerMesh:d,innerMesh:f}=$7(s(this,it).color),g=Y7(s(this,it).heading.color,s(this,it).heading.opacity);l.add(p),p.visible=!1,l.add(d),l.add(f),l.add(g),g.visible=!1,s(this,Gd).call(this,l)},update:s(this,Gd)},{visible:!0,interactive:!0},n);else{let l=this.core.getState(this.geometry);o=[l.position[0],l.position[1]]}s(this,Os)&&s(this,Os).stop(),I(this,Os,new nr(o).to([i.longitude,i.latitude],1e3).easing(rt.Cubic.Out).onUpdate(l=>{if(this.geometry){let p={position:[l[0],l[1]]};p.parent=n,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(s(this,Os)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});u(this,"onPositionUpdate",e=>{var i,n,o,a,c;if(this.state!=="disabled"){try{LN.parse(e)}catch(l){s(this,Ki).call(this,"error"),O.error("BlueDot: Browser sent invalid position",l instanceof E.ZodError?l.message:String(l)),this.publish("error");return}I(this,Hn,{latitude:(i=e.coords)==null?void 0:i.latitude,longitude:(n=e.coords)==null?void 0:n.longitude,accuracy:(o=e.coords)==null?void 0:o.accuracy,heading:(a=e.coords)==null?void 0:a.heading,floor:s(this,Nd).call(this,(c=e.coords)==null?void 0:c.floorLevel)}),s(this,Vd).call(this,s(this,Hn))}});u(this,"onPositionError",e=>{var i;switch(s(this,Ki).call(this,"error"),e.code){case e.PERMISSION_DENIED:O.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:O.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:O.error("Geolocation request timed out.",e);break;default:O.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)});S(this,Tg,()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==s(this,Bd)){I(this,Bd,e);let n=(i=this.core.getMetresPerPixel())!=null?i:1;I(this,lr,Math.max(s(this,it).radius/(.35/n),1))}});S(this,Ki,e=>{let i=ON[this.state].actions[e];if(i){switch(s(this,it).debug&&O.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(e)),i){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==i&&(this.publish("state-change",{state:i,action:e}),this.state=i)}else O.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))});S(this,Zn);S(this,Mg,()=>{if(s(this,Zn)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(n=>n.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(n=>n.floorId===this.geoJSONApi.currentFloor.id);I(this,Zn,(0,eP.default)(i.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,Zn)});S(this,As,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),s(this,Qi)&&(this.off("position-update",s(this,Qi)),I(this,Qi,void 0)),this.following=!1,I(this,Zn,void 0),this.core.off("user-interaction-start",s(this,As)),this.geoJSONApi.currentMap.off("navigation-active-path-change",s(this,jd)),this.publish("follow-change",{following:!1})});S(this,jd,()=>{I(this,Zn,void 0)});S(this,Qi);u(this,"follow",(e,i)=>{var o,a,c,l;if(e===!1){s(this,As).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&O.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(o=i==null?void 0:i.zoomLevel)!=null?o:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(a=i==null?void 0:i.pitch)!=null?a:45,duration:(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?s(this,Qi)&&this.off("position-update",s(this,Qi)):(this.following=!0,this.core.on("user-interaction-start",s(this,As)),this.geoJSONApi.currentMap.on("navigation-active-path-change",s(this,jd))),I(this,Qi,p=>{let{coordinate:d,heading:f,floor:g}=p;if(n.center=[d.longitude,d.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),I(this,Zn,void 0)),e==="position-and-heading")n.bearing=f!=null?f:void 0;else if(e==="position-and-path-direction"){let y=s(this,Mg).call(this);if(y!=null){let v=X7(y,[d.longitude,d.latitude]);if(v!=null){let x=y[v.segmentIndex],b=y[v.segmentIndex+1];n.bearing=qv(x,b)}}}this.core.camera.animateTo(n)}),this.on("position-update",s(this,Qi)),this.publish("follow-change",{following:!0,mode:e})})}get heading(){var e;return(e=s(this,Sr))==null?void 0:e.heading}get accuracy(){var e;return(e=s(this,Sr))==null?void 0:e.accuracy}get coordinate(){var e,i;if(s(this,Sr)!=null)return(s(this,zn)==null||((e=this.floor)==null?void 0:e.id)!==s(this,zn).floorId||s(this,Sr).latitude!==s(this,zn).latitude||s(this,Sr).longitude!==s(this,zn).longitude)&&I(this,zn,new ae(s(this,Sr).latitude,s(this,Sr).longitude,(i=this.floor)==null?void 0:i.id)),s(this,zn)}get floor(){var e;return(e=s(this,Sr))==null?void 0:e.floor}enable(e){I(this,it,(0,Q7.default)({},e,s(this,it))),s(this,Ki).call(this,"enable"),this.watchDevicePosition(s(this,it).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),s(this,Wn)&&(clearTimeout(s(this,Wn)),I(this,Wn,void 0)),this.following&&s(this,As).call(this),this.watchDevicePosition(!1),I(this,Sr,void 0),I(this,Cr,void 0),s(this,Ki).call(this,"disable")}watchDevicePosition(e){if(s(this,_s)&&(navigator.geolocation.clearWatch(s(this,_s)),I(this,_s,null)),s(this,Hn)&&I(this,Hn,void 0),e){if(this.state==="disabled"){O.warn("BlueDot must be enabled before watching browser position.");return}I(this,_s,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var n,o;e==null?I(this,Cr,void 0):"coords"in e?I(this,Cr,Object.assign({},s(this,Cr),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:s(this,Nd).call(this,e.coords.floorLevel)})):(I(this,Cr,Object.assign({},s(this,Cr),e)),"floorOrFloorId"in e&&(s(this,Cr).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?s(this,Rd).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((n=s(this,Cr))==null?void 0:n.latitude)!=null&&((o=s(this,Cr))==null?void 0:o.longitude)!=null||s(this,Hn)!=null)&&s(this,Vd).call(this,s(this,Hn))}};_s=new WeakMap,Hn=new WeakMap,Cr=new WeakMap,Sr=new WeakMap,Wn=new WeakMap,Os=new WeakMap,Ls=new WeakMap,ks=new WeakMap,it=new WeakMap,lr=new WeakMap,Bd=new WeakMap,zn=new WeakMap,Rd=new WeakMap,Nd=new WeakMap,Gd=new WeakMap,Vd=new WeakMap,Tg=new WeakMap,Ki=new WeakMap,Zn=new WeakMap,Mg=new WeakMap,As=new WeakMap,jd=new WeakMap,Qi=new WeakMap;var ON={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"}}},LN=E.object({coords:E.object({latitude:E.number(),longitude:E.number(),accuracy:E.number(),altitude:E.number().optional().nullable(),altitudeAccuracy:E.number().optional().nullable(),heading:E.number().optional().nullable(),speed:E.number().optional().nullable(),floorLevel:E.number().optional().nullable()}),timestamp:E.number()}),kN=E.object({latitude:E.number(),longitude:E.number(),floor:E.custom().optional(),accuracy:E.number().optional(),heading:E.number().optional().nullable()});m();var Xn,Hd,Ud=class{constructor({currentMapGetter:t}){S(this,Xn,new Map);S(this,Hd);I(this,Hd,t)}get currentMap(){return s(this,Hd).call(this)}getById(t){return s(this,Xn).get(t)}add(t,e,i){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Shapes.add(t,e||{},{floorId:i==null?void 0:i.id}),a=new Wo(o);return s(this,Xn).set(a.id,a),a}remove(t){var i;s(this,Xn).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),s(this,Xn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Xn).forEach(e=>{this.remove(e),t.push(e.id),s(this,Xn).delete(e.id.toString())}),t}};Xn=new WeakMap,Hd=new WeakMap;m();var zd,Wd=class{constructor({currentMapGetter:t}){S(this,zd);I(this,zd,t)}get currentMap(){return s(this,zd).call(this)}setFromStyleCollection(t){var e,i,n,o;for(let a in t)for(let c of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[a]==null||!c.layers.has(et))continue;let l=c.layers.get(et);if(l!=null&&l.layers.has(a)&&"color"in t[a]){let f=l.layers.get(a);f&&((i=this.currentMap)==null||i.renderer.setState(f,{color:t[a].color}))}if(l&&a===yo&&!(Oi in t)){let f=l.layers.get(Oi);f&&"color"in t[a]&&((n=this.currentMap)==null||n.renderer.setState(f,{color:t[a].color}))}if(!c.layers.has(Ma))continue;let p=c.layers.get(Ma),d=c.facadesByStyleId.get(a);if(d&&d.length>0)for(let f of d){let g=p.layers.get("".concat(f,"-").concat(a));g&&"color"in t[a]&&((o=this.currentMap)==null||o.renderer.setState(g,{color:t[a].color}))}}}};zd=new WeakMap;m();var mv={opacity:1},Gt,Zd,Xd,Ko,Yn,Fs,gv,tP,Sc=class{constructor(t,e){S(this,Fs);S(this,Gt);S(this,Zd,[]);S(this,Xd,{opacity:"initial"});S(this,Ko,{opacity:new Map});S(this,Yn,new Set);I(this,Gt,t),I(this,Zd,e||[]);let i=s(this,Gt).map;i&&i.on("idle",()=>{s(this,Ko).opacity.size||N(this,Fs,gv).call(this,i)})}setStyle(t){var e,i;if(s(this,Gt).map){(e=s(this,Gt).map)==null||e.setStyle(t),s(this,Yn).size&&(s(this,Yn).clear(),this.hide()),N(this,Fs,tP).call(this),N(this,Fs,gv).call(this,s(this,Gt).map),this.setOpacity(s(this,Xd).opacity),(i=s(this,Gt).map)==null||i.moveLayer(jg);for(let[n,o,a]of s(this,Zd)||[])s(this,Gt).hideOutdoorLayersIntersectingPolygons(n,o,a)}}get map(){return s(this,Gt).map}get enabled(){return!!s(this,Gt).map}get visible(){return s(this,Yn).size===0}show(){let t=s(this,Gt).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{s(this,Yn).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),s(this,Yn).clear())}hide(t=[]){let e=s(this,Gt).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(n=>{let o=e.getLayoutProperty(n.id,"visibility");!t.includes(n.id)&&o!=="none"&&(e.setLayoutProperty(n.id,"visibility","none"),s(this,Yn).add(n.id))})}setOpacity(t,e=[]){var o,a;let i=s(this,Gt).map;if(!i)return;let n=(a=(o=s(this,Gt).map)==null?void 0:o.getStyle())==null?void 0:a.layers;n&&i.once("idle",()=>{n.forEach(c=>{let l=i.getLayoutProperty(c.id,"visibility");if(!e.includes(c.id)&&l!=="none")try{let p=s(this,Ko).opacity.get(c.id);p!==void 0&&(c.id==="background"||(c.type==="symbol"?(i.setPaintProperty(c.id,"icon-opacity",t==="initial"?p[0]:t),i.setPaintProperty(c.id,"text-opacity",t==="initial"?p[1]:t)):i.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?p[0]:t)),s(this,Xd).opacity=t)}catch(p){O.warn("Error setting opacity:",p)}})})}};Gt=new WeakMap,Zd=new WeakMap,Xd=new WeakMap,Ko=new WeakMap,Yn=new WeakMap,Fs=new WeakSet,gv=function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var o,a,c;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?s(this,Ko).opacity.set(i.id,[(o=t.getPaintProperty(i.id,"icon-opacity"))!=null?o:mv.opacity,(a=t.getPaintProperty(i.id,"text-opacity"))!=null?a:mv.opacity]):s(this,Ko).opacity.set(i.id,[(c=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?c:mv.opacity,void 0])))})},tP=function(){Object.values(s(this,Ko)).forEach(t=>t.clear())};m();function AN(){c0(!1)}var qn,$n,Qo,Pg=class{constructor({currentMapGetter:t}){S(this,qn);S(this,$n,new Map);S(this,Qo,new Map);I(this,qn,t)}labelAll(t={}){var n,o;let e=[],i=new Set;return(o=(n=s(this,qn).call(this))==null?void 0:n.Text3D.labelAll(t))==null||o.forEach(({textInfo:a,target:c})=>{let l=a.id.toString(),p=s(this,Qo).get(l);if(p){i.has(l)||e.push(p.text3DView),i.add(l);return}i.add(l);let d=new zo(l,c);s(this,$n).set(d.id,{targetId:c.id,text3d:l,text3DView:d}),s(this,Qo).set(l,{text3DView:d}),e.push(d)}),e}label(t,e,i={}){var o;if(s(this,qn).call(this))if(vt.is(t)){let a=(o=s(this,qn).call(this))==null?void 0:o.Text3D.label(t,e,i);if(!a)return;let c=a.textInfo.id.toString(),l=s(this,Qo).get(c);if(l)return l.text3DView;let p=new zo(c,a.target);return s(this,$n).set(p.id,{targetId:a.target.id,text3d:c,text3DView:p}),s(this,Qo).set(c,{text3DView:p}),p}else throw new Error("Non-space target is not supported")}remove(t){var n;let e=typeof t=="string"?t:t.id,i=s(this,$n).get(e);i&&((n=s(this,qn).call(this))==null||n.Text3D.remove(i.text3d),s(this,$n).delete(e),s(this,Qo).delete(i.text3d))}removeAll(){s(this,$n).forEach(t=>{var e;(e=s(this,qn).call(this))==null||e.Text3D.remove(t.text3d)}),s(this,$n).clear()}};qn=new WeakMap,$n=new WeakMap,Qo=new WeakMap;var wg=.05,Yd=class{constructor(t,e){u(this,"core");u(this,"mapObjects",[]);u(this,"id");u(this,"mapDataExternal",{});u(this,"mapsByFloorId",{});u(this,"mapData");u(this,"currentMap");u(this,"hiddenOutdoorGeometries",[]);u(this,"lastFacadeIntersected");u(this,"manualFloorVisibility",!1);u(this,"mapView");u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"Outdoor");u(this,"BlueDot");u(this,"Shapes");u(this,"Style");u(this,"Images");u(this,"update",()=>{this.core.render()});this.core=t,this.mapView=e,this.Camera=new hd(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new wd("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",l=>{this.mapView.publish("facades-in-view-change",{facades:l.map(p=>{var d;return(d=this.getMapDataInternal())==null?void 0:d.facadesById[p]}).filter(p=>p!=null)})});let n=new cd(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",n)});let o=l=>p=>{var B,_,A;let d=[],f=[],g=[],y=[];p.labels.forEach(F=>{let G=this.Labels.getById(F.toString());G&&d.push(G.label)}),p.markers.forEach(F=>{let G=this.Markers.getById(F.toString())||this.Navigation.getMarkerById(F.toString());G&&f.push(G.marker)}),p.models.forEach(F=>{let G=this.Models.getById(F.toString());G&&g.push(G.model)}),p.paths.forEach(F=>{let G=this.Paths.getById(F.toString())||this.Navigation.getPathById(F.toString());G&&y.push(G.path)});let v=p.geometry.includes(Ig),x=p.geometry.filter(F=>F!==Ig)[0],b;x&&(b=(B=this.getMapDataInternal())==null?void 0:B.getById("space",x)),b||(b=(_=this.getMapDataInternal())==null?void 0:_.getById("object",x));let C=p.containers.reduce((F,G)=>{var z;let R=(z=this.getMapDataInternal())==null?void 0:z.getById("floor",G);return R&&mr.is(R)&&F.push(R),F},[]),M,P=0;if(C.length>0){M=C[0].id;let F=this.core.getState(M);P=p.coordinate[2]?p.coordinate[2]-F.altitude:P}let w;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!1})}),b&&vt.is(b)&&(w=(A=this.getMapDataInternal())==null?void 0:A.facadesBySpaceId[x],w&&w.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!0})})),this.lastFacadeIntersected=w;let D={coordinate:new ae({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:M,verticalOffset:P}),spaces:b&&vt.is(b)?[b]:[],objects:b&&gr.is(b)?[b]:[],markers:f,labels:d,models:g,paths:y,blueDot:v,floors:C,facades:w?[w]:[]};"pointerEvent"in p&&(D.pointerEvent=p.pointerEvent),this.mapView.publish(l,D)};this.core.on("hover",o("hover")),this.core.on("click",o("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let a={currentMapGetter:()=>this.currentMap};this.Markers=new Dd(a),this.Models=new Ld(a),this.Labels=new gd(a),this.Text3D=new Pg(a),this.Exporter=new md(a),this.Paths=new Ad(a),this.Navigation=new ud(this.core,this,a.currentMapGetter),this.BlueDot=new Cc(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 Sc(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 _d(a),this.Shapes=new Ud(a),this.Style=new Wd(a);let c=new xg(e,this.mapDataExternal);this.auto=c.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(et);if(o){let a=o.layers.get(yo);a&&this.core.setState(a,vb(e,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(et);if(o){let a=o.layers.get(Oi);a&&this.core.setState(a,vb(e,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(et);if(o){let a=o.layers.get(ml);a&&this.core.setState(a,Ef(e,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(et);if(o){let a=o.layers.get(gl);a&&this.core.setState(a,Ef(e,this.core.getState(a)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(Uo.is(i))return this.core.setState(i.id,S5({...e,type:"label"},this.core.getState(i.id)));if(Fn.is(i))return this.core.setState(i.id,T5({...e,type:"marker"},this.core.getState(i.id)));if((vt.is(i)||gr.is(i))&&this.core.setState(i.id,M5({...e,type:"geometry"},this.core.getState(i.id))),Ei.is(i)&&this.core.setState(i.id,Ef({...e,type:"doors"},this.core.getState(i.id))),Wo.is(i)&&this.core.setState(i.id,ur(e,["altitude","color","opacity"])),Ts.is(i)){let{position:n,scale:o,...a}=e,c=a;n&&(c.position=[n.longitude,n.latitude,n.verticalOffset]),o!=null&&(Array.isArray(o)?c.scale=o:c.scale=[o,o,o]),n&&i.updateTarget(n),this.core.setState(i.id,c)}if(mr.is(i)){let n=this.currentMap.floorsById.get(i.id);if(n==null)return;this.core.setState(i.id,ur(e,["visible","altitude"]));let o=n.layers.get(et);o!=null&&"geometry"in e&&this.core.setState(o.containerId,ur(e.geometry,["opacity","visible"]));let a=n.layers.get(yn);a!=null&&"labels"in e&&"enabled"in e.labels&&typeof e.labels.enabled=="boolean"&&a.setVisible(e.labels.enabled);let c=n.layers.get(Li);c!=null&&"markers"in e&&"enabled"in e.markers&&typeof e.markers.enabled=="boolean"&&c.setVisible(e.markers.enabled);let l=n.layers.get(Sp);l!=null&&"footprint"in e&&this.core.setState(l.containerId,ur(e.footprint,["visible","height","opacity","side","color","altitude"]));let p=n.layers.get(yl);p!=null&&"occlusion"in e&&"enabled"in e.occlusion&&typeof e.occlusion.enabled=="boolean"&&p.setVisible(e.occlusion.enabled)}if(qr.is(i)){let n=this.core.getState(i.id);for(let o of n.children)o.type==="group-container"&&this.core.setState(o.id,ur(e,["opacity","visible"]))}if(zo.is(i)&&this.core.setState(i.id,ur(e,bm)),ni.is(i))for(let n of i.segments)this.core.setState(n.id,ur(e,["color","nearRadius","farRadius","visible","completeFraction"]));dc.is(i)&&this.core.setState(i.id,ur(e,["color"]))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Wc(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var f,g,y,v;let n;try{n=Wc(t)}catch(x){O.error("Error adding map",x),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ae(a[1],a[0])});let c=o["manifest.geojson"].features[0].properties.name,l=new wd("mapObject-".concat(c),n,e,this),p=this.core.getBoundingArea(l.currentFloor.id);p==null&&O.error("Could not determine bounding box for map:",l.currentFloor.id);let d=(g=(f=e==null?void 0:e.outdoorView)==null?void 0:f.layersHiddenByGeometry)!=null?g:[];if(d.length>0){let x,b=[];for(let C of l.floorStacksById.values())if(C.defaultFloor.footprint&&C.defaultFloor.footprint.geometry!=null&&((y=C.defaultFloor.footprint.geometry)==null?void 0:y.coordinates.length)>0){let M=C.defaultFloor.footprint,P=Of(M);x==null?x=P:E5(x,P),b.push(M)}b.length>0&&x!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(x,b,d),this.hiddenOutdoorGeometries.push([x,b,d]))}if(this.mapObjects.push(l),n.getMVFFeatureByType("floor").forEach(x=>{this.mapsByFloorId[x.id]=l}),l.on("navigation-connection-click",x=>{this.mapView.publish("navigation-connection-click",x)}),l.on("navigation-active-path-change",x=>{this.mapView.publish("navigation-active-path-change",x)}),l.StackedMaps.on("stacked-maps-state-change",({state:x})=>{this.mapView.publish("stacked-maps-state-change",{state:x})}),l.on("floor-change-start",x=>{var b,C,M,P;this.mapView.publish("floor-change-start",{reason:x.reason,floor:(C=(b=this.getMapDataInternal())==null?void 0:b.getById("floor",x.floorId))!=null?C:this.currentFloor,previousFloor:(P=(M=this.getMapDataInternal())==null?void 0:M.getById("floor",x.previousFloorId))!=null?P:this.currentFloor})}),l.on("floor-change",x=>{var b,C;this.mapView.publish("floor-change",{reason:x.reason,floor:this.currentFloor,previousFloor:(C=(b=this.getMapDataInternal())==null?void 0:b.getById("floor",x.previousFloorId))!=null?C:this.currentFloor})}),this.currentMap=l,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null)this.core.camera.setZoomLevel(e.zoomLevel),i(t);else if(this.core.mode!=="outdoors-overlay"&&p){let x=(v=e==null?void 0:e.screenOffsets)!=null?v:{top:wg*this.core.canvasHeight,left:wg*this.core.canvasWidth,right:wg*this.core.canvasWidth,bottom:wg*this.core.canvasHeight};this.core.camera.focusOn(p,{duration:o5,padding:x}).then(()=>{i(t)})}else i(t)})}setFloor(t,e){return this.currentMap.setFloor(hp(t),e)}setFloorStack(t,e){return this.currentMap.setFloorStack(hp(t),e)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Nt("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw new Nt("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw new Nt("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw new Nt("Missing currentFloor");return e}getState(t){var n,o,a,c,l,p,d,f,g,y,v,x,b,C,M,P,w,D,B,_;typeof t=="object"&&ni.is(t)&&O.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let e=D5(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:A,topColor:F,texture:G,topTexture:R,visible:z,height:W,opacity:j}=i;return{type:"walls",visible:z,color:A,topColor:F,texture:G?{url:G}:void 0,topTexture:R?{url:R}:void 0,height:W,opacity:j}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:A,topColor:F,texture:G,topTexture:R,visible:z,opacity:W}=i;return{type:"doors",visible:z,color:A,topColor:F,opacity:W,texture:G?{url:G}:void 0,topTexture:R?{url:R}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0,flipImageToFaceCamera:i.flipImageToFaceCamera,topColor:i.topColor};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let A=typeof i.parent=="object"?i.parent.id:i.parent,F=this.Markers.getById(i.id.toString()),G=F!=null&&F.marker.target?F==null?void 0:F.marker.target.anchorTarget:void 0;return G==null&&(G=new ae(i.position[1],i.position[0],A.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize,lowPriorityPin:i.options.lowPriorityPin}}else if(i.type==="model"){let A=i!=null&&typeof i.parent=="object"?i.parent.id.toString():(o=i.parent)==null?void 0:o.toString();return delete i.parent,{...i,position:new ae({latitude:i.position[1],longitude:i.position[0],verticalOffset:i.position[2],floorId:A}),type:"model"}}else{if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&Wo.is(t)){let[A]=i.children;if(A.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(a=i.altitude)!=null?a:0,visible:i.visible,color:i.color,height:A.height,opacity:i.opacity}}else{if(i.type==="path")return{type:"path",color:i.color,visible:i.visible,nearRadius:i.nearRadius,farRadius:i.farRadius,completeFraction:i.completeFraction};if(i.type==="group-container"&&typeof t!="string"&&mr.is(t)){let A=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(et),F=A?this.core.getState(A.containerId):void 0,G=(l=this.currentMap.floorsById.get(t.id))==null?void 0:l.layers.get(yn),R=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(Li),z=(d=this.currentMap.floorsById.get(t.id))==null?void 0:d.layers.get(Sp),W=z?this.core.getState(z.containerId):void 0,j=(f=this.currentMap.floorsById.get(t.id))==null?void 0:f.layers.get(yl),ee=j?this.core.getState(j.containerId):void 0;return{type:"floor",geometry:{opacity:(g=F==null?void 0:F.opacity)!=null?g:0,visible:(y=F==null?void 0:F.visible)!=null?y:!0},labels:{enabled:(v=G==null?void 0:G.visible)!=null?v:!1},markers:{enabled:(x=R==null?void 0:R.visible)!=null?x:!1},footprint:{altitude:(b=W==null?void 0:W.altitude)!=null?b:0,visible:(C=W==null?void 0:W.visible)!=null?C:!1,height:(M=W==null?void 0:W.height)!=null?M:0,opacity:(P=W==null?void 0:W.opacity)!=null?P:0,side:(w=W==null?void 0:W.side)!=null?w:"double",color:(D=W==null?void 0:W.color)!=null?D:"white"},occlusion:{enabled:(B=ee==null?void 0:ee.visible)!=null?B:!1},visible:i.visible,altitude:(_=i.altitude)!=null?_:0}}else if(i.type==="group-container"&&i.children.length>0&&typeof t!="string"&&qr.is(t)){let A=this.core.getState(i.children[0].id);return{type:"facade",opacity:A.opacity,visible:A.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,e,i){var l;if(i!=null){let p=this.core.projectScreenXYToCoordinate(t,e,!0);return p?new ae(p.coordinate[1],p.coordinate[0],i.id):void 0}let n=this.core.projectScreenXYToCoordinate(t,e);if(n==null||n.coordinate==null)return;let{coordinate:o,groupContainers:a}=n,c=(l=a==null?void 0:a.find(p=>{let d=p.userData.entityId.toString();return d.includes("f_")||d.includes("m_")}))==null?void 0:l.userData.entityId.toString();return new ae(o[1],o[0],c)}getScreenCoordinateFromCoordinate(t){return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let e=new nr(t);return this.core.getTweenGroup().add(e),this.core.render(),e}removeTween(t){this.core.getTweenGroup().remove(t)}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};function FN(r){l2("".concat(r,"/maplibre-worker.csp.js")),Ob("".concat(r,"/collision-worker.csp.js"))}m();m();var Dg=class{constructor(t){u(this,"state");u(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};m();var rP=E.object({environment:E.union([E.literal("basic"),E.literal(!1)]).optional(),text3d:E.object({hoverColor:E.string().optional()}).optional(),geometry:E.object({hoverColor:E.string().optional()}).optional(),backgroundColor:E.string().optional(),backgroundAlpha:E.number().optional()}).strict();m();var Eg=ra(Hb(),1);var iP=r=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(e=>r.startsWith(e)))return!0;let t=console.warn;return console.warn=()=>{},r==="white"||yv(r).some(e=>e<1)?!0:(console.warn=t,!1)},yv=r=>{let t=new Oe(r);return[t.r,t.g,t.b]},BN=r=>{let t=new Oe;return t.setRGB(r[0],r[1],r[2],rn),"#"+t.getHexString()},nP=(r,t)=>{let e=(0,Eg.default)({},r),i=(0,Eg.default)({},r,t),n=(o,a,c)=>{for(let l in a){let p=o[l],d=a[l];if(typeof d=="number"&&typeof p=="number")o[l]=p+(d-p)*c;else if(typeof d=="string"&&typeof p=="string"){if(iP(p)&&iP(d)){let f=yv(p),g=yv(d);f&&g?o[l]=BN([f[0]+(g[0]-f[0])*c,f[1]+(g[1]-f[1])*c,f[2]+(g[2]-f[2])*c]):O.warn('Color "'.concat(l,'" could not be animated!'))}}else typeof d=="object"&&d!==null&&typeof p=="object"&&p!==null?n(p,d,c):O.warn('Value "'.concat(l,'" could not be animated!'))}};return o=>{if(o=Math.min(Math.max(o,0),1),o===0)return r;if(o===1)return i;let a=(0,Eg.default)({},e);return n(a,t,o),a}};var qd,$,Jn,Tc=class extends oe{constructor(e){super();S(this,qd,{});S(this,$);S(this,Jn);u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Images");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"BlueDot");u(this,"Style");u(this,"Shapes");u(this,"Outdoor");u(this,"update",()=>{s(this,$).core.render()});u(this,"getDirections",(e,i,n)=>{var o;return(o=s(this,$).getMapData())==null?void 0:o.getDirections(e,i,n)});u(this,"getDirectionsMultiDestination",(e,i,n)=>{var o;return(o=s(this,$).getMapData())==null?void 0:o.getDirectionsMultiDestination(e,i,n)});u(this,"on",(e,i)=>{super.on(e,i)});u(this,"off",(e,i)=>{super.off(e,i)});u(this,"Debug");I(this,Jn,e);let i=new Yd(e,this);I(this,$,i),this.Camera=s(this,$).Camera,I(this,qd,s(this,$).mapDataExternal),this.Markers=s(this,$).Markers,this.Models=s(this,$).Models,this.Labels=s(this,$).Labels,this.Text3D=s(this,$).Text3D,this.Exporter=s(this,$).Exporter,this.Paths=s(this,$).Paths,this.Navigation=s(this,$).Navigation,this.BlueDot=s(this,$).BlueDot,this.Shapes=s(this,$).Shapes,this.Style=s(this,$).Style,this.auto=s(this,$).auto,this.Outdoor=s(this,$).Outdoor,this.Images=s(this,$).Images,s(this,Jn).container.dataset.version=T.env.npm_package_version,this.Debug=new Dg(s(this,$).core)}get StackedMaps(){return s(this,$).currentMap.StackedMaps}updateState(e,i){return s(this,$).updateState(e,i)}animateState(e,i,n){var p;let o=s(this,$).getState(e);if(o==null)return O.warn("Cannot animate state of ".concat(e,".")),new Promise(f=>f());let a=nP(o,i),c=s(this,$).tween({percent:0}).to({percent:1},(p=n==null?void 0:n.duration)!=null?p:1e3).onUpdate(({percent:d})=>{s(this,$).updateState(e,a(d))});n!=null&&n.easing&&n.easing in Ln&&c.easing(Ln[n.easing]);let l=new Promise(d=>{c.onComplete(()=>{s(this,$).removeTween(c),d()}).onStop(()=>{s(this,$).removeTween(c),d()}),c.start()});return l.cancel=()=>{c.stop(),s(this,$).updateState(e,a(0))},l}updateGlobalState(e){var i,n,o,a;try{rP.parse(e)}catch(c){O.error("updateGlobalState",c);return}if(typeof e=="object"){let c={};if((i=e.text3d)!=null&&i.hoverColor&&(c.text3dHoverColor=e.text3d.hoverColor),(n=e.geometry)!=null&&n.hoverColor&&(c.hoverColor=e.geometry.hoverColor),e.backgroundColor||e.backgroundAlpha!==void 0){let l=(o=e.backgroundColor)!=null?o:s(this,$).core.backgroundColor,p=(a=e.backgroundAlpha)!=null?a:s(this,$).core.backgroundAlpha;s(this,$).core.setBackgroundColor(l,p)}e.environment!=null&&s(this,$).core.setEnvironment(e.environment),s(this,$).core.setState(c)}}getGlobalState(){let e=s(this,$).core.getState();return{backgroundColor:s(this,$).core.backgroundColor,backgroundAlpha:s(this,$).core.backgroundAlpha,environment:s(this,$).core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return s(this,qd)}getDimensions(){return{width:s(this,Jn).canvasWidth,height:s(this,Jn).canvasHeight}}expand(e){var i;return(i=s(this,$).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=s(this,$).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return s(this,$).addMap(e,i)}setFloor(e,i){return s(this,$).setFloor(e,i==null?void 0:i.context)}setFloorStack(e,i){return s(this,$).setFloorStack(e,i==null?void 0:i.context)}tween(e){return s(this,$).tween(e)}removeTween(e){s(this,$).removeTween(e)}get currentFloorStack(){return s(this,$).currentFloorStack}get currentFloor(){return s(this,$).currentFloor}updateWatermark(e){s(this,$).updateWatermark(e)}getState(e){return s(this,$).getState(e)}setHoverColor(e){s(this,$).setHoverColor(e)}getHoverColor(){return s(this,$).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return s(this,$).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return s(this,$).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return s(this,$).isInView(e)}getDistance(e,i){var n;return(n=s(this,$).getMapData())==null?void 0:n.getDistance(e,i)}createCoordinate(e,i,n){return typeof e=="object"?new ae(e):new ae(e,i,n==null?void 0:n.id)}createCoordinateFromScreenCoordinate(e,i,n){return s(this,$).createCoordinateFromScreenCoordinate(e,i,n)}getScreenCoordinateFromCoordinate(e){return s(this,$).getScreenCoordinateFromCoordinate(e)}auto(){return{labels:this.Labels.all()}}get __core(){if(T.env.INTERNAL==="true")return s(this,$).core;throw new Error("__core is not available.")}clear(){s(this,$).clear()}destroy(){s(this,$).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-CC3UZQDZ.js");await new i(this,s(this,$)).enable(e)}async takeScreenshot(){return await s(this,Jn).renderSync(),s(this,Jn).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return s(this,$).manualFloorVisibility}set manualFloorVisibility(e){s(this,$).manualFloorVisibility=e}};qd=new WeakMap,$=new WeakMap,Jn=new WeakMap;m();m();var _g=class extends oe{constructor(e){super();u(this,"gl");u(this,"el",document.createElement("div"));u(this,"core");u(this,"origin");u(this,"map");u(this,"layer");u(this,"handleStyleChange",()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))});u(this,"handleMove",()=>{if(!this.map)return;let[e,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(e,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ge.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ge.degToRad(this.map.getPitch()))});u(this,"handleError",e=>{O.warn(e)});this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new Qu(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=a2.fromLngLat(this.origin,0);return this.layer=hh(i,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};var Bs,Mc,ea,Rs,Og=class Og extends oe{constructor(e,i,n){super();S(this,Bs);S(this,Mc);S(this,ea);S(this,Rs);u(this,"on",(e,i)=>{super.on(e,i)});u(this,"off",(e,i)=>{super.off(e,i)});I(this,Rs,new _g(e)),I(this,Bs,i),I(this,Mc,n)}onAdd(e){var o,a;let i=s(this,Rs).onAdd(e),n={...Ta,...(o=s(this,Mc))!=null?o:{},outdoorView:{token:s(this,Bs).outdoorViewToken,...(a=s(this,Mc))==null?void 0:a.outdoorView}};return I(this,ea,new Tc(s(this,Rs).core)),s(this,ea).addMap(s(this,Bs),n).then(()=>{this.publish("loaded",{mapView:s(this,ea),mapData:s(this,Bs)})}),i}onRemove(){s(this,ea)&&s(this,ea).clear(),Og.instance=null,s(this,Rs).onRemove()}};Bs=new WeakMap,Mc=new WeakMap,ea=new WeakMap,Rs=new WeakMap,u(Og,"instance");var Ic=Og;m();var RN=1e3*60*60*2,ta,wc,Ne,pi,ui,Br,di,Dc,Ec,Jd,je,oP,aP,Pc,Lg,bv,vv,xv,$d=class{constructor(t,e){S(this,je);S(this,ta,new oe);S(this,wc);S(this,Ne);S(this,pi);S(this,ui);S(this,Br);S(this,di);S(this,Dc);S(this,Ec);S(this,Jd,()=>{"key"in s(this,Ne)&&"secret"in s(this,Ne)&&N(this,je,Pc).call(this),N(this,je,Lg).call(this)});u(this,"on",(t,e)=>s(this,ta).on(t,e));u(this,"off",(t,e)=>s(this,ta).off(t,e));I(this,wc,t),I(this,Ne,e)}setMapIds(t){I(this,wc,t)}setEnterprise(t){s(this,Ne).enterprise=t}async readySync(){if((!("key"in s(this,Ne))||!("secret"in s(this,Ne)))&&!("accessToken"in s(this,Ne))){O.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[N(this,je,Pc).call(this),null];s(this,Ne).enterprise||(t[1]=this.getSasTokensAsync());let[e,i]=await Promise.all(t);N(this,je,xv).call(this),N(this,je,bv).call(this,e),i!=null&&N(this,je,vv).call(this,i),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",s(this,Jd))}async refreshing(){let t=[];return s(this,pi)!=null&&t.push(s(this,pi)),s(this,ui)!=null&&t.push(s(this,ui)),Promise.all(t)}getAccessTokenAsync(){return N(this,je,Pc).call(this)}getSasTokensAsync(){return N(this,je,Lg).call(this)}getAccessToken(){return s(this,Br)==null?(O.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):s(this,Br)}getSasToken(t){return this.isEnterpriseMode()?(O.error("SAS tokens are not available in the enterprise mode!"),{token:""}):s(this,di)==null?(O.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in s(this,di).tokens?s(this,di).tokens[t]:(O.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=s(this,Ne).enterprise)!=null?t:!1}destroy(){N(this,je,xv).call(this),s(this,ta).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",s(this,Jd))}};ta=new WeakMap,wc=new WeakMap,Ne=new WeakMap,pi=new WeakMap,ui=new WeakMap,Br=new WeakMap,di=new WeakMap,Dc=new WeakMap,Ec=new WeakMap,Jd=new WeakMap,je=new WeakSet,oP=function(t){var i;let e=t.token!==((i=s(this,Br))==null?void 0:i.token);I(this,Br,t),e&&s(this,ta).publish("access-token-refreshed",{accessToken:t})},aP=function(t){var i;let e=JSON.stringify(t.tokens)!==JSON.stringify((i=s(this,di))==null?void 0:i.tokens);I(this,di,t),e&&s(this,ta).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},Pc=async function(t=!1){var e;if("accessToken"in s(this,Ne)&&typeof s(this,Ne).accessToken=="string"){let i={token:s(this,Ne).accessToken,expires:Date.now()+72e5};return I(this,Br,i),i}if(!("key"in s(this,Ne))||!("secret"in s(this,Ne))||typeof s(this,Ne).key!="string"||typeof s(this,Ne).secret!="string")throw new Error("No API keys or access token provided!");return s(this,pi)!=null?s(this,pi):s(this,Br)!=null&&s(this,Br).expires!=null&&s(this,Br).expires>Date.now()&&!t?s(this,Br):(I(this,pi,zc({...s(this,Ne),key:s(this,Ne).key,secret:s(this,Ne).secret},(e=s(this,Ne).enterprise)!=null?e:!1).then(i=>{let n={token:i.accessToken,expires:i.expiresTimestamp*1e3};return N(this,je,oP).call(this,n),n})),s(this,pi).finally(()=>{I(this,pi,void 0)}),s(this,pi))},Lg=async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:s(this,ui)!=null?s(this,ui):s(this,di)!=null&&s(this,di).expires>Date.now()&&!t?s(this,di):(I(this,ui,new Promise((e,i)=>{N(this,je,Pc).call(this).then(n=>{let o={},a=s(this,wc).map(c=>Xg({...s(this,Ne),mapId:c},n.token).then(l=>{o[c]={token:l.token,expires:l.expires}}).catch(l=>{O.error("Error getting SAS token for map ".concat(c,":"),l)}));Promise.all(a).then(()=>{let c={tokens:o,expires:Math.min(...Object.values(o).map(l=>{var p;return(p=l.expires)!=null?p:1/0}))};N(this,je,aP).call(this,c),e(c)})}).catch(n=>{i(n)})})),s(this,ui).catch(e=>{throw e}).finally(()=>{I(this,ui,void 0)}),s(this,ui))},bv=function(t){if(!("key"in s(this,Ne))||!("secret"in s(this,Ne)))return;let e=t.expires!=null?t.expires-Date.now():RN;isFinite(e)&&I(this,Dc,setTimeout(()=>{N(this,je,Pc).call(this,!0).then(i=>{N(this,je,bv).call(this,i)})},e-N2))},vv=function(t){let e=t.expires-Date.now();isFinite(e)&&I(this,Ec,setTimeout(()=>{N(this,je,Lg).call(this,!0).then(i=>{N(this,je,vv).call(this,i)})},e-j2))},xv=function(){s(this,Dc)!=null&&clearTimeout(s(this,Dc)),s(this,Ec)!=null&&clearTimeout(s(this,Ec))};m();var sP=(r,{id:t}={})=>{let e=Array.isArray(r)?r:[r];if(!e.every(o=>typeof o=="string"))return;let i=e.join(""),n=null;if(t){let o=document.getElementById(t);o instanceof HTMLStyleElement&&(n=o)}n==null&&(n=document.createElement("style")),t&&t!==""&&(n.id=t),n.textContent=i,document.head.appendChild(n)};var lP=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var cP='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var pP=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var uP=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var dP=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var hP='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var WN=[lP,cP,pP,uP,dP,hP],fP;function Rde(r){fP=r}var Nde=async(r,t)=>{let e,i=ca();t&&i.updateByUserOption(t);try{t&&(e=(await zc({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(a){O.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new Bl(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new gh(n)},mP=!1;function Gde(r){mP=r}var Vde=async(r,t)=>{var g,y,v,x;let e={...t||{}},i,n=ca();n.updateByUserOption(e);let o={};if("type"in r&&typeof r.type=="string"){if(o.enterprise=(g=r.options)==null?void 0:g.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let b=await vh(r.main);i=bh(b),o.languagePacks=[];for(let C of(y=r.languagePacks)!=null?y:[])C.localePack instanceof Uint8Array&&o.languagePacks.push({language:C.language,localePack:await Js(C.localePack)})}else if(r.type==="json")i=r.main,o.languagePacks=(v=r.languagePacks)!=null?v:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(o.binaryBundle=r.main)}else i=r,o.enterprise=i.enterprise!=null;let a=Kg(i),c=a.length>0?a:[e.mapId],l=new $d(c,{...e,enterprise:o.enterprise}),p;if("accessToken"in e)p=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=n.getBaseAuthUri(o.enterprise);let b=await l.getAccessTokenAsync();p=(b==null?void 0:b.token)||""}o.outdoorViewToken=p,o.env=n,o.getMapDataOptions=e;try{await l.readySync()}catch(b){O.error("Failed to ready token manager!",b)}let d=new Bl(i,o);p&&d.Analytics.init({accessToken:p,mapId:e.mapId,key:"key"in e?e.key:void 0,secret:"secret"in e?e.secret:void 0,...e.analytics,baseUri:n.getAnalyticsBaseUri(),context:(x=e.analytics)==null?void 0:x.context});let f=new gh(d);if("language"in e)try{await f.changeLanguage(e.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),f},zN=async r=>{var b;let t=mP,e,i=ca();i.updateByUserOption(r);let n={...r},o=new $d([n.mapId],n);if("accessToken"in n){e=n.accessToken;let{aud:C,sub:M}=ah(e);(s5.some(P=>C.includes(P))||M&&M.startsWith("client"))&&(t=!0,o.setEnterprise(t))}else if("key"in n&&"secret"in n)n.key.startsWith("mik_")||(t=!0,o.setEnterprise(t)),n.baseAuthUri=i.getBaseAuthUri(t),e=(await o.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");n.layoutId!=null&&(t?n.layoutId!=="draft"&&O.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):O.warn("layoutId is currently unsupported!")),n.baseUri=i.getBaseUri(t);let a=performance.now(),c,l;if(t){let C={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"},M=await $g(C);c=M.compressed,l=M.localePacks}else c=await Jg(n,e);let p=performance.now(),d=await vh(c),f=bh(d),g=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(f);let y=Kg(f);y.length>0?o.setMapIds(y):o.setMapIds([n.mapId]);try{await o.readySync()}catch(C){O.error("Failed to ready token manager!",C)}let v=new Bl(f,{env:i,outdoorViewToken:e,tokenManager:o,enterprise:t,localePacksUrls:l,binaryBundle:c,getMapDataOptions:n}),x=new gh(v,{search:r.search});if(v.Analytics.init({accessToken:e,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(b=n.analytics)==null?void 0:b.context}),v.Analytics.sendGetMapDataEvent({parseDuration:g-p,downloadDuration:p-a,viewId:n.viewId}),"language"in n)try{await x.changeLanguage(n.language)}catch{}return x},jde=zN,Ude=(r,t)=>{Ic.instance!=null&&O.warn("Only a single map venue is supported at this time.");let e=new Ic([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Ic.instance=e,e},ZN=async(r,t,e)=>{var p,d,f,g,y,v,x,b,C,M,P,w,D;let i=performance.now(),n=tb(e,t);n&&eb(n),((p=n.injectStyles)==null||p)&&sP(WN,{id:"mappedin__styles"});let o=l5((d=t.outdoorViewToken)!=null?d:""),a=Wc(t);(f=n.outdoorView)!=null&&f.style&&a.envControl.updateTileServerBaseUrl((g=n.outdoorView)==null?void 0:g.style);let c=await C7(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(y=n.style)==null?void 0:y.backgroundAlpha,backgroundColor:(v=n.style)==null?void 0:v.backgroundColor,outdoorView:(x=n.outdoorView)!=null&&x.token?{headers:{"x-mappedin-tiles-key":(b=n.outdoorView)==null?void 0:b.token},style:t.getEnv().tileServerUri,enabled:!!((C=n.outdoorView)!=null&&C.enabled),lowDpi:(M=n.outdoorView)==null?void 0:M.lowDpi}:void 0,watermark:{...n.watermark,visible:((P=n.watermark)==null?void 0:P.visible)||!a.enterpriseMode&&!o.remove_watermark,onClick:fP||void 0},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((w=n.antialiasing)!=null&&w.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(D=n.occlusion)==null?void 0:D.enabled,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:n.imagePlacementOptions,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:n.onWebGLContextRestored,onWebGLRendererError:n.onWebGLRendererError}),l=new Tc(c);return await l.addMap(t,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},Hde=ZN;export{ae as a,po as b,ma as c,ya as d,ho as e,Ei as f,vt as g,mr as h,LD as i,Ia as j,gr as k,mo as l,go as m,Tf as n,qr as o,gn as p,Mf as q,hb as r,bh as s,vh as t,E as u,Cl as v,If as w,i0 as x,fT as y,XM as z,cN as A,Lf as B,kf as C,AN as D,FN as E,Rde as F,Nde as G,Gde as H,Vde as I,zN as J,jde as K,Ude as L,ZN as M,Hde as N};
|