@mappedin/react-sdk 6.0.1-beta.23 → 6.0.1-beta.25
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 +55 -1
- package/lib/esm/GLTFExporter-P25FPTJF.js +1 -0
- package/lib/esm/GLTFLoader-2IV5BF7Z.js +1 -0
- package/lib/esm/browser-XQ5347KZ.js +1 -0
- package/lib/esm/chunk-23O3CSSY.js +1 -0
- package/lib/esm/chunk-GXJVVNTN.js +1 -0
- package/lib/esm/chunk-GXSN3IIM.js +1 -0
- package/lib/esm/chunk-J5IUISYU.js +1 -0
- package/lib/esm/chunk-JGWQFDEC.js +1 -0
- package/lib/esm/chunk-SXU2GBLV.js +1 -0
- package/lib/esm/chunk-UOA2IGIA.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +1511 -452
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-TLP7SW7I.js +1 -0
- package/lib/esm/internal-55777EMI.css +1 -0
- package/lib/esm/internal-AHUPGYIQ.js +1 -0
- package/lib/esm/outdoor-context-v4-KP4UBYI7.js +1 -0
- package/lib/esm/roboto-regular-V36DLM4S.js +1 -0
- package/lib/esm/text3d-2WIVFRJX.js +1 -0
- package/package.json +2 -2
- package/lib/esm/GLTFExporter-NAC5AOBR.js +0 -1
- package/lib/esm/GLTFLoader-DS2TN3AV.js +0 -1
- package/lib/esm/browser-7PYC6B4T.js +0 -1
- package/lib/esm/chunk-2ZAO5EG6.js +0 -1
- package/lib/esm/chunk-6JX55RII.js +0 -1
- package/lib/esm/chunk-DJMNLKJ5.js +0 -1
- package/lib/esm/chunk-FFK6S6NZ.js +0 -1
- package/lib/esm/chunk-OCVOMAWQ.js +0 -1
- package/lib/esm/inspector-FGBD6IFK.js +0 -1
- package/lib/esm/internal-C3WM3KGI.css +0 -1
- package/lib/esm/internal-DYMZQK6Q.js +0 -1
- package/lib/esm/outdoor-context-v4-5ZQPPV2K.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as ri,B as qm,C as ec,D as p3,E as d3,F as Md,G as Qa,a as Jl,b as ue,c as K2,d as Sr,e as ei,f as ti,g as Me,h as Zm,i as e3,j as Ja,k as Io,l as t3,m as Ka,n as r3,o as i3,p as zm,q as Cd,r as Sd,s as n3,t as o3,u as a3,v as Td,w as s3,x as l3,y as c3,z as u3}from"./chunk-UOA2IGIA.js";import{j as Q2}from"./chunk-JGWQFDEC.js";import{a as ii}from"./chunk-GXJVVNTN.js";import{A as re,Aa as X2,Ba as $r,Ca as Jr,Da as Y2,E as k2,Ea as Z2,F as F2,Fa as z2,G as B2,H as J,Ha as Kr,I as Ni,J as R2,K as Dn,L as Za,M as Gi,N as we,P as qt,Pa as $a,Q as Kl,R as N2,S as Te,Sa as xd,T as yd,Ta as q2,V as Ql,W as G2,X as Ym,Xa as $2,Y as V2,Z as Cr,_a as Qr,a as md,ab as J2,b as _2,c as O2,d as Bi,da as j2,e as qr,ea as H2,fa as za,ka as U2,n as L2,na as gd,o as A2,oa as qa,pa as vd,ra as Po,w as Ri,xa as W2,ya as _n,z as ve,za as bd}from"./chunk-23O3CSSY.js";import{a as m,b as T}from"./chunk-SXU2GBLV.js";import{a as u,c as V,d as D2,e as $l,f as d,g as s,h as S,i as P,j}from"./chunk-J5IUISYU.js";var cx=V((Xy,Yy)=>{m();(function(r,t){typeof Xy=="object"&&typeof Yy<"u"?Yy.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(Xy,function(){"use strict";function r(b,x,I,w,E){u(function _(O,F,G,N,H){for(;N>G;){if(N-G>600){var Y=N-G+1,le=F-G+1,ye=Math.log(Y),Ie=.5*Math.exp(2*ye/3),Oe=.5*Math.sqrt(ye*Ie*(Y-Ie)/Y)*(le-Y/2<0?-1:1),qe=Math.max(G,Math.floor(F-le*Ie/Y+Oe)),Yt=Math.min(N,Math.floor(F+(Y-le)*Ie/Y+Oe));_(O,F,qe,Yt,H)}var Le=O[F],$e=G,He=N;for(t(O,G,F),H(O[N],Le)>0&&t(O,G,N);$e<He;){for(t(O,$e,He),$e++,He--;H(O[$e],Le)<0;)$e++;for(;H(O[He],Le)>0;)He--}H(O[G],Le)===0?t(O,G,He):t(O,++He,N),He<=F&&(G=He+1),F<=He&&(N=He-1)}},"t")(b,x,I||0,w||b.length-1,E||e)}u(r,"t");function t(b,x,I){var w=b[x];b[x]=b[I],b[I]=w}u(t,"i");function e(b,x){return b<x?-1:b>x?1:0}u(e,"n");var i=u(function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function n(b,x,I){if(!I)return x.indexOf(b);for(var w=0;w<x.length;w++)if(I(b,x[w]))return w;return-1}u(n,"e");function o(b,x){a(b,0,b.children.length,x,b)}u(o,"a");function a(b,x,I,w,E){E||(E=C(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var _=x;_<I;_++){var O=b.children[_];l(E,b.leaf?w(O):O)}return E}u(a,"h");function l(b,x){return b.minX=Math.min(b.minX,x.minX),b.minY=Math.min(b.minY,x.minY),b.maxX=Math.max(b.maxX,x.maxX),b.maxY=Math.max(b.maxY,x.maxY),b}u(l,"o");function c(b,x){return b.minX-x.minX}u(c,"s");function p(b,x){return b.minY-x.minY}u(p,"l");function h(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}u(h,"f");function y(b){return b.maxX-b.minX+(b.maxY-b.minY)}u(y,"u");function g(b,x){return b.minX<=x.minX&&b.minY<=x.minY&&x.maxX<=b.maxX&&x.maxY<=b.maxY}u(g,"m");function v(b,x){return x.minX<=b.maxX&&x.minY<=b.maxY&&x.maxX>=b.minX&&x.maxY>=b.minY}u(v,"c");function C(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}u(C,"p");function M(b,x,I,w,E){for(var _=[x,I];_.length;)if(!((I=_.pop())-(x=_.pop())<=w)){var O=x+Math.ceil((I-x)/w/2)*w;r(b,O,x,I,E),_.push(x,O,O,I)}}return u(M,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var x=this.data,I=[];if(!v(b,x))return I;for(var w=this.toBBox,E=[];x;){for(var _=0;_<x.children.length;_++){var O=x.children[_],F=x.leaf?w(O):O;v(b,F)&&(x.leaf?I.push(O):g(b,F)?this._all(O,I):E.push(O))}x=E.pop()}return I},i.prototype.collides=function(b){var x=this.data;if(!v(b,x))return!1;for(var I=[];x;){for(var w=0;w<x.children.length;w++){var E=x.children[w],_=x.leaf?this.toBBox(E):E;if(v(b,_)){if(x.leaf||g(b,_))return!0;I.push(E)}}x=I.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var x=0;x<b.length;x++)this.insert(b[x]);return this}var I=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var w=this.data;this.data=I,I=w}this._insert(I,this.data.height-I.height-1,!0)}else this.data=I;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=C([]),this},i.prototype.remove=function(b,x){if(!b)return this;for(var I,w,E,_=this.data,O=this.toBBox(b),F=[],G=[];_||F.length;){if(_||(_=F.pop(),w=F[F.length-1],I=G.pop(),E=!0),_.leaf){var N=n(b,_.children,x);if(N!==-1)return _.children.splice(N,1),F.push(_),this._condense(F),this}E||_.leaf||!g(_,O)?w?(I++,_=w.children[I],E=!1):_=null:(F.push(_),G.push(I),I=0,w=_,_=_.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,x){return b.minX-x.minX},i.prototype.compareMinY=function(b,x){return b.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,x){for(var I=[];b;)b.leaf?x.push.apply(x,b.children):I.push.apply(I,b.children),b=I.pop();return x},i.prototype._build=function(b,x,I,w){var E,_=I-x+1,O=this._maxEntries;if(_<=O)return o(E=C(b.slice(x,I+1)),this.toBBox),E;w||(w=Math.ceil(Math.log(_)/Math.log(O)),O=Math.ceil(_/Math.pow(O,w-1))),(E=C([])).leaf=!1,E.height=w;var F=Math.ceil(_/O),G=F*Math.ceil(Math.sqrt(O));M(b,x,I,G,this.compareMinX);for(var N=x;N<=I;N+=G){var H=Math.min(N+G-1,I);M(b,N,H,F,this.compareMinY);for(var Y=N;Y<=H;Y+=F){var le=Math.min(Y+F-1,H);E.children.push(this._build(b,Y,le,w-1))}}return o(E,this.toBBox),E},i.prototype._chooseSubtree=function(b,x,I,w){for(;w.push(x),!x.leaf&&w.length-1!==I;){for(var E=1/0,_=1/0,O=void 0,F=0;F<x.children.length;F++){var G=x.children[F],N=h(G),H=(Y=b,le=G,(Math.max(le.maxX,Y.maxX)-Math.min(le.minX,Y.minX))*(Math.max(le.maxY,Y.maxY)-Math.min(le.minY,Y.minY))-N);H<_?(_=H,E=N<E?N:E,O=G):H===_&&N<E&&(E=N,O=G)}x=O||x.children[0]}var Y,le;return x},i.prototype._insert=function(b,x,I){var w=I?b:this.toBBox(b),E=[],_=this._chooseSubtree(w,this.data,x,E);for(_.children.push(b),l(_,w);x>=0&&E[x].children.length>this._maxEntries;)this._split(E,x),x--;this._adjustParentBBoxes(w,E,x)},i.prototype._split=function(b,x){var I=b[x],w=I.children.length,E=this._minEntries;this._chooseSplitAxis(I,E,w);var _=this._chooseSplitIndex(I,E,w),O=C(I.children.splice(_,I.children.length-_));O.height=I.height,O.leaf=I.leaf,o(I,this.toBBox),o(O,this.toBBox),x?b[x-1].children.push(O):this._splitRoot(I,O)},i.prototype._splitRoot=function(b,x){this.data=C([b,x]),this.data.height=b.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,x,I){for(var w,E,_,O,F,G,N,H=1/0,Y=1/0,le=x;le<=I-x;le++){var ye=a(b,0,le,this.toBBox),Ie=a(b,le,I,this.toBBox),Oe=(E=ye,_=Ie,O=void 0,F=void 0,G=void 0,N=void 0,O=Math.max(E.minX,_.minX),F=Math.max(E.minY,_.minY),G=Math.min(E.maxX,_.maxX),N=Math.min(E.maxY,_.maxY),Math.max(0,G-O)*Math.max(0,N-F)),qe=h(ye)+h(Ie);Oe<H?(H=Oe,w=le,Y=qe<Y?qe:Y):Oe===H&&qe<Y&&(Y=qe,w=le)}return w||I-x},i.prototype._chooseSplitAxis=function(b,x,I){var w=b.leaf?this.compareMinX:c,E=b.leaf?this.compareMinY:p;this._allDistMargin(b,x,I,w)<this._allDistMargin(b,x,I,E)&&b.children.sort(w)},i.prototype._allDistMargin=function(b,x,I,w){b.children.sort(w);for(var E=this.toBBox,_=a(b,0,x,E),O=a(b,I-x,I,E),F=y(_)+y(O),G=x;G<I-x;G++){var N=b.children[G];l(_,b.leaf?E(N):N),F+=y(_)}for(var H=I-x-1;H>=x;H--){var Y=b.children[H];l(O,b.leaf?E(Y):Y),F+=y(O)}return F},i.prototype._adjustParentBBoxes=function(b,x,I){for(var w=I;w>=0;w--)l(x[w],b)},i.prototype._condense=function(b){for(var x=b.length-1,I=void 0;x>=0;x--)b[x].children.length===0?x>0?(I=b[x-1].children).splice(I.indexOf(b[x]),1):this.clear():o(b[x],this.toBBox)},i})});var Jy=V($=>{"use strict";m();Object.defineProperty($,"__esModule",{value:!0});$.earthRadius=63710088e-1;$.factors={centimeters:$.earthRadius*100,centimetres:$.earthRadius*100,degrees:$.earthRadius/111325,feet:$.earthRadius*3.28084,inches:$.earthRadius*39.37,kilometers:$.earthRadius/1e3,kilometres:$.earthRadius/1e3,meters:$.earthRadius,metres:$.earthRadius,miles:$.earthRadius/1609.344,millimeters:$.earthRadius*1e3,millimetres:$.earthRadius*1e3,nauticalmiles:$.earthRadius/1852,radians:1,yards:$.earthRadius*1.0936};$.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/$.earthRadius,yards:1.0936133};$.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Hn(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}u(Hn,"feature");$.feature=Hn;function c9(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Zy(t).geometry;case"LineString":return qy(t).geometry;case"Polygon":return zy(t).geometry;case"MultiPoint":return px(t).geometry;case"MultiLineString":return ux(t).geometry;case"MultiPolygon":return dx(t).geometry;default:throw new Error(r+" is invalid")}}u(c9,"geometry");$.geometry=c9;function Zy(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(!Zd(r[0])||!Zd(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Hn(i,t,e)}u(Zy,"point");$.point=Zy;function u9(r,t,e){return e===void 0&&(e={}),zd(r.map(function(i){return Zy(i,t)}),e)}u(u9,"points");$.points=u9;function zy(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 l={type:"Polygon",coordinates:r};return Hn(l,t,e)}u(zy,"polygon");$.polygon=zy;function p9(r,t,e){return e===void 0&&(e={}),zd(r.map(function(i){return zy(i,t)}),e)}u(p9,"polygons");$.polygons=p9;function qy(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 Hn(i,t,e)}u(qy,"lineString");$.lineString=qy;function d9(r,t,e){return e===void 0&&(e={}),zd(r.map(function(i){return qy(i,t)}),e)}u(d9,"lineStrings");$.lineStrings=d9;function zd(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}u(zd,"featureCollection");$.featureCollection=zd;function ux(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return Hn(i,t,e)}u(ux,"multiLineString");$.multiLineString=ux;function px(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return Hn(i,t,e)}u(px,"multiPoint");$.multiPoint=px;function dx(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return Hn(i,t,e)}u(dx,"multiPolygon");$.multiPolygon=dx;function h9(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return Hn(i,t,e)}u(h9,"geometryCollection");$.geometryCollection=h9;function f9(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}u(f9,"round");$.round=f9;function hx(r,t){t===void 0&&(t="kilometers");var e=$.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}u(hx,"radiansToLength");$.radiansToLength=hx;function $y(r,t){t===void 0&&(t="kilometers");var e=$.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}u($y,"lengthToRadians");$.lengthToRadians=$y;function m9(r,t){return fx($y(r,t))}u(m9,"lengthToDegrees");$.lengthToDegrees=m9;function y9(r){var t=r%360;return t<0&&(t+=360),t}u(y9,"bearingToAzimuth");$.bearingToAzimuth=y9;function fx(r){var t=r%(2*Math.PI);return t*180/Math.PI}u(fx,"radiansToDegrees");$.radiansToDegrees=fx;function g9(r){var t=r%360;return t*Math.PI/180}u(g9,"degreesToRadians");$.degreesToRadians=g9;function v9(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 hx($y(r,t),e)}u(v9,"convertLength");$.convertLength=v9;function b9(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=$.areaFactors[t];if(!i)throw new Error("invalid original units");var n=$.areaFactors[e];if(!n)throw new Error("invalid final units");return r/i*n}u(b9,"convertArea");$.convertArea=b9;function Zd(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}u(Zd,"isNumber");$.isNumber=Zd;function x9(r){return!!r&&r.constructor===Object}u(x9,"isObject");$.isObject=x9;function C9(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(!Zd(t))throw new Error("bbox must only contain numbers")})}u(C9,"validateBBox");$.validateBBox=C9;function S9(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")}u(S9,"validateId");$.validateId=S9});var bx=V(Qe=>{"use strict";m();Object.defineProperty(Qe,"__esModule",{value:!0});var ct=Jy();function Ac(r,t,e){if(r!==null)for(var i,n,o,a,l,c,p,h=0,y=0,g,v=r.type,C=v==="FeatureCollection",M=v==="Feature",b=C?r.features.length:1,x=0;x<b;x++){p=C?r.features[x].geometry:M?r.geometry:r,g=p?p.type==="GeometryCollection":!1,l=g?p.geometries.length:1;for(var I=0;I<l;I++){var w=0,E=0;if(a=g?p.geometries[I]:p,a!==null){c=a.coordinates;var _=a.type;switch(h=e&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,y,x,w,E)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],y,x,w,E)===!1)return!1;y++,_==="MultiPoint"&&w++}_==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-h;n++){if(t(c[i][n],y,x,w,E)===!1)return!1;y++}_==="MultiLineString"&&w++,_==="Polygon"&&E++}_==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(E=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-h;o++){if(t(c[i][n][o],y,x,w,E)===!1)return!1;y++}E++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Ac(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}u(Ac,"coordEach");function T9(r,t,e,i){var n=e;return Ac(r,function(o,a,l,c,p){a===0&&e===void 0?n=o:n=t(n,o,a,l,c,p)},i),n}u(T9,"coordReduce");function mx(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}}u(mx,"propEach");function M9(r,t,e){var i=e;return mx(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}u(M9,"propReduce");function yx(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++);}u(yx,"featureEach");function P9(r,t,e){var i=e;return yx(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}u(P9,"featureReduce");function I9(r){var t=[];return Ac(r,function(e){t.push(e)}),t}u(I9,"coordAll");function Ky(r,t){var e,i,n,o,a,l,c,p,h,y,g=0,v=r.type==="FeatureCollection",C=r.type==="Feature",M=v?r.features.length:1;for(e=0;e<M;e++){for(l=v?r.features[e].geometry:C?r.geometry:r,p=v?r.features[e].properties:C?r.properties:{},h=v?r.features[e].bbox:C?r.bbox:void 0,y=v?r.features[e].id:C?r.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(t(null,g,p,h,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,p,h,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,p,h,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}u(Ky,"geomEach");function w9(r,t,e){var i=e;return Ky(r,function(n,o,a,l,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,l,c)}),i}u(w9,"geomReduce");function qd(r,t){Ky(r,function(e,i,n,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(ct.feature(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var h=e.coordinates[p],y={type:c,coordinates:h};if(t(ct.feature(y,n),i,p)===!1)return!1}})}u(qd,"flattenEach");function E9(r,t,e){var i=e;return qd(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}u(E9,"flattenReduce");function gx(r,t){qd(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,h=0;if(Ac(e,function(y,g,v,C,M){if(l===void 0||i>c||C>p||M>h){l=y,c=i,p=C,h=M,o=0;return}var b=ct.lineString([l,y],e.properties);if(t(b,i,n,M,o)===!1)return!1;o++,l=y})===!1)return!1}}})}u(gx,"segmentEach");function D9(r,t,e){var i=e,n=!1;return gx(r,function(o,a,l,c,p){n===!1&&e===void 0?i=o:i=t(i,o,a,l,c,p),n=!0}),i}u(D9,"segmentReduce");function vx(r,t){if(!r)throw new Error("geojson is required");qd(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 l=0;l<a.length;l++)if(t(ct.lineString(a[l],e.properties),i,n,l)===!1)return!1;break}}})}u(vx,"lineEach");function _9(r,t,e){var i=e;return vx(r,function(n,o,a,l){o===0&&e===void 0?i=n:i=t(i,n,o,a,l)}),i}u(_9,"lineReduce");function O9(r,t){if(t=t||{},!ct.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,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),ct.lineString([c[o],c[o+1]],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),ct.lineString([c[n][o],c[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),ct.lineString([c[i][o],c[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o-1),ct.lineString([c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}u(O9,"findSegment");function L9(r,t){if(t=t||{},!ct.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,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return ct.point(c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),ct.point(c[i],a,t);case"LineString":return o<0&&(o=c.length+o),ct.point(c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),ct.point(c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),ct.point(c[i][o],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),ct.point(c[i][n][o],a,t)}throw new Error("geojson is invalid")}u(L9,"findPoint");Qe.coordAll=I9;Qe.coordEach=Ac;Qe.coordReduce=T9;Qe.featureEach=yx;Qe.featureReduce=P9;Qe.findPoint=L9;Qe.findSegment=O9;Qe.flattenEach=qd;Qe.flattenReduce=E9;Qe.geomEach=Ky;Qe.geomReduce=w9;Qe.lineEach=vx;Qe.lineReduce=_9;Qe.propEach=mx;Qe.propReduce=M9;Qe.segmentEach=gx;Qe.segmentReduce=D9});var Qy=V((Oj,Cx)=>{"use strict";m();var xx=Object.prototype.toString;Cx.exports=u(function(t){var e=xx.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&xx.call(t.callee)==="[object Function]"),i},"isArguments")});var _x=V((kj,Dx)=>{"use strict";m();var Ex;Object.keys||(kc=Object.prototype.hasOwnProperty,eg=Object.prototype.toString,Sx=Qy(),tg=Object.prototype.propertyIsEnumerable,Tx=!tg.call({toString:null},"toString"),Mx=tg.call(function(){},"prototype"),Fc=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$d=u(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),Px={$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},Ix=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!Px["$"+r]&&kc.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{$d(window[r])}catch{return!0}}catch{return!0}return!1}(),wx=u(function(r){if(typeof window>"u"||!Ix)return $d(r);try{return $d(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),Ex=u(function(t){var e=t!==null&&typeof t=="object",i=eg.call(t)==="[object Function]",n=Sx(t),o=e&&eg.call(t)==="[object String]",a=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var l=Mx&&i;if(o&&t.length>0&&!kc.call(t,0))for(var c=0;c<t.length;++c)a.push(String(c));if(n&&t.length>0)for(var p=0;p<t.length;++p)a.push(String(p));else for(var h in t)!(l&&h==="prototype")&&kc.call(t,h)&&a.push(String(h));if(Tx)for(var y=wx(t),g=0;g<Fc.length;++g)!(y&&Fc[g]==="constructor")&&kc.call(t,Fc[g])&&a.push(Fc[g]);return a},"keys"));var kc,eg,Sx,tg,Tx,Mx,Fc,$d,Px,Ix,wx;Dx.exports=Ex});var Kd=V((Rj,Ax)=>{"use strict";m();var A9=Array.prototype.slice,k9=Qy(),Ox=Object.keys,Jd=Ox?u(function(t){return Ox(t)},"keys"):_x(),Lx=Object.keys;Jd.shim=u(function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=u(function(i){return k9(i)?Lx(A9.call(i)):Lx(i)},"keys"))}else Object.keys=Jd;return Object.keys||Jd},"shimObjectKeys");Ax.exports=Jd});var Fx=V((Vj,kx)=>{"use strict";m();kx.exports=Error});var Rx=V((Hj,Bx)=>{"use strict";m();Bx.exports=EvalError});var Gx=V((Wj,Nx)=>{"use strict";m();Nx.exports=RangeError});var jx=V((Yj,Vx)=>{"use strict";m();Vx.exports=ReferenceError});var rg=V((zj,Hx)=>{"use strict";m();Hx.exports=SyntaxError});var Ji=V(($j,Ux)=>{"use strict";m();Ux.exports=TypeError});var Xx=V((Kj,Wx)=>{"use strict";m();Wx.exports=URIError});var Bc=V((eH,Yx)=>{"use strict";m();Yx.exports=u(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[e]=n;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==n||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var Qd=V((iH,zx)=>{"use strict";m();var Zx=typeof Symbol<"u"&&Symbol,F9=Bc();zx.exports=u(function(){return typeof Zx!="function"||typeof Symbol!="function"||typeof Zx("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:F9()},"hasNativeSymbols")});var $x=V((aH,qx)=>{"use strict";m();var ig={__proto__:null,foo:{}},B9=Object;qx.exports=u(function(){return{__proto__:ig}.foo===ig.foo&&!(ig instanceof B9)},"hasProto")});var Qx=V((cH,Kx)=>{"use strict";m();var R9="Function.prototype.bind called on incompatible ",N9=Object.prototype.toString,G9=Math.max,V9="[object Function]",Jx=u(function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i},"concatty"),j9=u(function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},"slicy"),H9=u(function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e},"joiny");Kx.exports=u(function(t){var e=this;if(typeof e!="function"||N9.apply(e)!==V9)throw new TypeError(R9+e);for(var i=j9(arguments,1),n,o=u(function(){if(this instanceof n){var h=e.apply(this,Jx(i,arguments));return Object(h)===h?h:this}return e.apply(t,Jx(i,arguments))},"binder"),a=G9(0,e.length-i.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(n=Function("binder","return function ("+H9(l,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var p=u(function(){},"Empty");p.prototype=e.prototype,n.prototype=new p,p.prototype=null}return n},"bind")});var eh=V((dH,eC)=>{"use strict";m();var U9=Qx();eC.exports=Function.prototype.bind||U9});var ng=V((fH,tC)=>{"use strict";m();var W9=Function.prototype.call,X9=Object.prototype.hasOwnProperty,Y9=eh();tC.exports=Y9.call(W9,X9)});var Fr=V((yH,aC)=>{"use strict";m();var he,Z9=Fx(),z9=Rx(),q9=Gx(),$9=jx(),Ds=rg(),Es=Ji(),J9=Xx(),oC=Function,og=u(function(r){try{return oC('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Yo=Object.getOwnPropertyDescriptor;if(Yo)try{Yo({},"")}catch{Yo=null}var ag=u(function(){throw new Es},"throwTypeError"),K9=Yo?function(){try{return arguments.callee,ag}catch{try{return Yo(arguments,"callee").get}catch{return ag}}}():ag,Is=Qd()(),Q9=$x()(),at=Object.getPrototypeOf||(Q9?function(r){return r.__proto__}:null),ws={},eP=typeof Uint8Array>"u"||!at?he:at(Uint8Array),Zo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":Is&&at?at([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":ws,"%AsyncGenerator%":ws,"%AsyncGeneratorFunction%":ws,"%AsyncIteratorPrototype%":ws,"%Atomics%":typeof Atomics>"u"?he:Atomics,"%BigInt%":typeof BigInt>"u"?he:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?he:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?he:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?he:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Z9,"%eval%":eval,"%EvalError%":z9,"%Float32Array%":typeof Float32Array>"u"?he:Float32Array,"%Float64Array%":typeof Float64Array>"u"?he:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?he:FinalizationRegistry,"%Function%":oC,"%GeneratorFunction%":ws,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Is&&at?at(at([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Is||!at?he:at(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?he:Promise,"%Proxy%":typeof Proxy>"u"?he:Proxy,"%RangeError%":q9,"%ReferenceError%":$9,"%Reflect%":typeof Reflect>"u"?he:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?he:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Is||!at?he:at(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Is&&at?at(""[Symbol.iterator]()):he,"%Symbol%":Is?Symbol:he,"%SyntaxError%":Ds,"%ThrowTypeError%":K9,"%TypedArray%":eP,"%TypeError%":Es,"%Uint8Array%":typeof Uint8Array>"u"?he:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?he:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?he:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?he:Uint32Array,"%URIError%":J9,"%WeakMap%":typeof WeakMap>"u"?he:WeakMap,"%WeakRef%":typeof WeakRef>"u"?he:WeakRef,"%WeakSet%":typeof WeakSet>"u"?he:WeakSet};if(at)try{null.error}catch(r){rC=at(at(r)),Zo["%Error.prototype%"]=rC}var rC,tP=u(function r(t){var e;if(t==="%AsyncFunction%")e=og("async function () {}");else if(t==="%GeneratorFunction%")e=og("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=og("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&at&&(e=at(n.prototype))}return Zo[t]=e,e},"doEval"),iC={__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"]},Rc=eh(),th=ng(),rP=Rc.call(Function.call,Array.prototype.concat),iP=Rc.call(Function.apply,Array.prototype.splice),nC=Rc.call(Function.call,String.prototype.replace),rh=Rc.call(Function.call,String.prototype.slice),nP=Rc.call(Function.call,RegExp.prototype.exec),oP=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,aP=/\\(\\)?/g,sP=u(function(t){var e=rh(t,0,1),i=rh(t,-1);if(e==="%"&&i!=="%")throw new Ds("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ds("invalid intrinsic syntax, expected opening `%`");var n=[];return nC(t,oP,function(o,a,l,c){n[n.length]=l?nC(c,aP,"$1"):a||o}),n},"stringToPath"),lP=u(function(t,e){var i=t,n;if(th(iC,i)&&(n=iC[i],i="%"+n[0]+"%"),th(Zo,i)){var o=Zo[i];if(o===ws&&(o=tP(i)),typeof o>"u"&&!e)throw new Es("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Ds("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");aC.exports=u(function(t,e){if(typeof t!="string"||t.length===0)throw new Es("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Es('"allowMissing" argument must be a boolean');if(nP(/^%?[^%]*%?$/,t)===null)throw new Ds("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=sP(t),n=i.length>0?i[0]:"",o=lP("%"+n+"%",e),a=o.name,l=o.value,c=!1,p=o.alias;p&&(n=p[0],iP(i,rP([0,1],p)));for(var h=1,y=!0;h<i.length;h+=1){var g=i[h],v=rh(g,0,1),C=rh(g,-1);if((v==='"'||v==="'"||v==="`"||C==='"'||C==="'"||C==="`")&&v!==C)throw new Ds("property names with quotes must have matching quotes");if((g==="constructor"||!y)&&(c=!0),n+="."+g,a="%"+n+"%",th(Zo,a))l=Zo[a];else if(l!=null){if(!(g in l)){if(!e)throw new Es("base intrinsic for "+t+" exists, but the property is not available.");return}if(Yo&&h+1>=i.length){var M=Yo(l,g);y=!!M,y&&"get"in M&&!("originalValue"in M.get)?l=M.get:l=l[g]}else y=th(l,g),l=l[g];y&&!c&&(Zo[a]=l)}}return l},"GetIntrinsic")});var nh=V((bH,sC)=>{"use strict";m();var cP=Fr(),ih=cP("%Object.defineProperty%",!0)||!1;if(ih)try{ih({},"a",{value:1})}catch{ih=!1}sC.exports=ih});var ah=V((CH,lC)=>{"use strict";m();var uP=Fr(),oh=uP("%Object.getOwnPropertyDescriptor%",!0);if(oh)try{oh([],"length")}catch{oh=null}lC.exports=oh});var sh=V((TH,pC)=>{"use strict";m();var cC=nh(),pP=rg(),_s=Ji(),uC=ah();pC.exports=u(function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new _s("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new _s("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new _s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new _s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new _s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new _s("`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,l=arguments.length>6?arguments[6]:!1,c=!!uC&&uC(t,e);if(cC)cC(t,e,{configurable:a===null&&c?c.configurable:!a,enumerable:n===null&&c?c.enumerable:!n,value:i,writable:o===null&&c?c.writable:!o});else if(l||!n&&!o&&!a)t[e]=i;else throw new pP("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var lh=V((IH,hC)=>{"use strict";m();var sg=nh(),dC=u(function(){return!!sg},"hasPropertyDescriptors");dC.hasArrayLengthDefineBug=u(function(){if(!sg)return null;try{return sg([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");hC.exports=dC});var Un=V((DH,gC)=>{"use strict";m();var dP=Kd(),hP=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",fP=Object.prototype.toString,mP=Array.prototype.concat,fC=sh(),yP=u(function(r){return typeof r=="function"&&fP.call(r)==="[object Function]"},"isFunction"),mC=lh()(),gP=u(function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!yP(i)||!i())return}mC?fC(r,t,e,!0):fC(r,t,e)},"defineProperty"),yC=u(function(r,t){var e=arguments.length>2?arguments[2]:{},i=dP(t);hP&&(i=mP.call(i,Object.getOwnPropertySymbols(t)));for(var n=0;n<i.length;n+=1)gP(r,i[n],t[i[n]],e[i[n]])},"defineProperties");yC.supportsDescriptors=!!mC;gC.exports=yC});var SC=V((LH,CC)=>{"use strict";m();var vP=Fr(),vC=sh(),bP=lh()(),bC=ah(),xC=Ji(),xP=vP("%Math.floor%");CC.exports=u(function(t,e){if(typeof t!="function")throw new xC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||xP(e)!==e)throw new xC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&bC){var a=bC(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(bP?vC(t,"length",e,!0,!0):vC(t,"length",e)),t},"setFunctionLength")});var zo=V((FH,ch)=>{"use strict";m();var lg=eh(),uh=Fr(),CP=SC(),SP=Ji(),PC=uh("%Function.prototype.apply%"),IC=uh("%Function.prototype.call%"),wC=uh("%Reflect.apply%",!0)||lg.call(IC,PC),TC=nh(),TP=uh("%Math.max%");ch.exports=u(function(t){if(typeof t!="function")throw new SP("a function is required");var e=wC(lg,IC,arguments);return CP(e,1+TP(0,t.length-(arguments.length-1)),!0)},"callBind");var MC=u(function(){return wC(lg,PC,arguments)},"applyBind");TC?TC(ch.exports,"apply",{value:MC}):ch.exports.apply=MC});var Qt=V((NH,_C)=>{"use strict";m();var EC=Fr(),DC=zo(),MP=DC(EC("String.prototype.indexOf"));_C.exports=u(function(t,e){var i=EC(t,!!e);return typeof i=="function"&&MP(t,".prototype.")>-1?DC(i):i},"callBoundIntrinsic")});var cg=V((jH,FC)=>{"use strict";m();var PP=Kd(),AC=Bc()(),kC=Qt(),OC=Object,IP=kC("Array.prototype.push"),LC=kC("Object.prototype.propertyIsEnumerable"),wP=AC?Object.getOwnPropertySymbols:null;FC.exports=u(function(t,e){if(t==null)throw new TypeError("target must be an object");var i=OC(t);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=OC(arguments[n]),a=PP(o),l=AC&&(Object.getOwnPropertySymbols||wP);if(l)for(var c=l(o),p=0;p<c.length;++p){var h=c[p];LC(o,h)&&IP(a,h)}for(var y=0;y<a.length;++y){var g=a[y];if(LC(o,g)){var v=o[g];i[g]=v}}}return i},"assign")});var pg=V((WH,BC)=>{"use strict";m();var ug=cg(),EP=u(function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},i=0;i<t.length;++i)e[t[i]]=t[i];var n=Object.assign({},e),o="";for(var a in n)o+=a;return r!==o},"lacksProperEnumerationOrder"),DP=u(function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1},"assignHasPendingExceptions");BC.exports=u(function(){return!Object.assign||EP()||DP()?ug:Object.assign},"getPolyfill")});var NC=V((ZH,RC)=>{"use strict";m();var _P=Un(),OP=pg();RC.exports=u(function(){var t=OP();return _P(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t},"shimAssign")});var HC=V(($H,jC)=>{"use strict";m();var LP=Un(),AP=zo(),kP=cg(),GC=pg(),FP=NC(),BP=AP.apply(GC()),VC=u(function(t,e){return BP(Object,arguments)},"assign");LP(VC,{getPolyfill:GC,implementation:kP,shim:FP});jC.exports=VC});var WC=V((QH,UC)=>{"use strict";m();var Gc=u(function(){return typeof u(function(){},"f").name=="string"},"functionsHaveNames"),Nc=Object.getOwnPropertyDescriptor;if(Nc)try{Nc([],"length")}catch{Nc=null}Gc.functionsHaveConfigurableNames=u(function(){if(!Gc()||!Nc)return!1;var t=Nc(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var RP=Function.prototype.bind;Gc.boundFunctionsHaveNames=u(function(){return Gc()&&typeof RP=="function"&&u(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");UC.exports=Gc});var ZC=V((rU,YC)=>{"use strict";m();var XC=sh(),NP=lh()(),GP=WC().functionsHaveConfigurableNames(),VP=Ji();YC.exports=u(function(t,e){if(typeof t!="function")throw new VP("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||GP)&&(NP?XC(t,"name",e,!0,!0):XC(t,"name",e)),t},"setFunctionName")});var dg=V((oU,zC)=>{"use strict";m();var jP=ZC(),HP=Ji(),UP=Object;zC.exports=jP(u(function(){if(this==null||this!==UP(this))throw new HP("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var hg=V((lU,qC)=>{"use strict";m();var WP=dg(),XP=Un().supportsDescriptors,YP=Object.getOwnPropertyDescriptor;qC.exports=u(function(){if(XP&&/a/mig.flags==="gim"){var t=YP(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 WP},"getPolyfill")});var KC=V((pU,JC)=>{"use strict";m();var ZP=Un().supportsDescriptors,zP=hg(),qP=Object.getOwnPropertyDescriptor,$P=Object.defineProperty,JP=TypeError,$C=Object.getPrototypeOf,KP=/a/;JC.exports=u(function(){if(!ZP||!$C)throw new JP("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=zP(),e=$C(KP),i=qP(e,"flags");return(!i||i.get!==t)&&$P(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var r4=V((fU,t4)=>{"use strict";m();var QP=Un(),eI=zo(),tI=dg(),QC=hg(),rI=KC(),e4=eI(QC());QP(e4,{getPolyfill:QC,implementation:tI,shim:rI});t4.exports=e4});var Wn=V((yU,i4)=>{"use strict";m();var iI=Bc();i4.exports=u(function(){return iI()&&!!Symbol.toStringTag},"hasToStringTagShams")});var mg=V((bU,o4)=>{"use strict";m();var nI=Wn()(),oI=Qt(),fg=oI("Object.prototype.toString"),ph=u(function(t){return nI&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:fg(t)==="[object Arguments]"},"isArguments"),n4=u(function(t){return ph(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&fg(t)!=="[object Array]"&&fg(t.callee)==="[object Function]"},"isArguments"),aI=function(){return ph(arguments)}();ph.isLegacyArguments=n4;o4.exports=aI?ph:n4});var a4=V(()=>{m()});var I4=V((PU,P4)=>{m();var Pg=typeof Map=="function"&&Map.prototype,yg=Object.getOwnPropertyDescriptor&&Pg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hh=Pg&&yg&&typeof yg.get=="function"?yg.get:null,s4=Pg&&Map.prototype.forEach,Ig=typeof Set=="function"&&Set.prototype,gg=Object.getOwnPropertyDescriptor&&Ig?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,fh=Ig&&gg&&typeof gg.get=="function"?gg.get:null,l4=Ig&&Set.prototype.forEach,sI=typeof WeakMap=="function"&&WeakMap.prototype,jc=sI?WeakMap.prototype.has:null,lI=typeof WeakSet=="function"&&WeakSet.prototype,Hc=lI?WeakSet.prototype.has:null,cI=typeof WeakRef=="function"&&WeakRef.prototype,c4=cI?WeakRef.prototype.deref:null,uI=Boolean.prototype.valueOf,pI=Object.prototype.toString,dI=Function.prototype.toString,hI=String.prototype.match,wg=String.prototype.slice,Yn=String.prototype.replace,fI=String.prototype.toUpperCase,u4=String.prototype.toLowerCase,b4=RegExp.prototype.test,p4=Array.prototype.concat,pi=Array.prototype.join,mI=Array.prototype.slice,d4=Math.floor,xg=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vg=Object.getOwnPropertySymbols,Cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Os=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ut=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Os||!0)?Symbol.toStringTag:null,x4=Object.prototype.propertyIsEnumerable,h4=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function f4(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||b4.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-d4(-r):d4(r);if(i!==r){var n=String(i),o=wg.call(t,n.length+1);return Yn.call(n,e,"$&_")+"."+Yn.call(Yn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yn.call(t,e,"$&_")}u(f4,"addNumericSeparator");var Sg=a4(),m4=Sg.custom,y4=S4(m4)?m4:null;P4.exports=u(function r(t,e,i,n){var o=e||{};if(Xn(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Xn(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=Xn(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(Xn(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(Xn(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=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 M4(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?f4(t,c):c}if(typeof t=="bigint"){var p=String(t)+"n";return l?f4(t,p):p}var h=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=h&&h>0&&typeof t=="object")return Tg(t)?"[Array]":"[Object]";var y=AI(o,i);if(typeof n>"u")n=[];else if(T4(n,t)>=0)return"[Circular]";function g(ye,Ie,Oe){if(Ie&&(n=mI.call(n),n.push(Ie)),Oe){var qe={depth:o.depth};return Xn(o,"quoteStyle")&&(qe.quoteStyle=o.quoteStyle),r(ye,qe,i+1,n)}return r(ye,o,i+1,n)}if(u(g,"inspect"),typeof t=="function"&&!g4(t)){var v=MI(t),C=dh(t,g);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(C.length>0?" { "+pi.call(C,", ")+" }":"")}if(S4(t)){var M=Os?Yn.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Cg.call(t);return typeof t=="object"&&!Os?Vc(M):M}if(_I(t)){for(var b="<"+u4.call(String(t.nodeName)),x=t.attributes||[],I=0;I<x.length;I++)b+=" "+x[I].name+"="+C4(yI(x[I].value),"double",o);return b+=">",t.childNodes&&t.childNodes.length&&(b+="..."),b+="</"+u4.call(String(t.nodeName))+">",b}if(Tg(t)){if(t.length===0)return"[]";var w=dh(t,g);return y&&!LI(w)?"["+Mg(w,y)+"]":"[ "+pi.call(w,", ")+" ]"}if(vI(t)){var E=dh(t,g);return!("cause"in Error.prototype)&&"cause"in t&&!x4.call(t,"cause")?"{ ["+String(t)+"] "+pi.call(p4.call("[cause]: "+g(t.cause),E),", ")+" }":E.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+pi.call(E,", ")+" }"}if(typeof t=="object"&&a){if(y4&&typeof t[y4]=="function"&&Sg)return Sg(t,{depth:h-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(PI(t)){var _=[];return s4&&s4.call(t,function(ye,Ie){_.push(g(Ie,t,!0)+" => "+g(ye,t))}),v4("Map",hh.call(t),_,y)}if(EI(t)){var O=[];return l4&&l4.call(t,function(ye){O.push(g(ye,t))}),v4("Set",fh.call(t),O,y)}if(II(t))return bg("WeakMap");if(DI(t))return bg("WeakSet");if(wI(t))return bg("WeakRef");if(xI(t))return Vc(g(Number(t)));if(SI(t))return Vc(g(xg.call(t)));if(CI(t))return Vc(uI.call(t));if(bI(t))return Vc(g(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!gI(t)&&!g4(t)){var F=dh(t,g),G=h4?h4(t)===Object.prototype:t instanceof Object||t.constructor===Object,N=t instanceof Object?"":"null prototype",H=!G&&ut&&Object(t)===t&&ut in t?wg.call(Zn(t),8,-1):N?"Object":"",Y=G||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",le=Y+(H||N?"["+pi.call(p4.call([],H||[],N||[]),": ")+"] ":"");return F.length===0?le+"{}":y?le+"{"+Mg(F,y)+"}":le+"{ "+pi.call(F,", ")+" }"}return String(t)},"inspect_");function C4(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}u(C4,"wrapQuotes");function yI(r){return Yn.call(String(r),/"/g,""")}u(yI,"quote");function Tg(r){return Zn(r)==="[object Array]"&&(!ut||!(typeof r=="object"&&ut in r))}u(Tg,"isArray");function gI(r){return Zn(r)==="[object Date]"&&(!ut||!(typeof r=="object"&&ut in r))}u(gI,"isDate");function g4(r){return Zn(r)==="[object RegExp]"&&(!ut||!(typeof r=="object"&&ut in r))}u(g4,"isRegExp");function vI(r){return Zn(r)==="[object Error]"&&(!ut||!(typeof r=="object"&&ut in r))}u(vI,"isError");function bI(r){return Zn(r)==="[object String]"&&(!ut||!(typeof r=="object"&&ut in r))}u(bI,"isString");function xI(r){return Zn(r)==="[object Number]"&&(!ut||!(typeof r=="object"&&ut in r))}u(xI,"isNumber");function CI(r){return Zn(r)==="[object Boolean]"&&(!ut||!(typeof r=="object"&&ut in r))}u(CI,"isBoolean");function S4(r){if(Os)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Cg)return!1;try{return Cg.call(r),!0}catch{}return!1}u(S4,"isSymbol");function SI(r){if(!r||typeof r!="object"||!xg)return!1;try{return xg.call(r),!0}catch{}return!1}u(SI,"isBigInt");var TI=Object.prototype.hasOwnProperty||function(r){return r in this};function Xn(r,t){return TI.call(r,t)}u(Xn,"has");function Zn(r){return pI.call(r)}u(Zn,"toStr");function MI(r){if(r.name)return r.name;var t=hI.call(dI.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}u(MI,"nameOf");function T4(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}u(T4,"indexOf");function PI(r){if(!hh||!r||typeof r!="object")return!1;try{hh.call(r);try{fh.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}u(PI,"isMap");function II(r){if(!jc||!r||typeof r!="object")return!1;try{jc.call(r,jc);try{Hc.call(r,Hc)}catch{return!0}return r instanceof WeakMap}catch{}return!1}u(II,"isWeakMap");function wI(r){if(!c4||!r||typeof r!="object")return!1;try{return c4.call(r),!0}catch{}return!1}u(wI,"isWeakRef");function EI(r){if(!fh||!r||typeof r!="object")return!1;try{fh.call(r);try{hh.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}u(EI,"isSet");function DI(r){if(!Hc||!r||typeof r!="object")return!1;try{Hc.call(r,Hc);try{jc.call(r,jc)}catch{return!0}return r instanceof WeakSet}catch{}return!1}u(DI,"isWeakSet");function _I(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}u(_I,"isElement");function M4(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return M4(wg.call(r,0,t.maxStringLength),t)+i}var n=Yn.call(Yn.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,OI);return C4(n,"single",t)}u(M4,"inspectString");function OI(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":"")+fI.call(t.toString(16))}u(OI,"lowbyte");function Vc(r){return"Object("+r+")"}u(Vc,"markBoxed");function bg(r){return r+" { ? }"}u(bg,"weakCollectionOf");function v4(r,t,e,i){var n=i?Mg(e,i):pi.call(e,", ");return r+" ("+t+") {"+n+"}"}u(v4,"collectionOf");function LI(r){for(var t=0;t<r.length;t++)if(T4(r[t],"\n")>=0)return!1;return!0}u(LI,"singleLineValues");function AI(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=pi.call(Array(r.indent+1)," ");else return null;return{base:e,prev:pi.call(Array(t+1),e)}}u(AI,"getIndent");function Mg(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+pi.call(r,","+e)+"\n"+t.prev}u(Mg,"indentedJoin");function dh(r,t){var e=Tg(r),i=[];if(e){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=Xn(r,n)?t(r[n],r):""}var o=typeof vg=="function"?vg(r):[],a;if(Os){a={};for(var l=0;l<o.length;l++)a["$"+o[l]]=o[l]}for(var c in r)Xn(r,c)&&(e&&String(Number(c))===c&&c<r.length||Os&&a["$"+c]instanceof Symbol||(b4.call(/[^\w$]/,c)?i.push(t(c,r)+": "+t(r[c],r)):i.push(c+": "+t(r[c],r))));if(typeof vg=="function")for(var p=0;p<o.length;p++)x4.call(r,o[p])&&i.push("["+t(o[p])+"]: "+t(r[o[p]],r));return i}u(dh,"arrObjKeys")});var Dg=V((EU,E4)=>{"use strict";m();var w4=Fr(),Ls=Qt(),kI=I4(),FI=Ji(),mh=w4("%WeakMap%",!0),yh=w4("%Map%",!0),BI=Ls("WeakMap.prototype.get",!0),RI=Ls("WeakMap.prototype.set",!0),NI=Ls("WeakMap.prototype.has",!0),GI=Ls("Map.prototype.get",!0),VI=Ls("Map.prototype.set",!0),jI=Ls("Map.prototype.has",!0),Eg=u(function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),HI=u(function(r,t){var e=Eg(r,t);return e&&e.value},"listGet"),UI=u(function(r,t,e){var i=Eg(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},"listSet"),WI=u(function(r,t){return!!Eg(r,t)},"listHas");E4.exports=u(function(){var t,e,i,n={assert:function(o){if(!n.has(o))throw new FI("Side channel does not contain "+kI(o))},get:function(o){if(mh&&o&&(typeof o=="object"||typeof o=="function")){if(t)return BI(t,o)}else if(yh){if(e)return GI(e,o)}else if(i)return HI(i,o)},has:function(o){if(mh&&o&&(typeof o=="object"||typeof o=="function")){if(t)return NI(t,o)}else if(yh){if(e)return jI(e,o)}else if(i)return WI(i,o);return!1},set:function(o,a){mh&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new mh),RI(t,o,a)):yh?(e||(e=new yh),VI(e,o,a)):(i||(i={key:{},next:null}),UI(i,o,a))}};return n},"getSideChannel")});var _4=V((OU,D4)=>{"use strict";m();var XI=ng(),Uc=Dg()(),Ki=Ji(),_g={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ki("`O` is not an object");if(typeof t!="string")throw new Ki("`slot` must be a string");if(Uc.assert(r),!_g.has(r,t))throw new Ki("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ki("`O` is not an object");if(typeof t!="string")throw new Ki("`slot` must be a string");var e=Uc.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ki("`O` is not an object");if(typeof t!="string")throw new Ki("`slot` must be a string");var e=Uc.get(r);return!!e&&XI(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Ki("`O` is not an object");if(typeof t!="string")throw new Ki("`slot` must be a string");var i=Uc.get(r);i||(i={},Uc.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(_g);D4.exports=_g});var A4=V((AU,L4)=>{"use strict";m();var Wc=_4(),YI=SyntaxError,O4=typeof StopIteration=="object"?StopIteration:null;L4.exports=u(function(t){if(!O4)throw new YI("this environment lacks StopIteration");Wc.set(t,"[[Done]]",!1);var e={next:u(function(){var n=Wc.get(this,"[[Iterator]]"),o=Wc.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(Wc.set(n,"[[Done]]",!0),a!==O4)throw a;return{done:!0,value:void 0}}},"next")};return Wc.set(e,"[[Iterator]]",t),e},"getStopIterationIterator")});var Og=V((BU,k4)=>{m();var ZI={}.toString;k4.exports=Array.isArray||function(r){return ZI.call(r)=="[object Array]"}});var Lg=V((NU,F4)=>{"use strict";m();var zI=String.prototype.valueOf,qI=u(function(t){try{return zI.call(t),!0}catch{return!1}},"tryStringObject"),$I=Object.prototype.toString,JI="[object String]",KI=Wn()();F4.exports=u(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:KI?qI(t):$I.call(t)===JI},"isString")});var kg=V((jU,N4)=>{"use strict";m();var Ag=typeof Map=="function"&&Map.prototype?Map:null,QI=typeof Set=="function"&&Set.prototype?Set:null,gh;Ag||(gh=u(function(t){return!1},"isMap"));var R4=Ag?Map.prototype.has:null,B4=QI?Set.prototype.has:null;!gh&&!R4&&(gh=u(function(t){return!1},"isMap"));N4.exports=gh||u(function(t){if(!t||typeof t!="object")return!1;try{if(R4.call(t),B4)try{B4.call(t)}catch{return!0}return t instanceof Ag}catch{}return!1},"isMap")});var Bg=V((WU,j4)=>{"use strict";m();var ew=typeof Map=="function"&&Map.prototype?Map:null,Fg=typeof Set=="function"&&Set.prototype?Set:null,vh;Fg||(vh=u(function(t){return!1},"isSet"));var G4=ew?Map.prototype.has:null,V4=Fg?Set.prototype.has:null;!vh&&!V4&&(vh=u(function(t){return!1},"isSet"));j4.exports=vh||u(function(t){if(!t||typeof t!="object")return!1;try{if(V4.call(t),G4)try{G4.call(t)}catch{return!0}return t instanceof Fg}catch{}return!1},"isSet")});var Q4=V((ZU,Ch)=>{"use strict";m();var H4=mg(),U4=A4();Qd()()||Bc()()?(bh=Symbol.iterator,Ch.exports=u(function(t){if(t!=null&&typeof t[bh]<"u")return t[bh]();if(H4(t))return Array.prototype[bh].call(t)},"getIterator")):(W4=Og(),X4=Lg(),Rg=Fr(),Y4=Rg("%Map%",!0),Z4=Rg("%Set%",!0),yr=Qt(),Ng=yr("Array.prototype.push"),Gg=yr("String.prototype.charCodeAt"),z4=yr("String.prototype.slice"),q4=u(function(t,e){var i=t.length;if(e+1>=i)return e+1;var n=Gg(t,e);if(n<55296||n>56319)return e+1;var o=Gg(t,e+1);return o<56320||o>57343?e+1:e+2},"advanceStringIndex"),xh=u(function(t){var e=0;return{next:u(function(){var n=e>=t.length,o;return n||(o=t[e],e+=1),{done:n,value:o}},"next")}},"getArrayIterator"),Vg=u(function(t,e){if(W4(t)||H4(t))return xh(t);if(X4(t)){var i=0;return{next:u(function(){var o=q4(t,i),a=z4(t,i,o);return i=o,{done:o>t.length,value:a}},"next")}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},"getNonCollectionIterator"),!Y4&&!Z4?Ch.exports=u(function(t){if(t!=null)return Vg(t,!0)},"getIterator"):($4=kg(),J4=Bg(),jg=yr("Map.prototype.forEach",!0),Hg=yr("Set.prototype.forEach",!0),(typeof T>"u"||!T.versions||!T.versions.node)&&(Ug=yr("Map.prototype.iterator",!0),Wg=yr("Set.prototype.iterator",!0)),Xg=yr("Map.prototype.@@iterator",!0)||yr("Map.prototype._es6-shim iterator_",!0),Yg=yr("Set.prototype.@@iterator",!0)||yr("Set.prototype._es6-shim iterator_",!0),K4=u(function(t){if($4(t)){if(Ug)return U4(Ug(t));if(Xg)return Xg(t);if(jg){var e=[];return jg(t,function(n,o){Ng(e,[o,n])}),xh(e)}}if(J4(t)){if(Wg)return U4(Wg(t));if(Yg)return Yg(t);if(Hg){var i=[];return Hg(t,function(n){Ng(i,n)}),xh(i)}}},"getCollectionIterator"),Ch.exports=u(function(t){return K4(t)||Vg(t)},"getIterator")));var bh,W4,X4,Rg,Y4,Z4,yr,Ng,Gg,z4,q4,xh,Vg,$4,J4,jg,Hg,Ug,Wg,Xg,Yg,K4});var Zg=V(($U,tS)=>{"use strict";m();var eS=u(function(r){return r!==r},"numberIsNaN");tS.exports=u(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||eS(t)&&eS(e))},"is")});var zg=V((QU,rS)=>{"use strict";m();var tw=Zg();rS.exports=u(function(){return typeof Object.is=="function"?Object.is:tw},"getPolyfill")});var nS=V((rW,iS)=>{"use strict";m();var rw=zg(),iw=Un();iS.exports=u(function(){var t=rw();return iw(Object,{is:t},{is:u(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var lS=V((oW,sS)=>{"use strict";m();var nw=Un(),ow=zo(),aw=Zg(),oS=zg(),sw=nS(),aS=ow(oS(),Object);nw(aS,{getPolyfill:oS,implementation:aw,shim:sw});sS.exports=aS});var $g=V((sW,dS)=>{"use strict";m();var lw=zo(),pS=Qt(),cw=Fr(),qg=cw("%ArrayBuffer%",!0),Sh=pS("ArrayBuffer.prototype.byteLength",!0),uw=pS("Object.prototype.toString"),cS=!!qg&&!Sh&&new qg(0).slice,uS=!!cS&&lw(cS);dS.exports=u(Sh||uS?function(t){if(!t||typeof t!="object")return!1;try{return Sh?Sh(t):uS(t,0),!0}catch{return!1}}:qg?function(t){return uw(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var fS=V((uW,hS)=>{"use strict";m();var pw=Date.prototype.getDay,dw=u(function(t){try{return pw.call(t),!0}catch{return!1}},"tryDateGetDayCall"),hw=Object.prototype.toString,fw="[object Date]",mw=Wn()();hS.exports=u(function(t){return typeof t!="object"||t===null?!1:mw?dw(t):hw.call(t)===fw},"isDateObject")});var bS=V((hW,vS)=>{"use strict";m();var Jg=Qt(),mS=Wn()(),yS,gS,Kg,Qg;mS&&(yS=Jg("Object.prototype.hasOwnProperty"),gS=Jg("RegExp.prototype.exec"),Kg={},Th=u(function(){throw Kg},"throwRegexMarker"),Qg={toString:Th,valueOf:Th},typeof Symbol.toPrimitive=="symbol"&&(Qg[Symbol.toPrimitive]=Th));var Th,yw=Jg("Object.prototype.toString"),gw=Object.getOwnPropertyDescriptor,vw="[object RegExp]";vS.exports=u(mS?function(t){if(!t||typeof t!="object")return!1;var e=gw(t,"lastIndex"),i=e&&yS(e,"value");if(!i)return!1;try{gS(t,Qg)}catch(n){return n===Kg}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:yw(t)===vw},"isRegex")});var SS=V((yW,CS)=>{"use strict";m();var bw=Qt(),xS=bw("SharedArrayBuffer.prototype.byteLength",!0);CS.exports=u(xS?function(t){if(!t||typeof t!="object")return!1;try{return xS(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var MS=V((bW,TS)=>{"use strict";m();var xw=Number.prototype.toString,Cw=u(function(t){try{return xw.call(t),!0}catch{return!1}},"tryNumberObject"),Sw=Object.prototype.toString,Tw="[object Number]",Mw=Wn()();TS.exports=u(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:Mw?Cw(t):Sw.call(t)===Tw},"isNumberObject")});var wS=V((SW,IS)=>{"use strict";m();var PS=Qt(),Pw=PS("Boolean.prototype.toString"),Iw=PS("Object.prototype.toString"),ww=u(function(t){try{return Pw(t),!0}catch{return!1}},"booleanBrandCheck"),Ew="[object Boolean]",Dw=Wn()();IS.exports=u(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:Dw&&Symbol.toStringTag in t?ww(t):Iw(t)===Ew},"isBoolean")});var OS=V((PW,e1)=>{"use strict";m();var _w=Object.prototype.toString,Ow=Qd()();Ow?(ES=Symbol.prototype.toString,DS=/^Symbol\(.*\)$/,_S=u(function(t){return typeof t.valueOf()!="symbol"?!1:DS.test(ES.call(t))},"isRealSymbolObject"),e1.exports=u(function(t){if(typeof t=="symbol")return!0;if(_w.call(t)!=="[object Symbol]")return!1;try{return _S(t)}catch{return!1}},"isSymbol")):e1.exports=u(function(t){return!1},"isSymbol");var ES,DS,_S});var kS=V((EW,AS)=>{"use strict";m();var LS=typeof BigInt<"u"&&BigInt;AS.exports=u(function(){return typeof LS=="function"&&typeof BigInt=="function"&&typeof LS(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var RS=V((OW,t1)=>{"use strict";m();var Lw=kS()();Lw?(FS=BigInt.prototype.valueOf,BS=u(function(t){try{return FS.call(t),!0}catch{}return!1},"tryBigIntObject"),t1.exports=u(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:BS(t)},"isBigInt")):t1.exports=u(function(t){return!1},"isBigInt");var FS,BS});var GS=V((kW,NS)=>{"use strict";m();var Aw=Lg(),kw=MS(),Fw=wS(),Bw=OS(),Rw=RS();NS.exports=u(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(Aw(t))return"String";if(kw(t))return"Number";if(Fw(t))return"Boolean";if(Bw(t))return"Symbol";if(Rw(t))return"BigInt"},"whichBoxedPrimitive")});var HS=V((RW,jS)=>{"use strict";m();var Mh=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,VS=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Ph;Mh||(Ph=u(function(t){return!1},"isWeakMap"));var i1=Mh?Mh.prototype.has:null,r1=VS?VS.prototype.has:null;!Ph&&!i1&&(Ph=u(function(t){return!1},"isWeakMap"));jS.exports=Ph||u(function(t){if(!t||typeof t!="object")return!1;try{if(i1.call(t,i1),r1)try{r1.call(t,r1)}catch{return!0}return t instanceof Mh}catch{}return!1},"isWeakMap")});var WS=V((VW,o1)=>{"use strict";m();var Nw=Fr(),US=Qt(),Gw=Nw("%WeakSet%",!0),n1=US("WeakSet.prototype.has",!0);n1?(Ih=US("WeakMap.prototype.has",!0),o1.exports=u(function(t){if(!t||typeof t!="object")return!1;try{if(n1(t,n1),Ih)try{Ih(t,Ih)}catch{return!0}return t instanceof Gw}catch{}return!1},"isWeakSet")):o1.exports=u(function(t){return!1},"isWeakSet");var Ih});var YS=V((UW,XS)=>{"use strict";m();var Vw=kg(),jw=Bg(),Hw=HS(),Uw=WS();XS.exports=u(function(t){if(t&&typeof t=="object"){if(Vw(t))return"Map";if(jw(t))return"Set";if(Hw(t))return"WeakMap";if(Uw(t))return"WeakSet"}return!1},"whichCollection")});var $S=V((YW,qS)=>{"use strict";m();var zS=Function.prototype.toString,As=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,s1,wh;if(typeof As=="function"&&typeof Object.defineProperty=="function")try{s1=Object.defineProperty({},"length",{get:function(){throw wh}}),wh={},As(function(){throw 42},null,s1)}catch(r){r!==wh&&(As=null)}else As=null;var Ww=/^\s*class\b/,l1=u(function(t){try{var e=zS.call(t);return Ww.test(e)}catch{return!1}},"isES6ClassFunction"),a1=u(function(t){try{return l1(t)?!1:(zS.call(t),!0)}catch{return!1}},"tryFunctionToStr"),Eh=Object.prototype.toString,Xw="[object Object]",Yw="[object Function]",Zw="[object GeneratorFunction]",zw="[object HTMLAllCollection]",qw="[object HTML document.all class]",$w="[object HTMLCollection]",Jw=typeof Symbol=="function"&&!!Symbol.toStringTag,Kw=!(0 in[,]),c1=u(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(ZS=document.all,Eh.call(ZS)===Eh.call(document.all)&&(c1=u(function(t){if((Kw||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=Eh.call(t);return(e===zw||e===qw||e===$w||e===Xw)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var ZS;qS.exports=u(As?function(t){if(c1(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{As(t,null,s1)}catch(e){if(e!==wh)return!1}return!l1(t)&&a1(t)}:function(t){if(c1(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Jw)return a1(t);if(l1(t))return!1;var e=Eh.call(t);return e!==Yw&&e!==Zw&&!/^\[object HTML/.test(e)?!1:a1(t)},"isCallable")});var QS=V((qW,KS)=>{"use strict";m();var Qw=$S(),eE=Object.prototype.toString,JS=Object.prototype.hasOwnProperty,tE=u(function(t,e,i){for(var n=0,o=t.length;n<o;n++)JS.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},"forEachArray"),rE=u(function(t,e,i){for(var n=0,o=t.length;n<o;n++)i==null?e(t.charAt(n),n,t):e.call(i,t.charAt(n),n,t)},"forEachString"),iE=u(function(t,e,i){for(var n in t)JS.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},"forEachObject"),nE=u(function(t,e,i){if(!Qw(e))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),eE.call(t)==="[object Array]"?tE(t,e,n):typeof t=="string"?rE(t,e,n):iE(t,e,n)},"forEach");KS.exports=nE});var t5=V((KW,e5)=>{"use strict";m();e5.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var i5=V((eX,r5)=>{"use strict";m();var u1=t5(),oE=typeof globalThis>"u"?global:globalThis;r5.exports=u(function(){for(var t=[],e=0;e<u1.length;e++)typeof oE[u1[e]]=="function"&&(t[t.length]=u1[e]);return t},"availableTypedArrays")});var l5=V((iX,s5)=>{"use strict";m();var _h=QS(),aE=i5(),n5=zo(),h1=Qt(),Dh=ah(),sE=h1("Object.prototype.toString"),a5=Wn()(),o5=typeof globalThis>"u"?global:globalThis,d1=aE(),f1=h1("String.prototype.slice"),p1=Object.getPrototypeOf,lE=h1("Array.prototype.indexOf",!0)||u(function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},"indexOf"),Oh={__proto__:null};a5&&Dh&&p1?_h(d1,function(r){var t=new o5[r];if(Symbol.toStringTag in t){var e=p1(t),i=Dh(e,Symbol.toStringTag);if(!i){var n=p1(e);i=Dh(n,Symbol.toStringTag)}Oh["$"+r]=n5(i.get)}}):_h(d1,function(r){var t=new o5[r],e=t.slice||t.set;e&&(Oh["$"+r]=n5(e))});var cE=u(function(t){var e=!1;return _h(Oh,function(i,n){if(!e)try{"$"+i(t)===n&&(e=f1(n,1))}catch{}}),e},"tryAllTypedArrays"),uE=u(function(t){var e=!1;return _h(Oh,function(i,n){if(!e)try{i(t),e=f1(n,1)}catch{}}),e},"tryAllSlices");s5.exports=u(function(t){if(!t||typeof t!="object")return!1;if(!a5){var e=f1(sE(t),8,-1);return lE(d1,e)>-1?e:e!=="Object"?!1:uE(t)}return Dh?cE(t):null},"whichTypedArray")});var p5=V((aX,u5)=>{"use strict";m();var pE=Qt(),c5=pE("ArrayBuffer.prototype.byteLength",!0),dE=$g();u5.exports=u(function(t){return dE(t)?c5?c5(t):t.byteLength:NaN},"byteLength")});var B5=V((cX,F5)=>{"use strict";m();var L5=HC(),di=Qt(),d5=r4(),hE=Fr(),ks=Q4(),fE=Dg(),h5=lS(),f5=mg(),m5=Og(),y5=$g(),g5=fS(),v5=bS(),b5=SS(),x5=Kd(),C5=GS(),S5=YS(),T5=l5(),M5=p5(),P5=di("SharedArrayBuffer.prototype.byteLength",!0),I5=di("Date.prototype.getTime"),m1=Object.getPrototypeOf,w5=di("Object.prototype.toString"),Ah=hE("%Set%",!0),y1=di("Map.prototype.has",!0),kh=di("Map.prototype.get",!0),E5=di("Map.prototype.size",!0),Fh=di("Set.prototype.add",!0),A5=di("Set.prototype.delete",!0),Bh=di("Set.prototype.has",!0),Lh=di("Set.prototype.size",!0);function D5(r,t,e,i){for(var n=ks(r),o;(o=n.next())&&!o.done;)if(Br(t,o.value,e,i))return A5(r,o.value),!0;return!1}u(D5,"setHasEqualElement");function k5(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}u(k5,"findLooseMatchingPrimitives");function mE(r,t,e,i,n,o){var a=k5(e);if(a!=null)return a;var l=kh(t,a),c=L5({},n,{strict:!1});return typeof l>"u"&&!y1(t,a)||!Br(i,l,c,o)?!1:!y1(r,a)&&Br(i,l,c,o)}u(mE,"mapMightHaveLoosePrim");function yE(r,t,e){var i=k5(e);return i!=null?i:Bh(t,i)&&!Bh(r,i)}u(yE,"setMightHaveLoosePrim");function _5(r,t,e,i,n,o){for(var a=ks(r),l,c;(l=a.next())&&!l.done;)if(c=l.value,Br(e,c,n,o)&&Br(i,kh(t,c),n,o))return A5(r,c),!0;return!1}u(_5,"mapHasEqualEntry");function Br(r,t,e,i){var n=e||{};if(n.strict?h5(r,t):r===t)return!0;var o=C5(r),a=C5(t);if(o!==a)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return n.strict?h5(r,t):r==t;var l=i.has(r),c=i.has(t),p;if(l&&c){if(i.get(r)===i.get(t))return!0}else p={};return l||i.set(r,p),c||i.set(t,p),bE(r,t,n,i)}u(Br,"internalDeepEqual");function O5(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))}u(O5,"isBuffer");function gE(r,t,e,i){if(Lh(r)!==Lh(t))return!1;for(var n=ks(r),o=ks(t),a,l,c;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new Ah),Fh(c,a.value);else if(!Bh(t,a.value)){if(e.strict||!yE(r,t,a.value))return!1;c||(c=new Ah),Fh(c,a.value)}if(c){for(;(l=o.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!D5(c,l.value,e.strict,i))return!1}else if(!e.strict&&!Bh(r,l.value)&&!D5(c,l.value,e.strict,i))return!1;return Lh(c)===0}return!0}u(gE,"setEquiv");function vE(r,t,e,i){if(E5(r)!==E5(t))return!1;for(var n=ks(r),o=ks(t),a,l,c,p,h,y;(a=n.next())&&!a.done;)if(p=a.value[0],h=a.value[1],p&&typeof p=="object")c||(c=new Ah),Fh(c,p);else if(y=kh(t,p),typeof y>"u"&&!y1(t,p)||!Br(h,y,e,i)){if(e.strict||!mE(r,t,p,h,e,i))return!1;c||(c=new Ah),Fh(c,p)}if(c){for(;(l=o.next())&&!l.done;)if(p=l.value[0],y=l.value[1],p&&typeof p=="object"){if(!_5(c,r,p,y,e,i))return!1}else if(!e.strict&&(!r.has(p)||!Br(kh(r,p),y,e,i))&&!_5(c,r,p,y,L5({},e,{strict:!1}),i))return!1;return Lh(c)===0}return!0}u(vE,"mapEquiv");function bE(r,t,e,i){var n,o;if(typeof r!=typeof t||r==null||t==null||w5(r)!==w5(t)||f5(r)!==f5(t))return!1;var a=m5(r),l=m5(t);if(a!==l)return!1;var c=r instanceof Error,p=t instanceof Error;if(c!==p||(c||p)&&(r.name!==t.name||r.message!==t.message))return!1;var h=v5(r),y=v5(t);if(h!==y||(h||y)&&(r.source!==t.source||d5(r)!==d5(t)))return!1;var g=g5(r),v=g5(t);if(g!==v||(g||v)&&I5(r)!==I5(t)||e.strict&&m1&&m1(r)!==m1(t))return!1;var C=T5(r),M=T5(t);if(C!==M)return!1;if(C||M){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var b=O5(r),x=O5(t);if(b!==x)return!1;if(b||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 I=y5(r),w=y5(t);if(I!==w)return!1;if(I||w)return M5(r)!==M5(t)?!1:typeof Uint8Array=="function"&&Br(new Uint8Array(r),new Uint8Array(t),e,i);var E=b5(r),_=b5(t);if(E!==_)return!1;if(E||_)return P5(r)!==P5(t)?!1:typeof Uint8Array=="function"&&Br(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var O=x5(r),F=x5(t);if(O.length!==F.length)return!1;for(O.sort(),F.sort(),n=O.length-1;n>=0;n--)if(O[n]!=F[n])return!1;for(n=O.length-1;n>=0;n--)if(o=O[n],!Br(r[o],t[o],e,i))return!1;var G=S5(r),N=S5(t);return G!==N?!1:G==="Set"||N==="Set"?gE(r,t,e,i):G==="Map"?vE(r,t,e,i):!0}u(bE,"objEquiv");F5.exports=u(function(t,e,i){return Br(t,e,i,fE())},"deepEqual")});var K5=V(ge=>{"use strict";m();Object.defineProperty(ge,"__esModule",{value:!0});function xE(r){return r&&r.__esModule?r:{default:r}}u(xE,"_interopRequireDefault");var CE=Object.defineProperty,xe=u((r,t)=>CE(r,"name",{value:t,configurable:!0}),"__name"),SE=B5(),TE=xE(SE),Zc,R5=(Zc=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||!Xc(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=g1(t),n=g1(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(!Xc(t,e))return!1;let o=t,a=e;if(n&&!this.compareCoord(o[0],a[0])){let c=this.fixStartIndex(a,o);if(c)a=c;else return!1}let l=this.compareCoord(o[i],a[i]);return this.direction||l?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 Xc(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?TE.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Xc(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)}},u(Zc,"_GeojsonEquality"),Zc);xe(R5,"GeojsonEquality");var ME=R5;function Xc(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}u(Xc,"sameLength");xe(Xc,"sameLength");function g1(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}u(g1,"explode");xe(g1,"explode");var Vt=63710088e-1,b1={centimeters:Vt*100,centimetres:Vt*100,degrees:360/(2*Math.PI),feet:Vt*3.28084,inches:Vt*39.37,kilometers:Vt/1e3,kilometres:Vt/1e3,meters:Vt,metres:Vt,miles:Vt/1609.344,millimeters:Vt*1e3,millimetres:Vt*1e3,nauticalmiles:Vt/1852,radians:1,yards:Vt*1.0936},v1={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 Qi(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}u(Qi,"feature");xe(Qi,"feature");function N5(r,t,e={}){switch(r){case"Point":return Rh(t).geometry;case"LineString":return Gh(t).geometry;case"Polygon":return Nh(t).geometry;case"MultiPoint":return C1(t).geometry;case"MultiLineString":return x1(t).geometry;case"MultiPolygon":return S1(t).geometry;default:throw new Error(r+" is invalid")}}u(N5,"geometry");xe(N5,"geometry");function Rh(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(!Yc(r[0])||!Yc(r[1]))throw new Error("coordinates must contain numbers");return Qi({type:"Point",coordinates:r},t,e)}u(Rh,"point");xe(Rh,"point");function G5(r,t,e={}){return zc(r.map(i=>Rh(i,t)),e)}u(G5,"points");xe(G5,"points");function Nh(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 Qi({type:"Polygon",coordinates:r},t,e)}u(Nh,"polygon");xe(Nh,"polygon");function V5(r,t,e={}){return zc(r.map(i=>Nh(i,t)),e)}u(V5,"polygons");xe(V5,"polygons");function Gh(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Qi({type:"LineString",coordinates:r},t,e)}u(Gh,"lineString");xe(Gh,"lineString");function j5(r,t,e={}){return zc(r.map(i=>Gh(i,t)),e)}u(j5,"lineStrings");xe(j5,"lineStrings");function zc(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}u(zc,"featureCollection");xe(zc,"featureCollection");function x1(r,t,e={}){return Qi({type:"MultiLineString",coordinates:r},t,e)}u(x1,"multiLineString");xe(x1,"multiLineString");function C1(r,t,e={}){return Qi({type:"MultiPoint",coordinates:r},t,e)}u(C1,"multiPoint");xe(C1,"multiPoint");function S1(r,t,e={}){return Qi({type:"MultiPolygon",coordinates:r},t,e)}u(S1,"multiPolygon");xe(S1,"multiPolygon");function H5(r,t,e={}){return Qi({type:"GeometryCollection",geometries:r},t,e)}u(H5,"geometryCollection");xe(H5,"geometryCollection");function U5(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}u(U5,"round");xe(U5,"round");function T1(r,t="kilometers"){let e=b1[t];if(!e)throw new Error(t+" units is invalid");return r*e}u(T1,"radiansToLength");xe(T1,"radiansToLength");function Vh(r,t="kilometers"){let e=b1[t];if(!e)throw new Error(t+" units is invalid");return r/e}u(Vh,"lengthToRadians");xe(Vh,"lengthToRadians");function W5(r,t){return M1(Vh(r,t))}u(W5,"lengthToDegrees");xe(W5,"lengthToDegrees");function X5(r){let t=r%360;return t<0&&(t+=360),t}u(X5,"bearingToAzimuth");xe(X5,"bearingToAzimuth");function M1(r){return r%(2*Math.PI)*180/Math.PI}u(M1,"radiansToDegrees");xe(M1,"radiansToDegrees");function Y5(r){return r%360*Math.PI/180}u(Y5,"degreesToRadians");xe(Y5,"degreesToRadians");function Z5(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return T1(Vh(r,t),e)}u(Z5,"convertLength");xe(Z5,"convertLength");function z5(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=v1[t];if(!i)throw new Error("invalid original units");let n=v1[e];if(!n)throw new Error("invalid final units");return r/i*n}u(z5,"convertArea");xe(z5,"convertArea");function Yc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}u(Yc,"isNumber");xe(Yc,"isNumber");function q5(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}u(q5,"isObject");xe(q5,"isObject");function $5(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(!Yc(t))throw new Error("bbox must only contain numbers")})}u($5,"validateBBox");xe($5,"validateBBox");function J5(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")}u(J5,"validateId");xe(J5,"validateId");ge.GeojsonEquality=ME;ge.areaFactors=v1;ge.bearingToAzimuth=X5;ge.convertArea=z5;ge.convertLength=Z5;ge.degreesToRadians=Y5;ge.earthRadius=Vt;ge.factors=b1;ge.feature=Qi;ge.featureCollection=zc;ge.geometry=N5;ge.geometryCollection=H5;ge.isNumber=Yc;ge.isObject=q5;ge.lengthToDegrees=W5;ge.lengthToRadians=Vh;ge.lineString=Gh;ge.lineStrings=j5;ge.multiLineString=x1;ge.multiPoint=C1;ge.multiPolygon=S1;ge.point=Rh;ge.points=G5;ge.polygon=Nh;ge.polygons=V5;ge.radiansToDegrees=M1;ge.radiansToLength=T1;ge.round=U5;ge.validateBBox=$5;ge.validateId=J5});var c7=V(et=>{"use strict";m();Object.defineProperty(et,"__esModule",{value:!0});var PE=Object.defineProperty,lt=u((r,t)=>PE(r,"name",{value:t,configurable:!0}),"__name"),pt=K5();function Fs(r,t,e){if(r!==null)for(var i,n,o,a,l,c,p,h=0,y=0,g,v=r.type,C=v==="FeatureCollection",M=v==="Feature",b=C?r.features.length:1,x=0;x<b;x++){p=C?r.features[x].geometry:M?r.geometry:r,g=p?p.type==="GeometryCollection":!1,l=g?p.geometries.length:1;for(var I=0;I<l;I++){var w=0,E=0;if(a=g?p.geometries[I]:p,a!==null){c=a.coordinates;var _=a.type;switch(h=e&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,y,x,w,E)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],y,x,w,E)===!1)return!1;y++,_==="MultiPoint"&&w++}_==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-h;n++){if(t(c[i][n],y,x,w,E)===!1)return!1;y++}_==="MultiLineString"&&w++,_==="Polygon"&&E++}_==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(E=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-h;o++){if(t(c[i][n][o],y,x,w,E)===!1)return!1;y++}E++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Fs(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}u(Fs,"coordEach");lt(Fs,"coordEach");function Q5(r,t,e,i){var n=e;return Fs(r,function(o,a,l,c,p){a===0&&e===void 0?n=o:n=t(n,o,a,l,c,p)},i),n}u(Q5,"coordReduce");lt(Q5,"coordReduce");function P1(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}}u(P1,"propEach");lt(P1,"propEach");function e7(r,t,e){var i=e;return P1(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}u(e7,"propReduce");lt(e7,"propReduce");function I1(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++);}u(I1,"featureEach");lt(I1,"featureEach");function t7(r,t,e){var i=e;return I1(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}u(t7,"featureReduce");lt(t7,"featureReduce");function r7(r){var t=[];return Fs(r,function(e){t.push(e)}),t}u(r7,"coordAll");lt(r7,"coordAll");function jh(r,t){var e,i,n,o,a,l,c,p,h,y,g=0,v=r.type==="FeatureCollection",C=r.type==="Feature",M=v?r.features.length:1;for(e=0;e<M;e++){for(l=v?r.features[e].geometry:C?r.geometry:r,p=v?r.features[e].properties:C?r.properties:{},h=v?r.features[e].bbox:C?r.bbox:void 0,y=v?r.features[e].id:C?r.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(t(null,g,p,h,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,p,h,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,p,h,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}u(jh,"geomEach");lt(jh,"geomEach");function i7(r,t,e){var i=e;return jh(r,function(n,o,a,l,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,l,c)}),i}u(i7,"geomReduce");lt(i7,"geomReduce");function qc(r,t){jh(r,function(e,i,n,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(pt.feature.call(void 0,e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var h=e.coordinates[p],y={type:c,coordinates:h};if(t(pt.feature.call(void 0,y,n),i,p)===!1)return!1}})}u(qc,"flattenEach");lt(qc,"flattenEach");function n7(r,t,e){var i=e;return qc(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}u(n7,"flattenReduce");lt(n7,"flattenReduce");function w1(r,t){qc(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,h=0;if(Fs(e,function(y,g,v,C,M){if(l===void 0||i>c||C>p||M>h){l=y,c=i,p=C,h=M,o=0;return}var b=pt.lineString.call(void 0,[l,y],e.properties);if(t(b,i,n,M,o)===!1)return!1;o++,l=y})===!1)return!1}}})}u(w1,"segmentEach");lt(w1,"segmentEach");function o7(r,t,e){var i=e,n=!1;return w1(r,function(o,a,l,c,p){n===!1&&e===void 0?i=o:i=t(i,o,a,l,c,p),n=!0}),i}u(o7,"segmentReduce");lt(o7,"segmentReduce");function E1(r,t){if(!r)throw new Error("geojson is required");qc(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 l=0;l<a.length;l++)if(t(pt.lineString.call(void 0,a[l],e.properties),i,n,l)===!1)return!1;break}}})}u(E1,"lineEach");lt(E1,"lineEach");function a7(r,t,e){var i=e;return E1(r,function(n,o,a,l){o===0&&e===void 0?i=n:i=t(i,n,o,a,l)}),i}u(a7,"lineReduce");lt(a7,"lineReduce");function s7(r,t){if(t=t||{},!pt.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,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),pt.lineString.call(void 0,[c[o],c[o+1]],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),pt.lineString.call(void 0,[c[n][o],c[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),pt.lineString.call(void 0,[c[i][o],c[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o-1),pt.lineString.call(void 0,[c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}u(s7,"findSegment");lt(s7,"findSegment");function l7(r,t){if(t=t||{},!pt.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,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return pt.point.call(void 0,c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),pt.point.call(void 0,c[i],a,t);case"LineString":return o<0&&(o=c.length+o),pt.point.call(void 0,c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),pt.point.call(void 0,c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),pt.point.call(void 0,c[i][o],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),pt.point.call(void 0,c[i][n][o],a,t)}throw new Error("geojson is invalid")}u(l7,"findPoint");lt(l7,"findPoint");et.coordAll=r7;et.coordEach=Fs;et.coordReduce=Q5;et.featureEach=I1;et.featureReduce=t7;et.findPoint=l7;et.findSegment=s7;et.flattenEach=qc;et.flattenReduce=n7;et.geomEach=jh;et.geomReduce=i7;et.lineEach=E1;et.lineReduce=a7;et.propEach=P1;et.propReduce=e7;et.segmentEach=w1;et.segmentReduce=o7});var u7=V(Hh=>{"use strict";m();Object.defineProperty(Hh,"__esModule",{value:!0});var IE=Object.defineProperty,wE=u((r,t)=>IE(r,"name",{value:t,configurable:!0}),"__name"),EE=c7();function D1(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return EE.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}u(D1,"bbox");wE(D1,"bbox");var DE=D1;Hh.bbox=D1;Hh.default=DE});var m7=V((TX,_1)=>{m();var hi=cx(),d7=Jy(),h7=bx(),Bs=u7().default,_E=h7.featureEach,CX=h7.coordEach,SX=d7.polygon,p7=d7.featureCollection;function f7(r){var t=new hi(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Bs(e),hi.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:Bs(n),i.push(n)}):_E(e,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Bs(n),i.push(n)}),hi.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:Bs(e),hi.prototype.remove.call(this,e,i)},t.clear=function(){return hi.prototype.clear.call(this)},t.search=function(e){var i=hi.prototype.search.call(this,this.toBBox(e));return p7(i)},t.collides=function(e){return hi.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=hi.prototype.all.call(this);return p7(e)},t.toJSON=function(){return hi.prototype.toJSON.call(this)},t.fromJSON=function(e){return hi.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=Bs(e);else if(e.type==="FeatureCollection")i=Bs(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}u(f7,"geojsonRbush");_1.exports=f7;_1.exports.default=f7});var w0=V((du,qs)=>{m();var u_=200,K7="__lodash_hash_undefined__",p_=800,d_=16,Q7=9007199254740991,e6="[object Arguments]",h_="[object Array]",f_="[object AsyncFunction]",m_="[object Boolean]",y_="[object Date]",g_="[object Error]",t6="[object Function]",v_="[object GeneratorFunction]",b_="[object Map]",x_="[object Number]",C_="[object Null]",r6="[object Object]",S_="[object Proxy]",T_="[object RegExp]",M_="[object Set]",P_="[object String]",I_="[object Undefined]",w_="[object WeakMap]",E_="[object ArrayBuffer]",D_="[object DataView]",__="[object Float32Array]",O_="[object Float64Array]",L_="[object Int8Array]",A_="[object Int16Array]",k_="[object Int32Array]",F_="[object Uint8Array]",B_="[object Uint8ClampedArray]",R_="[object Uint16Array]",N_="[object Uint32Array]",G_=/[\\^$.*+?()[\]{}|]/g,V_=/^\[object .+?Constructor\]$/,j_=/^(?:0|[1-9]\d*)$/,Ee={};Ee[__]=Ee[O_]=Ee[L_]=Ee[A_]=Ee[k_]=Ee[F_]=Ee[B_]=Ee[R_]=Ee[N_]=!0;Ee[e6]=Ee[h_]=Ee[E_]=Ee[m_]=Ee[D_]=Ee[y_]=Ee[g_]=Ee[t6]=Ee[b_]=Ee[x_]=Ee[r6]=Ee[T_]=Ee[M_]=Ee[P_]=Ee[w_]=!1;var i6=typeof global=="object"&&global&&global.Object===Object&&global,H_=typeof self=="object"&&self&&self.Object===Object&&self,mu=i6||H_||Function("return this")(),n6=typeof du=="object"&&du&&!du.nodeType&&du,hu=n6&&typeof qs=="object"&&qs&&!qs.nodeType&&qs,o6=hu&&hu.exports===n6,y0=o6&&i6.process,U7=function(){try{var r=hu&&hu.require&&hu.require("util").types;return r||y0&&y0.binding&&y0.binding("util")}catch{}}(),W7=U7&&U7.isTypedArray;function a6(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)}u(a6,"apply");function U_(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}u(U_,"baseTimes");function W_(r){return function(t){return r(t)}}u(W_,"baseUnary");function X_(r,t){return r==null?void 0:r[t]}u(X_,"getValue");function Y_(r,t){return function(e){return r(t(e))}}u(Y_,"overArg");var Z_=Array.prototype,z_=Function.prototype,sf=Object.prototype,g0=mu["__core-js_shared__"],lf=z_.toString,an=sf.hasOwnProperty,X7=function(){var r=/[^.]+$/.exec(g0&&g0.keys&&g0.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),s6=sf.toString,q_=lf.call(Object),$_=RegExp("^"+lf.call(an).replace(G_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),of=o6?mu.Buffer:void 0,Y7=mu.Symbol,Z7=mu.Uint8Array,z7=of?of.allocUnsafe:void 0,l6=Y_(Object.getPrototypeOf,Object),q7=Object.create,J_=sf.propertyIsEnumerable,K_=Z_.splice,fa=Y7?Y7.toStringTag:void 0,af=function(){try{var r=M0(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Q_=of?of.isBuffer:void 0,$7=Math.max,eO=Date.now,c6=M0(mu,"Map"),fu=M0(Object,"create"),tO=function(){function r(){}return u(r,"object"),function(t){if(!on(t))return{};if(q7)return q7(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function ma(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])}}u(ma,"Hash");function rO(){this.__data__=fu?fu(null):{},this.size=0}u(rO,"hashClear");function iO(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}u(iO,"hashDelete");function nO(r){var t=this.__data__;if(fu){var e=t[r];return e===K7?void 0:e}return an.call(t,r)?t[r]:void 0}u(nO,"hashGet");function oO(r){var t=this.__data__;return fu?t[r]!==void 0:an.call(t,r)}u(oO,"hashHas");function aO(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=fu&&t===void 0?K7:t,this}u(aO,"hashSet");ma.prototype.clear=rO;ma.prototype.delete=iO;ma.prototype.get=nO;ma.prototype.has=oO;ma.prototype.set=aO;function sn(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])}}u(sn,"ListCache");function sO(){this.__data__=[],this.size=0}u(sO,"listCacheClear");function lO(r){var t=this.__data__,e=cf(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():K_.call(t,e,1),--this.size,!0}u(lO,"listCacheDelete");function cO(r){var t=this.__data__,e=cf(t,r);return e<0?void 0:t[e][1]}u(cO,"listCacheGet");function uO(r){return cf(this.__data__,r)>-1}u(uO,"listCacheHas");function pO(r,t){var e=this.__data__,i=cf(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}u(pO,"listCacheSet");sn.prototype.clear=sO;sn.prototype.delete=lO;sn.prototype.get=cO;sn.prototype.has=uO;sn.prototype.set=pO;function $s(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])}}u($s,"MapCache");function dO(){this.size=0,this.__data__={hash:new ma,map:new(c6||sn),string:new ma}}u(dO,"mapCacheClear");function hO(r){var t=pf(this,r).delete(r);return this.size-=t?1:0,t}u(hO,"mapCacheDelete");function fO(r){return pf(this,r).get(r)}u(fO,"mapCacheGet");function mO(r){return pf(this,r).has(r)}u(mO,"mapCacheHas");function yO(r,t){var e=pf(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}u(yO,"mapCacheSet");$s.prototype.clear=dO;$s.prototype.delete=hO;$s.prototype.get=fO;$s.prototype.has=mO;$s.prototype.set=yO;function Js(r){var t=this.__data__=new sn(r);this.size=t.size}u(Js,"Stack");function gO(){this.__data__=new sn,this.size=0}u(gO,"stackClear");function vO(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}u(vO,"stackDelete");function bO(r){return this.__data__.get(r)}u(bO,"stackGet");function xO(r){return this.__data__.has(r)}u(xO,"stackHas");function CO(r,t){var e=this.__data__;if(e instanceof sn){var i=e.__data__;if(!c6||i.length<u_-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new $s(i)}return e.set(r,t),this.size=e.size,this}u(CO,"stackSet");Js.prototype.clear=gO;Js.prototype.delete=vO;Js.prototype.get=bO;Js.prototype.has=xO;Js.prototype.set=CO;function SO(r,t){var e=C0(r),i=!e&&x0(r),n=!e&&!i&&f6(r),o=!e&&!i&&!n&&y6(r),a=e||i||n||o,l=a?U_(r.length,String):[],c=l.length;for(var p in r)(t||an.call(r,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||d6(p,c)))&&l.push(p);return l}u(SO,"arrayLikeKeys");function v0(r,t,e){(e!==void 0&&!df(r[t],e)||e===void 0&&!(t in r))&&S0(r,t,e)}u(v0,"assignMergeValue");function TO(r,t,e){var i=r[t];(!(an.call(r,t)&&df(i,e))||e===void 0&&!(t in r))&&S0(r,t,e)}u(TO,"assignValue");function cf(r,t){for(var e=r.length;e--;)if(df(r[e][0],t))return e;return-1}u(cf,"assocIndexOf");function S0(r,t,e){t=="__proto__"&&af?af(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}u(S0,"baseAssignValue");var MO=BO();function uf(r){return r==null?r===void 0?I_:C_:fa&&fa in Object(r)?RO(r):UO(r)}u(uf,"baseGetTag");function J7(r){return yu(r)&&uf(r)==e6}u(J7,"baseIsArguments");function PO(r){if(!on(r)||jO(r))return!1;var t=I0(r)?$_:V_;return t.test(ZO(r))}u(PO,"baseIsNative");function IO(r){return yu(r)&&m6(r.length)&&!!Ee[uf(r)]}u(IO,"baseIsTypedArray");function wO(r){if(!on(r))return HO(r);var t=h6(r),e=[];for(var i in r)i=="constructor"&&(t||!an.call(r,i))||e.push(i);return e}u(wO,"baseKeysIn");function T0(r,t,e,i,n){r!==t&&MO(t,function(o,a){if(n||(n=new Js),on(o))EO(r,t,a,e,T0,i,n);else{var l=i?i(b0(r,a),o,a+"",r,t,n):void 0;l===void 0&&(l=o),v0(r,a,l)}},g6)}u(T0,"baseMerge");function EO(r,t,e,i,n,o,a){var l=b0(r,e),c=b0(t,e),p=a.get(c);if(p){v0(r,e,p);return}var h=o?o(l,c,e+"",r,t,a):void 0,y=h===void 0;if(y){var g=C0(c),v=!g&&f6(c),C=!g&&!v&&y6(c);h=c,g||v||C?C0(l)?h=l:zO(l)?h=AO(l):v?(y=!1,h=_O(c,!0)):C?(y=!1,h=LO(c,!0)):h=[]:qO(c)||x0(c)?(h=l,x0(l)?h=$O(l):(!on(l)||I0(l))&&(h=NO(c))):y=!1}y&&(a.set(c,h),n(h,c,i,o,a),a.delete(c)),v0(r,e,h)}u(EO,"baseMergeDeep");function u6(r,t){return XO(WO(r,t,v6),r+"")}u(u6,"baseRest");var DO=af?function(r,t){return af(r,"toString",{configurable:!0,enumerable:!1,value:QO(t),writable:!0})}:v6;function _O(r,t){if(t)return r.slice();var e=r.length,i=z7?z7(e):new r.constructor(e);return r.copy(i),i}u(_O,"cloneBuffer");function OO(r){var t=new r.constructor(r.byteLength);return new Z7(t).set(new Z7(r)),t}u(OO,"cloneArrayBuffer");function LO(r,t){var e=t?OO(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}u(LO,"cloneTypedArray");function AO(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}u(AO,"copyArray");function kO(r,t,e,i){var n=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var l=t[o],c=i?i(e[l],r[l],l,e,r):void 0;c===void 0&&(c=r[l]),n?S0(e,l,c):TO(e,l,c)}return e}u(kO,"copyObject");function FO(r){return u6(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&&GO(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var l=e[i];l&&r(t,l,i,o)}return t})}u(FO,"createAssigner");function BO(r){return function(t,e,i){for(var n=-1,o=Object(t),a=i(t),l=a.length;l--;){var c=a[r?l:++n];if(e(o[c],c,o)===!1)break}return t}}u(BO,"createBaseFor");function p6(r,t,e,i,n,o){return on(r)&&on(t)&&(o.set(t,r),T0(r,t,void 0,p6,o),o.delete(t)),r}u(p6,"customDefaultsMerge");function pf(r,t){var e=r.__data__;return VO(t)?e[typeof t=="string"?"string":"hash"]:e.map}u(pf,"getMapData");function M0(r,t){var e=X_(r,t);return PO(e)?e:void 0}u(M0,"getNative");function RO(r){var t=an.call(r,fa),e=r[fa];try{r[fa]=void 0;var i=!0}catch{}var n=s6.call(r);return i&&(t?r[fa]=e:delete r[fa]),n}u(RO,"getRawTag");function NO(r){return typeof r.constructor=="function"&&!h6(r)?tO(l6(r)):{}}u(NO,"initCloneObject");function d6(r,t){var e=typeof r;return t=t==null?Q7:t,!!t&&(e=="number"||e!="symbol"&&j_.test(r))&&r>-1&&r%1==0&&r<t}u(d6,"isIndex");function GO(r,t,e){if(!on(e))return!1;var i=typeof t;return(i=="number"?P0(e)&&d6(t,e.length):i=="string"&&t in e)?df(e[t],r):!1}u(GO,"isIterateeCall");function VO(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}u(VO,"isKeyable");function jO(r){return!!X7&&X7 in r}u(jO,"isMasked");function h6(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||sf;return r===e}u(h6,"isPrototype");function HO(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}u(HO,"nativeKeysIn");function UO(r){return s6.call(r)}u(UO,"objectToString");function WO(r,t,e){return t=$7(t===void 0?r.length-1:t,0),function(){for(var i=arguments,n=-1,o=$7(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var l=Array(t+1);++n<t;)l[n]=i[n];return l[t]=e(a),a6(r,this,l)}}u(WO,"overRest");function b0(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}u(b0,"safeGet");var XO=YO(DO);function YO(r){var t=0,e=0;return function(){var i=eO(),n=d_-(i-e);if(e=i,n>0){if(++t>=p_)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}u(YO,"shortOut");function ZO(r){if(r!=null){try{return lf.call(r)}catch{}try{return r+""}catch{}}return""}u(ZO,"toSource");function df(r,t){return r===t||r!==r&&t!==t}u(df,"eq");var x0=J7(function(){return arguments}())?J7:function(r){return yu(r)&&an.call(r,"callee")&&!J_.call(r,"callee")},C0=Array.isArray;function P0(r){return r!=null&&m6(r.length)&&!I0(r)}u(P0,"isArrayLike");function zO(r){return yu(r)&&P0(r)}u(zO,"isArrayLikeObject");var f6=Q_||eL;function I0(r){if(!on(r))return!1;var t=uf(r);return t==t6||t==v_||t==f_||t==S_}u(I0,"isFunction");function m6(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Q7}u(m6,"isLength");function on(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}u(on,"isObject");function yu(r){return r!=null&&typeof r=="object"}u(yu,"isObjectLike");function qO(r){if(!yu(r)||uf(r)!=r6)return!1;var t=l6(r);if(t===null)return!0;var e=an.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&lf.call(e)==q_}u(qO,"isPlainObject");var y6=W7?W_(W7):IO;function $O(r){return kO(r,g6(r))}u($O,"toPlainObject");var JO=u6(function(r){return r.push(void 0,p6),a6(KO,void 0,r)});function g6(r){return P0(r)?SO(r,!0):wO(r)}u(g6,"keysIn");var KO=FO(function(r,t,e,i){T0(r,t,e,i)});function QO(r){return function(){return r}}u(QO,"constant");function v6(r){return r}u(v6,"identity");function eL(){return!1}u(eL,"stubFalse");qs.exports=JO});var CT=V((tJ,Eu)=>{"use strict";m();var DL=!1,Ca=!1,fT=!0,mT=!1,f={},yT=!1;typeof Eu<"u"&&Eu.exports?(Eu.exports=f,yT=!0):typeof document<"u"?window.ClipperLib=f:self.ClipperLib=f;var Ef;yT?(it="chrome",Ef="Netscape"):(it=navigator.userAgent.toString().toLowerCase(),Ef=navigator.appName);var it,pe={};it.indexOf("chrome")!=-1&&it.indexOf("chromium")==-1?pe.chrome=1:pe.chrome=0;it.indexOf("chromium")!=-1?pe.chromium=1:pe.chromium=0;it.indexOf("safari")!=-1&&it.indexOf("chrome")==-1&&it.indexOf("chromium")==-1?pe.safari=1:pe.safari=0;it.indexOf("firefox")!=-1?pe.firefox=1:pe.firefox=0;it.indexOf("firefox/17")!=-1?pe.firefox17=1:pe.firefox17=0;it.indexOf("firefox/15")!=-1?pe.firefox15=1:pe.firefox15=0;it.indexOf("firefox/3")!=-1?pe.firefox3=1:pe.firefox3=0;it.indexOf("opera")!=-1?pe.opera=1:pe.opera=0;it.indexOf("msie 10")!=-1?pe.msie10=1:pe.msie10=0;it.indexOf("msie 9")!=-1?pe.msie9=1:pe.msie9=0;it.indexOf("msie 8")!=-1?pe.msie8=1:pe.msie8=0;it.indexOf("msie 7")!=-1?pe.msie7=1:pe.msie7=0;it.indexOf("msie ")!=-1?pe.msie=1:pe.msie=0;f.biginteger_used=null;var io,_L=0xdeadbeefcafe,dT=(_L&16777215)==15715070;function B(r,t,e){f.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}u(B,"BigInteger");function fe(){return new B(null)}u(fe,"nbi");function OL(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}u(OL,"am1");function LL(r,t,e,i,n,o){for(var a=t&32767,l=t>>15;--o>=0;){var c=this[r]&32767,p=this[r++]>>15,h=l*c+p*a;c=a*c+((h&32767)<<15)+e[i]+(n&1073741823),n=(c>>>30)+(h>>>15)+l*p+(n>>>30),e[i++]=c&1073741823}return n}u(LL,"am2");function AL(r,t,e,i,n,o){for(var a=t&16383,l=t>>14;--o>=0;){var c=this[r]&16383,p=this[r++]>>14,h=l*c+p*a;c=a*c+((h&16383)<<14)+e[i]+n,n=(c>>28)+(h>>14)+l*p,e[i++]=c&268435455}return n}u(AL,"am3");dT&&Ef=="Microsoft Internet Explorer"?(B.prototype.am=LL,io=30):dT&&Ef!="Netscape"?(B.prototype.am=OL,io=26):(B.prototype.am=AL,io=28);B.prototype.DB=io;B.prototype.DM=(1<<io)-1;B.prototype.DV=1<<io;var cv=52;B.prototype.FV=Math.pow(2,cv);B.prototype.F1=cv-io;B.prototype.F2=2*io-cv;var kL="0123456789abcdefghijklmnopqrstuvwxyz",_f=new Array,rl,br;rl=48;for(br=0;br<=9;++br)_f[rl++]=br;rl=97;for(br=10;br<36;++br)_f[rl++]=br;rl=65;for(br=10;br<36;++br)_f[rl++]=br;function hT(r){return kL.charAt(r)}u(hT,"int2char");function gT(r,t){var e=_f[r.charCodeAt(t)];return e==null?-1:e}u(gT,"intAt");function FL(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}u(FL,"bnpCopyTo");function BL(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}u(BL,"bnpFromInt");function ro(r){var t=fe();return t.fromInt(r),t}u(ro,"nbv");function RL(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:gT(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=e,o>=this.DB&&(o-=this.DB)}e==8&&r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&B.ZERO.subTo(this,this)}u(RL,"bnpFromString");function NL(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}u(NL,"bnpClamp");function GL(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,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(i=this[a]>>l)>0&&(n=!0,o=hT(i));a>=0;)l<t?(i=(this[a]&(1<<l)-1)<<t-l,i|=this[--a]>>(l+=this.DB-t)):(i=this[a]>>(l-=t)&e,l<=0&&(l+=this.DB,--a)),i>0&&(n=!0),n&&(o+=hT(i));return n?o:"0"}u(GL,"bnToString");function VL(){var r=fe();return B.ZERO.subTo(this,r),r}u(VL,"bnNegate");function jL(){return this.s<0?this.negate():this}u(jL,"bnAbs");function HL(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}u(HL,"bnCompareTo");function Of(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}u(Of,"nbits");function UL(){return this.t<=0?0:this.DB*(this.t-1)+Of(this[this.t-1]^this.s&this.DM)}u(UL,"bnBitLength");function WL(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}u(WL,"bnpDLShiftTo");function XL(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}u(XL,"bnpDRShiftTo");function YL(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,l;for(l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>i|a,a=(this[l]&n)<<e;for(l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}u(YL,"bnpLShiftTo");function ZL(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()}u(ZL,"bnpRShiftTo");function zL(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()}u(zL,"bnpSubTo");function qL(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&&B.ZERO.subTo(t,t)}u(qL,"bnpMultiplyTo");function $L(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()}u($L,"bnpSquareTo");function JL(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=fe());var o=fe(),a=this.s,l=r.s,c=this.DB-Of(i[i.t-1]);c>0?(i.lShiftTo(c,o),n.lShiftTo(c,e)):(i.copyTo(o),n.copyTo(e));var p=o.t,h=o[p-1];if(h!=0){var y=h*(1<<this.F1)+(p>1?o[p-2]>>this.F2:0),g=this.FV/y,v=(1<<this.F1)/y,C=1<<this.F2,M=e.t,b=M-p,x=t==null?fe():t;for(o.dlShiftTo(b,x),e.compareTo(x)>=0&&(e[e.t++]=1,e.subTo(x,e)),B.ONE.dlShiftTo(p,x),x.subTo(o,o);o.t<p;)o[o.t++]=0;for(;--b>=0;){var I=e[--M]==h?this.DM:Math.floor(e[M]*g+(e[M-1]+C)*v);if((e[M]+=o.am(0,I,e,b,0,p))<I)for(o.dlShiftTo(b,x),e.subTo(x,e);e[M]<--I;)e.subTo(x,e)}t!=null&&(e.drShiftTo(p,t),a!=l&&B.ZERO.subTo(t,t)),e.t=p,e.clamp(),c>0&&e.rShiftTo(c,e),a<0&&B.ZERO.subTo(e,e)}}}u(JL,"bnpDivRemTo");function KL(r){var t=fe();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(B.ZERO)>0&&r.subTo(t,t),t}u(KL,"bnMod");function Sa(r){this.m=r}u(Sa,"Classic");function QL(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}u(QL,"cConvert");function eA(r){return r}u(eA,"cRevert");function tA(r){r.divRemTo(this.m,null,r)}u(tA,"cReduce");function rA(r,t,e){r.multiplyTo(t,e),this.reduce(e)}u(rA,"cMulTo");function iA(r,t){r.squareTo(t),this.reduce(t)}u(iA,"cSqrTo");Sa.prototype.convert=QL;Sa.prototype.revert=eA;Sa.prototype.reduce=tA;Sa.prototype.mulTo=rA;Sa.prototype.sqrTo=iA;function nA(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}u(nA,"bnpInvDigit");function Ta(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}u(Ta,"Montgomery");function oA(r){var t=fe();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(B.ZERO)>0&&this.m.subTo(t,t),t}u(oA,"montConvert");function aA(r){var t=fe();return r.copyTo(t),this.reduce(t),t}u(aA,"montRevert");function sA(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)}u(sA,"montReduce");function lA(r,t){r.squareTo(t),this.reduce(t)}u(lA,"montSqrTo");function cA(r,t,e){r.multiplyTo(t,e),this.reduce(e)}u(cA,"montMulTo");Ta.prototype.convert=oA;Ta.prototype.revert=aA;Ta.prototype.reduce=sA;Ta.prototype.mulTo=cA;Ta.prototype.sqrTo=lA;function uA(){return(this.t>0?this[0]&1:this.s)==0}u(uA,"bnpIsEven");function pA(r,t){if(r>4294967295||r<1)return B.ONE;var e=fe(),i=fe(),n=t.convert(this),o=Of(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)}u(pA,"bnpExp");function dA(r,t){var e;return r<256||t.isEven()?e=new Sa(t):e=new Ta(t),this.exp(r,e)}u(dA,"bnModPowInt");B.prototype.copyTo=FL;B.prototype.fromInt=BL;B.prototype.fromString=RL;B.prototype.clamp=NL;B.prototype.dlShiftTo=WL;B.prototype.drShiftTo=XL;B.prototype.lShiftTo=YL;B.prototype.rShiftTo=ZL;B.prototype.subTo=zL;B.prototype.multiplyTo=qL;B.prototype.squareTo=$L;B.prototype.divRemTo=JL;B.prototype.invDigit=nA;B.prototype.isEven=uA;B.prototype.exp=pA;B.prototype.toString=GL;B.prototype.negate=VL;B.prototype.abs=jL;B.prototype.compareTo=HL;B.prototype.bitLength=UL;B.prototype.mod=KL;B.prototype.modPowInt=dA;B.ZERO=ro(0);B.ONE=ro(1);function hA(){var r=fe();return this.copyTo(r),r}u(hA,"bnClone");function fA(){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]}u(fA,"bnIntValue");function mA(){return this.t==0?this.s:this[0]<<24>>24}u(mA,"bnByteValue");function yA(){return this.t==0?this.s:this[0]<<16>>16}u(yA,"bnShortValue");function gA(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}u(gA,"bnpChunkSize");function vA(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}u(vA,"bnSigNum");function bA(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=ro(e),n=fe(),o=fe(),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}u(bA,"bnpToRadix");function xA(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,l=0;l<r.length;++l){var c=gT(r,l);if(c<0){r.charAt(l)=="-"&&this.signum()==0&&(n=!0);continue}a=t*a+c,++o>=e&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),n&&B.ZERO.subTo(this,this)}u(xA,"bnpFromRadix");function CA(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(B.ONE.shiftLeft(r-1),uv,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(B.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)}}u(CA,"bnpFromNumber");function SA(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[n++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),i&128&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(t[n++]=i);return t}u(SA,"bnToByteArray");function TA(r){return this.compareTo(r)==0}u(TA,"bnEquals");function MA(r){return this.compareTo(r)<0?this:r}u(MA,"bnMin");function PA(r){return this.compareTo(r)>0?this:r}u(PA,"bnMax");function IA(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()}u(IA,"bnpBitwiseTo");function wA(r,t){return r&t}u(wA,"op_and");function EA(r){var t=fe();return this.bitwiseTo(r,wA,t),t}u(EA,"bnAnd");function uv(r,t){return r|t}u(uv,"op_or");function DA(r){var t=fe();return this.bitwiseTo(r,uv,t),t}u(DA,"bnOr");function vT(r,t){return r^t}u(vT,"op_xor");function _A(r){var t=fe();return this.bitwiseTo(r,vT,t),t}u(_A,"bnXor");function bT(r,t){return r&~t}u(bT,"op_andnot");function OA(r){var t=fe();return this.bitwiseTo(r,bT,t),t}u(OA,"bnAndNot");function LA(){for(var r=fe(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}u(LA,"bnNot");function AA(r){var t=fe();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}u(AA,"bnShiftLeft");function kA(r){var t=fe();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}u(kA,"bnShiftRight");function FA(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}u(FA,"lbit");function BA(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+FA(this[r]);return this.s<0?this.t*this.DB:-1}u(BA,"bnGetLowestSetBit");function RA(r){for(var t=0;r!=0;)r&=r-1,++t;return t}u(RA,"cbit");function NA(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=RA(this[e]^t);return r}u(NA,"bnBitCount");function GA(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}u(GA,"bnTestBit");function VA(r,t){var e=B.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}u(VA,"bnpChangeBit");function jA(r){return this.changeBit(r,uv)}u(jA,"bnSetBit");function HA(r){return this.changeBit(r,bT)}u(HA,"bnClearBit");function UA(r){return this.changeBit(r,vT)}u(UA,"bnFlipBit");function WA(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()}u(WA,"bnpAddTo");function XA(r){var t=fe();return this.addTo(r,t),t}u(XA,"bnAdd");function YA(r){var t=fe();return this.subTo(r,t),t}u(YA,"bnSubtract");function ZA(r){var t=fe();return this.multiplyTo(r,t),t}u(ZA,"bnMultiply");function zA(){var r=fe();return this.squareTo(r),r}u(zA,"bnSquare");function qA(r){var t=fe();return this.divRemTo(r,t,null),t}u(qA,"bnDivide");function $A(r){var t=fe();return this.divRemTo(r,null,t),t}u($A,"bnRemainder");function JA(r){var t=fe(),e=fe();return this.divRemTo(r,t,e),new Array(t,e)}u(JA,"bnDivideAndRemainder");function KA(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}u(KA,"bnpDMultiply");function QA(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]}}u(QA,"bnpDAddOffset");function Du(){}u(Du,"NullExp");function xT(r){return r}u(xT,"nNop");function ek(r,t,e){r.multiplyTo(t,e)}u(ek,"nMulTo");function tk(r,t){r.squareTo(t)}u(tk,"nSqrTo");Du.prototype.convert=xT;Du.prototype.revert=xT;Du.prototype.mulTo=ek;Du.prototype.sqrTo=tk;function rk(r){return this.exp(r,new Du)}u(rk,"bnPow");function ik(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()}u(ik,"bnpMultiplyLowerTo");function nk(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)}u(nk,"bnpMultiplyUpperTo");function il(r){this.r2=fe(),this.q3=fe(),B.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}u(il,"Barrett");function ok(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=fe();return r.copyTo(t),this.reduce(t),t}u(ok,"barrettConvert");function ak(r){return r}u(ak,"barrettRevert");function sk(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)}u(sk,"barrettReduce");function lk(r,t){r.squareTo(t),this.reduce(t)}u(lk,"barrettSqrTo");function ck(r,t,e){r.multiplyTo(t,e),this.reduce(e)}u(ck,"barrettMulTo");il.prototype.convert=ok;il.prototype.revert=ak;il.prototype.reduce=sk;il.prototype.mulTo=ck;il.prototype.sqrTo=lk;function uk(r,t){var e=r.bitLength(),i,n=ro(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 Sa(t):t.isEven()?o=new il(t):o=new Ta(t);var a=new Array,l=3,c=i-1,p=(1<<i)-1;if(a[1]=o.convert(this),i>1){var h=fe();for(o.sqrTo(a[1],h);l<=p;)a[l]=fe(),o.mulTo(h,a[l-2],a[l]),l+=2}var y=r.t-1,g,v=!0,C=fe(),M;for(e=Of(r[y])-1;y>=0;){for(e>=c?g=r[y]>>e-c&p:(g=(r[y]&(1<<e+1)-1)<<c-e,y>0&&(g|=r[y-1]>>this.DB+e-c)),l=i;!(g&1);)g>>=1,--l;if((e-=l)<0&&(e+=this.DB,--y),v)a[g].copyTo(n),v=!1;else{for(;l>1;)o.sqrTo(n,C),o.sqrTo(C,n),l-=2;l>0?o.sqrTo(n,C):(M=n,n=C,C=M),o.mulTo(C,a[g],n)}for(;y>=0&&!(r[y]&1<<e);)o.sqrTo(n,C),M=n,n=C,C=M,--e<0&&(e=this.DB-1,--y)}return o.revert(n)}u(uk,"bnModPow");function pk(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}u(pk,"bnGCD");function dk(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}u(dk,"bnpModInt");function hk(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return B.ZERO;for(var e=r.clone(),i=this.clone(),n=ro(1),o=ro(0),a=ro(0),l=ro(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()||!l.isEven())&&(a.addTo(this,a),l.subTo(r,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(r,l),l.rShiftTo(1,l);e.compareTo(i)>=0?(e.subTo(i,e),t&&n.subTo(a,n),o.subTo(l,o)):(i.subTo(e,i),t&&a.subTo(n,a),l.subTo(o,l))}if(i.compareTo(B.ONE)!=0)return B.ZERO;if(l.compareTo(r)>=0)return l.subtract(r);if(l.signum()<0)l.addTo(r,l);else return l;return l.signum()<0?l.add(r):l}u(hk,"bnModInverse");var Mt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],fk=(1<<26)/Mt[Mt.length-1];function mk(r){var t,e=this.abs();if(e.t==1&&e[0]<=Mt[Mt.length-1]){for(t=0;t<Mt.length;++t)if(e[0]==Mt[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<Mt.length;){for(var i=Mt[t],n=t+1;n<Mt.length&&i<fk;)i*=Mt[n++];for(i=e.modInt(i);t<n;)if(i%Mt[t++]==0)return!1}return e.millerRabin(r)}u(mk,"bnIsProbablePrime");function yk(r){var t=this.subtract(B.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>Mt.length&&(r=Mt.length);for(var n=fe(),o=0;o<r;++o){n.fromInt(Mt[Math.floor(Math.random()*Mt.length)]);var a=n.modPow(i,this);if(a.compareTo(B.ONE)!=0&&a.compareTo(t)!=0){for(var l=1;l++<e&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(B.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}u(yk,"bnpMillerRabin");B.prototype.chunkSize=gA;B.prototype.toRadix=bA;B.prototype.fromRadix=xA;B.prototype.fromNumber=CA;B.prototype.bitwiseTo=IA;B.prototype.changeBit=VA;B.prototype.addTo=WA;B.prototype.dMultiply=KA;B.prototype.dAddOffset=QA;B.prototype.multiplyLowerTo=ik;B.prototype.multiplyUpperTo=nk;B.prototype.modInt=dk;B.prototype.millerRabin=yk;B.prototype.clone=hA;B.prototype.intValue=fA;B.prototype.byteValue=mA;B.prototype.shortValue=yA;B.prototype.signum=vA;B.prototype.toByteArray=SA;B.prototype.equals=TA;B.prototype.min=MA;B.prototype.max=PA;B.prototype.and=EA;B.prototype.or=DA;B.prototype.xor=_A;B.prototype.andNot=OA;B.prototype.not=LA;B.prototype.shiftLeft=AA;B.prototype.shiftRight=kA;B.prototype.getLowestSetBit=BA;B.prototype.bitCount=NA;B.prototype.testBit=GA;B.prototype.setBit=jA;B.prototype.clearBit=HA;B.prototype.flipBit=UA;B.prototype.add=XA;B.prototype.subtract=YA;B.prototype.multiply=ZA;B.prototype.divide=qA;B.prototype.remainder=$A;B.prototype.divideAndRemainder=JA;B.prototype.modPow=uk;B.prototype.modInverse=hk;B.prototype.pow=rk;B.prototype.gcd=pk;B.prototype.isProbablePrime=mk;B.prototype.square=zA;var ce=B;ce.prototype.IsNegative=function(){return this.compareTo(ce.ZERO)==-1};ce.op_Equality=function(r,t){return r.compareTo(t)==0};ce.op_Inequality=function(r,t){return r.compareTo(t)!=0};ce.op_GreaterThan=function(r,t){return r.compareTo(t)>0};ce.op_LessThan=function(r,t){return r.compareTo(t)<0};ce.op_Addition=function(r,t){return new ce(r).add(new ce(t))};ce.op_Subtraction=function(r,t){return new ce(r).subtract(new ce(t))};ce.Int128Mul=function(r,t){return new ce(r).multiply(new ce(t))};ce.op_Division=function(r,t){return r.divide(t)};ce.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Df>"u"&&(Df=u(function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var i=Object.getOwnPropertyNames(t.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(t.prototype,i[n]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}},"Inherit"));var Df;f.Path=function(){return[]};f.Paths=function(){return[]};f.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};f.DoublePoint0=function(){this.X=0,this.Y=0};f.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};f.DoublePoint2=function(r,t){this.X=r,this.Y=t};f.PolyNode=function(){this.m_Parent=null,this.m_polygon=new f.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};f.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};f.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};f.PolyNode.prototype.Contour=function(){return this.m_polygon};f.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};f.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};f.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};f.PolyNode.prototype.Childs=function(){return this.m_Childs};f.PolyNode.prototype.Parent=function(){return this.m_Parent};f.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};f.PolyTree=function(){this.m_AllPolys=[],f.PolyNode.call(this)};f.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};f.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};f.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};Df(f.PolyTree,f.PolyNode);f.Math_Abs_Int64=f.Math_Abs_Int32=f.Math_Abs_Double=function(r){return Math.abs(r)};f.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};pe.msie||pe.opera||pe.safari?f.Cast_Int32=function(r){return r|0}:f.Cast_Int32=function(r){return~~r};pe.chrome?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:pe.firefox&&typeof Number.toInteger=="function"?f.Cast_Int64=function(r){return Number.toInteger(r)}:pe.msie7||pe.msie8?f.Cast_Int64=function(r){return parseInt(r,10)}:pe.msie?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:f.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};f.Clear=function(r){r.length=0};f.PI=3.141592653589793;f.PI2=2*3.141592653589793;f.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,Ca)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof f.DoublePoint){var e=r[0];this.X=f.Clipper.Round(e.X),this.Y=f.Clipper.Round(e.Y),this.Z=0}else{var i=r[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof f.DoublePoint){var e=r[0];this.X=f.Clipper.Round(e.X),this.Y=f.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};f.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};f.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};Ca?(f.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y),this.Z=0},f.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},f.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(f.IntPoint0=function(){this.X=0,this.Y=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y)},f.IntPoint2=function(r,t){this.X=r,this.Y=t});f.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};f.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};f.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};f.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};f.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};f.PolyType={ptSubject:0,ptClip:1};f.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};f.JoinType={jtSquare:0,jtRound:1,jtMiter:2};f.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};mT&&(f.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});f.EdgeSide={esLeft:0,esRight:1};f.Direction={dRightToLeft:0,dLeftToRight:1};f.TEdge=function(){this.Bot=new f.IntPoint,this.Curr=new f.IntPoint,this.Top=new f.IntPoint,this.Delta=new f.IntPoint,this.Dx=0,this.PolyTyp=f.PolyType.ptSubject,this.Side=f.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};f.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new f.IntPoint};f.MyIntersectNodeSort=function(){};f.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};f.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};f.Scanbeam=function(){this.Y=0,this.Next=null};f.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};f.OutPt=function(){this.Idx=0,this.Pt=new f.IntPoint,this.Next=null,this.Prev=null};f.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new f.IntPoint};f.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};f.ClipperBase.horizontal=-9007199254740992;f.ClipperBase.Skip=-2;f.ClipperBase.Unassigned=-1;f.ClipperBase.tolerance=1e-20;DL?(f.ClipperBase.loRange=46340,f.ClipperBase.hiRange=46340):(f.ClipperBase.loRange=47453132,f.ClipperBase.hiRange=0xfffffffffffff);f.ClipperBase.near_zero=function(r){return r>-f.ClipperBase.tolerance&&r<f.ClipperBase.tolerance};f.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};f.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(f.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};f.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,i){return i?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&ce.op_Equality(ce.Int128Mul(r.X-t.X,e.Y-t.Y),ce.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};f.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var i=t;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,e))return!0;if(i=i.Next,i==t)break}return!1};f.ClipperBase.prototype.SlopesEqual=f.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,n,o,a,l,c;return t==3?(e=r[0],i=r[1],c=r[2],c?ce.op_Equality(ce.Int128Mul(e.Delta.Y,i.Delta.X),ce.Int128Mul(e.Delta.X,i.Delta.Y)):f.Cast_Int64(e.Delta.Y*i.Delta.X)==f.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(n=r[0],o=r[1],a=r[2],c=r[3],c?ce.op_Equality(ce.Int128Mul(n.Y-o.Y,o.X-a.X),ce.Int128Mul(n.X-o.X,o.Y-a.Y)):f.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-f.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=r[0],o=r[1],a=r[2],l=r[3],c=r[4],c?ce.op_Equality(ce.Int128Mul(n.Y-o.Y,a.X-l.X),ce.Int128Mul(n.X-o.X,a.Y-l.Y)):f.Cast_Int64((n.Y-o.Y)*(a.X-l.X))-f.Cast_Int64((n.X-o.X)*(a.Y-l.Y))===0)};f.ClipperBase.SlopesEqual3=function(r,t,e){return e?ce.op_Equality(ce.Int128Mul(r.Delta.Y,t.Delta.X),ce.Int128Mul(r.Delta.X,t.Delta.Y)):f.Cast_Int64(r.Delta.Y*t.Delta.X)==f.Cast_Int64(r.Delta.X*t.Delta.Y)};f.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?ce.op_Equality(ce.Int128Mul(r.Y-t.Y,t.X-e.X),ce.Int128Mul(r.X-t.X,t.Y-e.Y)):f.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-f.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};f.ClipperBase.SlopesEqual5=function(r,t,e,i,n){return n?ce.op_Equality(ce.Int128Mul(r.Y-t.Y,e.X-i.X),ce.Int128Mul(r.X-t.X,e.Y-i.Y)):f.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-f.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};f.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,i=this.m_edges[r].length;e<i;++e)this.m_edges[r][e]=null;f.Clear(this.m_edges[r])}f.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};f.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};f.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>f.ClipperBase.hiRange||r.Y>f.ClipperBase.hiRange||-r.X>f.ClipperBase.hiRange||-r.Y>f.ClipperBase.hiRange)&&f.Error("Coordinate outside allowed range in RangeTest()."):(r.X>f.ClipperBase.loRange||r.Y>f.ClipperBase.loRange||-r.X>f.ClipperBase.loRange||-r.Y>f.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};f.ClipperBase.prototype.InitEdge=function(r,t,e,i){r.Next=t,r.Prev=e,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};f.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};f.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;f.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||f.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=f.ClipperBase.horizontal&&r.Prev.Dx!=f.ClipperBase.horizontal)break;for(;r.Prev.Dx==f.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==f.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};f.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,n,o;if(r.Dx==f.ClipperBase.horizontal&&(t?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=f.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=f.ClipperBase.Skip;)i=i.Next;if(i.Dx==f.ClipperBase.horizontal&&i.Next.OutIdx!=f.ClipperBase.Skip){for(n=i;n.Prev.Dx==f.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?t||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=f.ClipperBase.Skip;)i=i.Prev;if(i.Dx==f.ClipperBase.horizontal&&i.Prev.OutIdx!=f.ClipperBase.Skip){for(n=i;n.Next.Dx==f.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?t||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==f.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var a=new f.LocalMinima;a.Next=null,a.Y=r.Bot.Y,a.LeftBound=null,a.RightBound=r,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,t),this.InsertLocalMinima(a)}}return i};f.ClipperBase.prototype.AddPath=function(r,t,e){fT?!e&&t==f.PolyType.ptClip&&f.Error("AddPath: Open paths must be subject."):e||f.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&f.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&f.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new f.TEdge);var a=!0;n[1].Curr.X=r[1].X,n[1].Curr.Y=r[1].Y;var l={Value:this.m_UseFullRange};this.RangeTest(r[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(r[i],l),this.m_UseFullRange=l.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)l.Value=this.m_UseFullRange,this.RangeTest(r[o],l),this.m_UseFullRange=l.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var c=n[0],p=c,h=c;;){if(f.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==c&&(c=p.Next),p=this.RemoveEdge(p),h=p;continue}if(p.Prev==p.Next)break;if(e&&f.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==c&&(c=p.Next),p=this.RemoveEdge(p),p=p.Prev,h=p;continue}if(p=p.Next,p==h)break}if(!e&&p==p.Next||e&&p.Prev==p.Next)return!1;e||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=f.ClipperBase.Skip);var y=c;p=c;do this.InitEdge2(p,t),p=p.Next,a&&p.Curr.Y!=c.Curr.Y&&(a=!1);while(p!=c);if(a){if(e)return!1;p.Prev.OutIdx=f.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var g=new f.LocalMinima;for(g.Next=null,g.Y=p.Bot.Y,g.LeftBound=null,g.RightBound=p,g.RightBound.Side=f.EdgeSide.esRight,g.RightBound.WindDelta=0;p.Next.OutIdx!=f.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 v,C=null;p=this.FindNextLocMin(p),p!=C;){C==null&&(C=p);var g=new f.LocalMinima;g.Next=null,g.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(g.LeftBound=p.Prev,g.RightBound=p,v=!1):(g.LeftBound=p,g.RightBound=p.Prev,v=!0),g.LeftBound.Side=f.EdgeSide.esLeft,g.RightBound.Side=f.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,v);var M=this.ProcessBound(g.RightBound,!v);g.LeftBound.OutIdx==f.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==f.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),v||(p=M)}return!0};f.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],t,e)&&(i=!0);return i};f.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return f.IntPoint.op_Equality(r,e)||f.IntPoint.op_Equality(r,t)||f.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};f.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};f.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=f.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};f.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};f.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};f.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,Ca&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};f.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=f.EdgeSide.esLeft,t.OutIdx=f.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=f.EdgeSide.esRight,t.OutIdx=f.ClipperBase.Unassigned),r=r.Next}};f.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=f.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=f.PolyFillType.pftEvenOdd,this.m_SubjFillType=f.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,f.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=f.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,Ca&&(this.ZFillFunction=null)};f.Clipper.ioReverseSolution=1;f.Clipper.ioStrictlySimple=2;f.Clipper.ioPreserveCollinear=4;f.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),f.ClipperBase.prototype.Clear.call(this))};f.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};f.Clipper.prototype.Reset=function(){f.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};f.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new f.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new f.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new f.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};f.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof f.PolyTree;if(t==4&&!e){var i=r[0],n=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&f.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,f.Clear(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var l=this.ExecuteInternal();l&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==4&&e){var i=r[0],c=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var l=this.ExecuteInternal();l&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==2&&!e){var i=r[0],n=r[1];return this.Execute(i,n,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],c=r[1];return this.Execute(i,c,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}};f.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};f.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),f.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{f.Clear(this.m_Joins),f.Clear(this.m_GhostJoins)}};f.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};f.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);f.Clear(this.m_PolyOuts)};f.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};f.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};f.Clipper.prototype.AddJoin=function(r,t,e){var i=new f.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};f.Clipper.prototype.AddGhostJoin=function(r,t){var e=new f.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};Ca&&(f.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});f.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(i=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(f.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&f.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var n=0,o=this.m_GhostJoins.length;n<o;n++){var a=this.m_GhostJoins[n];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,e.Bot,e.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&f.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,l,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&f.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,l,e.Top)}var c=t.NextInAEL;if(c!==null)for(;c!=e;)this.IntersectEdges(e,c,t.Curr,!1),c=c.NextInAEL}}}};f.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};f.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<f.Clipper.TopX(r,t.Top.Y):r.Top.X>f.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};f.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_SubjFillType==f.PolyFillType.pftEvenOdd:this.m_ClipFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_ClipFillType==f.PolyFillType.pftEvenOdd:this.m_SubjFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==f.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case f.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case f.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case f.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case f.ClipType.ctIntersection:switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctUnion:switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case f.ClipType.ctDifference:if(r.PolyTyp==f.PolyType.ptSubject)switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctXor:if(r.WindDelta===0)switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};f.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=f.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,i=t.PrevInAEL;i!==null;)i.PolyTyp==t.PolyTyp&&i.WindDelta!==0&&(e=!e),i=i.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};f.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};f.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};f.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};f.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};f.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};f.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,n,o;if(f.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=f.EdgeSide.esLeft,t.Side=f.EdgeSide.esRight,n=r,n.PrevInAEL==t?o=t.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=f.EdgeSide.esRight,t.Side=f.EdgeSide.esLeft,n=t,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&f.Clipper.TopX(o,e.Y)==f.Clipper.TopX(n,e.Y)&&f.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,e);this.AddJoin(i,a,n.Top)}return i};f.Clipper.prototype.CreateOutRec=function(){var r=new f.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};f.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==f.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var n=new f.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),Ca&&(f.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):f.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),r.OutIdx=i.Idx,n}else{var i=this.m_PolyOuts[r.OutIdx],o=i.Pts;if(e&&f.IntPoint.op_Equality(t,o.Pt))return o;if(!e&&f.IntPoint.op_Equality(t,o.Prev.Pt))return o.Prev;var n=new f.OutPt;return n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,e&&(i.Pts=n),Ca&&(f.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):f.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),n}};f.Clipper.prototype.SwapPoints=function(r,t){var e=new f.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};f.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,i){return r.X>e.X==r.X<i.X||t.X>e.X==t.X<i.X||e.X>r.X==e.X<t.X||i.X>r.X==i.X<t.X||r.X==e.X&&t.X==i.X?!0:r.X==i.X&&t.X==e.X};f.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new f.OutPt;return i.Pt.X=e.X,i.Pt.Y=e.Y,t==r.Next?(r.Next=i,t.Prev=i,i.Next=t,i.Prev=r):(t.Next=i,r.Prev=i,i.Next=r,i.Prev=t),i};f.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;e&&(t.IsHole=!0)};f.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?f.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};f.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;f.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;f.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var n=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;f.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var o=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;f.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var a=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=o&&i>=a||n>=o&&n>=a};f.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;f.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};f.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,i=t.BottomPt;return e.Pt.Y>i.Pt.Y?r:e.Pt.Y<i.Pt.Y?t:e.Pt.X<i.Pt.X?r:e.Pt.X>i.Pt.X||e.Next==e?t:i.Next==i||this.FirstIsBottomPt(e,i)?r:t};f.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};f.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};f.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],n;this.Param1RightOfParam2(e,i)?n=i:this.Param1RightOfParam2(i,e)?n=e:n=this.GetLowermostRec(e,i);var o=e.Pts,a=o.Prev,l=i.Pts,c=l.Prev,p;r.Side==f.EdgeSide.esLeft?(t.Side==f.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=o,o.Prev=l,a.Next=c,c.Prev=a,e.Pts=c):(c.Next=o,o.Prev=c,l.Prev=a,a.Next=l,e.Pts=l),p=f.EdgeSide.esLeft):(t.Side==f.EdgeSide.esRight?(this.ReversePolyPtLinks(l),a.Next=c,c.Prev=a,l.Next=o,o.Prev=l):(a.Next=l,l.Prev=a,o.Prev=c,c.Next=o),p=f.EdgeSide.esRight),e.BottomPt=null,n==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var h=r.OutIdx,y=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==y){g.OutIdx=h,g.Side=p;break}g=g.NextInAEL}i.Idx=e.Idx};f.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};f.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};f.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};f.Clipper.prototype.IntersectEdges=function(r,t,e,i){var n=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,o=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,a=r.OutIdx>=0,l=t.OutIdx>=0;if(fT&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(n||o)&&a&&l&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==f.ClipType.ctUnion?r.WindDelta===0?l&&(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):a&&(this.AddOutPt(t,e),l&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),l&&(t.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):f.Error("Error intersecting polylines")),o&&(t.OutIdx<0?this.DeleteFromAEL(t):f.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var c=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=c}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var p,h,y,g;r.PolyTyp==f.PolyType.ptSubject?(p=this.m_SubjFillType,y=this.m_ClipFillType):(p=this.m_ClipFillType,y=this.m_SubjFillType),t.PolyTyp==f.PolyType.ptSubject?(h=this.m_SubjFillType,g=this.m_ClipFillType):(h=this.m_ClipFillType,g=this.m_SubjFillType);var v,C;switch(p){case f.PolyFillType.pftPositive:v=r.WindCnt;break;case f.PolyFillType.pftNegative:v=-r.WindCnt;break;default:v=Math.abs(r.WindCnt);break}switch(h){case f.PolyFillType.pftPositive:C=t.WindCnt;break;case f.PolyFillType.pftNegative:C=-t.WindCnt;break;default:C=Math.abs(t.WindCnt);break}if(a&&l)n||o||v!==0&&v!=1||C!==0&&C!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=f.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if(a)(C===0||C==1)&&(this.AddOutPt(r,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if(l)(v===0||v==1)&&(this.AddOutPt(t,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if((v===0||v==1)&&(C===0||C==1)&&!n&&!o){var M,b;switch(y){case f.PolyFillType.pftPositive:M=r.WindCnt2;break;case f.PolyFillType.pftNegative:M=-r.WindCnt2;break;default:M=Math.abs(r.WindCnt2);break}switch(g){case f.PolyFillType.pftPositive:b=t.WindCnt2;break;case f.PolyFillType.pftNegative:b=-t.WindCnt2;break;default:b=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(v==1&&C==1)switch(this.m_ClipType){case f.ClipType.ctIntersection:M>0&&b>0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctUnion:M<=0&&b<=0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctDifference:(r.PolyTyp==f.PolyType.ptClip&&M>0&&b>0||r.PolyTyp==f.PolyType.ptSubject&&M<=0&&b<=0)&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else f.Clipper.SwapSides(r,t)}n!=o&&(n&&r.OutIdx>=0||o&&t.OutIdx>=0)&&(f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(t)};f.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};f.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};f.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&f.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,f.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};f.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};f.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=f.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=f.Direction.dRightToLeft)};f.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=f.EdgeSide.esLeft&&(e=e.Prev),t&&(f.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};f.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,n=e.Left,o=e.Right,a=r,l=null;a.NextInLML!==null&&f.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(l=this.GetMaximaPair(a));;){for(var c=r==a,p=this.GetNextInAEL(r,i);p!==null&&!(p.Curr.X==r.Top.X&&r.NextInLML!==null&&p.Dx<r.NextInLML.Dx);){var h=this.GetNextInAEL(p,i);if(i==f.Direction.dLeftToRight&&p.Curr.X<=o||i==f.Direction.dRightToLeft&&p.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),p==l&&c){i==f.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),l.OutIdx>=0&&f.Error("ProcessHorizontal error");return}else if(i==f.Direction.dLeftToRight){var y=new f.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,y,!0)}else{var y=new f.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,y,!0)}this.SwapPositionsInAEL(r,p)}else if(i==f.Direction.dLeftToRight&&p.Curr.X>=o||i==f.Direction.dRightToLeft&&p.Curr.X<=n)break;p=h}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&f.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,e),i=e.Dir,n=e.Left,o=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var g=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var v=r.PrevInAEL,h=r.NextInAEL;if(v!==null&&v.Curr.X==r.Bot.X&&v.Curr.Y==r.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&f.ClipperBase.SlopesEqual(r,v,this.m_UseFullRange)){var C=this.AddOutPt(v,r.Bot);this.AddJoin(g,C,r.Top)}else if(h!==null&&h.Curr.X==r.Bot.X&&h.Curr.Y==r.Bot.Y&&h.WindDelta!==0&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&f.ClipperBase.SlopesEqual(r,h,this.m_UseFullRange)){var C=this.AddOutPt(h,r.Bot);this.AddJoin(g,C,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else l!==null?l.OutIdx>=0?(i==f.Direction.dLeftToRight?this.IntersectEdges(r,l,r.Top,!1):this.IntersectEdges(l,r,r.Top,!1),l.OutIdx>=0&&f.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(l)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};f.Clipper.prototype.GetNextInAEL=function(r,t){return t==f.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};f.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};f.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};f.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};f.Clipper.prototype.GetMaximaPair=function(r){var t=null;return f.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:f.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!f.ClipperBase.IsHorizontal(t))?null:t};f.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,f.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};f.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=f.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var n=e.NextInSEL,o=new f.IntPoint;if(e.Curr.X>n.Curr.X){!this.IntersectPoint(e,n,o)&&e.Curr.X>n.Curr.X+1&&f.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(e.Dx)>Math.abs(n.Dx)?o.X=f.Clipper.TopX(n,r):o.X=f.Clipper.TopX(e,r));var a=new f.IntersectNode;a.Edge1=e,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(e,n),i=!0}else e=n}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};f.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};f.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};f.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var i=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=i}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};f.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var gk=u(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),vk=u(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),bk=u(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),xk=u(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");pe.msie?f.Clipper.Round=gk:pe.chromium?f.Clipper.Round=bk:pe.safari?f.Clipper.Round=xk:f.Clipper.Round=vk;f.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+f.Clipper.Round(r.Dx*(t-r.Bot.Y))};f.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,n;if(f.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,f.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(n=t.Bot.Y-t.Bot.X/t.Dx,e.Y=f.Clipper.Round(e.X/t.Dx+n));else if(t.Delta.X===0)e.X=t.Bot.X,f.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=f.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=t.Bot.X-t.Bot.Y*t.Dx;var o=(n-i)/(r.Dx-t.Dx);e.Y=f.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=f.Clipper.Round(r.Dx*o+i):e.X=f.Clipper.Round(t.Dx*o+n)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=f.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=f.Clipper.TopX(r,e.Y):e.X=f.Clipper.TopX(t,e.Y)}return!0};f.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var i=this.GetMaximaPair(t);e=i===null||!f.ClipperBase.IsHorizontal(i)}if(e){var n=t.PrevInAEL;this.DoMaxima(t),n===null?t=this.m_ActiveEdges:t=n.NextInAEL}else{if(this.IsIntermediate(t,r)&&f.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=f.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var n=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==t.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,t.Curr),a=this.AddOutPt(t,t.Curr);this.AddJoin(o,a,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var o=null;t.OutIdx>=0&&(o=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var n=t.PrevInAEL,l=t.NextInAEL;if(n!==null&&n.Curr.X==t.Bot.X&&n.Curr.Y==t.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&f.ClipperBase.SlopesEqual(t,n,this.m_UseFullRange)&&t.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,t.Bot);this.AddJoin(o,a,t.Top)}else if(l!==null&&l.Curr.X==t.Bot.X&&l.Curr.Y==t.Bot.Y&&o!==null&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&f.ClipperBase.SlopesEqual(t,l,this.m_UseFullRange)&&t.WindDelta!==0&&l.WindDelta!==0){var a=this.AddOutPt(l,t.Bot);this.AddJoin(o,a,t.Top)}}t=t.NextInAEL}};f.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,i=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):f.Error("DoMaxima error")};f.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};f.Clipper.Orientation=function(r){return f.Clipper.Area(r)>=0};f.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};f.Clipper.prototype.BuildResult=function(r){f.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];if(i.Pts!==null){var n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),l=0;l<o;l++)a[l]=n.Pt,n=n.Prev;r.push(a)}}}};f.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new f.PolyNode;r.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,l=0;l<n;l++)o.m_polygon[l]=a.Pt,a=a.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};f.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(f.IntPoint.op_Equality(e.Pt,e.Next.Pt)||f.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||f.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var i=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,i=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};f.Clipper.prototype.DupOutPt=function(r,t){var e=new f.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};f.Clipper.prototype.GetOverlap=function(r,t,e,i,n){return r<t?e<i?(n.Left=Math.max(r,e),n.Right=Math.min(t,i)):(n.Left=Math.max(r,i),n.Right=Math.min(t,e)):e<i?(n.Left=Math.max(t,e),n.Right=Math.min(r,i)):(n.Left=Math.max(t,i),n.Right=Math.min(r,e)),n.Left<n.Right};f.Clipper.prototype.JoinHorz=function(r,t,e,i,n,o){var a=r.Pt.X>t.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight,l=e.Pt.X>i.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight;if(a==l)return!1;if(a==f.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,!o),f.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=n.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;!o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,o),f.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,o))}if(l==f.Direction.dLeftToRight){for(;e.Next.Pt.X<=n.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,!o),f.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,!o))}else{for(;e.Next.Pt.X>=n.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;!o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,o),f.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,o))}return a==f.Direction.dLeftToRight==o?(r.Prev=e,e.Next=r,t.Next=i,i.Prev=t):(r.Next=e,e.Prev=r,t.Prev=i,i.Next=t),!0};f.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,n=new f.OutPt,o=r.OutPt2,a=new f.OutPt,l=r.OutPt1.Pt.Y==r.OffPt.Y;if(l&&f.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&f.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(n=r.OutPt1.Next;n!=i&&f.IntPoint.op_Equality(n.Pt,r.OffPt);)n=n.Next;var c=n.Pt.Y>r.OffPt.Y;for(a=r.OutPt2.Next;a!=o&&f.IntPoint.op_Equality(a.Pt,r.OffPt);)a=a.Next;var p=a.Pt.Y>r.OffPt.Y;return c==p?!1:c?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}else if(l){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var h={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,h))return!1;var y=h.Left,g=h.Right,v=new f.IntPoint,C;return i.Pt.X>=y&&i.Pt.X<=g?(v.X=i.Pt.X,v.Y=i.Pt.Y,C=i.Pt.X>n.Pt.X):o.Pt.X>=y&&o.Pt.X<=g?(v.X=o.Pt.X,v.Y=o.Pt.Y,C=o.Pt.X>a.Pt.X):n.Pt.X>=y&&n.Pt.X<=g?(v.X=n.Pt.X,v.Y=n.Pt.Y,C=n.Pt.X>i.Pt.X):(v.X=a.Pt.X,v.Y=a.Pt.Y,C=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,v,C)}else{for(n=i.Next;f.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var M=n.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(M){for(n=i.Prev;f.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;f.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var b=a.Pt.Y>o.Pt.Y||!f.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(b){for(a=o.Prev;f.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!f.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||t==e&&M==b?!1:M?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}};f.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new f.IntRect(0,0,0,0);var i=new f.IntRect;for(i.left=r[t][0].X,i.right=i.left,i.top=r[t][0].Y,i.bottom=i.top;t<e;t++)for(var n=0,o=r[t].length;n<o;n++)r[t][n].X<i.left?i.left=r[t][n].X:r[t][n].X>i.right&&(i.right=r[t][n].X),r[t][n].Y<i.top?i.top=r[t][n].Y:r[t][n].Y>i.bottom&&(i.bottom=r[t][n].Y);return i};f.Clipper.prototype.GetBounds2=function(r){var t=r,e=new f.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};f.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var n=t[0],o=1;o<=i;++o){var a=o==i?t[0]:t[o];if(a.Y==r.Y&&(a.X==r.X||n.Y==r.Y&&a.X>r.X==n.X<r.X))return-1;if(n.Y<r.Y!=a.Y<r.Y){if(n.X>=r.X)if(a.X>r.X)e=1-e;else{var l=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(l==0)return-1;l>0==a.Y>n.Y&&(e=1-e)}else if(a.X>r.X){var l=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(l==0)return-1;l>0==a.Y>n.Y&&(e=1-e)}}n=a}return e};f.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var n=t.Pt.X,o=t.Pt.Y,a=t.Next.Pt.X,l=t.Next.Pt.Y;if(l==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=l<r.Y){if(n>=r.X)if(a>r.X)e=1-e;else{var c=(n-r.X)*(l-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==l>o&&(e=1-e)}else if(a>r.X){var c=(n-r.X)*(l-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==l>o&&(e=1-e)}}if(t=t.Next,i==t)break}return e};f.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var i=this.PointInPolygon(e.Pt,t);if(i>=0)return i!=0;e=e.Next}while(e!=r);return!0};f.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,t.Pts)&&(n.FirstLeft=t)}};f.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,n=i.length,o=i[e];e<n;e++,o=i[e])o.FirstLeft==r&&(o.FirstLeft=t)};f.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};f.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],i=this.GetOutRec(e.OutPt1.Idx),n=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||n.Pts==null)){var o;if(i==n?o=i:this.Param1RightOfParam2(i,n)?o=n:this.Param1RightOfParam2(n,i)?o=i:o=this.GetLowermostRec(i,n),!!this.JoinPoints(e,i,n))if(i==n){if(i.Pts=e.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=e.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,l=this.m_PolyOuts.length;a<l-1;a++){var c=this.m_PolyOuts[a];c.Pts==null||f.Clipper.ParseFirstLeft(c.FirstLeft)!=i||c.IsHole==i.IsHole||this.Poly2ContainsPoly1(c.Pts,e.OutPt2)&&(c.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};f.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};f.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var i=e.Next;i!=t.Pts;){if(f.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var n=e.Prev,o=i.Prev;e.Prev=o,o.Next=e,i.Prev=n,n.Next=i,t.Pts=e;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,t.Pts)?(a.IsHole=!t.IsHole,a.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,a.Pts)?(a.IsHole=t.IsHole,t.IsHole=!a.IsHole,a.FirstLeft=t.FirstLeft,t.FirstLeft=a):(a.IsHole=t.IsHole,a.FirstLeft=t.FirstLeft),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};f.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,n=t-1;i<t;++i)e+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-e*.5};f.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};mT&&(f.Clipper.OffsetPaths=function(r,t,e,i,n){var o=new f.Paths,a=new f.ClipperOffset(n,n);return a.AddPaths(r,e,i),a.Execute(o,t),o});f.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,e,t,t),e};f.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=f.PolyFillType.pftEvenOdd);var e=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,e,t,t),e};f.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};f.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,n=e.X-t.X,o=i*t.X+n*t.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};f.Clipper.SlopesNearCollinear=function(r,t,e,i){return f.Clipper.DistanceFromLineSqrd(t,r,e)<i};f.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,n=r.Y-t.Y;return i*i+n*n<=e};f.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};f.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var i=new Array(e),n=0;n<e;++n)i[n]=new f.OutPt;for(var n=0;n<e;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%e],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=t*t,a=i[0];a.Idx==0&&a.Next!=a.Prev;)f.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=f.Clipper.ExcludeOp(a),e--):f.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(f.Clipper.ExcludeOp(a.Next),a=f.Clipper.ExcludeOp(a),e-=2):f.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=f.Clipper.ExcludeOp(a),e--):(a.Idx=1,a=a.Next);e<3&&(e=0);for(var l=new Array(e),n=0;n<e;++n)l[n]=new f.IntPoint(a.Pt),a=a.Next;return i=null,l};f.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,n=r.length;i<n;i++)e[i]=f.Clipper.CleanPolygon(r[i],t);return e};f.Clipper.Minkowski=function(r,t,e,i){var n=i?1:0,o=r.length,a=t.length,l=new Array;if(e)for(var c=0;c<a;c++){for(var p=new Array(o),h=0,y=r.length,g=r[h];h<y;h++,g=r[h])p[h]=new f.IntPoint(t[c].X+g.X,t[c].Y+g.Y);l.push(p)}else for(var c=0;c<a;c++){for(var p=new Array(o),h=0,y=r.length,g=r[h];h<y;h++,g=r[h])p[h]=new f.IntPoint(t[c].X-g.X,t[c].Y-g.Y);l.push(p)}for(var v=new Array,c=0;c<a-1+n;c++)for(var h=0;h<o;h++){var C=new Array;C.push(l[c%a][h%o]),C.push(l[(c+1)%a][h%o]),C.push(l[(c+1)%a][(h+1)%o]),C.push(l[c%a][(h+1)%o]),f.Clipper.Orientation(C)||C.reverse(),v.push(C)}var M=new f.Clipper(0);return M.AddPaths(v,f.PolyType.ptSubject,!0),M.Execute(f.ClipType.ctUnion,l,f.PolyFillType.pftNonZero,f.PolyFillType.pftNonZero),l};f.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],n=r[2];return f.Clipper.Minkowski(e,i,!0,n)}else if(t==4){for(var e=r[0],o=r[1],a=r[2],n=r[3],l=new f.Clipper,c,p=0,h=o.length;p<h;++p){var c=f.Clipper.Minkowski(e,o[p],!0,n);l.AddPaths(c,f.PolyType.ptSubject,!0)}n&&l.AddPaths(o,f.PolyType.ptClip,!0);var y=new f.Paths;return l.Execute(f.ClipType.ctUnion,y,a,a),y}};f.Clipper.MinkowskiDiff=function(r,t,e){return f.Clipper.Minkowski(r,t,!1,e)};f.Clipper.PolyTreeToPaths=function(r){var t=new Array;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntAny,t),t};f.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case f.Clipper.NodeType.ntOpen:return;case f.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,l=o[n];n<a;n++,l=o[n])f.Clipper.AddPolyNodeToPaths(l,t,e)};f.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new f.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};f.Clipper.ClosedPathsFromPolyTree=function(r){var t=new f.Paths;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntClosed,t),t};Df(f.Clipper,f.ClipperBase);f.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};f.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=f.ClipperOffset.def_arc_tolerance),this.m_destPolys=new f.Paths,this.m_srcPoly=new f.Path,this.m_destPoly=new f.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new f.IntPoint,this.m_polyNodes=new f.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};f.ClipperOffset.two_pi=6.28318530717959;f.ClipperOffset.def_arc_tolerance=.25;f.ClipperOffset.prototype.Clear=function(){f.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};f.ClipperOffset.Round=f.Clipper.Round;f.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var n=new f.PolyNode;if(n.m_jointype=t,n.m_endtype=e,e==f.EndType.etClosedLine||e==f.EndType.etClosedPolygon)for(;i>0&&f.IntPoint.op_Equality(r[0],r[i]);)i--;n.m_polygon.push(r[0]);for(var o=0,a=0,l=1;l<=i;l++)f.IntPoint.op_Inequality(n.m_polygon[o],r[l])&&(o++,n.m_polygon.push(r[l]),(r[l].Y>n.m_polygon[a].Y||r[l].Y==n.m_polygon[a].Y&&r[l].X<n.m_polygon[a].X)&&(a=o));if(!(e==f.EndType.etClosedPolygon&&o<2||e!=f.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),e==f.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new f.IntPoint(0,a);else{var c=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>c.Y||n.m_polygon[a].Y==c.Y&&n.m_polygon[a].X<c.X)&&(this.m_lowest=new f.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};f.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],t,e)};f.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!f.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==f.EndType.etClosedPolygon||t.m_endtype==f.EndType.etClosedLine&&f.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==f.EndType.etClosedLine&&!f.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};f.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new f.DoublePoint(0,0);var n=1/Math.sqrt(e*e+i*i);return e*=n,i*=n,new f.DoublePoint(i,-e)};f.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,f.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==f.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=f.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*f.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*f.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(f.ClipperOffset.two_pi/n),this.m_cos=Math.cos(f.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/f.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||e.m_endtype!=f.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(e.m_jointype==f.JoinType.jtRound)for(var a=1,l=0,c=1;c<=n;c++){this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+l*r)));var p=a;a=a*this.m_cos-this.m_sin*l,l=p*this.m_sin+l*this.m_cos}else for(var a=-1,l=-1,c=0;c<4;++c)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+l*r))),a<0?a=1:l<0?l=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var c=0;c<o-1;c++)this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(e.m_endtype==f.EndType.etClosedLine||e.m_endtype==f.EndType.etClosedPolygon?this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new f.DoublePoint(this.m_normals[o-2])),e.m_endtype==f.EndType.etClosedPolygon){for(var h=o-1,c=0;c<o;c++)h=this.OffsetPoint(c,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==f.EndType.etClosedLine){for(var h=o-1,c=0;c<o;c++)h=this.OffsetPoint(c,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var y=this.m_normals[o-1],c=o-1;c>0;c--)this.m_normals[c]=new f.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new f.DoublePoint(-y.X,-y.Y),h=0;for(var c=o-1;c>=0;c--)h=this.OffsetPoint(c,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var h=0,c=1;c<o-1;++c)h=this.OffsetPoint(c,h,e.m_jointype);var g;if(e.m_endtype==f.EndType.etOpenButt){var c=o-1;g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*r),f.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*r)),this.m_destPoly.push(g),g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*r),f.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*r)),this.m_destPoly.push(g)}else{var c=o-1;h=o-2,this.m_sinA=0,this.m_normals[c]=new f.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),e.m_endtype==f.EndType.etOpenSquare?this.DoSquare(c,h):this.DoRound(c,h)}for(var c=o-1;c>0;c--)this.m_normals[c]=new f.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new f.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),h=o-1;for(var c=h-1;c>0;--c)h=this.OffsetPoint(c,h,e.m_jointype);e.m_endtype==f.EndType.etOpenButt?(g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(h=1,this.m_sinA=0,e.m_endtype==f.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};f.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof f.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new f.Clipper(0);if(n.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var o=f.Clipper.GetBounds(this.m_destPolys),a=new f.Path;if(a.push(new f.IntPoint(o.left-10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.top-10)),a.push(new f.IntPoint(o.left-10,o.top-10)),n.AddPath(a,f.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var l=e.Childs()[0];e.Childs()[0]=l.Childs()[0];for(var c=1;c<l.ChildCount();c++)e.AddChild(l.Childs()[c])}else e.Clear()}}else{var e=r[0],i=r[1];f.Clear(e),this.FixOrientations(),this.DoOffset(i);var n=new f.Clipper(0);if(n.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var o=f.Clipper.GetBounds(this.m_destPolys),a=new f.Path;a.push(new f.IntPoint(o.left-10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.top-10)),a.push(new f.IntPoint(o.left-10,o.top-10)),n.AddPath(a,f.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};f.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new f.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case f.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);i>=this.m_miterLim?this.DoMiter(r,t,i):this.DoSquare(r,t);break}case f.JoinType.jtSquare:this.DoSquare(r,t);break;case f.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};f.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};f.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),f.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};f.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),i=f.Cast_Int32(f.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),n=this.m_normals[t].X,o=this.m_normals[t].Y,a,l=0;l<i;++l)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};f.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};f.JS={};f.JS.AreaOfPolygon=function(r,t){return t||(t=1),f.Clipper.Area(r)/(t*t)};f.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=f.Clipper.Area(r[i]);return e/(t*t)};f.JS.BoundsOfPath=function(r,t){return f.JS.BoundsOfPaths([r],t)};f.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=f.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};f.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=f.JS.Clone(i);if(typeof t!="number"||t===null)return f.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||t<0)return i;e||(i=[i]);for(var n=i.length,o,a,l,c,p,h,y,g=[],v=0;v<n;v++)if(a=i[v],o=a.length,o!==0){if(o<3){l=a,g.push(l);continue}for(l=a,c=t*t,p=a[0],h=1,y=1;y<o;y++)(a[y].X-p.X)*(a[y].X-p.X)+(a[y].Y-p.Y)*(a[y].Y-p.Y)<=c||(l[h]=a[y],p=a[y],h++);p=a[h-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=c&&h--,h<o&&l.splice(h,o-h),l.length&&g.push(l)}return!e&&g.length?g=g[0]:!e&&g.length===0?g=[]:e&&g.length===0&&(g=[[]]),g};f.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,n,o,a,l=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};l[n]=a}return t||(l=l[0]),l};f.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return f.Error("Tolerance is not a number in Lighten()."),f.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return f.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,n,o,a,l,c,p,h,y,g,v,C,M,b,x,I,w=r.length,E=t*t,_=[];for(e=0;e<w;e++)if(n=r[e],l=n.length,l!=0){for(o=0;o<1e6;o++){for(a=[],l=n.length,n[l-1].X!=n[0].X||n[l-1].Y!=n[0].Y?(v=1,n.push({X:n[0].X,Y:n[0].Y}),l=n.length):v=0,g=[],i=0;i<l-2;i++)c=n[i],h=n[i+1],p=n[i+2],x=c.X,I=c.Y,C=p.X-x,M=p.Y-I,(C!==0||M!==0)&&(b=((h.X-x)*C+(h.Y-I)*M)/(C*C+M*M),b>1?(x=p.X,I=p.Y):b>0&&(x+=C*b,I+=M*b)),C=h.X-x,M=h.Y-I,y=C*C+M*M,y<=E&&(g[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<l-1;i++)g[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[l-1].X,Y:n[l-1].Y}),v&&n.pop(),g.length)n=a;else break}l=a.length,a[l-1].X==a[0].X&&a[l-1].Y==a[0].Y&&a.pop(),a.length>2&&_.push(a)}return!r[0]instanceof Array&&(_=_[0]),typeof _>"u"&&(_=[[]]),_};f.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,l=0,c=0,p=0,h=0,y=r.length;if(y<2)return 0;for(t&&(r[y]=r[0],y++);--y;)o=r[y],l=o.X,c=o.Y,a=r[y-1],p=a.X,h=a.Y,n+=i((l-p)*(l-p)+(c-h)*(c-h));return t&&r.pop(),n/e};f.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,n=0;n<r.length;n++)i+=f.JS.PerimeterOfPath(r[n],t,e);return i};f.JS.ScaleDownPath=function(r,t){var e,i;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=i.X/t,i.Y=i.Y/t};f.JS.ScaleDownPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=n.X/t,n.Y=n.Y/t};f.JS.ScaleUpPath=function(r,t){var e,i,n=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=n(i.X*t),i.Y=n(i.Y*t)};f.JS.ScaleUpPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=o(n.X*t),n.Y=o(n.Y*t)};f.ExPolygons=function(){return[]};f.ExPolygon=function(){this.outer=null,this.holes=null};f.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new f.ExPolygon;e.outer=r.Contour();var i=r.Childs(),n=i.length;e.holes=new Array(n);var o,a,l,c,p,h;for(l=0;l<n;l++)for(o=i[l],e.holes[l]=o.Contour(),c=0,p=o.Childs(),h=p.length;c<h;c++)a=p[c],f.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(e)};f.JS.ExPolygonsToPaths=function(r){var t,e,i,n,o=new f.Paths;for(t=0,i=r.length;t<i;t++)for(o.push(r[t].outer),e=0,n=r[t].holes.length;e<n;e++)o.push(r[t].holes[e]);return o};f.JS.PolyTreeToExPolygons=function(r){var t=new f.ExPolygons,e,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)e=n[i],f.JS.AddOuterPolyNodeToExPolygons(e,t);return t};Eu.exports=f});var LM=V((Vae,Dm)=>{m();(function(){"use strict";function r(a,l){var c=a.x-l.x,p=a.y-l.y;return c*c+p*p}u(r,"getSqDist");function t(a,l,c){var p=l.x,h=l.y,y=c.x-p,g=c.y-h;if(y!==0||g!==0){var v=((a.x-p)*y+(a.y-h)*g)/(y*y+g*g);v>1?(p=c.x,h=c.y):v>0&&(p+=y*v,h+=g*v)}return y=a.x-p,g=a.y-h,y*y+g*g}u(t,"getSqSegDist");function e(a,l){for(var c=a[0],p=[c],h,y=1,g=a.length;y<g;y++)h=a[y],r(h,c)>l&&(p.push(h),c=h);return c!==h&&p.push(h),p}u(e,"simplifyRadialDist");function i(a,l,c,p,h){for(var y=p,g,v=l+1;v<c;v++){var C=t(a[v],a[l],a[c]);C>y&&(g=v,y=C)}y>p&&(g-l>1&&i(a,l,g,p,h),h.push(a[g]),c-g>1&&i(a,g,c,p,h))}u(i,"simplifyDPStep");function n(a,l){var c=a.length-1,p=[a[0]];return i(a,0,c,l,p),p.push(a[c]),p}u(n,"simplifyDouglasPeucker");function o(a,l,c){if(a.length<=2)return a;var p=l!==void 0?l*l:1;return a=c?a:e(a,p),a=n(a,p),a}u(o,"simplify"),typeof define=="function"&&define.amd?define(function(){return o}):typeof Dm<"u"?(Dm.exports=o,Dm.exports.default=o):typeof self<"u"?self.simplify=o:window.simplify=o})()});m();function h3(r,t,e=!1){let i=null,n=0;return function(...o){n++,n===1&&e===!0&&r(...o);let a=u(()=>{(!e||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,t)}}u(h3,"debounce");m();m();var Pd="[MappedinJS]",$m=(n=>(n[n.LOG=0]="LOG",n[n.WARN=1]="WARN",n[n.ERROR=2]="ERROR",n[n.SILENT=3]="SILENT",n))($m||{});function f3(r){0<=r&&r<=3&&(m3.logState=r)}u(f3,"setLoggerLevel");var m3={logState:T.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(Pd,...r)},warn(...r){this.logState<=1&&console.warn(Pd,...r)},error(...r){this.logState<=2&&console.error(Pd,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,t){throw new Error("".concat(Pd," ").concat(r),t)}},L=m3;m();m();var Jm=class Jm extends Error{};u(Jm,"InvalidTokenError");var wo=Jm;wo.prototype.name="InvalidTokenError";function u8(r){return decodeURIComponent(atob(r).replace(/(.)/g,(t,e)=>{let i=e.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}u(u8,"b64DecodeUnicode");function p8(r){let t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return u8(t)}catch{return atob(t)}}u(p8,"base64UrlDecode");function y3(r,t){if(typeof r!="string")throw new wo("Invalid token specified: must be a string");t||(t={});let e=t.header===!0?0:1,i=r.split(".")[e];if(typeof i!="string")throw new wo("Invalid token specified: missing part #".concat(e+1));let n;try{n=p8(i)}catch(o){throw new wo("Invalid token specified: invalid base64 for part #".concat(e+1," (").concat(o.message,")"))}try{return JSON.parse(n)}catch(o){throw new wo("Invalid token specified: invalid json for part #".concat(e+1," (").concat(o.message,")"))}}u(y3,"jwtDecode");function Id(r){var e,i;let t=y3(r);if(t.sub==null)throw new Error("Access token is missing sub claim.");return{sub:t.sub,aud:typeof t.aud=="string"?[t.aud]:(e=t.aud)!=null?e:[],capabilities:(i=t.capabilities)!=null?i:{}}}u(Id,"decodeAccessToken");function On(r){return r*(Math.PI/180)}u(On,"toRadians");function d8(r){return r*(180/Math.PI)}u(d8,"toDegrees");function g3(r,t){return(r%t+t)%t}u(g3,"euclideanModulo");function wd([r,t],[e,i]){let n=On(i-t),o=On(e-r),a=On(t),l=On(i),c=Math.sin(n/2)*Math.sin(n/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(a)*Math.cos(l),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return Jl*p}u(wd,"haversineDistance");function v3([r,t],[e,i]){let n=On(t),o=On(r),a=On(i),c=On(e)-o,p=Math.sin(c)*Math.cos(a),h=Math.cos(n)*Math.sin(a)-Math.sin(n)*Math.cos(a)*Math.cos(c);return d8((Math.atan2(p,h)+Math.PI*2)%(Math.PI*2))}u(v3,"getForwardBearing");function Ed(r,t){let e=g3(r,Math.PI*2),i=g3(t,Math.PI*2),n=i-e,o=i+(n>Math.PI?-Math.PI*2:n<-Math.PI?Math.PI*2:0);return{start:e,end:o}}u(Ed,"shortestTweenRotation");m();var Km=class Km{constructor(){d(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach(function(i){typeof i=="function"&&i(e)})}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||this._subscribers[t]==null)return;let i=this._subscribers[t].indexOf(e);i!==-1&&this._subscribers[t].splice(i,1)}destroy(){this._subscribers={}}};u(Km,"PubSub");var q=Km;m();var b3="mi-session-data",x3="mi-local-data",Eo,Tr,Mr,tc=class tc{constructor(){S(this,Tr,void 0);S(this,Mr,void 0);try{let t=sessionStorage.getItem(b3);t?P(this,Tr,JSON.parse(t)):P(this,Tr,{id:ue()})}catch{P(this,Tr,{id:ue()})}try{let t=localStorage.getItem(x3);t?P(this,Mr,JSON.parse(t)):P(this,Mr,{deviceId:ue()})}catch{P(this,Mr,{deviceId:ue()})}s(this,Tr).id||(s(this,Tr).id=ue()),s(this,Mr).deviceId||(s(this,Mr).deviceId=ue())}static getInstance(){return s(this,Eo)||P(this,Eo,new tc),s(this,Eo)}static ___clearInstance(){P(this,Eo,void 0)}saveSessionData(t,e){s(this,Tr)[t]=e;try{return sessionStorage.setItem(b3,JSON.stringify(s(this,Tr))),!0}catch{return!1}}loadSessionData(t){let e=s(this,Tr)[t];if(e!=null)return e}saveLocalData(t,e){s(this,Mr)[t]=e;try{return localStorage.setItem(x3,JSON.stringify(s(this,Mr))),!0}catch{return!1}}loadLocalData(t){let e=s(this,Mr)[t];if(e!=null)return e}};Eo=new WeakMap,Tr=new WeakMap,Mr=new WeakMap,u(tc,"SafeStorage"),S(tc,Eo,void 0);var Vi=tc;m();m();var es=class es{constructor(t,e,i){d(this,"__type",es.__type);d(this,"id",ue());d(this,"latitude");d(this,"longitude");d(this,"floorId");this.latitude=t,this.longitude=e,this.floorId=i}static is(t){return t.__type===es.__type}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId}}destroy(){}};u(es,"Coordinate"),d(es,"__type","coordinate");var Qm=es,ne=Qm;m();var ey=class ey{constructor(t){d(this,"id");this.id=t}};u(ey,"BaseMetaData");var yt=ey;var Ln,gt,Do,_o,ts=class ts extends yt{constructor(e,i){super(i.mvfData.properties.id);d(this,"__type",ts.__type);S(this,Ln,void 0);S(this,gt,{});S(this,Do,void 0);S(this,_o,void 0);P(this,Ln,e),P(this,Do,i.floorId),P(this,_o,i.mvfData)}static is(e){return e.__type===ts.__type}get locations(){return s(this,gt).locations?s(this,gt).locations:(s(this,gt).locations=(s(this,Ln).locationIdsByNodeId[this.id]||[]).map(e=>s(this,Ln).getById("enterprise-location",e)).filter(Boolean),s(this,gt).locations)}get floor(){let e=s(this,Ln).getById("floor",s(this,Do));if(e==null)throw new Error("Floor ".concat(s(this,Do)," not found!"));return e}get coordinate(){if(s(this,gt).coordinate==null){let[e,i]=s(this,_o).geometry.coordinates;s(this,gt).coordinate=new ne(i,e,s(this,Do))}return s(this,gt).coordinate}get externalId(){var e;return(e=s(this,_o).properties.externalId)!=null?e:""}get neighbors(){if(s(this,gt).neighbours==null){let e=s(this,_o).properties.neighbors.map(i=>{let n=s(this,Ln).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});s(this,gt).neighbours=e}return s(this,gt).neighbours}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(s(this,gt)))delete s(this,gt)[e]}};Ln=new WeakMap,gt=new WeakMap,Do=new WeakMap,_o=new WeakMap,u(ts,"Node"),d(ts,"__type","node");var ty=ts,Pr=ty;m();m();m();m();var ic,rs,rc=class rc extends yt{constructor(e){super(String(ue()));S(this,ic,{});S(this,rs,void 0);P(this,rs,e.mvfData)}static is(e){return e.__type===rc.__type}get url(){return s(this,rs).url}get name(){return s(this,rs).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,ic)))delete s(this,ic)[e]}};ic=new WeakMap,rs=new WeakMap,u(rc,"Hyperlink"),d(rc,"__type","hyperlink");var ry=rc,nc=ry;m();var ac,Oo,oc=class oc extends yt{constructor(e){super(String(ue()));S(this,ac,{});S(this,Oo,void 0);P(this,Oo,e.mvfData)}static is(e){return e.__type===oc.__type}get url(){return s(this,Oo).url}get name(){return s(this,Oo).altText}get altText(){return s(this,Oo).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,ac)))delete s(this,ac)[e]}};ac=new WeakMap,Oo=new WeakMap,u(oc,"Image"),d(oc,"__type","image");var iy=oc,sc=iy;var ny=class ny{constructor(t,e,i){d(this,"id");d(this,"links");d(this,"images");var n,o,a,l;this.id=t,this.links=(o=(n=i==null?void 0:i.links)==null?void 0:n.map(c=>new nc({mvfData:c})))!=null?o:[],this.images=(l=(a=i==null?void 0:i.images)==null?void 0:a.map(c=>new sc({mvfData:{...c,url:e.sasToken?c.url+"?".concat(e.sasToken):c.url}})))!=null?l:[]}};u(ny,"BaseMapData");var Be=ny;var Lo,hr,Ir,ns,is=class is extends Be{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",is.__type);S(this,Lo,void 0);S(this,hr,{});S(this,Ir,void 0);S(this,ns,void 0);P(this,Lo,e),P(this,Ir,i.mvfData),P(this,ns,i.facadeId)}static is(e){return e.__type===is.__type}get type(){return s(this,Ir).type}get name(){var e;return(e=s(this,Ir).name)!=null?e:""}get externalId(){var e;return(e=s(this,Ir).externalId)!=null?e:""}get floors(){var e,i;if(s(this,hr).floors==null){let n=((i=(e=s(this,Ir).floors)!=null?e:s(this,Ir).maps)!=null?i:[]).reduce((o,a)=>{let l=s(this,Lo).floorsById[a];return l&&o.push(l),o},[]);n.length===0&&L.error("Floor stack ".concat(this.id," has no floors")),s(this,hr).floors=n}return s(this,hr).floors}get defaultFloor(){if(s(this,hr).defaultFloor!=null)return s(this,hr).defaultFloor;let e=s(this,Ir).defaultFloor?s(this,Lo).getById("floor",s(this,Ir).defaultFloor):void 0;return s(this,hr).defaultFloor=e||this.floors.reduce((i,n)=>Math.abs(n.elevation)<Math.abs(i.elevation)?n:i),s(this,hr).defaultFloor}get facade(){return s(this,ns)?s(this,Lo).facadesById[s(this,ns)]:void 0}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,hr)))delete s(this,hr)[e]}};Lo=new WeakMap,hr=new WeakMap,Ir=new WeakMap,ns=new WeakMap,u(is,"FloorStack"),d(is,"__type","floor-stack");var oy=is,lc=oy;m();m();m();var cc,Ao,as,An,os=class os extends Be{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",os.__type);S(this,cc,void 0);S(this,Ao,void 0);S(this,as,{});S(this,An,void 0);P(this,cc,e),P(this,Ao,i.floorId),P(this,An,i.mvfData)}static is(e){return e.__type===os.__type}get name(){var e,i;return(i=(e=s(this,An).properties.details)==null?void 0:e.name)!=null?i:""}get externalId(){var e;return(e=s(this,An).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,An).properties.details)==null?void 0:e.description)!=null?i:""}get center(){var e;if(s(this,as).center==null){let[i,n]=(e=s(this,An).properties.center)!=null?e:[0,0];s(this,as).center=new ne(n,i,s(this,Ao))}return s(this,as).center}get floor(){let e=s(this,cc).getById("floor",s(this,Ao));if(e==null)throw new Error("Floor ".concat(s(this,Ao)," not found!"));return e}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};cc=new WeakMap,Ao=new WeakMap,as=new WeakMap,An=new WeakMap,u(os,"Area"),d(os,"__type","area");var ay=os,ji=ay;m();var ko,Hi,Fo,ni,ss=class ss extends Be{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",ss.__type);S(this,ko,void 0);S(this,Hi,void 0);S(this,Fo,void 0);S(this,ni,void 0);P(this,Hi,{}),P(this,ni,i.mvfData),P(this,ko,e),P(this,Fo,i.floorId)}static is(e){return e.__type===ss.__type}get name(){var e,i,n;return"details"in s(this,ni).properties?(n=(i=s(this,ni).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,ni).properties.externalId)!=null?e:""}get externalId(){var e;return(e=s(this,ni).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,ni).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=s(this,ko).getById("floor",s(this,Fo));if(e==null)throw new Error("Floor ".concat(s(this,Fo)," not found!"));return e}get center(){if(s(this,Hi).center==null){let[[e,i],[n,o]]=s(this,ni).geometry.coordinates,a=(e+n)/2,l=(i+o)/2;s(this,Hi).center=new ne(l,a,s(this,Fo))}return s(this,Hi).center}get isExterior(){var n;let e=s(this,ko).obstructionIdByEntranceId[this.id],i=s(this,ko).getMVFFeatureById("obstruction",e);return(n=i==null?void 0:i.properties.footprintComponent)!=null?n:!1}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,Hi)))delete s(this,Hi)[e]}};ko=new WeakMap,Hi=new WeakMap,Fo=new WeakMap,ni=new WeakMap,u(ss,"Door"),d(ss,"__type","door");var sy=ss,$t=sy;m();var kn,Bo,Jt,Bt,ls=class ls extends Be{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",ls.__type);S(this,kn,void 0);S(this,Bo,void 0);S(this,Jt,{});S(this,Bt,void 0);P(this,kn,e),P(this,Bo,i.floorId),P(this,Bt,i.mvfData)}getMvfData(){return s(this,Bt)}static is(e){return e.__type===ls.__type}get name(){var e,i,n;return"details"in s(this,Bt).properties?(n=(i=s(this,Bt).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,Bt).properties.externalId)!=null?e:""}get type(){return f8(s(this,Bt).properties.kind)}get description(){var e,i;return(i=(e=s(this,Bt).properties.details)==null?void 0:e.description)!=null?i:""}get externalId(){var e;return(e=s(this,Bt).properties.externalId)!=null?e:""}get locations(){if(s(this,Jt).locations)return s(this,Jt).locations;s(this,Jt).locations=[];let e=s(this,kn).locationsBySpaceId[s(this,Bt).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let n=s(this,kn).getById("enterprise-location",i.id);n&&s(this,Jt).locations.push(n)}return s(this,Jt).locations}get floor(){let e=s(this,kn).getById("floor",s(this,Bo));if(e==null)throw new Error("Floor ".concat(s(this,Bo)," not found!"));return e}get doors(){return s(this,Bt).properties.destinationNodes.reduce((e,i)=>{let n=s(this,kn).doorsByNodeId[i];return n&&e.push(n),e},[])}get center(){var e;if(s(this,Jt).center==null){let[i,n]=(e=s(this,Bt).properties.center)!=null?e:[0,0];s(this,Jt).center=new ne(n,i,s(this,Bo))}return s(this,Jt).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,Jt)))delete s(this,Jt)[e]}};kn=new WeakMap,Bo=new WeakMap,Jt=new WeakMap,Bt=new WeakMap,u(ls,"Space"),d(ls,"__type","space");var ly=ls,h8=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function f8(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return h8.includes(t)?t:"room"}u(f8,"validateSpaceType");var ot=ly;m();var wr,Pe,Ui,cs=class cs extends Be{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",cs.__type);S(this,wr,void 0);S(this,Pe,{});S(this,Ui,void 0);P(this,wr,e),P(this,Ui,i.mvfData)}static is(e){return e.__type===cs.__type}get name(){var e,i;return"name"in s(this,Ui)?(i=s(this,Ui).name)!=null?i:"":(e=s(this,Ui).externalId)!=null?e:""}get externalId(){var e;return(e=s(this,Ui).externalId)!=null?e:""}get elevation(){return s(this,Ui).elevation}get spaces(){if(s(this,Pe).spaces==null){let e=s(this,wr).spaces.filter(i=>i.floor.id===this.id);s(this,Pe).spaces=e}return s(this,Pe).spaces}get objects(){if(s(this,Pe).objects==null){let e=s(this,wr).objects.filter(i=>i.floor.id===this.id);s(this,Pe).objects=e}return s(this,Pe).objects}get connections(){if(s(this,Pe).connections==null){let e=s(this,wr).connections.filter(i=>i.floors.includes(this));s(this,Pe).connections=e}return s(this,Pe).connections}get doors(){if(s(this,Pe).doors==null){let e=s(this,wr).doors.filter(i=>i.floor.id===this.id);s(this,Pe).doors=e}return s(this,Pe).doors}get annotations(){if(s(this,Pe).annotations==null){let e=s(this,wr).annotations.filter(i=>i.floor.id===this.id);s(this,Pe).annotations=e}return s(this,Pe).annotations}get pois(){if(s(this,Pe).pois==null){let e=s(this,wr).pointsOfInterest.filter(i=>i.floor.id===this.id);s(this,Pe).pois=e}return s(this,Pe).pois}get floorStack(){if(s(this,Pe).floorStack==null){let e=s(this,wr).floorStacks.find(i=>i.floors.includes(this));s(this,Pe).floorStack=e}return s(this,Pe).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,Pe)))delete s(this,Pe)[e]}};wr=new WeakMap,Pe=new WeakMap,Ui=new WeakMap,u(cs,"Floor"),d(cs,"__type","floor");var cy=cs,oi=cy;m();m();m();var uc=u(r=>r!=null,"notNull");m();function pc(r){return typeof r=="string"?r:r.id}u(pc,"getId");function uy(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}u(uy,"isPosition");m();function Je(r){let t;if(ot.is(r)||$t.is(r)||vt.is(r)||ji.is(r)||Rt.is(r))t=r.center;else if(Er.is(r)||Wi.is(r))t=r.coordinate;else if(ne.is(r))t=r;else if(Pr.is(r))t=r.coordinate;else if(fr.is(r))t=r.coordinates[0];else return;return t}u(Je,"getCoordinateFromStuffs");m();m();var dc={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},ai="ExteriorWalls",Fn="Walls",C3=0,us="InteriorDoors",ps="ExteriorDoors",Ue="GeometryLayer",Bn="LabelsLayer",si="MarkersLayer",ds="FootprintLayer",S3="ImagesLayer";var T3=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];function py(r){var t,e;if((t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}u(py,"validateOptions");function dy(r,t){var n,o,a,l;let e=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||t.outdoorViewToken,i={...dc,...r!=null?r:{},outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!e:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(l=dc.outdoorView)==null?void 0:l.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}u(dy,"handleShow3DMapOptionDefault");function M3(r){let t={remove_watermark:!1};if(r)try{let e=Id(r);Object.assign(t,e.capabilities)}catch(e){L.error("Error decoding capabilities from token",e)}return t}u(M3,"handleTokenCapabilities");var fs,Xi,Dr,hs=class hs extends Be{constructor(e,i){let n=Object.values(i.mvfDataByFloorId)[0];super(n.properties.id,e,"details"in n.properties?n.properties.details:void 0);d(this,"__type",hs.__type);S(this,fs,void 0);S(this,Xi,void 0);S(this,Dr,void 0);P(this,Xi,{}),P(this,fs,e),P(this,Dr,i.mvfDataByFloorId)}static is(e){return e.__type===hs.__type}get name(){var i,n,o;let e=Object.values(s(this,Dr))[0];return"details"in e.properties?(o=(n=e.properties.details)==null?void 0:n.name)!=null?o:"":(i=e.properties.externalId)!=null?i:""}get description(){var e,i;return(i=(e=Object.values(s(this,Dr))[0].properties.details)==null?void 0:e.description)!=null?i:""}get accessible(){var e;return(e=Object.values(s(this,Dr))[0].properties.accessible)!=null?e:!1}get externalId(){var e;return(e=Object.values(s(this,Dr))[0].properties.externalId)!=null?e:""}get type(){var e,i;return(i=(e=Object.values(s(this,Dr))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get coordinates(){return s(this,Xi).coordinates==null&&(s(this,Xi).coordinates=Object.entries(s(this,Dr)).map(([e,i])=>new ne(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),s(this,Xi).coordinates}get nodes(){return Object.values(s(this,Dr))[0].properties.nodes.map(e=>s(this,fs).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?s(this,fs).getById("floor",e.floorId):void 0).filter(uc)}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id)}}destroy(){for(let e of Object.keys(s(this,Xi)))delete s(this,Xi)[e]}};fs=new WeakMap,Xi=new WeakMap,Dr=new WeakMap,u(hs,"Connection"),d(hs,"__type","connection");var hy=hs,li=hy;m();var hc,Ro,Rn,_r,ms=class ms extends Be{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",ms.__type);S(this,hc,void 0);S(this,Ro,void 0);S(this,Rn,{});S(this,_r,void 0);P(this,hc,e),P(this,Ro,i.floorId),P(this,_r,i.mvfData)}static is(e){return e.__type===ms.__type}get name(){var e,i,n;return"details"in s(this,_r).properties?(n=(i=s(this,_r).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,_r).properties.externalId)!=null?e:""}get externalId(){var e;return(e=s(this,_r).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,_r).properties.details)==null?void 0:e.description)!=null?i:""}get type(){let e=s(this,_r).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=s(this,hc).getById("floor",s(this,Ro));if(e==null)throw new Error("Floor ".concat(s(this,Ro)," not found!"));return e}get center(){var e;if(s(this,Rn).center==null){let[i,n]=(e=s(this,_r).properties.center)!=null?e:[0,0];s(this,Rn).center=new ne(n,i,s(this,Ro))}return s(this,Rn).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,Rn)))s(this,Rn)[e]=null}};hc=new WeakMap,Ro=new WeakMap,Rn=new WeakMap,_r=new WeakMap,u(ms,"MapObject"),d(ms,"__type","object");var fy=ms,vt=fy;m();var fc,No,Nn,ci,ys=class ys extends Be{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);d(this,"__type",ys.__type);S(this,fc,void 0);S(this,No,void 0);S(this,Nn,{});S(this,ci,void 0);P(this,fc,e),P(this,ci,i.mvfData),P(this,No,i.floorId)}static is(e){return e.__type===ys.__type}get name(){var e,i,n;return"details"in s(this,ci).properties?(n=(i=s(this,ci).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,ci).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,ci).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=s(this,fc).getById("floor",s(this,No));if(e==null)throw new Error("Floor ".concat(s(this,No)," not found!"));return e}get coordinate(){var e;if(s(this,Nn).coordinate==null){let[i,n]=(e=s(this,ci).geometry.coordinates)!=null?e:[0,0];s(this,Nn).coordinate=new ne(n,i,s(this,No))}return s(this,Nn).coordinate}get externalId(){var e;return(e=s(this,ci).properties.externalId)!=null?e:""}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in s(this,Nn))s(this,Nn)[e]=null}};fc=new WeakMap,No=new WeakMap,Nn=new WeakMap,ci=new WeakMap,u(ys,"PointOfInterest"),d(ys,"__type","point-of-interest");var my=ys,Er=my;m();var mc,Go,Gn,Vo,yc,gy,gs=class gs extends Be{constructor(e,i){super(i.mvfData.properties.id,e);S(this,yc);d(this,"__type",gs.__type);S(this,mc,void 0);S(this,Go,void 0);S(this,Gn,{});S(this,Vo,void 0);P(this,mc,e),P(this,Go,i.floorId),P(this,Vo,i.mvfData)}static is(e){return e.__type===gs.__type}get group(){return j(this,yc,gy).call(this).group}get type(){return j(this,yc,gy).call(this).type}get externalId(){var e;return(e=s(this,Vo).properties.externalId)!=null?e:""}get coordinate(){if(s(this,Gn).coordinate==null){let[e,i]=s(this,Vo).geometry.coordinates;s(this,Gn).coordinate=new ne(i,e,s(this,Go))}return s(this,Gn).coordinate}get floor(){let e=s(this,mc).getById("floor",s(this,Go));if(e==null)throw new Error("Floor ".concat(s(this,Go)," not found!"));return e}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(s(this,Gn)))delete s(this,Gn)[e]}};mc=new WeakMap,Go=new WeakMap,Gn=new WeakMap,Vo=new WeakMap,yc=new WeakSet,gy=u(function(){let[e,i]=s(this,Vo).properties.symbolId.split("--");return{group:e,type:i}},"#getGroupAndTypeFromSymbolId"),u(gs,"Annotation"),d(gs,"__type","annotation");var yy=gs,Wi=yy;m();var m8=u((r,t)=>{var v,C;let e={},i={},n={},o={},a={},l={},c={},p={},h={},y={},g=globalThis.Object.keys(r.space);for(let M of g){let b=r.space[M];if(b!=null)for(let x of b.features){y[x.properties.id]=M,a[x.properties.id]=x;for(let I of x.properties.destinationNodes)n[I]==null&&(n[I]=[]),n[I].push(x.properties.id);if(x.properties.kind==="desk-entrance"&&(o[x.properties.externalId]==null&&(o[x.properties.externalId]=[]),o[x.properties.externalId].push(...x.properties.destinationNodes)),!["void","desk-entrance"].includes((v=x.properties.kind)!=null?v:"")){if((C=x.properties.kind)!=null&&C.includes("connection")){let I="".concat(x.geometry.coordinates[1],"-").concat(x.geometry.coordinates[0]);p[I]==null&&(p[I]=[]),p[I].push(x.properties.id);continue}if(x.properties.kind==="poi"){let I=new Er(t,{floorId:M,mvfData:x});i[x.properties.id]=I,c[M]||(c[M]=[]),c[M].push(x)}else{let I=new ot(t,{floorId:M,mvfData:x});e[x.properties.id]=I,l[M]||(l[M]=[]),l[M].push(x)}}}}for(let M in p){let b=p[M],x={};for(let w of b){let E=y[w],_=a[w];x[E]=_}let I=new li(t,{mvfDataByFloorId:x});h[I.id]=I}return{spacesById:e,poisById:i,connectionsById:h,spaceIdsByDestinationNodeId:n,objectEntranceNodeIdsByObstructionId:o,mvfSpacesById:a,connectionIdsByLatLon:p,mvfSpacesByFloorId:l,mvfPoisByFloorId:c}},"processMVFSpaces"),y8=u((r,t)=>{var o,a;let e={},i={},n={};for(let l of r["node.geojson"].features){i[l.properties.id]=l;let c=new Pr(t,{mvfData:l,floorId:(o=l.properties.floor)!=null?o:l.properties.map});e[l.properties.id]=c;let p=(a=l.properties.floor)!=null?a:l.properties.map;n[p]||(n[p]=[]),n[p].push(l)}return{nodesById:e,mvfNodesById:i,mvfNodesByFloorId:n}},"processMVFNodes"),g8=u((r,t)=>{let e={},i={},n={},o=globalThis.Object.keys(r.obstruction);for(let a of o){let l=r.obstruction[a];if(l!=null)for(let c of l.features){i[c.properties.id]=c;for(let h of c.properties.entrances)n[h]=c.properties.id;if(c.properties.kind==="Wall")continue;let p=new vt(t,{floorId:a,mvfData:c});e[c.properties.id]=p}}return{objectsById:e,mvfObstructionById:i,obstructionIdByEntranceId:n}},"processMVFObstructions"),v8=u((r,t)=>{let e={},i={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){i[n.properties.id]=n.properties;let o=new oi(t,{mvfData:n.properties});e[n.properties.id]=o}else for(let n of r["map.geojson"]){i[n.id]=n;let o=new oi(t,{mvfData:n});e[n.id]=o}return{floorsById:e,mvfFloorsById:i}},"processMVFFloors"),b8=u((r,t)=>{var l;let e={},i={},n={},o={},a=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(a!=null)for(let c of a){let p=(l=r.facade)==null?void 0:l[c.id],h=new lc(t,{mvfData:c,facadeId:p==null?void 0:p.id});if(e[c.id]=h,i[c.id]=c,p){let y=new Rt(t,{mvfData:p,floorStackId:c.id});n[p.id]=y;for(let g of p.spaces)o[g.spaceId]=y}}return{floorStacksById:e,mvfFloorStacksById:i,facadesById:n,facadesBySpaceId:o}},"processMVFFloorStacks"),x8=u(r=>{let t={},e=r["connection.json"].reduce((i,n)=>(n.nodes.forEach(o=>i[o]=n),t[n.id]=n,i),{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:e}},"processMVFConnections"),C8=u((r,t)=>{let e={},i={},n={},o={},a=globalThis.Object.keys(r.entrance);for(let l of a){let c=r.entrance[l];if(c!=null)for(let p of c.features){n[p.properties.id]=p;let h=new $t(t,{floorId:l,mvfData:p});p.properties.node&&(i[p.properties.node]=h),e[p.properties.id]=h,o[l]||(o[l]=[]),o[l].push(p)}}return{doorsById:e,doorsByNodeId:i,mvfEntrancesById:n,mvfEntrancesByFloorId:o}},"processMVFEntrances"),S8=u((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 l=a==null?void 0:a.properties,c=t[l.anchorId]||e[l.anchorId];if(c!=null&&l!=null){let p=c.properties;p.textArea=l,p.textArea&&(p.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),T8=u((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 l=a==null?void 0:a.properties,c=t[l.anchorId]||e[l.anchorId];if(c!=null&&l!=null){let p=c.properties;p.image=l,p.image&&(p.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),M8=u((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 l=r.annotation[a];if(l!=null)for(let c of l.features){i[c.properties.id]=c;let p=new Wi(t,{floorId:a,mvfData:c});e[c.properties.id]=p,n[a]||(n[a]=[]),n[a].push(c)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n}},"processMVFAnnotations"),P8=u((r,t)=>{let e={},i={};if(r.area==null)return{areasById:e,mvfAreasById:i};let n=globalThis.Object.keys(r.area);for(let o of n){let a=r.area[o];if(a!=null)for(let l of a.features){i[l.properties.id]=l;let c=new ji(t,{floorId:o,mvfData:l});e[l.properties.id]=c}}return{areasById:e,mvfAreasById:i}},"processMVFAreas"),P3=u((r,t)=>{var v,C,M,b,x,I,w,E,_;let e={},i={},n=((C=(v=r.enterprise)==null?void 0:v.locations)!=null?C:[]).reduce((O,F)=>(O[F.id]=F,O),{}),o={},a={},l={},c={},p={},h=((M=r.enterprise)==null?void 0:M.venue)||{},y={};for(let O of(x=(b=r.enterprise)==null?void 0:b.categories)!=null?x:[])o[O.id]=new gc(t,{mvfData:O}),a[O.id]=O,O.locations.forEach(F=>{c[F]==null&&(c[F]=[]),c[F].push(O.id)});let g={};for(let O of(w=(I=r.enterprise)==null?void 0:I.locationInstances)!=null?w:[]){let F=n[O.parent],G=Object.keys(F),N={};for(let Y of G)N[Y]=void 0;let H={...N,polygons:[],nodes:[],...O};g[H.parent]==null&&(g[H.parent]=[]),g[H.parent].push(new fr(t,{mvfData:H,categoryIds:c[H.id],parentId:O.parent})),y[H.id]=O}for(let O of(_=(E=r.enterprise)==null?void 0:E.locations)!=null?_:[]){i[O.id]=new fr(t,{mvfData:O,categoryIds:c[O.id],locationInstances:g[O.id]}),O.nodes.forEach(F=>{p[F.id]==null&&(p[F.id]=[]),p[F.id].push(O.id)});for(let F of O.polygons)l[F.id]==null&&(l[F.id]=[]),l[F.id].push(O)}if(t.enterpriseMode===!0){for(let O in t.mvfConnectionsById){let F={};for(let G of t.mvfConnectionsById[O].nodes){let N=t.nodesById[G],H=t.mvfConnectionsById[O];N!=null&&(F[N.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[N.coordinate.longitude,N.coordinate.latitude]},properties:{id:O,externalId:H.externalId,kind:"enterprise."+H.type,destinationNodes:[],flags:"",type:H.type,nodes:H.nodes,accessible:H.accessible}})}Object.keys(F).length>0&&(e[O]=new li(t,{mvfDataByFloorId:F}))}t.connectionsById=e}return{locationIdsByNodeId:p,locationsBySpaceId:l,mvfLocationsById:n,mvfCategoriesById:a,locationsById:i,locationInstancesById:y,categoriesById:o,venue:h}},"createEnterpriseDataFromMVF"),I3=u((r,t)=>{let{spacesById:e,spaceIdsByDestinationNodeId:i,poisById:n,mvfSpacesById:o,objectEntranceNodeIdsByObstructionId:a,connectionsById:l,connectionIdsByLatLon:c,mvfSpacesByFloorId:p,mvfPoisByFloorId:h}=m8(r,t),{nodesById:y,mvfNodesById:g,mvfNodesByFloorId:v}=y8(r,t),{objectsById:C,mvfObstructionById:M,obstructionIdByEntranceId:b}=g8(r,t),{floorsById:x,mvfFloorsById:I}=v8(r,t),{floorStacksById:w,mvfFloorStacksById:E,facadesById:_,facadesBySpaceId:O}=b8(r,t),{mvfConnectionsById:F,mvfConnectionsByNodeId:G}=x8(r),{doorsById:N,doorsByNodeId:H,mvfEntrancesById:Y,mvfEntrancesByFloorId:le}=C8(r,t),{annotationsById:ye,mvfAnnotationsById:Ie,mvfAnnotationsByFloorId:Oe}=M8(r,t),{areasById:qe,mvfAreasById:Yt}=P8(r,t);return T8(r,o,M),S8(r,o,M),{spacesById:e,nodesById:y,objectsById:C,floorsById:x,floorStacksById:w,facadesById:_,facadesBySpaceId:O,connectionsById:l,doorsById:N,doorsByNodeId:H,poisById:n,annotationsById:ye,areasById:qe,spaceIdsByDestinationNodeId:i,objectEntranceNodeIdsByObstructionId:a,obstructionIdByEntranceId:b,connectionIdsByLatLon:c,mvfSpacesById:o,mvfNodesById:g,mvfObstructionById:M,mvfFloorsById:I,mvfFloorStacksById:E,mvfConnectionsById:F,mvfConnectionsByNodeId:G,mvfEntrancesById:Y,mvfAnnotationsById:Ie,mvfNodesByFloorId:v,mvfSpacesByFloorId:p,mvfPoisByFloorId:h,mvfAreasById:Yt,mvfEntrancesByFloorId:le,mvfAnnotationsByFloorId:Oe}},"createDataFromMVF");m();m();m();var I8=u(function(){let t=globalThis.fetch;return{fetch(...e){if(!uc(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...e)},setFetch(e){t=e}}},"createFetchControl")(),w3=I8.fetch;var O3=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],E3=O3[0],L3="https://api-gateway.mappedin.com/track-analytics/a/",A3="deny-watchposition",k3="load-mapview",F3="load-mapdata",B3="change-language",R3="query-directions";var Yi,Or,vs,Dd,by=class by{constructor(){S(this,vs);S(this,Yi,Object.freeze({}));S(this,Or,void 0);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",h3((t,e)=>this.sendAnalyticEvent(R3,{start:t,end:e,type:"location_to_location"}),2500));P(this,Or,j(this,vs,Dd).call(this,s(this,Yi)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){P(this,Yi,{}),P(this,Or,j(this,vs,Dd).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return P(this,Yi,Object.freeze(Object.assign({},s(this,Yi),t))),P(this,Or,j(this,vs,Dd).call(this,t)),s(this,Or)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=vy({...s(this,Or),mapId:e.mapId})),e.context&&(e.context=_3(e.context)),e.baseUri&&(e.analyticsBaseUrl=vy({baseUri:e.baseUri,mapId:s(this,Or).mapId})),Object.assign(s(this,Or),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,Or)}getContext(){return this.getState().context||s(this,Yi).context||E3}getSessionId(){return this.getState().sessionId||s(this,Yi).sessionId||D3()}sendAnalyticEvent(t,e={}){let i=this.getState(),n=E8(i.analyticsBaseUrl,t),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&L.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return L.warn("Auth needs to be ready to send analytics.");let a={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(a,i.userPosition),o["Content-Type"]="application/json",i.accessToken?o.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(o["x-mappedin-key"]=btoa(i.key),o["x-mappedin-secret"]=btoa(i.secret)),w3(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(t,e){if(_8.includes(t))return L.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=D8.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(F3,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(B3,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(A3)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(k3,{type:"3d",firstRenderDuration:t,width:e.width,height:e.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};Yi=new WeakMap,Or=new WeakMap,vs=new WeakSet,Dd=u(function(t){var i,n,o,a;let e=(i=t.baseUri)!=null?i:L3;return{baseUri:e,analyticsBaseUrl:vy({...t,baseUri:e}),version:((n=T==null?void 0:T.env)==null?void 0:n.npm_package_version)||"v6",deviceId:t.deviceId||w8(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||D3(),platformString:t.platformString||"",context:_3(t.context)||E3,geolocationMode:!1,sendEvents:(o=t.sendEvents)!=null?o:!0,logEvents:(a=t.logEvents)!=null?a:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),u(by,"AnalyticsInternal");var bs=by;function vy({mapId:r,baseUri:t=L3}){return"".concat(t).concat(r,"/")}u(vy,"getBaseUrl");function w8(){return Vi.getInstance().loadLocalData("deviceId")}u(w8,"getDeviceIDFromStorage");function D3(){return Vi.getInstance().loadSessionData("id")}u(D3,"getSessionIDFromStorage");function E8(r,t){return r+t}u(E8,"buildUrl");function _3(r){return O3.find(t=>t===r)}u(_3,"getValidContext");var D8=["$select-location","$select-category","$query-suggest","$query-search"],_8=[k3,F3,R3,A3,B3],DN=new bs,Zi,xy=class xy{constructor(t){S(this,Zi,void 0);d(this,"capture");d(this,"updateState");P(this,Zi,t),this.capture=s(this,Zi).capture.bind(s(this,Zi)),this.updateState=s(this,Zi).updateState.bind(s(this,Zi))}getState(){return Object.assign({},s(this,Zi).getState())}};Zi=new WeakMap,u(xy,"Analytics");var vc=xy;m();var O8=new Set(["polygons"]),Lr,ke,Nt,bc,xs=class xs extends yt{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",xs.__type);d(this,"description");d(this,"name","");d(this,"amenity");d(this,"externalId","");d(this,"extra");d(this,"gallery");d(this,"instances");d(this,"logo");d(this,"operationHours");d(this,"phone");d(this,"picture");d(this,"shortName");d(this,"showFloatingLabelWhenImagePresent");d(this,"showLogo");d(this,"siblingGroups");d(this,"social");d(this,"sortOrder",-1);d(this,"states");d(this,"tags");d(this,"type","");S(this,Lr,void 0);S(this,ke,{});S(this,Nt,void 0);S(this,bc,void 0);P(this,Lr,e),P(this,Nt,i.mvfData),P(this,bc,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let n in i.mvfData)!O8.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(i.parentId){let o=s(this,Lr).locationsById[i.parentId];return s(this,Nt)[n]!=null?s(this,Lr).getPropTranslation(this.__type,n,s(this,Nt).id,s(this,Nt)[n]):s(this,Lr).getPropTranslation(this.__type,n,s(this,Nt).id,o[n])}return s(this,Lr).getPropTranslation(this.__type,n,s(this,Nt).id,s(this,Nt)[n])}})}static is(e){return e.__type===xs.__type}get categories(){return s(this,ke).categories?s(this,ke).categories:(s(this,ke).categories=(s(this,bc).map(e=>s(this,Lr).getById("enterprise-category",e))||[]).filter(Boolean),s(this,ke).categories)}get coordinates(){if(s(this,ke).coordinates)return s(this,ke).coordinates;s(this,ke).coordinates=[];for(let e=0;e<this.nodes.length;e++)s(this,ke).coordinates.push(this.nodes[e].coordinate);return s(this,ke).coordinates}get nodes(){if(s(this,ke).nodes)return s(this,ke).nodes;s(this,ke).nodes=[];for(let e=0;e<s(this,Nt).nodes.length;e++){let i=s(this,Lr).getById("node",s(this,Nt).nodes[e].id);i&&s(this,ke).nodes.push(i)}return s(this,ke).nodes}get spaces(){if(s(this,ke).spaces)return s(this,ke).spaces;s(this,ke).spaces=[];for(let e=0;e<s(this,Nt).polygons.length;e++){let i=s(this,Lr).getById("space",s(this,Nt).polygons[e].id);i&&s(this,ke).spaces.push(i)}return s(this,ke).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,ke)))delete s(this,ke)[e]}};Lr=new WeakMap,ke=new WeakMap,Nt=new WeakMap,bc=new WeakMap,u(xs,"EnterpriseLocation"),d(xs,"__type","enterprise-location");var Cy=xs,fr=Cy;m();var L8=new Set,jo,bt,ui,Cs=class Cs extends yt{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Cs.__type);d(this,"name","");d(this,"color");d(this,"externalId","");d(this,"extra");d(this,"icon");d(this,"iconFromDefaultList");d(this,"sortOrder",-1);S(this,jo,void 0);S(this,bt,{});S(this,ui,void 0);P(this,jo,e),P(this,ui,i.mvfData);for(let n in i.mvfData)!L8.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,jo).getPropTranslation(this.__type,n,s(this,ui).id,s(this,ui)[n])}})}static is(e){return e.__type===Cs.__type}get children(){if(s(this,bt).children)return s(this,bt).children;s(this,bt).children=[];for(let e=0;e<s(this,ui).children.length;e++){let i=s(this,jo).getById("enterprise-category",s(this,ui).children[e]);i&&s(this,bt).children.push(i)}return s(this,bt).children}get locations(){if(s(this,bt).locations)return s(this,bt).locations;s(this,bt).locations=[];for(let e=0;e<s(this,ui).locations.length;e++){let i=s(this,jo).getById("enterprise-location",s(this,ui).locations[e]);i&&s(this,bt).locations.push(i)}return s(this,bt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,bt)))delete s(this,bt)[e]}};jo=new WeakMap,bt=new WeakMap,ui=new WeakMap,u(Cs,"EnterpriseCategory"),d(Cs,"__type","enterprise-category");var Sy=Cs,gc=Sy;m();var A8=new Set,xc,Cc,Ss=class Ss extends yt{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Ss.__type);d(this,"countrycode");d(this,"externalId","");d(this,"defaultLanguage",{code:"en",name:"English"});d(this,"defaultMap");d(this,"extra");d(this,"icon");d(this,"languages",[]);d(this,"links",[]);d(this,"logo");d(this,"mappedinWebUrl");d(this,"slug","");d(this,"topLocations");d(this,"tzid");S(this,xc,{});S(this,Cc,void 0);P(this,Cc,i.mvfData);for(let n in i.mvfData)!A8.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(e){return e.__type===Ss.__type}get name(){var e;return(e=s(this,Cc).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,xc)))delete s(this,xc)[e]}};xc=new WeakMap,Cc=new WeakMap,u(Ss,"EnterpriseVenue"),d(Ss,"__type","enterprise-venue");var Ty=Ss,_d=Ty;m();var N3=globalThis.fetch,H3,k8=(H3=T==null?void 0:T.env)==null?void 0:H3.npm_package_version,Py="https://app.mappedin.com/",F8="https://auth.mappedin.com/",G3="accessTokens",V3="sasTokens";function zi(){if(N3==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return N3}u(zi,"isomorphicFetch");var U3={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function W3(r){var e;let t={...U3,...r};return t.headers={...t.headers,"mappedin-sdk-version":k8},t.things=[],"platformString"in r&&(t.headers={...t.headers,"mappedin-platform-version":r.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}u(W3,"parseOptions");function B8(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}}u(B8,"constructParamsForRequest");async function R8(r,t,e=!1){let i=B8(r,t,e),n=await zi()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}u(R8,"generateAPIRequest");async function N8(r,t="exports/mvf/1/bundle"){var o;let e=W3({baseUri:"https://api-gateway.mappedin.com/",...U3,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((o=e.version)!=null?o:"2.0.0");return e.headers["Content-Type"]="application/zip",await R8(e,i)}u(N8,"getVenueMVFURL");var My=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function Iy(r,{signal:t}){let e=await(await zi()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}u(Iy,"getLanguagePackUnitArray");async function Ts(r){let e=(await import("./browser-XQ5347KZ.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let n=e["enterprise/locations.json"];n&&(i.enterprise.locations=JSON.parse(My().decode(n)));let o=e["enterprise/categories.json"];o&&(i.enterprise.categories=JSON.parse(My().decode(o)))}return e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(My().decode(e["manifest.json"]))),i}u(Ts,"parseLanguagePack");async function X3(r,{signal:t}){try{let e=await(await zi()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Ts(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}u(X3,"downloadLanguagePack");async function wy(r){return new Promise(async(t,e)=>{try{let{url:i,locale_packs:n}=await N8(r,"exports/mvf2/1/bundle"),o=await zi()(i).then(l=>l.arrayBuffer()),a=new Uint8Array(o);t({compressed:a,localePacks:n})}catch(i){e(i)}})}u(wy,"downloadVenueBundleMVFAPIGateway");async function Ey(r,t){return new Promise(async(e,i)=>{try{let{url:n}=await G8(r,t),o=await zi()(n).then(l=>l.arrayBuffer()),a=new Uint8Array(o);e(a)}catch(n){i(n)}})}u(Ey,"downloadMVF");function Dy(r){return r.endsWith("/")?r:"".concat(r,"/")}u(Dy,"normalizeUrl");async function G8(r,t){let e="".concat(r.baseUri?Dy(r.baseUri):Py,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await zi()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}u(G8,"getMakerBundleURL");async function Sc(r,t=!1){let e="".concat(r.key),i=Vi.getInstance(),n=(i==null?void 0:i.loadSessionData(G3))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&o<n[e].expiresTimestamp)return n[e];let a=t?await V8(r,o):await j8(r,o),l={...n,[e]:a};return i==null||i.saveSessionData(G3,l),a}u(Sc,"getAccessToken");async function V8(r,t){var o;let e="".concat((o=r.baseAuthUri)!=null?o:F8,"oauth2/token"),i=await zi()(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}}u(V8,"fetchAccessTokenEnterprise");async function j8(r,t){let e="".concat(r.baseAuthUri?Dy(r.baseAuthUri):Py,"api/api-key/token"),i=await zi()(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}}u(j8,"fetchAccessToken");function Tc(r){var i,n,o,a,l,c,p,h;let t=new TextDecoder,e=t.decode.bind(t);try{let y={"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:{}};if(r.enterprise!=null&&(y.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(y.enterprise.locations=JSON.parse(e((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(y.enterprise.categories=JSON.parse(e((a=r.enterprise)==null?void 0:a["categories.json"]))),(l=r.enterprise)!=null&&l["venue.json"]&&(y.enterprise.venue=JSON.parse(e((c=r.enterprise)==null?void 0:c["venue.json"]))),(p=r.enterprise)!=null&&p["locationInstances.json"]&&(y.enterprise.locationInstances=JSON.parse(e((h=r.enterprise)==null?void 0:h["locationInstances.json"])))),r["floorstack.json"]!=null?y["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(y["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),y["floorstack.json"]==null&&y["mapstack.json"]==null&&y["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(y["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),y["floor.geojson"]==null&&y["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(y["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(y["shapes.json"]=JSON.parse(e(r["shapes.json"]))),r.annotation!=null){y.annotation={};let v=Object.keys(r.annotation);for(let C of v){let M=C.replace(/\.json|\.geojson/g,"");y.annotation[M]=JSON.parse(e(r.annotation[C]))}}let g=Object.keys(r.space);for(let v of g){let C=v.replace(/\.json|\.geojson/g,"");y.space[C]=JSON.parse(e(r.space[v]))}if(r.obstruction!=null){let v=Object.keys(r.obstruction);for(let C of v){let M=C.replace(/\.json|\.geojson/g,"");y.obstruction[M]=JSON.parse(e(r.obstruction[C]))}}else y.obstruction={};if(r.entrance!=null){let v=Object.keys(r.entrance);for(let C of v){let M=C.replace(/\.json|\.geojson/g,"");y.entrance[M]=JSON.parse(e(r.entrance[C]))}}else y.entrance={};if("floorImages"in r&&r.floorImages!=null){y.floorImages={};for(let v of Object.keys(r.floorImages)){let C=v.replace(/\.json|\.geojson/g,"");y.floorImages[C]=JSON.parse(e(r.floorImages[v]))}}if("textAreas"in r&&r.textAreas!=null){y.textAreas={};for(let v of Object.keys(r.textAreas)){let C=v.replace(/\.json|\.geojson/g,"");y.textAreas[C]=JSON.parse(e(r.textAreas[v]))}}if("facade"in r&&r.facade!=null){y.facade={};for(let v of Object.keys(r.facade)){let C=v.replace(/\.json|\.geojson/g,"");y.facade[C]=JSON.parse(e(r.facade[v]))}}if("area"in r&&r.area!=null){y.area={};for(let v of Object.keys(r.area)){let C=v.replace(/\.json|\.geojson/g,"");y.area[C]=JSON.parse(e(r.area[v]))}}return y}catch(y){throw L.error(y),new Error("MVF parsing failed! Probably encountered a bad file.")}}u(Tc,"parseMVF");function H8(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}u(H8,"validateStaticMVFFiles");async function Mc(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-XQ5347KZ.js")).unzipSync(r);if(!H8(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let l of a){if(n[l].length===0)continue;let c=l.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){o[c[0]]=n[l];continue}if(c[0]==="image"){L.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[c[0]]==null&&(o[c[0]]={}),o[c[0]][c[1]]=n[l]}t(o)}catch(i){e(i)}})}u(Mc,"unzipMVF");async function Od(r,t){let e="".concat(t),i=Vi.getInstance(),n=(i==null?void 0:i.loadSessionData(V3))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&o<n[e].expires)return n[e];let a=await U8(r,t),l={...n,[e]:{token:a.token,expires:o+new Date(a.expires).getTime()/1e3}};return i==null||i.saveSessionData(V3,l),a}u(Od,"getSasToken");async function U8(r,t){let e="".concat(r.baseAuthUri?Dy(r.baseAuthUri):Py,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await zi()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));return await i.json()}u(U8,"fetchSasToken");function Ho(){let r="us",t={};function e(){return Y8(z8(r),t)}return u(e,"getState"),{updateByUserOption(i){var n,o;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(n=i.analytics)!=null&&n.baseUri&&(t.analyticsBaseUri=(o=i.analytics)==null?void 0:o.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?j3.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?j3.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}u(Ho,"createEnvControl");var Y3=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"}),j3=Object.freeze({...Y3,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),W8=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"}),X8=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function Y8(r,t){return{...r,...t}}u(Y8,"getAuthStateByEnvironment");var Z8={eu:W8,us:Y3,"us-staging":X8};function z8(r){return Z8[r]}u(z8,"getEnvironmentAuthState");m();function _y(r){var e,i,n,o,a;let t=((i=(e=r.enterprise)==null?void 0:e.locations)==null?void 0:i.reduce((l,c)=>(l[c.id]=c,l),{}))||{};for(let l of((n=r.enterprise)==null?void 0:n.locationInstances)||[])t[l.id]=l;return{type:"downloaded",data:r,optimized:{locations:t,categories:(a=(o=r.enterprise)==null?void 0:o.categories)==null?void 0:a.reduce((l,c)=>(l[c.id]=c,l),{})}}}u(_y,"parseLocalePackToLanguagePack");m();m();m();m();m();m();m();var Oy=class Oy{constructor({origin:t,destination:e,distance:i=0,angle:n=0,pathWeight:o=0}){d(this,"origin");d(this,"destination");d(this,"distance");d(this,"angle");d(this,"weight");this.origin=t,this.destination=e,this.distance=i,this.angle=n;let a=o||0;if(this.weight=a>=0?this.distance+a:0,isNaN(this.angle))throw new Error("nan angle")}};u(Oy,"Edge");var Uo=Oy;m();m();m();m();m();var xt=63710088e-1,Z3={centimeters:xt*100,centimetres:xt*100,degrees:xt/111325,feet:xt*3.28084,inches:xt*39.37,kilometers:xt/1e3,kilometres:xt/1e3,meters:xt,metres:xt,miles:xt/1609.344,millimeters:xt*1e3,millimetres:xt*1e3,nauticalmiles:xt/1852,radians:1,yards:xt*1.0936},sG={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/xt,yards:1.0936133};function Vn(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}u(Vn,"feature");function Ar(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(!Ly(r[0])||!Ly(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Vn(i,t,e)}u(Ar,"point");function qi(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 Vn(i,t,e)}u(qi,"lineString");function Pc(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}u(Pc,"featureCollection");function z3(r,t){t===void 0&&(t="kilometers");var e=Z3[t];if(!e)throw new Error(t+" units is invalid");return r*e}u(z3,"radiansToLength");function q3(r,t){t===void 0&&(t="kilometers");var e=Z3[t];if(!e)throw new Error(t+" units is invalid");return r/e}u(q3,"lengthToRadians");function Ic(r){var t=r%(2*Math.PI);return t*180/Math.PI}u(Ic,"radiansToDegrees");function Gt(r){var t=r%360;return t*Math.PI/180}u(Gt,"degreesToRadians");function Ly(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}u(Ly,"isNumber");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")}u(mr,"getCoord");function Kt(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")}u(Kt,"getCoords");function $3(r){return r.type==="Feature"?r.geometry:r}u($3,"getGeom");function J3(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}u(J3,"getType");function Ay(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=$3(t),o=n.type,a=t.bbox,l=n.coordinates;if(a&&q8(i,a)===!1)return!1;o==="Polygon"&&(l=[l]);for(var c=!1,p=0;p<l.length&&!c;p++)if(K3(i,l[p][0],e.ignoreBoundary)){for(var h=!1,y=1;y<l[p].length&&!h;)K3(i,l[p][y],!e.ignoreBoundary)&&(h=!0),y++;h||(c=!0)}return c}u(Ay,"booleanPointInPolygon");function K3(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],l=t[n][1],c=t[o][0],p=t[o][1],h=r[1]*(a-c)+l*(c-r[0])+p*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(l-r[1])*(p-r[1])<=0;if(h)return!e;var y=l>r[1]!=p>r[1]&&r[0]<(c-a)*(r[1]-l)/(p-l)+a;y&&(i=!i)}return i}u(K3,"inRing");function q8(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}u(q8,"inBBox");m();m();function $i([r,t],[e,i]){let n=t-i,o=r-e;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}u($i,"getAngle");m();var $8=63710088e-1;function kr(r,t){let[e,i]=r.map(h=>h*Math.PI/180),[n,o]=t.map(h=>h*Math.PI/180),a=o-i,l=n-e,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(l/2)*Math.sin(l/2),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return $8*p}u(kr,"getDistance");m();m();function Ld(r,t,e,i){let[n,o]=r,[a,l]=t,[c,p]=e,[h,y]=i;if(o===l&&n===a||p===y&&c===h)return null;let g=(h-c)*(l-o)-(y-p)*(a-n);if(g===0)return null;let v=((y-p)*(n-c)-(h-c)*(o-p))/g,C=((l-o)*(n-c)-(a-n)*(o-p))/g;if(v<0||v>1||C<0||C>1)return null;let M=o+v*(l-o);return[n+v*(a-n),M]}u(Ld,"getLineIntersection");m();m();function Wo(r,t,e,i){i===void 0&&(i={});var n=mr(r),o=Gt(n[0]),a=Gt(n[1]),l=Gt(e),c=q3(t,i.units),p=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),h=o+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(p)),y=Ic(h),g=Ic(p);return Ar([y,g],i.properties)}u(Wo,"destination");function ky(r,t,e,i){let n=Wo(r,e/1e3,i),o=Wo(t,e/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}u(ky,"getOffsetLine");m();function Fy(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}u(Fy,"radToDegNormalized");function Q3(r,t,e=[],i=0){let n=!0,o=r.geometry.coordinates,a=t.geometry.coordinates,l=Fy($i(o,a)-Math.PI/2),c=Fy($i(o,a)+Math.PI/2);return e.forEach(p=>{if(i>0){let h=ky(o,a,i,l),y=ky(o,a,i,c);if(Ld(h[0],h[1],p[0],p[1])||Ld(y[0],y[1],p[0],p[1])){n=!1;return}}else if(Ld(o,a,p[0],p[1])){n=!1;return}}),n}u(Q3,"hasLineOfSight");var Xo,wc,By,kd,ex,Fd,tx,Bd,rx,Rd,ix,Nd,nx,Gd,ox,Vd,Ry=class Ry{constructor({nodes:t,groupBy:e}){S(this,wc);S(this,kd);S(this,Fd);S(this,Bd);S(this,Rd);S(this,Nd);S(this,Gd);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);S(this,Xo,void 0);S(this,Vd,u((t,e)=>{let i=0;for(let n of e)(!n[s(this,Xo)]||n[s(this,Xo)]===t.properties[s(this,Xo)])&&Ay(t.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i},"#getZonalCost"));P(this,Xo,e);let{features:i}=t;this.nodesById=j(this,kd,ex).call(this,i),j(this,Fd,tx).call(this),j(this,Bd,rx).call(this,i,e)}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,zones:n}){let o=j(this,wc,By).call(this,t),a=j(this,wc,By).call(this,e);if(o.length===0||a.length===0)return[];let{frontier:l,cameFrom:c,costSoFar:p}=j(this,Rd,ix).call(this,o,a);for(;l.length>0;){let h=l.shift();if(!h)break;if(j(this,Nd,nx).call(this,h.origin,a))return j(this,Gd,ox).call(this,c,h.origin.properties.id);for(let y of this.edges[h.origin.properties.id]){let g=p[h.origin.properties.id]+y.weight+s(this,Vd).call(this,y.destination,n);if(!(g===1/0||i!=null&&i.has(y.destination.properties.id))&&(p[y.destination.properties.id]==null||g<p[y.destination.properties.id])){let v=g+this.getShortestEuclideanDistance(y.destination,a);p[y.destination.properties.id]=g,c[y.destination.properties.id]=y,l.push({origin:y.destination,priority:v})}}l.sort((y,g)=>y.priority-g.priority)}return[]}};Xo=new WeakMap,wc=new WeakSet,By=u(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),kd=new WeakSet,ex=u(function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},"#createNodesById"),Fd=new WeakSet,tx=u(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},"#removeInvalidNeighbors"),Bd=new WeakSet,rx=u(function(t,e){t.forEach(i=>{let n=e==="default"?e:i.properties[e];this.nodesByGroup.has(n)||this.nodesByGroup.set(n,[]),this.nodesByGroup.get(n).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:o,weight:a})=>{let l=this.nodesById[o],c=kr(i.geometry.coordinates,l.geometry.coordinates),p=$i(i.geometry.coordinates,l.geometry.coordinates);return new Uo({origin:i,destination:l,pathWeight:a,distance:c,angle:p})})})},"#initializeEdgesAndGroups"),Rd=new WeakSet,ix=u(function(t,e){let i=[],n={},o={};return t.forEach(a=>{let l=this.getShortestEuclideanDistance(a,e);i.push({origin:a,priority:l}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,l)=>a.priority-l.priority),{frontier:i,cameFrom:n,costSoFar:o}},"#initializeSearch"),Nd=new WeakSet,nx=u(function(t,e){return e.some(i=>i.properties.id===t.properties.id)},"#isDestinationNode"),Gd=new WeakSet,ox=u(function(t,e){let i=[],n=t[e];for(;n;)i.push(n),n=t[n.origin.properties.id];return i.reverse()},"#reconstructPath"),Vd=new WeakMap,u(Ry,"NavigationGraph");var Ad=Ry;var J8=.4,Ny=class Ny{constructor({nodes:t,geojsonCollection:e,groupBy:i="default"}){d(this,"groupBy");d(this,"graph");d(this,"geometryEdgesByMapId",new Map);d(this,"generatePath",u(t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<t.length;o++){let{origin:a}=t[o],l={id:a.properties.id,angle:t[o].angle,distance:t[o].distance};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};return this.groupBy!=="default"&&(n.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:n}),i},"generatePath"));d(this,"getDistance",u((t,e)=>kr(t,e),"getDistance"));d(this,"getAngle",u((t,e)=>$i(t,e),"getAngle"));this.groupBy=i,this.graph=new Ad({nodes:t,groupBy:this.groupBy}),((e==null?void 0:e.features)||[]).forEach(o=>{let a=null;if(o.geometry.type==="LineString"?a=o.geometry.coordinates:o.geometry.type==="Polygon"&&(a=o.geometry.coordinates.flat()),a){let l=this.groupBy==="default"?this.groupBy:o.properties[this.groupBy];this.geometryEdgesByMapId.has(l)||this.geometryEdgesByMapId.set(l,[]),a.forEach((c,p)=>{this.geometryEdgesByMapId.get(l).push([c,a[p+1]||a[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:n,simplify:o}){var p,h;let a=(p=o==null?void 0:o.enabled)!=null?p:!0,l=t!=null?t:[],c=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:l,excludedNodeIds:new Set(n)});return c.length===0?{type:"FeatureCollection",features:[]}:(a&&(c=this.simplifyAllSteps(c,(h=o==null?void 0:o.bufferRadius)!=null?h:J8)),this.generatePath(c))}simplifyAllSteps(t,e){var c,p;let i=[],n=[t[0]];for(let h=1;h<t.length;h++)if(this.groupBy!=="default"&&t[h].origin.properties[this.groupBy]!==t[h-1].origin.properties[this.groupBy]){let y=t[h-1].origin.properties[this.groupBy],g=(c=this.geometryEdgesByMapId.get(y))!=null?c:[];i.push(...this.simplifySteps(n,g,e)),n=[t[h]]}else n.push(t[h]);let o=t[t.length-1],a=this.groupBy==="default"?this.groupBy:o.origin.properties[this.groupBy],l=(p=this.geometryEdgesByMapId.get(a))!=null?p:[];return i.push(...this.simplifySteps(n,l,e)),i}simplifySteps(t,e,i){if(t.length<3)return t;let n=[t[0]],o=1;for(let a=o+2;a<t.length;a++)if(!Q3(t[o].origin,t[a].origin,e,i)){let l=a-1;n.push(new Uo({...t[o],destination:t[l].origin,distance:kr(t[o].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:$i(t[o].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),o=l}return n.push(new Uo({...t[o],destination:t[t.length-1].origin,distance:kr(t[o].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:$i(t[o].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates)}),t[t.length-1]),n}};u(Ny,"Navigator");var Ms=Ny;m();var qF={};D2(qF,{Annotation:()=>Wi,Connection:()=>li,Coordinate:()=>ne,DOORS:()=>np,Door:()=>$t,E_SDK_LOG_LEVEL:()=>$m,EnterpriseCategory:()=>gc,EnterpriseLocation:()=>fr,EnterpriseVenue:()=>_d,Facade:()=>Rt,Floor:()=>oi,FloorStack:()=>lc,Hyperlink:()=>nc,ImageData:()=>sc,MapObject:()=>vt,Node:()=>Pr,PointOfInterest:()=>Er,Space:()=>ot,WALLS:()=>ip,createMapLibreOverlay:()=>ZF,enableTestMode:()=>Q0,getMapData:()=>HM,getMapDataEnterprise:()=>YF,hydrateMapData:()=>XF,hydrateMapDataFromMVF:()=>UF,parseMVF:()=>Tc,preloadFont:()=>A0,setLoggerLevel:()=>f3,setUseEnterpriseAPI:()=>WF,show3dMap:()=>UM,show3dMapGeojson:()=>zF,unzipMVF:()=>Mc});m();m();m();m();var Dc,_c,Oc,Gy=class Gy{constructor(t,e,{enabled:i=!1}={}){S(this,Dc,void 0);d(this,"searchInstance");S(this,_c,void 0);S(this,Oc,void 0);d(this,"enabled",!1);P(this,Dc,t),P(this,_c,e),P(this,Oc,()=>{var n;(n=this.searchInstance)==null||n.then(o=>o.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return L.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return L.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-AHUPGYIQ.js").then(({InternalSearch:t})=>new t(s(this,Dc)))),s(this,_c).on("language-change",s(this,Oc)),await this.searchInstance)}};Dc=new WeakMap,_c=new WeakMap,Oc=new WeakMap,u(Gy,"Search");var Ec=Gy;var ax=new WeakMap,Ke,jy=class jy extends q{constructor(e,{search:i}={}){super();S(this,Ke,void 0);d(this,"Analytics");d(this,"Search");d(this,"Query");d(this,"getDirections",u((e,i,n)=>s(this,Ke).getDirections(e,i,n),"getDirections"));d(this,"getDirectionsMultiDestination",u((e,i,n)=>s(this,Ke).getDirectionsMultiDestination(e,i,n),"getDirectionsMultiDestination"));P(this,Ke,e),ax.set(this,e),this.Analytics=new vc(e.Analytics),this.Query=e.Query,this.Search=new Ec(this,e,{enabled:i==null?void 0:i.enabled}),s(this,Ke).on("language-change",n=>{this.publish("language-change",n)})}getEnv(){return s(this,Ke).getEnv()}get mapName(){return s(this,Ke).mapName}get mapCenter(){return s(this,Ke).mapCenter}get organizationId(){return s(this,Ke).organizationId}get outdoorViewToken(){return s(this,Ke).outdoorViewToken}getByType(e){return s(this,Ke).getByType(e)}getById(e,i){return s(this,Ke).getById(e,i)}async changeLanguage(e){return s(this,Ke).changeLanguage(e)}get currentLanguage(){return s(this,Ke).currentLanguage}getDistance(e,i){return s(this,Ke).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return s(this,Ke).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return s(this,Ke).toJSONBundle({downloadLanguagePacks:e})}};Ke=new WeakMap,u(jy,"MapData");var Vy=jy,jd=Vy;function Ps(r){let t=ax.get(r);if(!t)throw new Error("MapDataInternal not found");return t}u(Ps,"getMapDataInternal");m();m();m();m();m();function K8(r,t,e){e===void 0&&(e={});for(var i=mr(r),n=Kt(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")),Q8(n[o],n[o+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}u(K8,"booleanPointOnLine");function Q8(r,t,e,i,n){var o=e[0],a=e[1],l=r[0],c=r[1],p=t[0],h=t[1],y=e[0]-l,g=e[1]-c,v=p-l,C=h-c,M=y*C-g*v;if(n!==null){if(Math.abs(M)>n)return!1}else if(M!==0)return!1;if(i){if(i==="start")return Math.abs(v)>=Math.abs(C)?v>0?l<o&&o<=p:p<=o&&o<l:C>0?c<a&&a<=h:h<=a&&a<c;if(i==="end")return Math.abs(v)>=Math.abs(C)?v>0?l<=o&&o<p:p<o&&o<=l:C>0?c<=a&&a<h:h<a&&a<=c;if(i==="both")return Math.abs(v)>=Math.abs(C)?v>0?l<o&&o<p:p<o&&o<l:C>0?c<a&&a<h:h<a&&a<c}else return Math.abs(v)>=Math.abs(C)?v>0?l<=o&&o<=p:p<=o&&o<=l:C>0?c<=a&&a<=h:h<=a&&a<=c;return!1}u(Q8,"isPointOnLineSegment");var sx=K8;m();m();m();function Hd(r,t,e){if(r!==null)for(var i,n,o,a,l,c,p,h=0,y=0,g,v=r.type,C=v==="FeatureCollection",M=v==="Feature",b=C?r.features.length:1,x=0;x<b;x++){p=C?r.features[x].geometry:M?r.geometry:r,g=p?p.type==="GeometryCollection":!1,l=g?p.geometries.length:1;for(var I=0;I<l;I++){var w=0,E=0;if(a=g?p.geometries[I]:p,a!==null){c=a.coordinates;var _=a.type;switch(h=e&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,y,x,w,E)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],y,x,w,E)===!1)return!1;y++,_==="MultiPoint"&&w++}_==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-h;n++){if(t(c[i][n],y,x,w,E)===!1)return!1;y++}_==="MultiLineString"&&w++,_==="Polygon"&&E++}_==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(E=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-h;o++){if(t(c[i][n][o],y,x,w,E)===!1)return!1;y++}E++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Hd(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}u(Hd,"coordEach");function Hy(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++);}u(Hy,"featureEach");function e9(r,t){var e,i,n,o,a,l,c,p,h,y,g=0,v=r.type==="FeatureCollection",C=r.type==="Feature",M=v?r.features.length:1;for(e=0;e<M;e++){for(l=v?r.features[e].geometry:C?r.geometry:r,p=v?r.features[e].properties:C?r.properties:{},h=v?r.features[e].bbox:C?r.bbox:void 0,y=v?r.features[e].id:C?r.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(t(null,g,p,h,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,p,h,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,p,h,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}u(e9,"geomEach");function Lc(r,t){e9(r,function(e,i,n,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(Vn(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var h=e.coordinates[p],y={type:c,coordinates:h};if(t(Vn(y,n),i,p)===!1)return!1}})}u(Lc,"flattenEach");function t9(r,t){Lc(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,h=0;if(Hd(e,function(y,g,v,C,M){if(l===void 0||i>c||C>p||M>h){l=y,c=i,p=C,h=M,o=0;return}var b=qi([l,y],e.properties);if(t(b,i,n,M,o)===!1)return!1;o++,l=y})===!1)return!1}}})}u(t9,"segmentEach");function lx(r,t,e){var i=e,n=!1;return t9(r,function(o,a,l,c,p){n===!1&&e===void 0?i=o:i=t(i,o,a,l,c,p),n=!0}),i}u(lx,"segmentReduce");function Uy(r){var t=[1/0,1/0,-1/0,-1/0];return Hd(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}u(Uy,"bbox");Uy.default=Uy;var Ud=Uy;function r9(r,t){t===void 0&&(t={});var e=Ud(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Ar([i,n],t.properties,t)}u(r9,"center");var Wd=r9;m();m();function i9(r,t,e){e===void 0&&(e={});var i=mr(r),n=mr(t),o=Gt(n[1]-i[1]),a=Gt(n[0]-i[0]),l=Gt(i[1]),c=Gt(n[1]),p=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return z3(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),e.units)}u(i9,"distance");var jn=i9;function Xd(r,t){return t===void 0&&(t={}),lx(r,function(e,i){var n=i.geometry.coordinates;return e+jn(n[0],n[1],t)},0)}u(Xd,"length");m();m();m();function Yd(r,t,e){if(e===void 0&&(e={}),e.final===!0)return n9(r,t);var i=mr(r),n=mr(t),o=Gt(i[0]),a=Gt(n[0]),l=Gt(i[1]),c=Gt(n[1]),p=Math.sin(a-o)*Math.cos(c),h=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-o);return Ic(Math.atan2(p,h))}u(Yd,"bearing");function n9(r,t){var e=Yd(t,r);return e=(e+180)%360,e}u(n9,"calculateFinalBearing");m();m();function o9(r){if(!r)throw new Error("geojson is required");var t=[];return Lc(r,function(e){a9(e,t)}),Pc(t)}u(o9,"lineSegment");function a9(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=Kt(i);break;case"LineString":e=[Kt(i)]}e.forEach(function(n){var o=s9(n,r.properties);o.forEach(function(a){a.id=t.length,t.push(a)})})}}u(a9,"lineSegmentFeature");function s9(r,t){var e=[];return r.reduce(function(i,n){var o=qi([i,n],t);return o.bbox=l9(i,n),e.push(o),n}),e}u(s9,"createSegments");function l9(r,t){var e=r[0],i=r[1],n=t[0],o=t[1],a=e<n?e:n,l=i<o?i:o,c=e>n?e:n,p=i>o?i:o;return[a,l,c,p]}u(l9,"bbox");var Wy=o9;var g7=$l(m7(),1);function OE(r,t){var e={},i=[];if(r.type==="LineString"&&(r=Vn(r)),t.type==="LineString"&&(t=Vn(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=y7(r,t);return n&&i.push(n),Pc(i)}var o=(0,g7.default)();return o.load(Wy(t)),Hy(Wy(r),function(a){Hy(o.search(a),function(l){var c=y7(a,l);if(c){var p=Kt(c).join(",");e[p]||(e[p]=!0,i.push(c))}})}),Pc(i)}u(OE,"lineIntersect");function y7(r,t){var e=Kt(r),i=Kt(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],l=e[1][1],c=i[0][0],p=i[0][1],h=i[1][0],y=i[1][1],g=(y-p)*(a-n)-(h-c)*(l-o),v=(h-c)*(o-p)-(y-p)*(n-c),C=(a-n)*(o-p)-(l-o)*(n-c);if(g===0)return null;var M=v/g,b=C/g;if(M>=0&&M<=1&&b>=0&&b<=1){var x=n+M*(a-n),I=o+M*(l-o);return Ar([x,I])}return null}u(y7,"intersects");var v7=OE;function LE(r,t,e){e===void 0&&(e={});var i=Ar([1/0,1/0],{dist:1/0}),n=0;return Lc(r,function(o){for(var a=Kt(o),l=0;l<a.length-1;l++){var c=Ar(a[l]);c.properties.dist=jn(t,c,e);var p=Ar(a[l+1]);p.properties.dist=jn(t,p,e);var h=jn(c,p,e),y=Math.max(c.properties.dist,p.properties.dist),g=Yd(c,p),v=Wo(t,y,g+90,e),C=Wo(t,y,g-90,e),M=v7(qi([v.geometry.coordinates,C.geometry.coordinates]),qi([c.geometry.coordinates,p.geometry.coordinates])),b=null;M.features.length>0&&(b=M.features[0],b.properties.dist=jn(t,b,e),b.properties.location=n+jn(c,b,e)),c.properties.dist<i.properties.dist&&(i=c,i.properties.index=l,i.properties.location=n),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=l+1,i.properties.location=n+h),b&&b.properties.dist<i.properties.dist&&(i=b,i.properties.index=l),n+=h}}),i}u(LE,"nearestPointOnLine");var $c=LE;function AE(r,t,e){var i=Kt(e);if(J3(e)!=="LineString")throw new Error("line must be a LineString");var n=$c(e,r),o=$c(e,t),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var l=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)l.push(i[c]);return l.push(a[1].geometry.coordinates),qi(l,e.properties)}u(AE,"lineSlice");var O1=AE;var kE=1e-7;function L1(r){return{type:"Point",coordinates:r}}u(L1,"point");function FE(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,n=e.map(o=>$c(r,L1(o)));return i.reduce((o,a)=>{let l=O1(L1(a),n[0],r),c=O1(L1(a),n[1],r),p=Xd(l)<Xd(c)?l:c;return p.properties={...r.properties,entrances:[]},o.concat([p])},[])}u(FE,"splitObstructionByEntrance");function A1(r,t){return t.reduce((e,i)=>{let n={epsilon:kE},o=e.obstructions.findIndex(l=>sx(Wd(i),l,n)),a=e.obstructions[o];if(a){let[l,c]=FE(a,i);e.entrances.push(i),e.obstructions.splice(o,1,l,c)}return e},{obstructions:[r],entrances:[]})}u(A1,"findAndSplitObstructionByAllEntrances");m();m();m();m();m();m();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();m();m();m();m();function b7(r){return Ud(r)}u(b7,"getBoundingBoxFromFeature");var k1=class k1 extends qa{constructor(){super(...arguments);d(this,"type","entityBatchedMesh");d(this,"userData",{entities:{}})}};u(k1,"EntityBatchedMesh");var fi=k1,Jc,Kc,qo,F1=class F1{constructor(t){d(this,"mesh");d(this,"focusMesh");d(this,"outline");d(this,"imageMesh");d(this,"textMesh");d(this,"textEntityId");d(this,"type","geometry");d(this,"dirty",!0);d(this,"detached",!1);d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"currentHeight",.1);d(this,"focusable",!1);d(this,"color",new we);d(this,"topColor",new we);d(this,"position",new J);S(this,Jc,0);S(this,Kc,1);S(this,qo,void 0);d(this,"texturesVisible",!1);this.feature=t}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(t){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,t),this.imageMesh&&(this.imageMesh.visible=t)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}setColor(t,e){this.color.set(t),this.topColor.set(e),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var t;return(t=this.material)==null?void 0:t.getColor(this.instanceIndex)}get altitude(){return s(this,Jc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Jc,t))}get opacity(){return s(this,Kc)}set opacity(t){this.material&&(this.material.opacity=t,this.material.transparent=t<1,this.material.needsUpdate=!0),P(this,Kc,t)}get texture(){var t,e;return(e=(t=this.material)==null?void 0:t.texture)==null?void 0:e.image.src}set texture(t){this.material&&(this.material.texture=t)}get textureInstance(){var t;return(t=this.material)==null?void 0:t.texture}set topTexture(t){this.material&&(this.material.topTexture=t)}get topTexture(){var t,e;return(e=(t=this.material)==null?void 0:t.topTexture)==null?void 0:e.image.src}get topTextureInstance(){var t;return(t=this.material)==null?void 0:t.topTexture}get featureBbox(){return s(this,qo)?s(this,qo):(P(this,qo,b7(this.feature)),s(this,qo))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Jc=new WeakMap,Kc=new WeakMap,qo=new WeakMap,u(F1,"MeshComponent");var Re=F1;m();var RE="#ffffff",zn,B1=class B1{constructor(t={}){d(this,"color",RE);d(this,"topColor");d(this,"opacity",1);d(this,"height");S(this,zn,void 0);d(this,"outline",!0);d(this,"texture");d(this,"topTexture");d(this,"dirty",!0);var e,i;this.color=(e=t==null?void 0:t.color)!=null?e:this.color,this.topColor=t==null?void 0:t.topColor,this.opacity=(i=t==null?void 0:t.opacity)!=null?i:this.opacity,this.height=t==null?void 0:t.height,this.shading=t==null?void 0:t.shading,this.outline=(t==null?void 0:t.outline)!==void 0?!!t.outline:this.outline}get shading(){return s(this,zn)}set shading(t){var e;if(!t){P(this,zn,void 0);return}P(this,zn,(e=s(this,zn))!=null?e:{start:0,end:0,intensity:0}),Object.assign(s(this,zn),t)}};zn=new WeakMap,u(B1,"GeometryGroupStyleComponent");var $o=B1;m();m();function qn(r){var e;let t=(e=r.parent)==null?void 0:e.children.find(i=>i.userData.outlineOfEntityId===r.userData.entityId);return t instanceof Po?t:void 0}u(qn,"findOutline");m();m();m();m();var R1=class R1{constructor(){d(this,"hover",!1);d(this,"dirty",!1)}};u(R1,"InteractionComponent");var Rs=R1;m();m();var x7=["","","low","medium","high","always-visible"];function C7(r){return Math.min(5,Math.max(2,r))}u(C7,"clampTierNumber");function Ns(r){if(typeof r=="number")return C7(r);let t=x7.indexOf(r);return t===-1?3:t}u(Ns,"convertCollisionRankingTierToNumber");function Qc(r){let t=C7(r);return x7[t]}u(Qc,"convertNumberToCollisionRankingTier");m();var me;(function(r){r.assertEqual=n=>n;function t(n){}u(t,"assertIs"),r.assertIs=t;function e(n){throw new Error}u(e,"assertNever"),r.assertNever=e,r.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},r.getValidEnumValues=n=>{let o=r.objectKeys(n).filter(l=>typeof n[n[l]]!="number"),a={};for(let l of o)a[l]=n[l];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)}u(i,"joinValues"),r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(me||(me={}));var G1;(function(r){r.mergeShapes=(t,e)=>({...t,...e})})(G1||(G1={}));var W=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$n=u(r=>{switch(typeof r){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(r)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(r)?W.array:r===null?W.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?W.promise:typeof Map<"u"&&r instanceof Map?W.map:typeof Set<"u"&&r instanceof Set?W.set:typeof Date<"u"&&r instanceof Date?W.date:W.object;default:return W.unknown}},"getParsedType"),R=me.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"]),NE=u(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),qh=class qh 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=u(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 l=i,c=0;for(;c<a.path.length;){let p=a.path[c];c===a.path.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(e(a))):l[p]=l[p]||{_errors:[]},l=l[p],c++}}},"processError");return n(this),i}static assert(t){if(!(t instanceof qh))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.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()}};u(qh,"ZodError");var tr=qh;tr.create=r=>new tr(r);var Us=u((r,t)=>{let e;switch(r.code){case R.invalid_type:r.received===W.undefined?e="Required":e="Expected ".concat(r.expected,", received ").concat(r.received);break;case R.invalid_literal:e="Invalid literal value, expected ".concat(JSON.stringify(r.expected,me.jsonStringifyReplacer));break;case R.unrecognized_keys:e="Unrecognized key(s) in object: ".concat(me.joinValues(r.keys,", "));break;case R.invalid_union:e="Invalid input";break;case R.invalid_union_discriminator:e="Invalid discriminator value. Expected ".concat(me.joinValues(r.options));break;case R.invalid_enum_value:e="Invalid enum value. Expected ".concat(me.joinValues(r.options),", received '").concat(r.received,"'");break;case R.invalid_arguments:e="Invalid function arguments";break;case R.invalid_return_type:e="Invalid function return type";break;case R.invalid_date:e="Invalid date";break;case R.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,'"'):me.assertNever(r.validation):r.validation!=="regex"?e="Invalid ".concat(r.validation):e="Invalid";break;case R.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 R.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 R.custom:e="Invalid input";break;case R.invalid_intersection_types:e="Intersection results could not be merged";break;case R.not_multiple_of:e="Number must be a multiple of ".concat(r.multipleOf);break;case R.not_finite:e="Number must be finite";break;default:e=t.defaultError,me.assertNever(r)}return{message:e}},"errorMap"),M7=Us;function GE(r){M7=r}u(GE,"setErrorMap");function Uh(){return M7}u(Uh,"getErrorMap");var Wh=u(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 l="",c=i.filter(p=>!!p).slice().reverse();for(let p of c)l=p(a,{data:t,defaultError:l}).message;return{...n,path:o,message:l}},"makeIssue"),VE=[];function U(r,t){let e=Uh(),i=Wh({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===Us?void 0:Us].filter(n=>!!n)});r.common.issues.push(i)}u(U,"addIssueToContext");var $h=class $h{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 ee;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 $h.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 ee;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}}};u($h,"ParseStatus");var dt=$h,ee=Object.freeze({status:"aborted"}),Vs=u(r=>({status:"dirty",value:r}),"DIRTY"),Ct=u(r=>({status:"valid",value:r}),"OK"),V1=u(r=>r.status==="aborted","isAborted"),j1=u(r=>r.status==="dirty","isDirty"),su=u(r=>r.status==="valid","isValid"),lu=u(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Xh(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)}u(Xh,"__classPrivateFieldGet");function P7(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}u(P7,"__classPrivateFieldSet");var z;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(z||(z={}));var eu,tu,U1=class U1{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}};u(U1,"ParseInputLazyPath");var vr=U1,S7=u((r,t)=>{if(su(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 tr(r.common.issues);return this._error=e,this._error}}},"handleResult");function oe(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:u((a,l)=>{var c,p;let{message:h}=r;return a.code==="invalid_enum_value"?{message:h!=null?h:l.defaultError}:typeof l.data>"u"?{message:(c=h!=null?h:i)!==null&&c!==void 0?c:l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:(p=h!=null?h:e)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:n}}u(oe,"processCreateParams");var W1=class W1{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 $n(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:$n(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dt,ctx:{common:t.parent.common,data:t.data,parsedType:$n(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(lu(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:$n(t)},o=this._parseSync({data:t,path:n.path,parent:n});return S7(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:$n(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(lu(n)?n:Promise.resolve(n));return S7(i,o)}refine(t,e){let i=u(n=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(n):e,"getIssueProperties");return this._refinement((n,o)=>{let a=t(n),l=u(()=>o.addIssue({code:R.custom,...i(n)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!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 rr({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return gr.create(this,this._def)}nullable(){return yi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this,this._def)}promise(){return Qn.create(this,this._def)}or(t){return na.create([this,t],this._def)}and(t){return oa.create(this,t,this._def)}transform(t){return new rr({...oe(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new ua({...oe(this._def),innerType:this,defaultValue:e,typeName:K.ZodDefault})}brand(){return new cu({typeName:K.ZodBranded,type:this,...oe(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new pa({...oe(this._def),innerType:this,catchValue:e,typeName:K.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return uu.create(this,t)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};u(W1,"ZodType");var ae=W1,jE=/^c[^\s-]{8,}$/i,HE=/^[0-9a-z]+$/,UE=/^[0-9A-HJKMNP-TV-Z]{26}$/,WE=/^[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,XE=/^[a-z0-9_-]{21}$/i,YE=/^[-+]?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)?)??$/,ZE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",N1,qE=/^(?:(?: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])$/,$E=/^(([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})))$/,JE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,I7="((\\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])))",KE=new RegExp("^".concat(I7,"$"));function w7(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}u(w7,"timeRegexSource");function QE(r){return new RegExp("^".concat(w7(r),"$"))}u(QE,"timeRegex");function E7(r){let t="".concat(I7,"T").concat(w7(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,"$"))}u(E7,"datetimeRegex");function eD(r,t){return!!((t==="v4"||!t)&&qE.test(r)||(t==="v6"||!t)&&$E.test(r))}u(eD,"isValidIP");var Jo=class Jo extends ae{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==W.string){let o=this._getOrReturnCtx(t);return U(o,{code:R.invalid_type,expected:W.string,received:o.parsedType}),ee}let i=new dt,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),U(n,{code:R.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),U(n,{code:R.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,l=t.data.length<o.value;(a||l)&&(n=this._getOrReturnCtx(t,n),a?U(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&U(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")ZE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"email",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")N1||(N1=new RegExp(zE,"u")),N1.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"emoji",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")WE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"uuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")XE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"nanoid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")jE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"cuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")HE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"cuid2",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")UE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"ulid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),U(n,{validation:"url",code:R.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),U(n,{validation:"regex",code:R.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),U(n,{code:R.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),U(n,{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),U(n,{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?E7(o).test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{code:R.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?KE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{code:R.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?QE(o).test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{code:R.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?YE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"duration",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?eD(t.data,o.version)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"ip",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?JE.test(t.data)||(n=this._getOrReturnCtx(t,n),U(n,{validation:"base64",code:R.invalid_string,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:t.data}}_regex(t,e,i){return this.refinement(n=>t.test(n),{validation:e,code:R.invalid_string,...z.errToObj(i)})}_addCheck(t){return new Jo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...z.errToObj(t)})}url(t){return this._addCheck({kind:"url",...z.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...z.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...z.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...z.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...z.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...z.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...z.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...z.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...z.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,...z.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,...z.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...z.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...z.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...z.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...z.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...z.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...z.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...z.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...z.errToObj(e)})}nonempty(t){return this.min(1,z.errToObj(t))}trim(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jo({...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}};u(Jo,"ZodString");var Jn=Jo;Jn.create=r=>{var t;return new Jn({checks:[],typeName:K.ZodString,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...oe(r)})};function tD(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)}u(tD,"floatSafeRemainder");var ru=class ru extends ae{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)!==W.number){let o=this._getOrReturnCtx(t);return U(o,{code:R.invalid_type,expected:W.number,received:o.parsedType}),ee}let i,n=new dt;for(let o of this._def.checks)o.kind==="int"?me.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),U(i,{code:R.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),U(i,{code:R.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),U(i,{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?tD(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),U(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),U(i,{code:R.not_finite,message:o.message}),n.dirty()):me.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,z.toString(e))}gt(t,e){return this.setLimit("min",t,!1,z.toString(e))}lte(t,e){return this.setLimit("max",t,!0,z.toString(e))}lt(t,e){return this.setLimit("max",t,!1,z.toString(e))}setLimit(t,e,i,n){return new ru({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:z.toString(n)}]})}_addCheck(t){return new ru({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:z.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:z.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:z.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.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"&&me.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)}};u(ru,"ZodNumber");var Ko=ru;Ko.create=r=>new Ko({checks:[],typeName:K.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...oe(r)});var iu=class iu extends ae{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)!==W.bigint){let o=this._getOrReturnCtx(t);return U(o,{code:R.invalid_type,expected:W.bigint,received:o.parsedType}),ee}let i,n=new dt;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),U(i,{code:R.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),U(i,{code:R.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),U(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):me.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,z.toString(e))}gt(t,e){return this.setLimit("min",t,!1,z.toString(e))}lte(t,e){return this.setLimit("max",t,!0,z.toString(e))}lt(t,e){return this.setLimit("max",t,!1,z.toString(e))}setLimit(t,e,i,n){return new iu({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:z.toString(n)}]})}_addCheck(t){return new iu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:z.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}};u(iu,"ZodBigInt");var Qo=iu;Qo.create=r=>{var t;return new Qo({checks:[],typeName:K.ZodBigInt,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...oe(r)})};var X1=class X1 extends ae{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==W.boolean){let i=this._getOrReturnCtx(t);return U(i,{code:R.invalid_type,expected:W.boolean,received:i.parsedType}),ee}return Ct(t.data)}};u(X1,"ZodBoolean");var ea=X1;ea.create=r=>new ea({typeName:K.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...oe(r)});var Jh=class Jh extends ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==W.date){let o=this._getOrReturnCtx(t);return U(o,{code:R.invalid_type,expected:W.date,received:o.parsedType}),ee}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return U(o,{code:R.invalid_date}),ee}let i=new dt,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),U(n,{code:R.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),U(n,{code:R.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):me.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Jh({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:z.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:z.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}};u(Jh,"ZodDate");var ta=Jh;ta.create=r=>new ta({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:K.ZodDate,...oe(r)});var Y1=class Y1 extends ae{_parse(t){if(this._getType(t)!==W.symbol){let i=this._getOrReturnCtx(t);return U(i,{code:R.invalid_type,expected:W.symbol,received:i.parsedType}),ee}return Ct(t.data)}};u(Y1,"ZodSymbol");var Ws=Y1;Ws.create=r=>new Ws({typeName:K.ZodSymbol,...oe(r)});var Z1=class Z1 extends ae{_parse(t){if(this._getType(t)!==W.undefined){let i=this._getOrReturnCtx(t);return U(i,{code:R.invalid_type,expected:W.undefined,received:i.parsedType}),ee}return Ct(t.data)}};u(Z1,"ZodUndefined");var ra=Z1;ra.create=r=>new ra({typeName:K.ZodUndefined,...oe(r)});var z1=class z1 extends ae{_parse(t){if(this._getType(t)!==W.null){let i=this._getOrReturnCtx(t);return U(i,{code:R.invalid_type,expected:W.null,received:i.parsedType}),ee}return Ct(t.data)}};u(z1,"ZodNull");var ia=z1;ia.create=r=>new ia({typeName:K.ZodNull,...oe(r)});var q1=class q1 extends ae{constructor(){super(...arguments),this._any=!0}_parse(t){return Ct(t.data)}};u(q1,"ZodAny");var Kn=q1;Kn.create=r=>new Kn({typeName:K.ZodAny,...oe(r)});var $1=class $1 extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ct(t.data)}};u($1,"ZodUnknown");var tn=$1;tn.create=r=>new tn({typeName:K.ZodUnknown,...oe(r)});var J1=class J1 extends ae{_parse(t){let e=this._getOrReturnCtx(t);return U(e,{code:R.invalid_type,expected:W.never,received:e.parsedType}),ee}};u(J1,"ZodNever");var Rr=J1;Rr.create=r=>new Rr({typeName:K.ZodNever,...oe(r)});var K1=class K1 extends ae{_parse(t){if(this._getType(t)!==W.undefined){let i=this._getOrReturnCtx(t);return U(i,{code:R.invalid_type,expected:W.void,received:i.parsedType}),ee}return Ct(t.data)}};u(K1,"ZodVoid");var Xs=K1;Xs.create=r=>new Xs({typeName:K.ZodVoid,...oe(r)});var js=class js extends ae{_parse(t){let{ctx:e,status:i}=this._processInputParams(t),n=this._def;if(e.parsedType!==W.array)return U(e,{code:R.invalid_type,expected:W.array,received:e.parsedType}),ee;if(n.exactLength!==null){let a=e.data.length>n.exactLength.value,l=e.data.length<n.exactLength.value;(a||l)&&(U(e,{code:a?R.too_big:R.too_small,minimum:l?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&&(U(e,{code:R.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&&(U(e,{code:R.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,l)=>n.type._parseAsync(new vr(e,a,e.path,l)))).then(a=>dt.mergeArray(i,a));let o=[...e.data].map((a,l)=>n.type._parseSync(new vr(e,a,e.path,l)));return dt.mergeArray(i,o)}get element(){return this._def.type}min(t,e){return new js({...this._def,minLength:{value:t,message:z.toString(e)}})}max(t,e){return new js({...this._def,maxLength:{value:t,message:z.toString(e)}})}length(t,e){return new js({...this._def,exactLength:{value:t,message:z.toString(e)}})}nonempty(t){return this.min(1,t)}};u(js,"ZodArray");var rn=js;rn.create=(r,t)=>new rn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...oe(t)});function Gs(r){if(r instanceof jt){let t={};for(let e in r.shape){let i=r.shape[e];t[e]=gr.create(Gs(i))}return new jt({...r._def,shape:()=>t})}else return r instanceof rn?new rn({...r._def,type:Gs(r.element)}):r instanceof gr?gr.create(Gs(r.unwrap())):r instanceof yi?yi.create(Gs(r.unwrap())):r instanceof mi?mi.create(r.items.map(t=>Gs(t))):r}u(Gs,"deepPartialify");var er=class er extends ae{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=me.objectKeys(t);return this._cached={shape:t,keys:e}}_parse(t){if(this._getType(t)!==W.object){let p=this._getOrReturnCtx(t);return U(p,{code:R.invalid_type,expected:W.object,received:p.parsedType}),ee}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof Rr&&this._def.unknownKeys==="strip"))for(let p in n.data)a.includes(p)||l.push(p);let c=[];for(let p of a){let h=o[p],y=n.data[p];c.push({key:{status:"valid",value:p},value:h._parse(new vr(n,y,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof Rr){let p=this._def.unknownKeys;if(p==="passthrough")for(let h of l)c.push({key:{status:"valid",value:h},value:{status:"valid",value:n.data[h]}});else if(p==="strict")l.length>0&&(U(n,{code:R.unrecognized_keys,keys:l}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let h of l){let y=n.data[h];c.push({key:{status:"valid",value:h},value:p._parse(new vr(n,y,n.path,h)),alwaysSet:h in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let h of c){let y=await h.key,g=await h.value;p.push({key:y,value:g,alwaysSet:h.alwaysSet})}return p}).then(p=>dt.mergeObjectSync(i,p)):dt.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return z.errToObj,new er({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,i)=>{var n,o,a,l;let c=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,e,i).message)!==null&&a!==void 0?a:i.defaultError;return e.code==="unrecognized_keys"?{message:(l=z.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}extend(t){return new er({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new er({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:K.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new er({...this._def,catchall:t})}pick(t){let e={};return me.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(e[i]=this.shape[i])}),new er({...this._def,shape:()=>e})}omit(t){let e={};return me.objectKeys(this.shape).forEach(i=>{t[i]||(e[i]=this.shape[i])}),new er({...this._def,shape:()=>e})}deepPartial(){return Gs(this)}partial(t){let e={};return me.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];t&&!t[i]?e[i]=n:e[i]=n.optional()}),new er({...this._def,shape:()=>e})}required(t){let e={};return me.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])e[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof gr;)o=o._def.innerType;e[i]=o}}),new er({...this._def,shape:()=>e})}keyof(){return D7(me.objectKeys(this.shape))}};u(er,"ZodObject");var jt=er;jt.create=(r,t)=>new jt({shape:()=>r,unknownKeys:"strip",catchall:Rr.create(),typeName:K.ZodObject,...oe(t)});jt.strictCreate=(r,t)=>new jt({shape:()=>r,unknownKeys:"strict",catchall:Rr.create(),typeName:K.ZodObject,...oe(t)});jt.lazycreate=(r,t)=>new jt({shape:r,unknownKeys:"strip",catchall:Rr.create(),typeName:K.ZodObject,...oe(t)});var Q1=class Q1 extends ae{_parse(t){let{ctx:e}=this._processInputParams(t),i=this._def.options;function n(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return e.common.issues.push(...l.ctx.common.issues),l.result;let a=o.map(l=>new tr(l.ctx.common.issues));return U(e,{code:R.invalid_union,unionErrors:a}),ee}if(u(n,"handleResults"),e.common.async)return Promise.all(i.map(async o=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await o._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let c of i){let p={...e,common:{...e.common,issues:[]},parent:null},h=c._parseSync({data:e.data,path:e.path,parent:p});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,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 l=a.map(c=>new tr(c));return U(e,{code:R.invalid_union,unionErrors:l}),ee}}get options(){return this._def.options}};u(Q1,"ZodUnion");var na=Q1;na.create=(r,t)=>new na({options:r,typeName:K.ZodUnion,...oe(t)});var en=u(r=>r instanceof aa?en(r.schema):r instanceof rr?en(r.innerType()):r instanceof sa?[r.value]:r instanceof la?r.options:r instanceof ca?me.objectValues(r.enum):r instanceof ua?en(r._def.innerType):r instanceof ra?[void 0]:r instanceof ia?[null]:r instanceof gr?[void 0,...en(r.unwrap())]:r instanceof yi?[null,...en(r.unwrap())]:r instanceof cu||r instanceof da?en(r.unwrap()):r instanceof pa?en(r._def.innerType):[],"getDiscriminator"),Kh=class Kh extends ae{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==W.object)return U(e,{code:R.invalid_type,expected:W.object,received:e.parsedType}),ee;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}):(U(e,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,i){let n=new Map;for(let o of e){let a=en(o.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let l of a){if(n.has(l))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(l)));n.set(l,o)}}return new Kh({typeName:K.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:n,...oe(i)})}};u(Kh,"ZodDiscriminatedUnion");var Yh=Kh;function H1(r,t){let e=$n(r),i=$n(t);if(r===t)return{valid:!0,data:r};if(e===W.object&&i===W.object){let n=me.objectKeys(t),o=me.objectKeys(r).filter(l=>n.indexOf(l)!==-1),a={...r,...t};for(let l of o){let c=H1(r[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(e===W.array&&i===W.array){if(r.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<r.length;o++){let a=r[o],l=t[o],c=H1(a,l);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return e===W.date&&i===W.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}u(H1,"mergeValues");var e0=class e0 extends ae{_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=u((o,a)=>{if(V1(o)||V1(a))return ee;let l=H1(o.value,a.value);return l.valid?((j1(o)||j1(a))&&e.dirty(),{status:e.value,value:l.data}):(U(i,{code:R.invalid_intersection_types}),ee)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};u(e0,"ZodIntersection");var oa=e0;oa.create=(r,t,e)=>new oa({left:r,right:t,typeName:K.ZodIntersection,...oe(e)});var Qh=class Qh extends ae{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==W.array)return U(i,{code:R.invalid_type,expected:W.array,received:i.parsedType}),ee;if(i.data.length<this._def.items.length)return U(i,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ee;!this._def.rest&&i.data.length>this._def.items.length&&(U(i,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let o=[...i.data].map((a,l)=>{let c=this._def.items[l]||this._def.rest;return c?c._parse(new vr(i,a,i.path,l)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>dt.mergeArray(e,a)):dt.mergeArray(e,o)}get items(){return this._def.items}rest(t){return new Qh({...this._def,rest:t})}};u(Qh,"ZodTuple");var mi=Qh;mi.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mi({items:r,typeName:K.ZodTuple,rest:null,...oe(t)})};var nu=class nu extends ae{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!==W.object)return U(i,{code:R.invalid_type,expected:W.object,received:i.parsedType}),ee;let n=[],o=this._def.keyType,a=this._def.valueType;for(let l in i.data)n.push({key:o._parse(new vr(i,l,i.path,l)),value:a._parse(new vr(i,i.data[l],i.path,l)),alwaysSet:l in i.data});return i.common.async?dt.mergeObjectAsync(e,n):dt.mergeObjectSync(e,n)}get element(){return this._def.valueType}static create(t,e,i){return e instanceof ae?new nu({keyType:t,valueType:e,typeName:K.ZodRecord,...oe(i)}):new nu({keyType:Jn.create(),valueType:t,typeName:K.ZodRecord,...oe(e)})}};u(nu,"ZodRecord");var Zh=nu,t0=class t0 extends ae{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!==W.map)return U(i,{code:R.invalid_type,expected:W.map,received:i.parsedType}),ee;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([l,c],p)=>({key:n._parse(new vr(i,l,i.path,[p,"key"])),value:o._parse(new vr(i,c,i.path,[p,"value"]))}));if(i.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let c of a){let p=await c.key,h=await c.value;if(p.status==="aborted"||h.status==="aborted")return ee;(p.status==="dirty"||h.status==="dirty")&&e.dirty(),l.set(p.value,h.value)}return{status:e.value,value:l}})}else{let l=new Map;for(let c of a){let p=c.key,h=c.value;if(p.status==="aborted"||h.status==="aborted")return ee;(p.status==="dirty"||h.status==="dirty")&&e.dirty(),l.set(p.value,h.value)}return{status:e.value,value:l}}}};u(t0,"ZodMap");var Ys=t0;Ys.create=(r,t,e)=>new Ys({valueType:t,keyType:r,typeName:K.ZodMap,...oe(e)});var ou=class ou extends ae{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==W.set)return U(i,{code:R.invalid_type,expected:W.set,received:i.parsedType}),ee;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(U(i,{code:R.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&&(U(i,{code:R.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),e.dirty());let o=this._def.valueType;function a(c){let p=new Set;for(let h of c){if(h.status==="aborted")return ee;h.status==="dirty"&&e.dirty(),p.add(h.value)}return{status:e.value,value:p}}u(a,"finalizeSet");let l=[...i.data.values()].map((c,p)=>o._parse(new vr(i,c,i.path,p)));return i.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,e){return new ou({...this._def,minSize:{value:t,message:z.toString(e)}})}max(t,e){return new ou({...this._def,maxSize:{value:t,message:z.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};u(ou,"ZodSet");var Zs=ou;Zs.create=(r,t)=>new Zs({valueType:r,minSize:null,maxSize:null,typeName:K.ZodSet,...oe(t)});var Hs=class Hs extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==W.function)return U(e,{code:R.invalid_type,expected:W.function,received:e.parsedType}),ee;function i(l,c){return Wh({data:l,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Uh(),Us].filter(p=>!!p),issueData:{code:R.invalid_arguments,argumentsError:c}})}u(i,"makeArgsIssue");function n(l,c){return Wh({data:l,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Uh(),Us].filter(p=>!!p),issueData:{code:R.invalid_return_type,returnTypeError:c}})}u(n,"makeReturnsIssue");let o={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof Qn){let l=this;return Ct(async function(...c){let p=new tr([]),h=await l._def.args.parseAsync(c,o).catch(v=>{throw p.addIssue(i(c,v)),p}),y=await Reflect.apply(a,this,h);return await l._def.returns._def.type.parseAsync(y,o).catch(v=>{throw p.addIssue(n(y,v)),p})})}else{let l=this;return Ct(function(...c){let p=l._def.args.safeParse(c,o);if(!p.success)throw new tr([i(c,p.error)]);let h=Reflect.apply(a,this,p.data),y=l._def.returns.safeParse(h,o);if(!y.success)throw new tr([n(h,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Hs({...this._def,args:mi.create(t).rest(tn.create())})}returns(t){return new Hs({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,i){return new Hs({args:t||mi.create([]).rest(tn.create()),returns:e||tn.create(),typeName:K.ZodFunction,...oe(i)})}};u(Hs,"ZodFunction");var zh=Hs,r0=class r0 extends ae{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})}};u(r0,"ZodLazy");var aa=r0;aa.create=(r,t)=>new aa({getter:r,typeName:K.ZodLazy,...oe(t)});var i0=class i0 extends ae{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return U(e,{received:e.data,code:R.invalid_literal,expected:this._def.value}),ee}return{status:"valid",value:t.data}}get value(){return this._def.value}};u(i0,"ZodLiteral");var sa=i0;sa.create=(r,t)=>new sa({value:r,typeName:K.ZodLiteral,...oe(t)});function D7(r,t){return new la({values:r,typeName:K.ZodEnum,...oe(t)})}u(D7,"createZodEnum");var au=class au extends ae{constructor(){super(...arguments),eu.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),i=this._def.values;return U(e,{expected:me.joinValues(i),received:e.parsedType,code:R.invalid_type}),ee}if(Xh(this,eu,"f")||P7(this,eu,new Set(this._def.values),"f"),!Xh(this,eu,"f").has(t.data)){let e=this._getOrReturnCtx(t),i=this._def.values;return U(e,{received:e.data,code:R.invalid_enum_value,options:i}),ee}return Ct(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 au.create(t,{...this._def,...e})}exclude(t,e=this._def){return au.create(this.options.filter(i=>!t.includes(i)),{...this._def,...e})}};u(au,"ZodEnum");var la=au;eu=new WeakMap;la.create=D7;var n0=class n0 extends ae{constructor(){super(...arguments),tu.set(this,void 0)}_parse(t){let e=me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==W.string&&i.parsedType!==W.number){let n=me.objectValues(e);return U(i,{expected:me.joinValues(n),received:i.parsedType,code:R.invalid_type}),ee}if(Xh(this,tu,"f")||P7(this,tu,new Set(me.getValidEnumValues(this._def.values)),"f"),!Xh(this,tu,"f").has(t.data)){let n=me.objectValues(e);return U(i,{received:i.data,code:R.invalid_enum_value,options:n}),ee}return Ct(t.data)}get enum(){return this._def.values}};u(n0,"ZodNativeEnum");var ca=n0;tu=new WeakMap;ca.create=(r,t)=>new ca({values:r,typeName:K.ZodNativeEnum,...oe(t)});var o0=class o0 extends ae{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==W.promise&&e.common.async===!1)return U(e,{code:R.invalid_type,expected:W.promise,received:e.parsedType}),ee;let i=e.parsedType===W.promise?e.data:Promise.resolve(e.data);return Ct(i.then(n=>this._def.type.parseAsync(n,{path:e.path,errorMap:e.common.contextualErrorMap})))}};u(o0,"ZodPromise");var Qn=o0;Qn.create=(r,t)=>new Qn({type:r,typeName:K.ZodPromise,...oe(t)});var a0=class a0 extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.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=>{U(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 l=>{if(e.value==="aborted")return ee;let c=await this._def.schema._parseAsync({data:l,path:i.path,parent:i});return c.status==="aborted"?ee:c.status==="dirty"||e.value==="dirty"?Vs(c.value):c});{if(e.value==="aborted")return ee;let l=this._def.schema._parseSync({data:a,path:i.path,parent:i});return l.status==="aborted"?ee:l.status==="dirty"||e.value==="dirty"?Vs(l.value):l}}if(n.type==="refinement"){let a=u(l=>{let c=n.refinement(l,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(i.common.async===!1){let l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?ee:(l.status==="dirty"&&e.dirty(),a(l.value),{status:e.value,value:l.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>l.status==="aborted"?ee:(l.status==="dirty"&&e.dirty(),a(l.value).then(()=>({status:e.value,value:l.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(!su(a))return a;let l=n.transform(a.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:l}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>su(a)?Promise.resolve(n.transform(a.value,o)).then(l=>({status:e.value,value:l})):a);me.assertNever(n)}};u(a0,"ZodEffects");var rr=a0;rr.create=(r,t,e)=>new rr({schema:r,typeName:K.ZodEffects,effect:t,...oe(e)});rr.createWithPreprocess=(r,t,e)=>new rr({schema:t,effect:{type:"preprocess",transform:r},typeName:K.ZodEffects,...oe(e)});var s0=class s0 extends ae{_parse(t){return this._getType(t)===W.undefined?Ct(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};u(s0,"ZodOptional");var gr=s0;gr.create=(r,t)=>new gr({innerType:r,typeName:K.ZodOptional,...oe(t)});var l0=class l0 extends ae{_parse(t){return this._getType(t)===W.null?Ct(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};u(l0,"ZodNullable");var yi=l0;yi.create=(r,t)=>new yi({innerType:r,typeName:K.ZodNullable,...oe(t)});var c0=class c0 extends ae{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return e.parsedType===W.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};u(c0,"ZodDefault");var ua=c0;ua.create=(r,t)=>new ua({innerType:r,typeName:K.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...oe(t)});var u0=class u0 extends ae{_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 lu(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new tr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};u(u0,"ZodCatch");var pa=u0;pa.create=(r,t)=>new pa({innerType:r,typeName:K.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...oe(t)});var p0=class p0 extends ae{_parse(t){if(this._getType(t)!==W.nan){let i=this._getOrReturnCtx(t);return U(i,{code:R.invalid_type,expected:W.nan,received:i.parsedType}),ee}return{status:"valid",value:t.data}}};u(p0,"ZodNaN");var zs=p0;zs.create=r=>new zs({typeName:K.ZodNaN,...oe(r)});var rD=Symbol("zod_brand"),d0=class d0 extends ae{_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}};u(d0,"ZodBranded");var cu=d0,ef=class ef extends ae{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.common.async)return u(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?ee:o.status==="dirty"?(e.dirty(),Vs(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})},"handleAsync")();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?ee: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 ef({in:t,out:e,typeName:K.ZodPipeline})}};u(ef,"ZodPipeline");var uu=ef,h0=class h0 extends ae{_parse(t){let e=this._def.innerType._parse(t),i=u(n=>(su(n)&&(n.value=Object.freeze(n.value)),n),"freeze");return lu(e)?e.then(n=>i(n)):i(e)}unwrap(){return this._def.innerType}};u(h0,"ZodReadonly");var da=h0;da.create=(r,t)=>new da({innerType:r,typeName:K.ZodReadonly,...oe(t)});function _7(r,t={},e){return r?Kn.create().superRefine((i,n)=>{var o,a;if(!r(i)){let l=typeof t=="function"?t(i):typeof t=="string"?{message:t}:t,c=(a=(o=l.fatal)!==null&&o!==void 0?o:e)!==null&&a!==void 0?a:!0,p=typeof l=="string"?{message:l}:l;n.addIssue({code:"custom",...p,fatal:c})}}):Kn.create()}u(_7,"custom");var iD={object:jt.lazycreate},K;(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"})(K||(K={}));var nD=u((r,t={message:"Input not instance of ".concat(r.name)})=>_7(e=>e instanceof r,t),"instanceOfType"),O7=Jn.create,L7=Ko.create,oD=zs.create,aD=Qo.create,A7=ea.create,sD=ta.create,lD=Ws.create,cD=ra.create,uD=ia.create,pD=Kn.create,dD=tn.create,hD=Rr.create,fD=Xs.create,mD=rn.create,yD=jt.create,gD=jt.strictCreate,vD=na.create,bD=Yh.create,xD=oa.create,CD=mi.create,SD=Zh.create,TD=Ys.create,MD=Zs.create,PD=zh.create,ID=aa.create,wD=sa.create,ED=la.create,DD=ca.create,_D=Qn.create,T7=rr.create,OD=gr.create,LD=yi.create,AD=rr.createWithPreprocess,kD=uu.create,FD=u(()=>O7().optional(),"ostring"),BD=u(()=>L7().optional(),"onumber"),RD=u(()=>A7().optional(),"oboolean"),ND={string:r=>Jn.create({...r,coerce:!0}),number:r=>Ko.create({...r,coerce:!0}),boolean:r=>ea.create({...r,coerce:!0}),bigint:r=>Qo.create({...r,coerce:!0}),date:r=>ta.create({...r,coerce:!0})},GD=ee,D=Object.freeze({__proto__:null,defaultErrorMap:Us,setErrorMap:GE,getErrorMap:Uh,makeIssue:Wh,EMPTY_PATH:VE,addIssueToContext:U,ParseStatus:dt,INVALID:ee,DIRTY:Vs,OK:Ct,isAborted:V1,isDirty:j1,isValid:su,isAsync:lu,get util(){return me},get objectUtil(){return G1},ZodParsedType:W,getParsedType:$n,ZodType:ae,datetimeRegex:E7,ZodString:Jn,ZodNumber:Ko,ZodBigInt:Qo,ZodBoolean:ea,ZodDate:ta,ZodSymbol:Ws,ZodUndefined:ra,ZodNull:ia,ZodAny:Kn,ZodUnknown:tn,ZodNever:Rr,ZodVoid:Xs,ZodArray:rn,ZodObject:jt,ZodUnion:na,ZodDiscriminatedUnion:Yh,ZodIntersection:oa,ZodTuple:mi,ZodRecord:Zh,ZodMap:Ys,ZodSet:Zs,ZodFunction:zh,ZodLazy:aa,ZodLiteral:sa,ZodEnum:la,ZodNativeEnum:ca,ZodPromise:Qn,ZodEffects:rr,ZodTransformer:rr,ZodOptional:gr,ZodNullable:yi,ZodDefault:ua,ZodCatch:pa,ZodNaN:zs,BRAND:rD,ZodBranded:cu,ZodPipeline:uu,ZodReadonly:da,custom:_7,Schema:ae,ZodSchema:ae,late:iD,get ZodFirstPartyTypeKind(){return K},coerce:ND,any:pD,array:mD,bigint:aD,boolean:A7,date:sD,discriminatedUnion:bD,effect:T7,enum:ED,function:PD,instanceof:nD,intersection:xD,lazy:ID,literal:wD,map:TD,nan:oD,nativeEnum:DD,never:hD,null:uD,nullable:LD,number:L7,object:yD,oboolean:RD,onumber:BD,optional:OD,ostring:FD,pipeline:kD,preprocess:AD,promise:_D,record:SD,set:MD,strictObject:gD,string:O7,symbol:lD,transformer:T7,tuple:CD,undefined:cD,union:vD,unknown:dD,void:fD,NEVER:GD,ZodIssueCode:R,quotelessJson:NE,ZodError:tr});var tf=4,f0=D.object({rank:D.union([D.enum(["low","medium","high","always-visible"]),D.number()]).optional(),interactive:D.union([D.boolean(),D.literal("pointer-events-auto")]).optional(),id:D.string().optional(),anchor:D.union([D.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),D.array(D.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:D.boolean().optional()});function k7(r,t,e){D.array(D.number()).refine(i=>i.length===2||i.length===3,{message:"Array length must be either 2 or 3"}).parse(r),D.string().parse(t),f0.parse(e)}u(k7,"validateMarker");var ha=class ha{constructor(t,e={}){d(this,"id");d(this,"type","marker");d(this,"rank",0);d(this,"initialRank",0);d(this,"activeAnchor","center");d(this,"pointerEvents","none");d(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1});d(this,"projection",new re);d(this,"enabled",!0);d(this,"offscreen",!1);d(this,"activeStrategyIndex",-1);d(this,"strategyIndex",-1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"containerEl");d(this,"contentEl",null);d(this,"contentHtml","");d(this,"style",{top:"0px",left:"0px"});d(this,"dirty",!1);d(this,"collisionDirty",!0);d(this,"visibilityNeedsUpdate","show");d(this,"visible",!1);d(this,"animation",null);d(this,"currentStrategyIndex",-1);d(this,"onStrategySelected",u((t,e=!1)=>{if(this.currentStrategyIndex===t||e)return;this.currentStrategyIndex=t,this.activeAnchor=this.strategies[t].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:i,height:n}=this.dimensions,o=-n/2+"px",a=-i/2+"px";switch(this.style.top=o,this.style.left=a,this.activeAnchor){case"top":{this.style.top=-n+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-i+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-n+"px",this.style.left=-i+"px";break}case"top-right":{this.style.top=-n+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-i+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));d(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(e==null?void 0:e.id)||ue(),this.options={...this.options,...e},typeof e.rank=="string")this.rank=Ns(e.rank);else if(e.rank!=null&&e.rank>0)this.rank=e.rank;else{let n=Math.trunc(T.env.NODE_ENV==="test"?ha.testId:ha.testId*10)/10;ha.testId+=.001,this.rank=n}typeof e.interactive=="string"&&(this.pointerEvents=e.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank;let i=document.createElement("div");i.style.opacity="0",i.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=i.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(t,e){if(t!=null&&e!=null)this.dimensions={width:t,height:e};else{let{width:i,height:n}=this.containerEl.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"})}get strategies(){let{width:t,height:e}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(n=>({name:n,getBoundingBox:()=>{let o=e/2,a=e/2,l=t/2,c=t/2;switch(n){case"top":{o=e,a=0;break}case"bottom":{o=0,a=e;break}case"left":{l=t,c=0;break}case"right":{l=0,c=t;break}case"top-left":{o=e,l=t,a=0,c=0;break}case"top-right":{o=e,c=t,a=0,l=0;break}case"bottom-left":{a=e,l=t,o=0,c=0;break}case"bottom-right":{a=e,c=t,o=0,l=0;break}}return[o+tf,a+tf,l+tf,c+tf]}}))}toPackedMessage(t=!1){return 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,this.visible&&t&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((e,i)=>[...e.getBoundingBox(),i]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};u(ha,"MarkerComponent"),d(ha,"testId",0);var gi=ha;m();m();function rf(r){"@babel/helpers - typeof";return rf=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},rf(r)}u(rf,"_typeof");var VD=/^\s+/,jD=/\s+$/;function X(r,t){if(r=r||"",t=t||{},r instanceof X)return r;if(!(this instanceof X))return new X(r,t);var e=HD(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}u(X,"tinycolor");X.prototype={isDark:u(function(){return this.getBrightness()<128},"isDark"),isLight:u(function(){return!this.isDark()},"isLight"),isValid:u(function(){return this._ok},"isValid"),getOriginalInput:u(function(){return this._originalInput},"getOriginalInput"),getFormat:u(function(){return this._format},"getFormat"),getAlpha:u(function(){return this._a},"getAlpha"),getBrightness:u(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:u(function(){var t=this.toRgb(),e,i,n,o,a,l;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?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*l},"getLuminance"),setAlpha:u(function(t){return this._a=j7(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:u(function(){var t=B7(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:u(function(){var t=B7(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHsvString"),toHsl:u(function(){var t=F7(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:u(function(){var t=F7(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHslString"),toHex:u(function(t){return R7(this._r,this._g,this._b,t)},"toHex"),toHexString:u(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:u(function(t){return YD(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:u(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:u(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:u(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:u(function(){return{r:Math.round(Fe(this._r,255)*100)+"%",g:Math.round(Fe(this._g,255)*100)+"%",b:Math.round(Fe(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:u(function(){return this._a==1?"rgb("+Math.round(Fe(this._r,255)*100)+"%, "+Math.round(Fe(this._g,255)*100)+"%, "+Math.round(Fe(this._b,255)*100)+"%)":"rgba("+Math.round(Fe(this._r,255)*100)+"%, "+Math.round(Fe(this._g,255)*100)+"%, "+Math.round(Fe(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:u(function(){return this._a===0?"transparent":this._a<1?!1:n_[R7(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:u(function(t){var e="#"+N7(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=X(t);i="#"+N7(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},"toFilter"),toString:u(function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!e&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(i=this.toRgbString()),t==="prgb"&&(i=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(i=this.toHexString()),t==="hex3"&&(i=this.toHexString(!0)),t==="hex4"&&(i=this.toHex8String(!0)),t==="hex8"&&(i=this.toHex8String()),t==="name"&&(i=this.toName()),t==="hsl"&&(i=this.toHslString()),t==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},"toString"),clone:u(function(){return X(this.toString())},"clone"),_applyModification:u(function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},"_applyModification"),lighten:u(function(){return this._applyModification($D,arguments)},"lighten"),brighten:u(function(){return this._applyModification(JD,arguments)},"brighten"),darken:u(function(){return this._applyModification(KD,arguments)},"darken"),desaturate:u(function(){return this._applyModification(ZD,arguments)},"desaturate"),saturate:u(function(){return this._applyModification(zD,arguments)},"saturate"),greyscale:u(function(){return this._applyModification(qD,arguments)},"greyscale"),spin:u(function(){return this._applyModification(QD,arguments)},"spin"),_applyCombination:u(function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},"_applyCombination"),analogous:u(function(){return this._applyCombination(r_,arguments)},"analogous"),complement:u(function(){return this._applyCombination(e_,arguments)},"complement"),monochromatic:u(function(){return this._applyCombination(i_,arguments)},"monochromatic"),splitcomplement:u(function(){return this._applyCombination(t_,arguments)},"splitcomplement"),triad:u(function(){return this._applyCombination(G7,[3])},"triad"),tetrad:u(function(){return this._applyCombination(G7,[4])},"tetrad")};X.fromRatio=function(r,t){if(rf(r)=="object"){var e={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?e[i]=r[i]:e[i]=pu(r[i]));r=e}return X(r,t)};function HD(r){var t={r:0,g:0,b:0},e=1,i=null,n=null,o=null,a=!1,l=!1;return typeof r=="string"&&(r=l_(r)),rf(r)=="object"&&(nn(r.r)&&nn(r.g)&&nn(r.b)?(t=UD(r.r,r.g,r.b),a=!0,l=String(r.r).substr(-1)==="%"?"prgb":"rgb"):nn(r.h)&&nn(r.s)&&nn(r.v)?(i=pu(r.s),n=pu(r.v),t=XD(r.h,i,n),a=!0,l="hsv"):nn(r.h)&&nn(r.s)&&nn(r.l)&&(i=pu(r.s),o=pu(r.l),t=WD(r.h,i,o),a=!0,l="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=j7(e),{ok:a,format:r.format||l,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}}u(HD,"inputToRGB");function UD(r,t,e){return{r:Fe(r,255)*255,g:Fe(t,255)*255,b:Fe(e,255)*255}}u(UD,"rgbToRgb");function F7(r,t,e){r=Fe(r,255),t=Fe(t,255),e=Fe(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,l=(i+n)/2;if(i==n)o=a=0;else{var c=i-n;switch(a=l>.5?c/(2-i-n):c/(i+n),i){case r:o=(t-e)/c+(t<e?6:0);break;case t:o=(e-r)/c+2;break;case e:o=(r-t)/c+4;break}o/=6}return{h:o,s:a,l}}u(F7,"rgbToHsl");function WD(r,t,e){var i,n,o;r=Fe(r,360),t=Fe(t,100),e=Fe(e,100);function a(p,h,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(h-p)*6*y:y<1/2?h:y<2/3?p+(h-p)*(2/3-y)*6:p}if(u(a,"hue2rgb"),t===0)i=n=o=e;else{var l=e<.5?e*(1+t):e+t-e*t,c=2*e-l;i=a(c,l,r+1/3),n=a(c,l,r),o=a(c,l,r-1/3)}return{r:i*255,g:n*255,b:o*255}}u(WD,"hslToRgb");function B7(r,t,e){r=Fe(r,255),t=Fe(t,255),e=Fe(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,l=i,c=i-n;if(a=i===0?0:c/i,i==n)o=0;else{switch(i){case r:o=(t-e)/c+(t<e?6:0);break;case t:o=(e-r)/c+2;break;case e:o=(r-t)/c+4;break}o/=6}return{h:o,s:a,v:l}}u(B7,"rgbToHsv");function XD(r,t,e){r=Fe(r,360)*6,t=Fe(t,100),e=Fe(e,100);var i=Math.floor(r),n=r-i,o=e*(1-t),a=e*(1-n*t),l=e*(1-(1-n)*t),c=i%6,p=[e,a,o,o,l,e][c],h=[l,e,e,a,o,o][c],y=[o,o,l,e,e,a][c];return{r:p*255,g:h*255,b:y*255}}u(XD,"hsvToRgb");function R7(r,t,e,i){var n=[Gr(Math.round(r).toString(16)),Gr(Math.round(t).toString(16)),Gr(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("")}u(R7,"rgbToHex");function YD(r,t,e,i,n){var o=[Gr(Math.round(r).toString(16)),Gr(Math.round(t).toString(16)),Gr(Math.round(e).toString(16)),Gr(H7(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("")}u(YD,"rgbaToHex");function N7(r,t,e,i){var n=[Gr(H7(i)),Gr(Math.round(r).toString(16)),Gr(Math.round(t).toString(16)),Gr(Math.round(e).toString(16))];return n.join("")}u(N7,"rgbaToArgbHex");X.equals=function(r,t){return!r||!t?!1:X(r).toRgbString()==X(t).toRgbString()};X.random=function(){return X.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ZD(r,t){t=t===0?0:t||10;var e=X(r).toHsl();return e.s-=t/100,e.s=nf(e.s),X(e)}u(ZD,"_desaturate");function zD(r,t){t=t===0?0:t||10;var e=X(r).toHsl();return e.s+=t/100,e.s=nf(e.s),X(e)}u(zD,"_saturate");function qD(r){return X(r).desaturate(100)}u(qD,"_greyscale");function $D(r,t){t=t===0?0:t||10;var e=X(r).toHsl();return e.l+=t/100,e.l=nf(e.l),X(e)}u($D,"_lighten");function JD(r,t){t=t===0?0:t||10;var e=X(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)))),X(e)}u(JD,"_brighten");function KD(r,t){t=t===0?0:t||10;var e=X(r).toHsl();return e.l-=t/100,e.l=nf(e.l),X(e)}u(KD,"_darken");function QD(r,t){var e=X(r).toHsl(),i=(e.h+t)%360;return e.h=i<0?360+i:i,X(e)}u(QD,"_spin");function e_(r){var t=X(r).toHsl();return t.h=(t.h+180)%360,X(t)}u(e_,"_complement");function G7(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=X(r).toHsl(),i=[X(r)],n=360/t,o=1;o<t;o++)i.push(X({h:(e.h+o*n)%360,s:e.s,l:e.l}));return i}u(G7,"polyad");function t_(r){var t=X(r).toHsl(),e=t.h;return[X(r),X({h:(e+72)%360,s:t.s,l:t.l}),X({h:(e+216)%360,s:t.s,l:t.l})]}u(t_,"_splitcomplement");function r_(r,t,e){t=t||6,e=e||30;var i=X(r).toHsl(),n=360/e,o=[X(r)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,o.push(X(i));return o}u(r_,"_analogous");function i_(r,t){t=t||6;for(var e=X(r).toHsv(),i=e.h,n=e.s,o=e.v,a=[],l=1/t;t--;)a.push(X({h:i,s:n,v:o})),o=(o+l)%1;return a}u(i_,"_monochromatic");X.mix=function(r,t,e){e=e===0?0:e||50;var i=X(r).toRgb(),n=X(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 X(a)};X.readability=function(r,t){var e=X(r),i=X(t);return(Math.max(e.getLuminance(),i.getLuminance())+.05)/(Math.min(e.getLuminance(),i.getLuminance())+.05)};X.isReadable=function(r,t,e){var i=X.readability(r,t),n,o;switch(o=!1,n=c_(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};X.mostReadable=function(r,t,e){var i=null,n=0,o,a,l,c;e=e||{},a=e.includeFallbackColors,l=e.level,c=e.size;for(var p=0;p<t.length;p++)o=X.readability(r,t[p]),o>n&&(n=o,i=X(t[p]));return X.isReadable(r,i,{level:l,size:c})||!a?i:(e.includeFallbackColors=!1,X.mostReadable(r,["#fff","#000"],e))};var m0=X.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"},n_=X.hexNames=o_(m0);function o_(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}u(o_,"flip");function j7(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}u(j7,"boundAlpha");function Fe(r,t){a_(r)&&(r="100%");var e=s_(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)}u(Fe,"bound01");function nf(r){return Math.min(1,Math.max(0,r))}u(nf,"clamp01");function nr(r){return parseInt(r,16)}u(nr,"parseIntFromHex");function a_(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}u(a_,"isOnePointZero");function s_(r){return typeof r=="string"&&r.indexOf("%")!=-1}u(s_,"isPercentage");function Gr(r){return r.length==1?"0"+r:""+r}u(Gr,"pad2");function pu(r){return r<=1&&(r=r*100+"%"),r}u(pu,"convertToPercentage");function H7(r){return Math.round(parseFloat(r)*255).toString(16)}u(H7,"convertDecimalToHex");function V7(r){return nr(r)/255}u(V7,"convertHexToDecimal");var Nr=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 nn(r){return!!Nr.CSS_UNIT.exec(r)}u(nn,"isValidCSSUnit");function l_(r){r=r.replace(VD,"").replace(jD,"").toLowerCase();var t=!1;if(m0[r])r=m0[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=Nr.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=Nr.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=Nr.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=Nr.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=Nr.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=Nr.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=Nr.hex8.exec(r))?{r:nr(e[1]),g:nr(e[2]),b:nr(e[3]),a:V7(e[4]),format:t?"name":"hex8"}:(e=Nr.hex6.exec(r))?{r:nr(e[1]),g:nr(e[2]),b:nr(e[3]),format:t?"name":"hex"}:(e=Nr.hex4.exec(r))?{r:nr(e[1]+""+e[1]),g:nr(e[2]+""+e[2]),b:nr(e[3]+""+e[3]),a:V7(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=Nr.hex3.exec(r))?{r:nr(e[1]+""+e[1]),g:nr(e[2]+""+e[2]),b:nr(e[3]+""+e[3]),format:t?"name":"hex"}:!1}u(l_,"stringInputToObject");function c_(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}}u(c_,"validateWCAG2Parms");var E0=$l(w0());var _0=D.object({rank:D.union([D.enum(["low","medium","high","always-visible"]),D.number()]).optional(),interactive:D.boolean().optional(),appearance:D.object({margin:D.number().min(6).optional(),text:D.object({numLines:D.number().optional(),lineHeight:D.number().optional(),size:D.number().optional(),maxWidth:D.number().optional(),foregroundColor:D.string().optional(),backgroundColor:D.string().optional()}).optional(),marker:D.object({size:D.number().optional(),foregroundColor:D.object({active:D.string().optional(),inactive:D.string().optional()}).optional(),backgroundColor:D.object({active:D.string().optional(),inactive:D.string().optional()}).optional()}).optional()}).optional()});function T6(r,t,e){D.array(D.number()).length(2).parse(r),D.string().parse(t),_0.parse(e||{})}u(T6,"validateLabel");var Ks={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}}},tL={lightOnDark:{...Ks,text:{...Ks.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Ks.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Ks,text:{...Ks.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Ks.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},rL="LOW_PRIORITY",b6=4,iL=6,nL=20,oL=2.5,aL=2,sL="cover",x6=.5,C6=6.5,S6={heightAbovePolygon:0,appearance:tL.darkOnLight};var ya=class ya{constructor(t,e,i){d(this,"lines",0);d(this,"id");d(this,"rank");d(this,"type","label");d(this,"initialRank");d(this,"contextConfigured",!1);d(this,"fillText");d(this,"newStyle",{});d(this,"opacity",0);d(this,"visibilityNeedsUpdate",!1);d(this,"activeStrategyIndex",-1);d(this,"text");d(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});d(this,"projection",new re);d(this,"_cache",{});d(this,"appearance");d(this,"options");d(this,"visible",!1);d(this,"enabled",!0);d(this,"offscreen",!1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"currentStrategyIndex",-1);d(this,"totalMarkerSize",0);d(this,"dirty",!0);d(this,"collisionDirty",!0);d(this,"lastTextAlign");d(this,"imageHash");d(this,"markerSize",0);d(this,"iconVisible",!1);d(this,"zoomProportion",0);d(this,"dp");d(this,"animate",!0);d(this,"onStrategySelected",u(t=>{if(this.currentStrategyIndex===t)return;let e=this.strategies[t];e&&e.onStrategySelected(this),this.currentStrategyIndex=t;let i=this.style;this.style=this.newStyle,this.newStyle=i},"onStrategySelected"));d(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=e.id)!=null?o:ue(),this.options=(0,E0.default)({},e,S6),this.text=t,this.dp=(l=1)=>l*i.pixelRatio,typeof e.rank=="string")this.rank=Ns(e.rank),this.initialRank=this.rank;else if(e.rank!=null&&e.rank>0)this.rank=e.rank,this.initialRank=e.rank;else{let l=Math.trunc(T.env.NODE_ENV==="test"?ya.testId:ya.testId*10)/10;ya.testId+=.001,this.rank=l,this.initialRank=l}let n=(0,E0.default)({},this.options.appearance,S6.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||X(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||X(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||nL,iconPadding:(a=n.marker.iconPadding)!=null?a:aL,iconFit:n.marker.iconFit||sL,iconVisibilityThreshold:n.marker.iconVisibilityThreshold==null?x6:n.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:t=x6}=this.appearance.marker,e=this.dp();this.zoomProportion<=t&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(C6)),this.totalMarkerSize=Math.ceil((this.markerSize+oL)/e)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:e}=this.dimensions,{margin:i}=this.appearance;this.calculateMarkerSize();let n=Math.max(iL,i),o=this.iconVisible?n/2:0,a=this.iconVisible?this.totalMarkerSize:C6*2,l=[{name:"RIGHT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,e);return[c/2+n,c/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+b6,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,e);return[c/2+n,c/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-b6,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let c=this.dp();return[e+this.totalMarkerSize/2/c+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:rL,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}}]:l}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){return this.visible&&t&&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.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((e,i)=>[...e.getBoundingBox(),i]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};u(ya,"LabelComponent"),d(ya,"testId",0);var D0=ya,eo=D0;m();m();var B0=class B0 extends q{constructor(e,i){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"textSet",new Set);d(this,"batchedTextMap",new Map);d(this,"debugTextAreaMesh",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}remove(e){this.textSet.delete(e)}update(e){var l,c,p;let i,n,o,a=[];for(let h of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(h),(i==null?void 0:i.type)==="text3d"){n=i.components[0],o=i.components[1];let y=(l=n.mesh)==null?void 0:l.parent;if(!y||!(y instanceof Ne)||!(n instanceof Qs))continue;if((c=n.feature.properties)!=null&&c.textArea&&n.mesh!=null&&n.polygonEntityId!=null&&n.textMesh==null&&n.mesh.parent!=null&&((p=n.feature.properties)==null?void 0:p.textArea.position)!=null){if(this.textSet.has(n.polygonEntityId))continue;this.textSet.add(n.polygonEntityId),this.batchedTextMap.has(y)||this.batchedTextMap.set(y,k0().then(({BatchedText:C})=>{let M=new C;return M.type="batchedtext",y.add(M),M}));let v=this.batchedTextMap.get(y);if(!v)throw new Error("batched text required");a.push(lL({entityId:h,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:v,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let g=this.batchedTextMap.get(y);n.textMesh&&g&&Promise.all([g,Promise.resolve({meshComponent:n,styleComponent:o})]).then(([v,{meshComponent:C,styleComponent:M}])=>{let{textMesh:b}=C;if(v&&b){let x=F0(v,b);C.visible&&!x?v.add(b):!C.visible&&x&&v.remove(b)}M.flipToFaceCamera&&this.flipIfNeeded(C,e)})}return Promise.all(a)}flipIfNeeded(e,i){let n=e.textMesh;if(!n)return!1;let o=n.rotation.z,a=zm(o+i);a>Math.PI/2&&a<3*Math.PI/2&&(n.rotation.z=zm(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];let o=i.feature.properties.textArea;if(!o)continue;let a=new Cr(o.maxWidth,o.maxHeight),l=new Te(a,new qt({color:"pink"})),{textMesh:c}=i;if(!c)continue;let p=this.convertTo3DMapPosition(o.position,gu);l.position.copy(p),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,O0.identity(),O0.makeRotationAxis(new J(0,0,1),c.userData.rotationZ),gu.set(o.maxWidth/2,0,0),gu.applyMatrix4(O0),l.position.x-=gu.x,l.position.y-=gu.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(n,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(e=>{this.rendererState.entityScene.remove(e)}),this.debugTextAreaMesh.clear(),this.publish("render")}};u(B0,"Text3DSystem");var hf=B0,O0=new Dn,gu=new J,L0;async function A0(r){let{preloadFont:t}=await k0();return t(r)}u(A0,"preloadFont");function k0(){return L0||(L0=import("./text3d-2WIVFRJX.js").then(r=>r)),L0}u(k0,"getText3DService");async function lL({entityId:r,textComponent:t,styleComponent:e,convertTo3DMapPosition:i,batchedMeshPromise:n,rendererState:o}){return Promise.all([k0(),Promise.resolve({entityId:r,meshComponent:t,styleComponent:e})]).then(([{createTroikaText:a},l])=>a(l.entityId,l.meshComponent,l.styleComponent,i)).catch(a=>{L.warn("Trouble creating text: ",a)}).then(a=>{if(a!=null&&a.text){if(t.polygonEntityId){let l=o.geometry3DMap.get(t.polygonEntityId);if((l==null?void 0:l.type)==="geometry"){let c=l.components[0],p=l.components[1];c.textMesh=a.text,c.mesh!=null&&(a.text.position.z=p.altitude+p.height+cL)}}return Promise.all([Promise.resolve(a.text),n])}}).then(a=>{if(!a)return;let[l,c]=a;c.add(l),t.batchedText||(t.batchedText=c)})}u(lL,"createText");function F0(r,t){return r._members.has(t)}u(F0,"doesBatchedTextContainsText");var cL=.5;var uL=D.object({visible:D.boolean(),color:D.string(),flipToFaceCamera:D.boolean(),font:D.string().optional(),fontSize:D.number(),margin:D.union([D.number(),D.tuple([D.number(),D.number(),D.number(),D.number()])]),outlineColor:D.string(),outlineOpacity:D.number(),outlineBlur:D.union([D.number(),D.string()]),outlineWidth:D.number(),outlineOffsetX:D.number(),outlineOffsetY:D.number(),strokeWidth:D.number(),maxWidth:D.number().optional(),maxHeight:D.number().optional(),strokeOpacity:D.number(),strokeColor:D.string(),fillOpacity:D.number(),hoverColor:D.string().optional(),id:D.union([D.string(),D.number()]),type:D.literal("text3d"),position:D.tuple([D.number(),D.number(),D.number()]),content:D.string()}),M6=uL.partial().omit({id:!0,type:!0}).strict(),P6=M6.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),I6=D.object({appearance:M6.optional(),parentId:D.string().optional()}).strict(),R0=class R0{constructor(t){d(this,"mesh",new ti);d(this,"textMesh");d(this,"type","text3d");d(this,"feature");d(this,"parent");d(this,"batchedText");d(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?F0(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}};u(R0,"Text3DComponent");var Qs=R0;function Tt(r,t,e){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return t===!0?(r instanceof ei&&r.components[1]===void 0?(r.components[1]=new Rs,r.components[1].dirty=!0):r instanceof Me&&r.components[2]===void 0?(r.components[2]=new Rs,r.components[2].dirty=!0):r instanceof Ne&&r.components[1]===void 0&&(r.components[1]=new Rs,r.components[1].dirty=!0),!0):(r instanceof ei?r.components[1]=void 0:r instanceof Me?r.components[2]=void 0:r instanceof Ne&&(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),Tt(i,t,e);return!0}}return!1}u(Tt,"updateInteractivity");function w6(r,t,e){if(!(!(e!=null&&e.color)&&!(e!=null&&e.topColor))){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let i,n,o=r.components[0];for(let a of r.userData.entities3D.values())i=t.geometry3DMap.get(a),i&&(n=i.components[1],n.color===o.color&&(n.initialColor=e.color||o.color,n.color=e.color||o.color,n.dirty=!0),n.topColor===o.topColor&&(n.topColor=e.topColor||o.topColor,n.dirty=!0));return e.color!==void 0&&(o.color=e.color,o.dirty=!0),e.topColor!==void 0&&(o.topColor=e.topColor,o.dirty=!0),!0}return!1}}u(w6,"updateGroupColor");function E6(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}u(E6,"updateGroupShading");function D6(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))}u(D6,"updateImageProps");function N0(r,t,e){var i;if(e!==void 0){if(r.type==="geometry"){let n=r.components[1];if(n.height!==e)return n.height=e,n.dirty=!0,((i=r.parent)==null?void 0:i.type)==="geometry-group"&&(r.parent.userData.outlineDirty=!0),!0}else if(r.type==="geometry-group"){let n=r.components[0];for(let o of r.userData.entities3D.values()){let a=t.geometry3DMap.get(o),l;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(l=a.components[1],l.height===n.height&&(a.components[1].height=e,a.components[1].dirty=!0))}return r.components[0].height=e,r.userData.outlineDirty=!0,!0}}return!1}u(N0,"updateHeight");function G0(r,t){t!==void 0&&(r.type==="path"||r.type==="geometry")&&(t.initialColor!==void 0&&(r.components[1].initialColor=t.initialColor),t.color!==void 0&&(r.components[1].color=t.color),t.topColor!==void 0&&(r.components[1].topColor=t.topColor),r.components[1].dirty=!0)}u(G0,"updateColor");function V0(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)))}u(V0,"updatePosition");function j0(r,t){var e;return t!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parent!==t&&r.parent instanceof Ne?((e=r.parent)==null||e.removeEntity(r),t.addEntity(r),!0):!1}u(j0,"updateParent");function _6(r,t){t!==void 0&&(r.type==="marker"||r.type==="label")&&(r.components[0].enabled=t)}u(_6,"updateEnabled");function O6(r,t,e){if(t!==void 0&&r.type==="marker"){let i=r.components[0];if(t.contentHTML!==void 0)return i.containerEl.innerHTML=t.contentHTML,!0;if(t.options!=null){try{f0.parse(t.options||{})}catch(n){return L.error(n),!1}return t.options.interactive==="pointer-events-auto"?(i.pointerEvents="auto",Tt(r,!1,e)):(i.pointerEvents="none",Tt(r,t.options.interactive,e)),L6(r,t.options.rank),!0}}return!1}u(O6,"updateMarker");function L6(r,t){return t!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Ns(t),!0):!1}u(L6,"updateRank");function A6(r,t,e){var i,n,o,a,l;if(t!==void 0&&r.type==="label"){let c=r.components[0];t.text!==void 0&&(c.text=t.text,c.dirty=!0);try{_0.parse(t.options||{})}catch(p){L.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&&(a3(c.appearance,((o=t.options)==null?void 0:o.appearance)||{}),c.dirty=!0),Tt(r,(a=t.options)==null?void 0:a.interactive,e),L6(r,(l=t.options)==null?void 0:l.rank)}}u(A6,"updateLabel");function k6(r,t){t!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=t,r.components[1].dirty=!0)}u(k6,"updateHoverColor");function F6(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}u(F6,"updateHovered");function H0(r,t){t!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=t)}u(H0,"updateFlipImageToFaceCamera");function to(r,t){if(t!==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=t,r.components[1].dirty=!0;let e=r.parent;e instanceof tt&&(e.userData.outlineDirty=!0)}else(r.type==="group-container"||r.type==="geometry-group")&&r.setVisible(t);return!0}return!1}u(to,"updateVisibility");function B6(r,t,e){if(e!==void 0&&r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=t.geometry3DMap.get(n),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.opacity===i.opacity&&(o.components[1].opacity=e,o.components[1].dirty=!0))}return r.setOpacity(e),i.opacity=e,!0}return!1}u(B6,"updateOpacity");function R6(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)}}u(R6,"updateGroupTexture");function N6(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 Re){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}u(N6,"updateIndividualGeometryTexture");function G6(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.opacity!==t){e.opacity=t;let i=r.components[0];i.detached===!1&&(i.detached=!0,i.dirty=!0),t===0?e.visible=!1:e.visible=!0,e.dirty=!0;let n=r.parent;return(n==null?void 0:n.type)==="geometry-group"&&(n.userData.outlineDirty=!0,n.userData.shadingDirty=!0),!0}}return!1}u(G6,"updateIndividualGeometryOpacity");function ff(r,t){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=t,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==t)return r.setAltitude(t),!0}return!1}u(ff,"updateAltitude");function U0(r,t){if(t!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=t,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=t,r.components[1].dirty=!0;let e=r.parent;e instanceof tt&&(e.userData.outlineDirty=!0)}return!0}return!1}u(U0,"updateOutline");function V6(r,t){return t!==void 0&&r.type==="geometry"&&r.components[0]&&r.components[0]instanceof Re?(r.components[0].focusable=t,!0):!1}u(V6,"updateFocusable");function j6(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),e.dirty=!0,!0}}return!1}u(j6,"updateIndividualGeometryRenderOrder");function H6(r,t){let{visible:e,color:i}=t;if(r.type!=="path")return;let n=r.components[0];e!=null&&to(r,e),i!=null&&G0(r,{color:i}),Object.assign(n,W0(t)),r3(t)||(n.materialDirty=!0,(t.nearRadius!=null||t.farRadius!=null)&&(n.dirty=!0))}u(H6,"handlePathUpdate");function W0(r){return Ka(r,pL)}u(W0,"pickPathOptions");var pL=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function U6(r){if(!(r instanceof Me&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}u(U6,"assetGeometryIsText3D");var mf=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function W6(r,t){to(r,t.visible);let e=r.components[1],i=Ka(t,mf);"margin"in t&&L.warn("update to margin is not supported atm"),"content"in t&&L.warn("content update is not supported atm");try{P6.parse(i)}catch(n){L.error(n);return}Object.keys(i).length>0&&(Object.assign(e,i),e.dirty=!0)}u(W6,"handleText3DUpdate");m();m();m();m();var Z0=class Z0 extends U2{constructor(e){let i=e,n=3,o=n*4;super(new Float32Array(e*o),n,e,A2,L2);d(this,"_width");d(this,"_height");d(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(e,i,n){let o=this.image.data,a=e*this._width;o[a]=i.r,o[a+1]=i.g,o[a+2]=i.b,o[a+3]=0,o[a+4]=n.r,o[a+5]=n.g,o[a+6]=n.b,o[a+7]=0,this.needsUpdate=!0}getColor(e){let i=this.image.data,n=e*this._width,o=new we(i[n],i[n+1],i[n+2]),a=new we(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}};u(Z0,"BatchedPropertiesTexture");var yf=Z0;var X6="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var Y6="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}\n";var fL=-.05,mL=1,z0=class z0 extends Kr{constructor(e,i,n=1){super(e);d(this,"propertiesTexture");d(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});d(this,"showTextures",u(e=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,i,n),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new yf(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,h=this.uniforms.uTexture,y=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=X6,o.fragmentShader=Y6,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:fL},uMaxSideAlpha:{value:mL},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:h,uRepeatYFactor:y})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(e){e!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=e,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(e){e.wrapS=qr,e.wrapT=qr,e.colorSpace=Ri,this.uniforms.uTexture.value=e}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(e){e.wrapS=qr,e.wrapT=qr,e.colorSpace=Ri,this.uniforms.uTopTexture.value=e}setGradientShading(e,i,n){this.uniforms.uGradientStart.value=e,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(e,i,n){this.propertiesTexture.setColor(e,i,n)}getColor(e){return this.propertiesTexture.getColor(e)}hideTextures(e){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,!1,!1),this.needsUpdate=!0)}removeSideTexture(e){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(e,!1,i),this.needsUpdate=!0}}removeTopTexture(e){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(e,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};u(z0,"BatchedStandardMaterial");var ga=z0;var vL=80;function Z6(r,t){var l,c,p;let e=0;for(let h of r)e+=((c=(l=h.components[0])==null?void 0:l.geometry)==null?void 0:c.attributes.position.count)||0;let i=new we(t.color),n;n=new ga({color:i,side:t.side==="back"?O2:t.side==="front"?_2:Bi,opacity:(p=t.opacity)!=null?p:1,transparent:t.opacity!==void 0?t.opacity<1:!1},r.length);let o=new fi(r.length,e,0,n),a;for(let h of r)a=h.components[0],!(!(a instanceof Re)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=h.id,n instanceof ga&&n.setColor(a.instanceIndex,i,t.topColor?new we(t.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}u(Z6,"batchGeometries");function q0(r,t){t.polygonOffset=!0,t.polygonOffsetFactor=1,t.polygonOffsetUnits=1;let e=new X2(r,vL),i=$0(t.color.getHexString()),n=new vd({linewidth:2,color:i,transparent:!0}),o=new Po(e,n);return o.layers.set(1),o}u(q0,"createOutlines");function $0(r){return X(r).darken(30).toRgbString()}u($0,"darkenColorForOutline");m();function z6(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}u(z6,"scrubMaterial");function We(r){for(let t=r.children.length-1;t>=0;t--)We(r.children[t]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(t){z6(t)}):"material"in r&&typeof r.material<"u"&&z6(r.material)}u(We,"destroyObject3D");var bu,el,J0=class J0{constructor(t){d(this,"rendererState");d(this,"dirty",!0);S(this,bu,!0);S(this,el,0);this.rendererState=t}get geometries3DDirty(){return s(this,bu)}set geometries3DDirty(t){P(this,bu,t)}update(t,e=!1){var o,a;let i;if(this.geometries3DDirty){let l;for(let c of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(c),i&&i.type==="geometry-group"&&i.userData.modelURL===void 0&&i.userData.dirty===!1&&i.userData.outlineDirty===!0){let p=i.children[0];i.userData.outlineDirty=!1;let h=qn(i);if(h&&We(h),!i.components[0].outline||!i.visible)continue;if(i.children.length>0){let y;if(p instanceof fi){let C=[],M,b,x,I;for(let w of i.userData.entities3D)I=this.rendererState.geometry3DMap.get(w),(I==null?void 0:I.type)==="geometry"&&(b=I.components[0],x=I.components[1],b instanceof Re&&x.visible&&x.opacity>0&&x.outline&&!b.detached&&(M=b==null?void 0:b.geometry,M&&C.push(M)));C.length>0&&(y=ii(C))}else y=p.geometry;y&&(l=q0(y,p.material),l.position.z=i.altitude,l.userData.outlineOfEntityId=i.userData.entityId);let g,v;for(let C of i.userData.entities3D.values()){let M=this.rendererState.geometry3DMap.get(C);(M==null?void 0:M.type)==="geometry"&&(g=M.components[0],v=M.components[1],l&&(M==null?void 0:M.type)==="geometry"&&!g.detached?(M.components[0].outline=l,(o=i.parent)==null||o.add(l)):(M==null?void 0:M.type)==="geometry"&&g.geometry!=null&&g.material!=null&&g.detached&&(g.outline&&We(g.outline),v&&v.opacity>0&&v.visible&&v.outline&&(g.outline=q0(g.geometry,g.material),(a=i.parent)==null||a.add(g.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let n=e?ri(t,16,19,0,1):s(this,el);if((n!==s(this,el)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let l;for(let c of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(c),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let p=qn(l);if(p&&p.visible){let h=Array.isArray(p.material)?p.material:[p.material];for(let y of h)y.opacity=Math.min(n,l.components[0].opacity)}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof Re&&l.components[0].detached){let p=l.components[0].outline;if(p){let h=Array.isArray(p.material)?p.material:[p.material];for(let y of h)y.opacity=Math.min(n,l.components[1].opacity)}}}P(this,el,n),this.dirty=!1}};bu=new WeakMap,el=new WeakMap,u(J0,"OutlineInterpolationSystem");var vu=J0;var K0=class K0 extends Gi{constructor(e,i=new $o){super();d(this,"visible",!0);d(this,"type","geometry-group");d(this,"components");d(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[i],this.userData.entityId=e}setVisible(e){this.visible=e;let i=qn(this);i&&(i.visible=e),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(e){this.userData.opacity=e}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let e;for(let n of this.children)if(!n.userData.detached){e=n;break}return e instanceof fi?Object.values(e.userData.entities)[0]:void 0}setAltitude(e){this.position.z=e,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};u(K0,"GeometryGroupObject3D");var tt=K0;var xu=class xu extends Gi{constructor(e){super();d(this,"childrenIds",new Set);d(this,"children",[]);d(this,"type","group-container");d(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});d(this,"components",[]);this.userData.entityId=e}addEntity(e){e instanceof xu?(this.childrenIds.add(e.userData.entityId),this.add(e)):e instanceof ei?(this.childrenIds.add(e.id),this.add(e.object3d),this.userData.entities2D.add(e.id)):e instanceof tt?(this.childrenIds.add(e.userData.entityId),this.add(e)):e instanceof Me&&e.object3d&&(this.childrenIds.add(e.id),this.add(e.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(e){e instanceof xu?(this.childrenIds.delete(e.userData.entityId),this.remove(e)):e instanceof ei?(this.childrenIds.delete(e.id),this.userData.entities2D.delete(e.id),this.remove(e.object3d)):e instanceof tt?(this.childrenIds.delete(e.userData.entityId),this.remove(e)):e instanceof Me&&e.object3d&&(this.childrenIds.delete(e.id),this.add(e.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(e){this.visible=e,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(e){this.position.z=e,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};u(xu,"GroupContainerObject3D");var Ne=xu;m();m();var q6=!1;function Q0(){q6=!0}u(Q0,"enableTestMode");function $6(){return q6}u($6,"isTestMode");var ev=class ev{constructor(t,e=2){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new we);d(this,"width",0);d(this,"height",0);d(this,"options",{});d(this,"renderer");var i,n;try{this.options=t;let o={canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,outputColorSpace:Ri,powerPreference:"high-performance",preserveDrawingBuffer:!0};$6()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new we,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=e===2?new j2(o):new H2(o),this.backgroundColor=new we((i=t.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(o){L.error(o),t.onWebGLRendererError&&t.onWebGLRendererError(o)}}destroy(){var t,e;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t))}render(t,e){this.renderer&&(this.renderer.state.reset(),e.layers.enable(0),e.layers.enable(1),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.state.reset())}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){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}};u(ev,"Renderer");var gf=ev;m();m();var J6='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(J(n,typeof e!="symbol"?e+"":e,t),t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),Q=new s(0,t-5,e,t+S),Y=Z(e,t,i,o,h),F=[O,K,W,Q],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,V,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,_=U-D,A=V-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+_)+d,P=Math.max(P,L+A)+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.enabled){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&&F.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Y)){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{enabled: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 K6(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}u(K6,"contains");m();function Q6(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}u(Q6,"intersectPoint");m();function eT(r,t){let e=t.x,i=t.y,n=t.x+t.w,o=t.y+t.h,a=r.x,l=r.y,c=r.x+r.w,p=r.y+r.h;return e<c&&a<n&&i<p&&l<o}u(eT,"intersects");m();function cn(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}u(cn,"appendItems");m();var tv=class tv{constructor(t,e,i,n,o){d(this,"x");d(this,"y");d(this,"w");d(this,"h");d(this,"userData");this.userData=typeof o>"u"?null:o,this.x=t,this.y=e,this.w=i,this.h=n}contains(t){return t===this?!1:K6(this,t)}intersects(t){return eT(this,t)}intersectsPoint(t){return Q6(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};u(tv,"Rectangle");var rt=tv;var va=class va{constructor(t,e){d(this,"topLeft");d(this,"topRight");d(this,"bottomLeft");d(this,"bottomRight");d(this,"divided",!1);d(this,"boundary");d(this,"capacity",16);d(this,"objects",[]);d(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:n}=this.boundary;this.topLeft=new va(new rt(t,e,i/2,n/2),this),this.topRight=new va(new rt(t+i/2,e,i/2,n/2),this),this.bottomLeft=new va(new rt(t,e+n/2,i/2,n/2),this),this.bottomRight=new va(new rt(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&&(cn(e,this.topLeft.queryRect(t)),cn(e,this.topRight.queryRect(t)),cn(e,this.bottomLeft.queryRect(t)),cn(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(cn(e,this.topLeft.queryPoint(t)),cn(e,this.topRight.queryPoint(t)),cn(e,this.bottomLeft.queryPoint(t)),cn(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()}};u(va,"QuadTree");var vi=va;m();function rT(r,t,e){let i,n,o,a=null,l=0;e||(e={});let c=u(function(){l=e.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)},"later");return function(){let p=Date.now();!l&&e.leading===!1&&(l=p);let h=t-(p-l);return i=globalThis,n=arguments,h<=0||h>t?(a&&(clearTimeout(a),a=null),l=p,o=r.apply(i,n),a||(i=n=null)):!a&&e.trailing!==!1&&(a=setTimeout(c,h)),o}}u(rT,"throttle");var ba=!1,CL=150,rv=class rv extends q{constructor(e,i,n=new Worker(URL.createObjectURL(new Blob([J6],{type:"text/javascript"})))){super();d(this,"worker");d(this,"debugContext");d(this,"debugCanvas");d(this,"collidersDirty",!0);d(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);d(this,"visibleCollidersQTree",new vi(new rt(0,0,0,0)));d(this,"interactiveCollidersQTree",new vi(new rt(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",u(()=>{ba=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",u(()=>{ba=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));d(this,"currentMsgId","");d(this,"working",!1);d(this,"_postMessage",u(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));d(this,"componentArray",[]);d(this,"update",u((e,i,n="bottom-left",o=!0)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let l;for(let c of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(c);p&&(l=p.components[0],this.componentArray.push(l))}this.resize(e,i,n),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(l=>l.collisionDirty===!0);a&&this.componentArray.sort((l,c)=>c.rank-l.rank);for(let l=0;l<this.componentArray.length;l++)if(this.packedMessage){let c=this.componentArray[l].toPackedMessage(!o&&!a);this.packedMessage[0][l]==null&&(this.packedMessage[0][l]=[]),this.packedMessage[0][l][0]==null&&(this.packedMessage[0][l][0]=[]),this.packedMessage[0][l][0]=c.bboxes,this.packedMessage[0][l][1]=c.enabled?1:0,this.packedMessage[0][l][2]=c.rank===5?1:0,this.packedMessage[0][l][3]=c.x,this.packedMessage[0][l][4]=c.y,this.packedMessage[0][l][5]=c.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][l][6]=c.lockedToStrategyIndex}this.working||this.postMessage()},"update"));d(this,"resolve",u(e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,n=-1,o,a,l;ba&&(this.visibleCollidersQTree=new vi(new rt(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new vi(new rt(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let c=0;c<this.componentArray.length;c++){let p=this.componentArray[c];i[c]!=null&&(n=i[c][0],o=i[c][2],p.offscreen=i[c][1]===1,n!==-1&&o!=null?(l=new rt(o.x,o.y,o.w,o.h,{entityId:p.id}),ba&&this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(p.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new rt(o.x,o.y,o.w,o.h,{entityId:p.id})),(p.visible===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),n!==-1&&n!==p.activeStrategyIndex&&(p.activeBoundingBox=l,p.onStrategySelected(n))):((p.visible===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),n!==-1&&n!==p.activeStrategyIndex&&p.onStrategySelected(n)))}ba&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",u(()=>{ba&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));d(this,"destroy",u(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=rT(this._postMessage,CL,!1),ba?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}};u(rv,"CollisionSystem");var vf=rv;m();m();m();m();var nv=class nv{constructor(t){d(this,"type");d(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};u(nv,"Tap");var bf=nv,ov=class ov{constructor(){d(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};u(ov,"TapsController");var xf=ov;m();function iT(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 Ne&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}u(iT,"getUniqueIntersectedGroupContainers");function nT(r,t){if(r==null||t==null)return r===t;if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}u(nT,"arraysEqual");var tl,av=class av extends q{constructor(e,i,n,o,a){super();d(this,"raycaster",new Qr);d(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});d(this,"coreState");d(this,"camera");d(this,"cameraPlane");d(this,"_quadtree",new vi(new rt(0,0,0,0)));d(this,"_container");d(this,"lastPointerEvent");d(this,"cursor","grab");d(this,"touchesCount",0);d(this,"isUserInteracting");d(this,"hasTouched",!1);S(this,tl,void 0);d(this,"onPointerMoveRaf",u(e=>{this.lastPointerEvent=e,s(this,tl)&&cancelAnimationFrame(s(this,tl)),P(this,tl,requestAnimationFrame(()=>{this.onPointerMove(e)}))},"onPointerMoveRaf"));d(this,"onPointerMove",u(e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()},"onPointerMove"));d(this,"tapsControl",new xf);d(this,"onPointerDown",u(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 bf(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));d(this,"clickTimeout");d(this,"onPointerUp",u(e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));d(this,"dirty3D",!0);d(this,"cachedHitBoxes",{entities:[],groups:[]});d(this,"ndcPoint",new re);d(this,"debugPanel");d(this,"resize",u(()=>{let{top:e,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[e,i]},"resize"));this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=e,this.coreState=i,this.cameraPlane=o,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:n,entity2D:o,position:a,groupContainers:l}=this.intersect(i);(this.detect3DEntityHover(n)||this.detect2DEntityHover(o)||this.detect3DContainerHover(l))&&(this.state.hovered3DEntity=n,this.state.lastHover=n,this.state.hovered2DEntity=o,this.state.hovered3DContainers=l,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:l})),this.handleCursor()}handleCursor(){let e=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=ML(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.components[2]?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var C,M;let i=[e.offsetX,e.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(b=>b.intersectsPoint(i)),a=this.state.containerOffset[0],l=this.state.containerOffset[1];this.ndcPoint.x=(e.clientX-l)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-a)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[c]=this.getMouseRayIntersects(),p=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(b=>b.object.visible),[h]=p,y=(C=h==null?void 0:h.instanceId)!=null?C:h==null?void 0:h.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(b=>b.object.visible),v;return g!=null&&g.length>0&&(v=iT(g)),{entity2D:((M=o==null?void 0:o.userData)==null?void 0:M.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:y!=null?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[y]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId),position:Array.isArray(g)&&(g==null?void 0:g.length)>0?g[0].point:c==null?void 0:c.point,groupContainers:v}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&aT(this.state.lastHover,!1,this.coreState),e&&aT(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!nT(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.cameraPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var 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}};tl=new WeakMap,u(av,"InteractionSystem");var Cu=av;function aT(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)}u(aT,"updateHover");function ML(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}u(ML,"processCursor");m();m();var xa,bi,Cf,Sf,sT,Tu,Tf,Mf,lT,Pf,cT,Mu,If,Pu,Iu,wf,lv=class lv{constructor(t){S(this,Sf);S(this,Mf);S(this,Pf);S(this,xa,null);S(this,bi,void 0);d(this,"getCurrentSceneGLTF",u(async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await j(this,Sf,sT).call(this),n=s(this,Cf).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 l=JSON.stringify(o,null,2);a=new Blob([l],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));S(this,Cf,u(t=>{let{scale:e,light:i,onlyVisible:n}=t,o=new za,a=new Ni().setFromObject(s(this,bi).entityScene);if(s(this,Tu).call(this,s(this,bi).entityScene,o,n),i){let l=new xd(16777215,.3*Math.PI);l.position.set(0,Math.max(a.max.x,a.max.y)*e*.5,a.max.y*e*4),l.lookAt(0,0,-1),l.target.position.set(0,0,-1),l.add(l.target),o.add(l)}return o},"#getExportedScene"));S(this,Tu,u((t,e,i)=>{t.material&&(t instanceof qa?j(this,Mf,lT).call(this,t).forEach(n=>e.add(n)):t instanceof Po&&e.add(j(this,Pf,cT).call(this,t))),t.children.forEach(n=>{(!i||n.visible)&&s(this,Tu).call(this,n,e,i)})},"#processObject3D"));S(this,Tf,u((t,e,i)=>{let n=new z2({color:new we(t),metalness:0});return n.opacity=e,n.transparent=i,n},"#createStandardMaterial"));S(this,Mu,u(t=>{let{geometry:e,material:i,position:n,rotation:o,quaternion:a,scale:l}=t;if(!(e!=null&&e.isBufferGeometry))return t;let c=e.attributes.position,p=e.attributes.normal,h=e.attributes.uv;return s(this,If).call(this,c,p),s(this,Iu).call(this,n,l,o,a),h&&s(this,wf).call(this,h),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=Bi),t},"#convertGeometry"));S(this,If,u((t,e)=>{let i=new J,n=new J;for(let o=0;o<t.count;o++)i.fromBufferAttribute(t,o),s(this,Pu).call(this,i),t.setXYZ(o,i.x,i.y,i.z),e&&(n.fromBufferAttribute(e,o),s(this,Pu).call(this,n),e.setXYZ(o,n.x,n.y,n.z))},"#convertAttributes"));S(this,Pu,u(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));S(this,Iu,u((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 Za)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let l=n.y;n.set(n.x,n.z,-l,n.w)}},"#convertObjectProperties"));S(this,wf,u(t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),n=t.getY(e);t.setXY(e,i,n)}},"#convertUVs"));P(this,bi,t),s(this,bi).entityScene=t.entityScene,s(this,bi).geometry3DMap=t.geometry3DMap}destroy(){P(this,xa,null)}};xa=new WeakMap,bi=new WeakMap,Cf=new WeakMap,Sf=new WeakSet,sT=u(async function(){if(!s(this,xa)){let{GLTFExporter:t}=await import("./GLTFExporter-P25FPTJF.js");P(this,xa,new t)}return s(this,xa)},"#getGLTFExporter"),Tu=new WeakMap,Tf=new WeakMap,Mf=new WeakSet,lT=u(function(t){var a,l;let e=[],n=((a=t.userData)!=null&&a.entities?Object.values((l=t.userData)==null?void 0:l.entities):[]).map(c=>s(this,bi).geometry3DMap.get(c)),o=new Map;return n.forEach(c=>{var v;if(!c||!(c instanceof Me))return;let p=c.components[1],h=c.components[2];if(!p.visible||p instanceof Sr&&p.opacity===0||p instanceof Md)return;let y=h!=null&&h.hover?p.hoverColor||s(this,bi).hoverColor:p.color,g="".concat(y,"-").concat(p.opacity,"-").concat(Number(p.visible));o.has(g)||o.set(g,[]),(v=o.get(g))==null||v.push(c)}),o.forEach((c,p)=>{let[h,y,g]=p.split("-"),v=c.reduce((x,I)=>{if(I.type==="custom-geometry")return x;let w=I.components[0];return"geometry"in w&&w.geometry instanceof N2&&x.push(w.geometry),x},[]),C=s(this,Tf).call(this,h,Number(y),t.material.transparent),M=ii(v,!0),b=new Te(M,C);b.position.copy(t.position),b.rotation.copy(t.rotation),b.scale.copy(t.scale),b.visible=!!g,s(this,Iu).call(this,b.position,b.scale,b.rotation,b.quaternion),e.push(s(this,Mu).call(this,b))}),e},"#processBatchedMesh"),Pf=new WeakSet,cT=u(function(t){let e=t.geometry.clone(),i=t.material,n=new qt({color:i.color,side:Bi});n.opacity=i.opacity,n.transparent=i.transparent;let o=new Po(e,n);return o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o.visible=t.visible,s(this,Mu).call(this,o)},"#processLineSegments"),Mu=new WeakMap,If=new WeakMap,Pu=new WeakMap,Iu=new WeakMap,wf=new WeakMap,u(lv,"ExporterSystem");var Su=lv;m();m();m();m();var wu={top:0,bottom:0,left:0,right:0,type:"pixel"};m();m();var PL="gray",IL=.1;function uT(r,t,e){let{color:i=PL,opacity:n=1,altitude:o=0,height:a=IL}=e||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o},center:{x:0,y:0,z:(a+o)/2}},c=new $r,p=r.geometry.coordinates[0].map(v=>{let C=t(v[1],v[0]);return l.min.x=Math.min(l.min.x,C.x),l.min.y=Math.min(l.min.y,C.y),l.max.x=Math.max(l.max.x,C.x),l.max.y=Math.max(l.max.y,C.y),C});c.moveTo(p[0].x,p[0].y),p.slice(1).forEach(v=>c.lineTo(v.x,v.y)),c.lineTo(p[0].x,p[0].y);let h=r.geometry.coordinates.slice(1);c.holes=h.map(v=>{let C=v.map(b=>t(b[1],b[0])),M=new _n;return 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),M});let y={bevelEnabled:!1,depth:a},g=new Jr(c,y);return g.translate(0,0,o||0),g.userData={style:{color:i,opacity:n}},g}u(uT,"renderPolygonGeometry");m();var wL="gray",EL=.1;function pT(r,t,e){let{color:i=wL,opacity:n=1,altitude:o=0,height:a=EL}=e||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},c={bevelEnabled:!1,depth:a},p=[];r.geometry.coordinates.forEach(y=>{let g=new $r,v=y[0].map(b=>{let x=t(b[1],b[0]);return l.min.x=Math.min(l.min.x,x.x),l.min.y=Math.min(l.min.y,x.y),l.max.x=Math.max(l.max.x,x.x),l.max.y=Math.max(l.max.y,x.y),x});g.moveTo(v[0].x,v[0].y),v.slice(1).forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(v[0].x,v[0].y);let C=y.slice(1);g.holes=C.map(b=>{let x=b.map(w=>t(w[1],w[0])),I=new _n;return I.moveTo(x[0].x,x[0].y),x.slice(1).forEach(w=>I.lineTo(w.x,w.y)),I.lineTo(x[0].x,x[0].y),I});let M=new Jr(g,c);p.push(M)});let h=ii(p);return h.translate(0,0,o||0),h.userData={style:{color:i,opacity:n}},h}u(pT,"renderMultiPolygonGeometry");m();m();var pv=$l(CT());function ST(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}u(ST,"JSClipperError");ST.prototype=Error.prototype;pv.default.Error=function(r){throw new ST(r)};var Ht=pv.default;var Ck="gray",dv=new Ht.ClipperOffset,Pt=100;function TT(r,t,e){let{color:i=Ck,opacity:n=1,width:o=1,join:a="round",cap:l="round",height:c=.01,altitude:p=0}=e||{};Array.isArray(n)&&(n=0);let h=[];for(let M=0;M<r.geometry.coordinates.length-1;M++){let b=t(r.geometry.coordinates[M][1],r.geometry.coordinates[M][0]),x=t(r.geometry.coordinates[M+1][1],r.geometry.coordinates[M+1][0]);h.push([b,x])}dv.AddPaths(h.map(M=>M.map(b=>({X:b.x*Pt,Y:b.y*Pt}))),a==="round"?Ht.JoinType.jsRound:a==="miter"?Ht.JoinType.jsMiter:Ht.JoinType.jsSquare,l==="round"?Ht.EndType.etOpenRound:l==="butt"?Ht.EndType.etOpenButt:Ht.EndType.etOpenSquare);let y=new Ht.PolyTree;dv.Execute(y,o/2*Pt);let g=[],v={bevelEnabled:!1,depth:c};for(let M of y.m_AllPolys){let b=new $r;if(M.IsHole())continue;let x=M.m_polygon;b.moveTo(x[0].X/Pt,x[0].Y/Pt),x.slice(1).forEach(I=>b.lineTo(I.X/Pt,I.Y/Pt)),b.lineTo(x[0].X/Pt,x[0].Y/Pt),b.holes=M.m_Childs.map(I=>{let w=new _n,E=I.m_polygon;return w.moveTo(E[0].X/Pt,E[0].Y/Pt),E.slice(1).forEach(_=>w.lineTo(_.X/Pt,_.Y/Pt)),w.lineTo(E[0].X/Pt,E[0].Y/Pt),w}),g.push(new Jr(b,v))}let C=ii(g);return C.translate(0,0,p||0),C.userData={style:{color:i,opacity:n}},dv.Clear(),C}u(TT,"renderLineStringGeometry");m();var It=100,Sk=.22,Tk=.01;function MT(r,t,e={}){let{width:i=Sk,height:n=Tk,color:o="gray",opacity:a=1,altitude:l=0}=e,c={min:{x:1/0,y:1/0,z:l},max:{x:-1/0,y:-1/0,z:l+n}},p={bevelEnabled:!1,depth:n},h=new Ht.ClipperOffset,y=r.geometry.coordinates.map(M=>M.map(b=>t(b[1],b[0])));h.AddPaths(y.map(M=>M.map(b=>({X:b.x*It,Y:b.y*It}))),Ht.JoinType.jsMiter,Ht.EndType.etOpenRound);let g=new Ht.PolyTree;h.Execute(g,i/2*It);let v=[];for(let M of g.m_AllPolys){let b=new $r;if(M.IsHole())continue;c.min.x=Math.min(c.min.x,M.m_polygon[0].X),c.min.y=Math.min(c.min.y,M.m_polygon[0].Y),c.max.x=Math.max(c.max.x,M.m_polygon[0].X),c.max.y=Math.max(c.max.y,M.m_polygon[0].Y);let x=M.m_polygon;b.moveTo(x[0].X/It,x[0].Y/It),x.slice(1).forEach(I=>b.lineTo(I.X/It,I.Y/It)),b.lineTo(x[0].X/It,x[0].Y/It),b.holes=M.m_Childs.map(I=>{let w=new _n,E=I.m_polygon;return w.moveTo(E[0].X/It,E[0].Y/It),E.slice(1).forEach(_=>w.lineTo(_.X/It,_.Y/It)),w.lineTo(E[0].X/It,E[0].Y/It),w}),v.push(new Jr(b,p))}let C=ii(v);return C.translate(0,0,l||0),C.userData={style:{color:o,opacity:a}},h.Clear(),C}u(MT,"renderMultiLineStringGeometry");m();m();var nl=D.object({type:D.enum(["Point"]),coordinates:D.array(D.number()).length(2)});var Mk=D.object({rotation:D.array(D.number()).length(3).optional(),altitude:D.number().optional(),scale:D.array(D.number()).length(3).optional(),interactive:D.boolean().optional(),id:D.union([D.number(),D.string()]).optional()}),Pk=D.object({type:D.enum(["Feature"]),geometry:nl,properties:Mk}),Ik=D.object({type:D.enum(["FeatureCollection"]),features:D.array(Pk)}),wk=D.object({url:D.string(),color:D.string().optional(),opacity:D.number().optional()});function PT(r,t,e){D.union([D.number(),D.string()]).parse(r),Ik.parse(t),wk.parse(e)}u(PT,"validateModelGroup");var _u,Ou,hv=class hv{constructor(t){d(this,"mesh");d(this,"type","model");d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new we);d(this,"position",new J);S(this,_u,0);S(this,Ou,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return s(this,_u)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,_u,t))}get opacity(){return s(this,Ou)}set opacity(t){var e,i;if(this.mesh){for(let n of this.mesh.children)if(n instanceof gd){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let o=ri(t,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=o,n.material.transparent=o<1,n.material.needsUpdate=!0}}P(this,Ou,t)}};_u=new WeakMap,Ou=new WeakMap,u(hv,"ModelComponent");var no=hv;function Ek(r){let{color:t,opacity:e,topColor:i,texture:n,topTexture:o}=r;return"".concat(t).concat(e).concat(i||"").concat(n||"").concat(o||"")}u(Ek,"generateIndex");var Dk=1e4,fv=class fv extends q{constructor(e,i){super();d(this,"state");d(this,"convertTo3DMapPosition");d(this,"loader");this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:e}=await import("./GLTFLoader-2IV5BF7Z.js");this.loader=new e}createEntityFromFeature(e,i,n){let o=new Re(i),a=new Me(o,new Sr(n));return a.id=e,a}createModelFromFeature(e,i,n){let o=new no(i),a=new Me(o,new Sr(n));return a.id=e,a}populateEntityMesh(e,i){let n=e.components[0];n.geometry=i,n.currentHeight=e.components[1].height,n.dirty=!1}async populateModelGroup(e,i,n){let o=new Dn,a=new Za,l=new B2,c=new J,p=new ti;return this.loader||await this.getGLTFLoader(),this.loader.load(i,h=>{var v,C,M,b,x,I;h.scene.traverse(w=>{let E=w;if("isMesh"in E&&E.isMesh===!0){let _=new gd(E.geometry,E.material,e.size);_.userData={entities:{}},p.add(_),n.add(p)}});let y=0,g;for(let w of e.values()){if(g=this.state.geometry3DMap.get(w),!g||(g==null?void 0:g.type)!=="model")continue;let E=g.components[0],_=g.components[0].feature;E.mesh=p,E.instanceIndex=y;let{x:O,y:F,z:G}=this.convertTo3DMapPosition(_.geometry.coordinates[1],_.geometry.coordinates[0],0);E.position.set(O,F,G),a.set(((v=_.properties.rotation)==null?void 0:v[0])||0,((C=_.properties.rotation)==null?void 0:C[1])||0,((M=_.properties.rotation)==null?void 0:M[2])||0),c.set(((b=_.properties.scale)==null?void 0:b[0])||1,((x=_.properties.scale)==null?void 0:x[1])||1,((I=_.properties.scale)==null?void 0:I[2])||1),l.setFromEuler(a),o.compose(E.position,l,c),p.children.forEach(N=>{if(!g||(g==null?void 0:g.type)!=="model")return;let H=N;H.setMatrixAt(y,o),H.userData.entities[y]=g.id}),y++}this.publish("model-loaded")}),p}populateEntityGroup(e){let i,n,o,a;for(let l of e.values())a=this.state.geometry3DMap.get(l),a.components[0]instanceof Re&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=uT(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=pT(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=TT(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=MT(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof tt||e instanceof Ne)){for(let a of e.children)this.optimize(a);if(e instanceof Ne||e.userData.dirty===!1)return;let n={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(a){L.warn(a)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let o=0;if(e.userData.dirty){let a=0,l;for(let c of e.userData.entities3D.values()){l=this.state.geometry3DMap.get(c);let p=l==null?void 0:l.components[0];if((l==null?void 0:l.type)==="geometry"){let h=l.components[1];a++,a>=Dk&&(a=0,o++);let y=Ek(h)+o;n[y]===void 0&&(n[y]={style:h,entities:[]}),n[y].entities.push(l)}else p&&"mesh"in p&&p.mesh&&((i=p.mesh)==null?void 0:i.parent)!==e&&e.add(p.mesh)}for(let c in n){let p=Z6(n[c].entities,n[c].style);e.add(p),e.userData.outlineDirty=!0,e.userData.dirty=!1}}}}update(){this.optimize(this.state.entityScene)}};u(fv,"MeshCreationAndOptimizationSystem");var Lf=fv;m();var mv=class mv{constructor(t,e){d(this,"state");d(this,"dirty",!0);d(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let i=t.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let i=t.components[0];i instanceof gi&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:t.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};u(mv,"DOMVisibilitySystem");var Af=mv;m();var yv=class yv{constructor(t,e){d(this,"state");d(this,"project");this.state=t,this.project=e}update(){let t;for(let e of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(e),t&&this.project(t.components[0].projection,t.position)}};u(yv,"TwoDProjectionSystem");var kf=yv;m();m();var _k=u(function(){let t,e;return i=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*i,t.height=500*i,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}},"createMeasureCanvasContext")(),IT=u(({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let l="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:c}=_k(i);c.font=l;let p=[],h=r.split(" "),y=0,g=0,v=0;for(;g<h.length;){let x=h[g];if(y===n&&y>0){p[y-1]+="...";break}if(p[y]==null&&(p[y]=x,g++),h.length===1){p[y]=x;break}if(h[g]==null)break;let{width:I}=c.measureText(p[y]+" "+h[g]);I<=e*i?(p[y]+=" "+h[g],g++):y++}p.forEach(x=>{let{width:I}=c.measureText(x);v=Math.max(I,v)});let C=t*i*o,M=p.length*C;return{maxWidth:v,maxHeight:M,lines:p.length,draw:(x,I,w)=>{p.length===1?(a.strokeText&&x.strokeText(p[0],I,w),x.fillText(p[0],I,w)):(a.strokeText&&(x.strokeText(p[0],I,w-C/2),x.strokeText(p[1],I,w+C/2)),x.fillText(p[0],I,w-C/2),x.fillText(p[1],I,w+C/2))}}},"shaveText");m();function wT(r){let t=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}u(wT,"createImage");var Ok=3.5,Lk=2.5,Ak=2,kk=5,Lu=2.5;var gv=class gv{constructor(t,e){d(this,"dirty",!1);d(this,"state");d(this,"colliderContext");d(this,"colliderCanvas");d(this,"pinCache",{});d(this,"imagePromiseCache",{});d(this,"imageDimensionsCache",{});d(this,"textCache",{});d(this,"update",u((t,e,i)=>{let n=(t-e)/(i-e),o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let a,l,c,p,h,y;for(let g of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(g),y!=null&&y.components[0]instanceof eo&&!y.disposed){if(h=y.components[0],l=h.appearance.marker.foregroundColor,c=h.appearance.marker.backgroundColor,p=h.markerSize,a="".concat(l.active,"-").concat(l.inactive,"-").concat(c.active,"-").concat(c.inactive,"-").concat(p),this.pinCache[a]||this.prepare(h,a,this.colliderContext),h.appearance.marker.icon&&(!h.imageHash||h.dirty)&&this.cacheImage(h),this.textCache[h.id]==null||h.dirty||this.dirty){h.dirty=!1,h.collisionDirty=!0,this.textCache[h.id]={};let{textDrawFn:v,width:C,height:M}=this.processText(h.text,h.appearance.text.size,h.appearance.text.maxWidth,h.appearance.text.numLines,h.appearance.text.lineHeight);["left","center","right"].forEach(x=>{this.textCache[h.id][x]=this.textToCanvas(v,h.appearance.text.size,x,C,M,h.appearance.text.foregroundColor,h.appearance.text.backgroundColor)}),h.dimensions={width:Math.ceil(C/o),height:Math.ceil(M/o)},h.currentStrategyIndex===-1&&(h.currentStrategyIndex=0);let b=h.strategies[h.currentStrategyIndex];if(b){b.onStrategySelected(h);let x=h.style;h.style=h.newStyle,h.newStyle=x}}h.visible&&(h.enabled||h.visibilityNeedsUpdate!==!1)&&(h.zoomProportion=n,this.draw(h,a,this.colliderContext))}this.dirty=!1},"update"));d(this,"processText",u((t,e,i,n,o)=>{let a=this.state.pixelRatio,{draw:l,maxWidth:c,maxHeight:p}=IT({text:t,size:e,pixelRatio:a,maxWidth:i,maxLines:n,lineHeight:o});return{textDrawFn:l,width:c+Lu*a*2,height:p+Lu*a*2}},"processText"));d(this,"textToCanvas",u((t,e,i,n,o,a,l)=>{let c=this.state.pixelRatio,p,h=n,y=o;window.OffscreenCanvas!=null&&!t3()?p=new OffscreenCanvas(h,y):(p=document.createElement("canvas"),p.width=h,p.height=y,p.style.width=h+"px",p.style.height=y+"px");let g=p.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=i,g.font="bold ".concat(e*c,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=Lu*c,g.fillStyle=a,g.strokeStyle=l;let v=i==="left"?0:i==="center"?h/2:h-Lu*c/2;return t(g,v,(y+Lu*c/2)/2),p},"textToCanvas"));d(this,"cacheImage",u(t=>{if(!t.appearance.marker.icon)return;let e=l3(t.appearance.marker.icon);if(t.imageHash=e,!this.imagePromiseCache[e]){let i=wT(t.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[e]=i}}},"cacheImage"));d(this,"createPinCanvas",u((t,e,i,n)=>{let o,a=this.state.pixelRatio,l=t.totalMarkerSize*2*a;window.OffscreenCanvas!=null?o=new OffscreenCanvas(l,l):(o=document.createElement("canvas"),o.width=l,o.height=l,o.style.width=l/a+"px",o.style.height=l/a+"px");let c=o.getContext("2d");return c.shadowColor="rgba(0,0,0,0.3)",c.shadowOffsetY=Ak*a,c.shadowBlur=kk*a,c.beginPath(),c.arc(l/2,l/2,e/2+Lk*a/2,0,2*Math.PI),c.fillStyle=i,c.fill(),c.beginPath(),c.arc(l/2,l/2,e/2,0,2*Math.PI),c.shadowColor="transparent",c.fillStyle=n,c.fill(),o},"createPinCanvas"));d(this,"prepare",u((t,e,i)=>{let n=this.state.pixelRatio;i.lineWidth=4*n;let o=this.createPinCanvas(t,t.markerSize,t.appearance.marker.backgroundColor.active,t.appearance.marker.foregroundColor.active),a=this.createPinCanvas(t,t.iconVisible?t.markerSize:Ok*n,t.appearance.marker.backgroundColor.inactive,t.appearance.marker.foregroundColor.inactive);this.pinCache[e]=[o,a]},"prepare"));this.state=t,this.colliderCanvas=e,this.colliderContext=e.getContext("2d")}draw(t,e,i){if(!t.visible)return;i.save(),i.globalAlpha=t.opacity;let n=this.state.pixelRatio,o=t.projection.x*n,a=t.projection.y*n,l=t.style.pinVisibility===1?this.pinCache[e][0]:this.pinCache[e][1];if(i.drawImage(l,o-t.totalMarkerSize*n,a-t.totalMarkerSize*n),t.appearance.marker.icon&&t.iconVisible&&t.imageHash&&t.appearance.marker.iconSize&&this.imagePromiseCache[t.imageHash]){let c=this.imagePromiseCache[t.imageHash],p=(t.appearance.marker.iconSize-t.appearance.marker.iconPadding)*n,h=t.appearance.marker.iconFit,y=p,g=p,v="".concat(t.imageHash,"_").concat(h);if(this.imageDimensionsCache[v])y=this.imageDimensionsCache[v].width,g=this.imageDimensionsCache[v].height;else{let C=c.width*n,M=c.height*n;if(h==="contain"){let b=Math.sqrt(C**2+M**2),x=p/b;y=C*x,g=M*x}if(h==="cover"){let b=p/C,x=p/M,I=Math.max(b,x);y=C*I,g=M*I}}i.save(),i.beginPath(),i.arc(o,a,p/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(c,o-y/2,a-g/2,y,g),i.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left&&t.style.top&&i.drawImage(this.textCache[t.id][t.style.textAlign],o+t.style.left*n,a+t.style.top*n),i.restore()}};u(gv,"TwoDDrawSystem");var Ff=gv;m();m();var oo=class oo{constructor(){d(this,"loader");this.loader=new $a}static getInstance(){return oo.instance||(oo.instance=new oo),oo.instance}getLoader(){return this.loader}};u(oo,"TextureLoaderSingleton"),d(oo,"instance");var vv=oo,ol=vv.getInstance();function Fk(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]}u(Fk,"processColor");var Au,bv,xv=class xv extends q{constructor(e){super();S(this,Au);d(this,"state");d(this,"textureLoadingCache",new Map);this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,n){i.texture!==e.texture&&i.texture!==""&&j(this,Au,bv).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&j(this,Au,bv).call(this,i.topTexture,e,"topTexture"),(e.texture!=null||e.topTexture!=null)&&(n!=null&&n.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var a,l,c,p,h,y,g,v,C;let e,i,n,o;for(let M of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(M),o instanceof tt&&o.type==="geometry-group"){if(i=o.components[0],o.userData.shadingDirty){let b=o.userData.entities3D.values().next().value;if(b==null)continue;let x=this.state.geometry3DMap.get(b);x instanceof Me&&(x.type==="geometry"||x.type==="custom-geometry")&&(e=x.components[0],o.userData.shadingDirty&&i.shading&&this.setShading(e,i.shading));let I,w;for(let E of o.userData.entities3D.values())I=this.state.geometry3DMap.get(E),w=I.components[0],I.type==="geometry"&&w.detached&&o.userData.shadingDirty&&i.shading&&this.setShading(w,i.shading);o.userData.shadingDirty=!1}if(i.dirty){let b=qn(o);b&&b.material instanceof vd&&(b.material.color.set($0(i.color)),b.material.needsUpdate=!0);let x=o.getfirstChildEntityId();if(x){let I=this.state.geometry3DMap.get(x),w=I==null?void 0:I.components[0];w instanceof Re&&this.processTextures(w,i)}i.dirty=!1}}else if(o instanceof Me&&(o.type==="geometry"||o.type==="custom-geometry")&&((a=o.components[1])!=null&&a.dirty||(l=o.components[2])!=null&&l.dirty)){e=o.components[0],i=o.components[1],n=o.components[2];let b=Fk(o,this.state.hoverColor);if(e.setColor(b[0],b[1]),i.visible!==e.visible&&(e.visible=i.visible,e.textMesh)){let x=this.state.geometry3DMap.get(e.textMesh.userData.entityId);(x==null?void 0:x.type)==="text3d"&&(x.components[0].visible=i.visible)}i.altitude!==e.altitude&&(e.altitude=i.altitude),i.opacity!==e.opacity&&(e.opacity=i.opacity),i.renderOrder!==e.renderOrder&&(e.renderOrder=i.renderOrder),i.dirty=!1,this.processTextures(e,i,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model"&&((c=o.components[1])!=null&&c.dirty))e=o.components[0],i=o.components[1],i.opacity!==e.opacity&&(e.opacity=i.opacity),i.dirty=!1;else if((o==null?void 0:o.type)==="image"&&((p=o.components[1])!=null&&p.dirty))e=o.components[0],i=o.components[1],i.visible!==e.visible&&(e.visible=i.visible),i.dirty=!1;else if((o==null?void 0:o.type)==="text3d"&&((h=o.components[1])!=null&&h.dirty)){e=o.components[0],i=o.components[1],i.visible!=null&&i.visible!==e.visible&&(e.visible=i.visible);let{textMesh:b}=e;if(b){Object.assign(b,i.getState());let x=(y=i.hoverColor)!=null?y:this.state.text3dHoverColor;b.color=i.hoverByPolygon?x:(g=i.color)!=null?g:Qa.color,b.outlineColor=i.hoverByPolygon?x:(v=i.outlineColor)!=null?v:Qa.outlineColor,b.strokeColor=i.hoverByPolygon?x:(C=i.strokeColor)!=null?C:Qa.strokeColor}i.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};Au=new WeakSet,bv=u(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,l)=>{ol.getLoader().load(e,c=>{n==="topTexture"?i.topTexture=c:i.texture=c,i.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{L.error("Failed to load texture: ".concat(e)),l("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,o)}},"#loadTexture"),u(xv,"DrawSystem");var Bf=xv;m();var Cv=class Cv extends q{constructor(e){super();d(this,"state");d(this,"animating",new Map);d(this,"isAnimating",!1);d(this,"startTime",-1);d(this,"showDuration",300);d(this,"hideDuration",250);d(this,"update",u(()=>{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 eo&&(i.visibilityNeedsUpdate==="show"?(i.visible=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));d(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[n,o]]of this.animating.entries()){let a=o===1?this.showDuration:this.hideDuration,l=(e-this.startTime)/a;i.opacity=ri(l,0,1,n,o,o===0?c3:u3),e-this.startTime>=a&&(o===1?i.visible=!0:o===0&&(i.visible=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};u(Cv,"TwoDVisibilitySystem");var Rf=Cv;m();var Sv=class Sv extends q{constructor(e,i,n,o,a,l,c){super();d(this,"state");d(this,"renderer");d(this,"mode");d(this,"scene");d(this,"cameraObject");d(this,"viewCamera");d(this,"systems");d(this,"twoDdirty",!0);d(this,"threeDdirty",!0);d(this,"frameId",null);d(this,"twoDFrameId",null);d(this,"animationFrameId",null);d(this,"nextFrame",null);d(this,"update",u((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,o)=>{this.frameId=requestAnimationFrame(()=>{var a;return((a=this.renderer)==null?void 0:a.renderer)==null?n():this.mode==="standalone"?this.commitRenderState().then(()=>{this.paint(),n()}).catch(l=>{L.error("render loop error:",l),o(l)}):n()})})},"update"));d(this,"animate2D",u(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));d(this,"drawEntities2D",u(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"drawEntities2D"));d(this,"updateEntities2D",u(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));d(this,"commitRenderState",u(()=>{let e=[];return this.frameId=null,this.systems.preRenderSystem.update(),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(),o3(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(),n3(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0),this.systems.meshOptimizationSystem.update(),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.drawSystem.update(),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,this.systems.cameraSystem.rotationDirty)}),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,Promise.all(e)},"commitRenderState"));this.renderer=e,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=l,this.systems=c,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.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)}};u(Sv,"RenderSystem");var Nf=Sv;m();var Bk=D.object({interactive:D.boolean().optional(),id:D.string().optional(),nearRadius:D.number().optional(),farRadius:D.number().optional(),accentColor:D.string().optional(),displayArrowsOnPath:D.boolean().optional(),animateArrowsOnPath:D.boolean().optional()}),Rk=D.object({type:D.enum(["Feature"]),geometry:nl,properties:D.object({parentId:D.any().optional()})});function ET(r,t){D.object({features:D.array(Rk)}).parse(r),Bk.parse(t)}u(ET,"validatePath");var ku,Tv=class Tv{constructor(t,e){d(this,"type","path");d(this,"mesh",new ti);d(this,"material");d(this,"geometry");d(this,"outline");d(this,"feature");d(this,"options");d(this,"nearRadius",.2);d(this,"farRadius",.4);d(this,"accentColor","blue");d(this,"completeFraction",1);d(this,"altitudeAdjustment",1);d(this,"displayArrowsOnPath",!1);d(this,"animateArrowsOnPath",!1);d(this,"isVertical",!1);d(this,"dirty",!0);d(this,"materialDirty",!0);d(this,"position",new J);S(this,ku,0);var i,n,o,a,l;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.displayArrowsOnPath=(a=e==null?void 0:e.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(l=e==null?void 0:e.animateArrowsOnPath)!=null?l: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,ku)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,ku,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};ku=new WeakMap,u(Tv,"PathComponent");var ao=Tv;m();var Mv=class Mv{constructor(t){d(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Ne&&t.components[0]){let i=t.components[0];if(i.dirty){for(let n of t.children)(n instanceof tt||n instanceof Ne)&&(n.userData.entityId!==t.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};u(Mv,"StackSystem");var Gf=Mv;m();m();m();var Ge=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-Ge.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?Ge.Bounce.In(r*2)*.5:Ge.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}}}}),Fu=u(function(){return performance.now()},"now"),Iv=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 u(r,"Group"),r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,o=e;n<o.length;n++){var a=o[n];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var o=n[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=Fu()),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}(),al={Linear:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=al.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=al.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=al.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=al.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,l=n*n,c=n*l;return(2*t-2*e+o+a)*c+(-3*t+3*e-2*o-a)*l+o*n+t}}},DT=function(){function r(){}return u(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),Pv=new Iv,ht=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=Ge.Linear.None,this._interpolationFunction=al.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=DT.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=Pv,Pv.add(this))}return u(r,"Tween"),r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=Fu()),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 l=t[a],c=Array.isArray(l),p=c?"array":typeof l,h=!c&&Array.isArray(i[a]);if(!(p==="undefined"||p==="function")){if(h){var y=i[a];if(y.length===0)continue;for(var g=[l],v=0,C=y.length;v<C;v+=1){var M=this._handleRelativeValue(l,y[v]);if(isNaN(M)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(M)}h&&(i[a]=g)}if((p==="object"||c)&&l&&!h){e[a]=c?[]:{};var b=l;for(var x in b)e[a][x]=b[x];n[a]=c?[]:{};var y=i[a];if(!this._isDynamic){var I={};for(var x in y)I[x]=y[x];i[a]=y=I}this._setupProperties(b,e[a],y,n[a],o)}else(typeof e[a]>"u"||o)&&(e[a]=l),c||(e[a]*=1),h?n[a]=i[a].slice().reverse():n[a]=e[a]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=Fu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=Fu()),!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=Ge.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=al.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=Fu()),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,l=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),c=this._duration+this._repeat*l,p=u(function(){if(i._duration===0||a>c)return 1;var M=Math.trunc(a/l),b=a-M*l,x=Math.min(b/i._duration,1);return x===0&&a===i._duration?1:x},"calculateElapsedPortion"),h=p(),y=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,y),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||a>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((a-this._duration)/l)+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+=l*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,C=this._chainedTweens.length;v<C;v++)this._chainedTweens[v].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,l=i[o],c=Array.isArray(t[o]),p=Array.isArray(l),h=!c&&p;h?t[o]=this._interpolationFunction(l,n):typeof l=="object"&&l?this._updateProperties(t[o],a,l,n):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(t[o]=a+(l-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 KK=DT.nextId,xi=Pv,QK=xi.getAll.bind(xi),eQ=xi.removeAll.bind(xi),tQ=xi.add.bind(xi),rQ=xi.remove.bind(xi),iQ=xi.update.bind(xi);m();m();m();var _T=u((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),OT=u((r,t)=>new re(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),wv=u((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),Bu=u((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),Ev=u((r,t)=>new re((r.x+t.x)/2,(r.y+t.y)/2),"average"),Dv=u(r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t},"getScrollDelta");var _v=class _v{constructor(t,e){d(this,"input1");d(this,"input2");d(this,"lastAngle");d(this,"lastDistance");d(this,"totalDistance");d(this,"first");d(this,"second");this.input1=t,this.input2=e,this.lastAngle=wv(t,e),this.lastDistance=Bu(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=Bu(t,e);this.input1=t,this.input2=e;let n=wv(t,e);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(Bu(this.first,t)+Bu(this.second,e))/2,this.first=Ev(this.first,t),this.second=Ev(this.second,e)}};u(_v,"InputSet");var Vf=_v;m();var Ov=class Ov{constructor(t,e,i){d(this,"touch");d(this,"camera");d(this,"cameraPlane");d(this,"viewCoordinate");d(this,"snapHolderMatrix");d(this,"snapCamera");d(this,"cameraPosition");d(this,"raycaster");d(this,"worldCoordinate");d(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=i,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new re(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Qr,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 re(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}};u(Ov,"TouchAnchor");var Ru=Ov;var Vr={};D2(Vr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Nk,CLIPPING_RADIUS:()=>Nu,CONTROL_OPTIONS:()=>Hf,DEFAULT_BEARING:()=>Uk,DEFAULT_MAX_ZOOM_LEVEL:()=>jk,DEFAULT_MIN_ZOOM_LEVEL:()=>Bv,DEFAULT_PITCH:()=>Hk,DEFAULT_ZOOM_LEVEL:()=>Vk,EVENTS:()=>Xf,MAPLIBRE_TILE_SIZE:()=>jf,MAX_LAT:()=>Av,MAX_MERCATOR_ZOOM_LEVEL:()=>Wf,MIN_LAT:()=>Lv,MIN_MERCATOR_ZOOM_LEVEL:()=>Uf,ROOM_MERCATOR_ZOOM_LEVEL:()=>Gk,TWO_PI:()=>kv,WHEEL_ZOOM_MULTIPLIER:()=>Fv,ZRANGE:()=>sl});m();var jf=512,Lv=-85.051129,Av=85.051129,Nu=1e4,Hf={chain:"chain",cancel:"cancel"},kv=Math.PI*2,sl=100,Fv=1e4,Uf=0,Wf=24,Nk=17,Gk=20,Xf=["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"],Vk=18,Bv=12,jk=22,Hk=0,Uk=0;var Yf=!1,Wk=!1;var Zf,zf=class zf extends q{constructor(e,i,n,o,a){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);d(this,"rotationDirty",!1);S(this,Zf,Bv);d(this,"zoomSpeed",5);d(this,"rotateSpeed",100);d(this,"enabled",!0);d(this,"enableZoom",!0);d(this,"enablePan",!0);d(this,"enablePedestal",!1);d(this,"maxPedestal",1/0);d(this,"minPedestal",0);d(this,"enableRotate",!0);d(this,"minZoomAltitude",0);d(this,"maxZoomAltitude",1/0);d(this,"ignoreZoomLimits",!1);d(this,"zoomFactor",1);d(this,"panBounds",{min:new J(1/0,1/0),max:new J(-1/0,-1/0),center:new J(0,0,0),radius:1/0});d(this,"minTilt",0);d(this,"maxTilt",1.2);d(this,"MOUSE_BUTTONS",{ORBIT:md.RIGHT,ZOOM:md.MIDDLE,PAN:md.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new Qr);d(this,"rendererState");d(this,"options");d(this,"state",-1);d(this,"intersection");d(this,"viewState",null);d(this,"tweens",new Map);d(this,"clock",new $2(!0));d(this,"coords",{mouse:new re,rotateStart:new re,rotateEnd:new re,rotateDelta:new re,panStart:new J,panCameraStart:new J,panEnd:new J,panDelta:new J,initialShiftPos:new re,initialPedestal:0,floorAnchor:new J});d(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});d(this,"scrollTimer",null);d(this,"lastWheelTime",0);d(this,"resetZoom",!1);d(this,"zoomStart");d(this,"pedestalScaleFactor",1);d(this,"isUserZooming",!1);d(this,"stayInsideBounds",!0);d(this,"userInteracting",!1);d(this,"raycastToFloor",u(e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new J},"raycastToFloor"));d(this,"isUserInteracting",u(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",u(()=>new J(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));d(this,"getPedestal",u(()=>this.orbit.position.z,"getPedestal"));d(this,"pan",u((e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));d(this,"postRender",u(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));d(this,"isCameraMoving",u(()=>this.state!==-1,"isCameraMoving"));d(this,"setPosition",u((e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));d(this,"updateCameraPosition",u((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 l=Math.atan2(o,n),c={x:Math.cos(l)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(l)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=e,this.orbit.position.y=i},"updateCameraPosition"));d(this,"tilt",u(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));d(this,"zoomIn",u((e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},e,i,n)},"zoomIn"));d(this,"zoomOut",u((e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},e,i,n)},"zoomOut"));d(this,"getRotation",u(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));d(this,"cancelAnimation",u(()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));d(this,"animateCamera",u((e,i,n,o,a,l)=>{let c={mode:Hf.cancel,...l},p={},h={},y=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(p.x=y.x,h.x=e.position.x),e.position.y!==void 0&&(p.y=y.y,h.y=e.position.y),e.position.z!==void 0&&(p.z=y.z,h.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?h.zoom=e.zoom:h.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:w,end:E}=Ed(this.getRotation(),e.rotation);p.rotation=w,h.rotation=E}e.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.tilt=e.tilt:h.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==h.zoom,v=p.rotation!==h.rotation,C=p.tilt!==h.tilt,M=new ht(p).to(h,T.env.TESTING?0:i).onUpdate(w=>{this.setMulti({x:w.x,y:w.y,z:w.z},w.zoom,w.rotation,w.tilt)}).onComplete(()=>{this.completeTween(M),this.publish("multi-end",{zooming:g,rotating:v,tilting:C}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,M.state=7,this.publish("multi-start",{zooming:g,rotating:v,tilting:C})),this.publish("change")});this.rendererState.tweenGroup.add(M);let b=Array.from(this.tweens.entries()),x=b[b.length-1],I=!1;return x!=null&&(c.mode===Hf.chain?(I=!0,x[0].chain(M)):(typeof x[1]=="function"&&x[1](),this.completeTween(x[0]))),this.tweens.set(M,a),n?M.easing(n):M.easing(Ge.Quadratic.In),!e.doNotAutoStart&&!I&&(M.start(),this.publish("change")),M.cameraAnimation=!0,M},"animateCamera"));d(this,"setMulti",u((e,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let l=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),l=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),l=!0)),l&&this.publish("position-updated");let c={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&&(c.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Nu&&(this.camera.near=i-Nu,this.camera.far=i+Nu):(this.camera.near=i/sl,this.camera.far=i*sl),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(c.rotating=!0,this.orbit.rotation.z=-n,this.publish("rotation-updated")),o!==void 0&&!isNaN(o)){let p=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;p!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)},"setMulti"));d(this,"getZoomScaledMin",u(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));d(this,"getZoomScaledMax",u(()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)},"getZoomScaledMax"));d(this,"setRotation",u((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=-(e%kv);n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));d(this,"setZoomAltitude",u(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/sl,this.camera.far=i*sl,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));d(this,"setZoomLevel",u(e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))},"setZoomLevel"));d(this,"getZoomAltitude",u(()=>this.camera.position.z,"getZoomAltitude"));d(this,"getZoomLevel",u(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));d(this,"setTilt",u((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));d(this,"getTilt",u(()=>this.elevation.rotation.x,"getTilt"));d(this,"setCameraPlaneElevation",u(e=>{this.cameraPlane.position.z=e},"setCameraPlaneElevation"));d(this,"zoom",u(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));d(this,"getProjectionScaleFactor",u((e,i,n)=>qm(e,i,n),"getProjectionScaleFactor"));d(this,"update",u(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));d(this,"setPedestal",u((e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)},"setPedestal"));d(this,"dispose",u(()=>{for(let e of Xf)e.endsWith("start")?this.off(e,this.setUserInteracting):e.endsWith("end")&&this.off(e,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));d(this,"createCameraPlane",u(()=>{let e=Yf?2e3:1e10,i=Yf?100:1,n=new Cr(e,e,i,i),o=new qt({color:0,wireframe:Yf,visible:Yf}),a=new Te(n,o);return this.scene.add(a),a},"createCameraPlane"));d(this,"addEventListeners",u(()=>{let{domElement:e}=this.renderer;for(let i of Xf)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));d(this,"addMouseEventListeners",u(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));d(this,"addMouseMoveEventListeners",u(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));d(this,"removeMouseMoveEventListeners",u(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));d(this,"removeEventListeners",u(()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));d(this,"removeMouseUpEventListeners",u(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));d(this,"onContextMenu",u(e=>{e.preventDefault()},"onContextMenu"));d(this,"onMouseUp",u(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1}},"onMouseUp"));d(this,"onMouseMove",u(e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)},"onMouseMove"));d(this,"onTouchStart",u(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 Vf(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));d(this,"onTouchMove",u(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 re(this.touch.touches[0].x,this.touch.touches[0].y),a=new re(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 l=i.y<o.y&&n.y<a.y,c=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(c||l)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}},"onTouchMove"));d(this,"onTouchEnd",u(e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}},"onTouchEnd"));d(this,"handleTouchMovePan",u(e=>{let i=Object.hasOwn(e,"x")?new re(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panEnd.set(n.x,n.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleTouchMovePan"));d(this,"handleTouchStartDolly",u(()=>{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 re(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 Ru(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Ru(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));d(this,"handleMouseMovePan",u(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleMouseMovePan"));d(this,"handleTouchStartTilt",u(e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));d(this,"handleTouchMovePedestal",u(e=>{this.handleMouseMovePedestal(e.touches[0])},"handleTouchMovePedestal"));d(this,"handleTouchMoveTilt",u(e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));d(this,"handleTouchMoveDolly",u(()=>{let e=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));d(this,"handleTouchEnd",u(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")},"handleTouchEnd"));d(this,"handleTouchStartPan",u(e=>{let i=Object.hasOwn(e,"x")?new re(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));d(this,"handleTouchStartPedestal",u(e=>{this.handleMouseDownPedestal(e.touches[0])},"handleTouchStartPedestal"));d(this,"onMouseDown",u(e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));d(this,"onMouseWheel",u(e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))},"onMouseWheel"));d(this,"handleMouseWheel",u(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-Dv(e)*i/Fv*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let o=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-o),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));d(this,"setCameraFromTransformMatrix",u(e=>{this.orbit.updateMatrixWorld();let i=new Za;i.setFromRotationMatrix(e,"ZYX");let n=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new J(0,0,1);a.applyEuler(i),a.setLength(n);let l=new J;l.setFromMatrixPosition(e),l.sub(a),this.enablePan&&this.setPosition(l.x,l.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-o)},"setCameraFromTransformMatrix"));d(this,"makeTransformFromTouchAnchors",u((e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=e.worldCoordinate,a=i.worldCoordinate,l=e.reUnproject(),c=i.reUnproject();if(!l||!c||!o||!a)return null;let p=e.viewCoordinate,h=i.viewCoordinate,y=a.x-o.x,g=a.y-o.y,v=Math.atan2(g,y),C=c.x-l.x,M=c.y-l.y,b=Math.atan2(M,C),x=_T(v,b),I=new Dn;I.makeRotationZ(-x);let w=I.clone();w.multiply(e.snapHolderMatrix);let E=u((s8,l8,c8)=>s8.elements[(l8-1)*4+c8-1],"m"),_=E(n,1,1)*E(w,1,1)-p.x*E(n,3,4)*E(w,3,1),O=E(n,1,1)*E(w,1,2)-p.x*E(n,3,4)*E(w,3,2),F=E(n,1,1)*E(w,1,3)-p.x*E(n,3,4)*E(w,3,3),G=o.x*_+o.y*O+o.z*F,N=E(n,2,2)*E(w,2,1)-p.y*E(n,3,4)*E(w,3,1),H=E(n,2,2)*E(w,2,2)-p.y*E(n,3,4)*E(w,3,2),Y=E(n,2,2)*E(w,2,3)-p.y*E(n,3,4)*E(w,3,3),le=o.x*N+o.y*H+o.z*Y,ye=E(n,1,1)*E(w,1,1)-h.x*E(n,3,4)*E(w,3,1),Ie=E(n,1,1)*E(w,1,2)-h.x*E(n,3,4)*E(w,3,2),Oe=E(n,1,1)*E(w,1,3)-h.x*E(n,3,4)*E(w,3,3),qe=a.x*ye+a.y*Ie+a.z*Oe,Yt=E(n,2,2)*E(w,2,1)-h.y*E(n,3,4)*E(w,3,1),Le=E(n,2,2)*E(w,2,2)-h.y*E(n,3,4)*E(w,3,2),$e=E(n,2,2)*E(w,2,3)-h.y*E(n,3,4)*E(w,3,3),He=a.x*Yt+a.y*Le+a.z*$e,Zt=Math.abs(ye-_),Fi=Math.abs(Ie-O),Ft=Math.abs(Oe-F),zt=Math.abs(ye-N),Mo=Math.abs(Ie-H),Xa=Math.abs(Oe-Y),de=Math.abs(Yt-_),be=Math.abs(Le-O),Ae=Math.abs($e-F),dr=Math.abs(Yt-N),Ya=Math.abs(Le-H),zl=Math.abs($e-Y),zr=Math.min(Zt+Fi+Ft,zt+Mo+Xa),En=Math.min(de+be+Ae,dr+Ya+zl);zr<En&&(ye=Yt,Ie=Le,Oe=$e,qe=He);let ql=N*F-_*Y,Um=H*F-O*Y,M2=le*F-G*Y,Wm=ye*Y-N*Oe,Xm=Ie*Y-H*Oe,P2=qe*Y-le*Oe,r8=(P2*Um-M2*Xm)/(Wm*Um-ql*Xm),i8=(P2*ql-M2*Wm)/(Xm*ql-Um*Wm),I2=H*_-O*N,n8=Y*_-F*N,o8=le*_-G*N,w2=Ie*N-H*ye,a8=Oe*N-Y*ye,E2=((qe*N-le*ye)*I2-o8*w2)/(a8*I2-n8*w2),fd=w.clone();return fd.elements[12]=r8,fd.elements[13]=i8,fd.elements[14]=E2,E2>0?fd:null},"makeTransformFromTouchAnchors"));d(this,"updateTouchOrigin",u(()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top},"updateTouchOrigin"));d(this,"touchToScene",u(e=>{this.touch.touches=[];for(let i=0,n=e.touches.length;i<n;i++){let o=e.touches[i],a=OT(o,this.touch.origin);this.touch.touches.push(new re(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));d(this,"canScrollZoom",u(e=>{let i=Dv(e),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())},"canScrollZoom"));d(this,"mouseToScene",u(e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));d(this,"getMousePos",u(e=>({x:e.offsetX,y:e.offsetY}),"getMousePos"));d(this,"handleMouseDownRotate",u(e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));d(this,"handleMouseDownPan",u(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));d(this,"handleMouseDownPedestal",u(e=>{let i=new re(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=qm(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));d(this,"handleMouseMovePedestal",u(e=>{let i={x:e.clientX,y:e.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)},"handleMouseMovePedestal"));d(this,"handleMouseMoveRotate",u(e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));d(this,"publishUserZoomDebounced",Io(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));d(this,"publishUserZoomEvent",u(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));d(this,"setUserInteracting",u(()=>{this.userInteracting=!0},"setUserInteracting"));d(this,"unsetUserInteracting",u(()=>{this.userInteracting=!1},"unsetUserInteracting"));d(this,"publishPedestalChangeEvent",u(e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));d(this,"convertAltitudeToZoomLevel",u(e=>{let[,i]=this.center,o=e*2*Math.tan(ve.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ve.degToRad(i))*2*Math.PI*Jl/o;return ve.clamp(Math.log2(a/512),Uf,Wf)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",u(e=>{let[,i]=this.center,n=ve.clamp(e,Uf,Wf),o=Math.pow(2,n),a=ve.clamp(i,Lv,Av),l=o*512;return Math.cos(ve.degToRad(a))*Math.PI*2*Jl/l*this.options.canvasHeight/2/Math.tan(ve.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));d(this,"completeTween",u(e=>{e.isPlaying()?e.stop():e.end(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)},"completeTween"));d(this,"debugContainer",new Gi);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,Zf)}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,l,c;let e=this.getPosition(),{lat:i,lon:n}=Cd((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(c=(l=this.rendererState.center)==null?void 0:l[0])!=null?c:0,e.x,e.y);return[n,i]}setCenter(e,i){var a,l,c,p;let{x:n,y:o}=Sd((l=(a=this.rendererState.center)==null?void 0:a[1])!=null?l:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p:0,i,e);this.setPosition(n,o)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}focusOn(e,i){Wk&&(this.debugContainer&&We(this.debugContainer),e.forEach(b=>{let x=new Te(new yd(2,2,2),new qt({color:65280}));x.position.copy(b),this.debugContainer.add(x),this.scene.add(this.debugContainer)}));let n=i.curve,o=i.callback,a=i.cancelledCallback,l=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,c=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,h=this.options.canvasHeight,y;i.duration!==void 0?y=i.duration:T.env.TESTING==="true"?y=0:y=200;let g=i.padding,v=this.getRotation(),C=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let M=Xk(e,{canvasHeight:h,paddingOption:g,canvasWidth:p,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(v),this.setTilt(C),this.animateCamera({position:M.position,tilt:i.tilt,rotation:i.rotation,zoom:M.zoom},y,n,o,a)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};Zf=new WeakMap,u(zf,"CameraSystem"),d(zf,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var ll=zf;function Xk(r,{canvasWidth:t,orbit:e,paddingOption:i,canvasHeight:n,minZoom:o,maxZoom:a,camera:l,position:c}){let p={zoom:o,position:c};if(r.length===0)return p;for(let En of ll.CAMERA_FRAME_PADDING_SIDES)typeof i[En]!="number"&&(i[En]=0);let h=i.type==="portion"?{top:i.top*n,bottom:i.bottom*n,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(h.left+h.right>=t||h.top+h.bottom>=n)return p;e.updateMatrixWorld();let y=l.matrixWorldInverse,g=l.fov*(Math.PI/180)/2,v=g,M=Math.atan(Math.tan(g)*(t/n)),b=new J(1/0,1/0,1/0),x=new J(-1/0,-1/0,-1/0),I=new Ni().setFromPoints(r),w;for(let En=0,ql=r.length;En<ql;En++)w=r[En].clone(),w.applyMatrix4(y),b.min(w),x.max(w);let E=x.x-b.x,_=x.y-b.y,O=t-h.left-h.right,F=n-h.top-h.bottom,G=(x.x+b.x)/2,N=(x.y+b.y)/2,H=E/O,Y=_/F,le=o,ye=a,Ie=le*Math.tan(M)*2,Oe=ye*Math.tan(M)*2,qe=Ie/t,Yt=Oe/t,Le=Math.max(H,Y);Le=ve.clamp(Le,qe,Yt);let $e=O*Le,He=F*Le,Zt={min:{x:G-$e/2-h.left*Le,y:N-He/2-h.bottom*Le},max:{x:G+$e/2+h.right*Le,y:N+He/2+h.top*Le}},Fi=(Zt.min.x+Zt.max.x)/2,Ft=(Zt.min.y+Zt.max.y)/2,zt=I.getCenter(new J),Mo=Math.abs(Fi-Zt.min.x),Xa=Math.abs(Ft-Zt.min.y),de=Mo/Math.tan(M),be=Xa/Math.tan(v),Ae=new J;Ae.set(Fi,Ft,x.z+Math.max(de,be)),Ae.applyMatrix4(l.matrixWorld);let dr=new J;dr.set(Fi,Ft,x.z),dr.applyMatrix4(l.matrixWorld);let Ya=new J().subVectors(dr,Ae),zl=(zt.z-Ae.z)/Ya.z,zr=new J().copy(Ae).add(Ya.clone().multiplyScalar(zl));return dr.set(zr.x,zr.y,zr.z),Ae.sub(dr),{position:zr,zoom:Ae.length()}}u(Xk,"getCameraFrameForPoints");m();var Yk=300,Gu,Vu,Rv=class Rv{constructor(t){d(this,"state");S(this,Gu,new J);S(this,Vu,new J);this.state=t}update(t){var n;let e,i;this.state.cameraObject.getWorldPosition(s(this,Vu));for(let o of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if((i.visible===!0||((n=i.animation)==null?void 0:n.pending)===!0)&&!i.offscreen){e.object3d.getWorldPosition(s(this,Gu));let a=s(this,Vu).distanceTo(s(this,Gu));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-a,"px)")}i.visible===!0?i.containerEl.style.pointerEvents=t?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.animation&&i.animation.cancel(),i.visibilityNeedsUpdate==="show"?(i.containerEl.style.opacity="0",i.visible=!0):i.visible=!1,i.animation=i.containerEl.animate([{opacity:i.visible?"1":"0"}],{duration:Yk,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};Gu=new WeakMap,Vu=new WeakMap,u(Rv,"DOMDrawSystem");var qf=Rv;m();var Nv=class Nv{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};u(Nv,"StackComponent");var $f=Nv;m();var Gv=class Gv extends q{constructor(e,i){super();d(this,"state");d(this,"dirty",!0);d(this,"domTree");d(this,"observers",new Map);d(this,"updateDimensions",u(e=>{e.forEach(i=>{let n=i.target,o=n.getAttribute("data-marker-id");if(o){let a=this.state.geometry2DMap.get(o);if(a&&a.components[0]instanceof gi&&n.firstElementChild){let{width:l,height:c}=n.firstElementChild.getBoundingClientRect();a.components[0].updateDimensions(l,c)}}}),this.publish("dimensions-update")},"updateDimensions"));this.state=e,this.domTree=i}setupObserver(){var i;if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let e;for(let n of this.domTree.children){let o=n.getAttribute("data-marker-id");if(o!=null&&(e=this.state.geometry2DMap.get(o),(i=e.components[0].options)!=null&&i.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(n),this.observers.set(n.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};u(Gv,"DOMResizeSystem");var Jf=Gv;m();var Zk=0,zk=90;function un(r,t,e,i){return(r<t||r>e)&&L.warn(i),Math.min(e,Math.max(t,r))}u(un,"clampWithWarning");var cl={linear:Ge.Linear.None,"ease-in":Ge.Quadratic.In,"ease-out":Ge.Quadratic.Out,"ease-in-out":Ge.Quadratic.InOut},Z,ie,ul,ju,Ci,Vv=class Vv{constructor(t,e,i,n){S(this,Z,void 0);S(this,ie,void 0);S(this,ul,void 0);S(this,ju,void 0);S(this,Ci,void 0);P(this,Z,t),P(this,ie,e),P(this,ul,i),P(this,ju,n),s(this,ie).cameraSystem.on("pedestal-change",({pedestal:o})=>{s(this,Z).map&&(s(this,Z).map.transform.elevation=o,s(this,Z).map.transform.minElevationForCurrentTile=o,s(this,Z).map.triggerRepaint()),s(this,ie).cameraSystem.setCameraPlaneElevation(o),s(this,ju).position.z=o})}get center(){return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?s(this,Z).map.getCenter().toArray():s(this,ie).cameraSystem.center}setCenter(t){var e;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map){(e=s(this,Z).map)==null||e.setCenter(t),s(this,ie).interactionSystem.handleHover();return}s(this,ie).cameraSystem.setCenter(t[0],t[1]),s(this,ie).interactionSystem.handleHover()}get zoomLevel(){var t;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(t=s(this,Z).map)==null?void 0:t.getZoom():s(this,ie).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map&&((e=s(this,Z).map)==null||e.setZoom(t)),s(this,ie).cameraSystem.setZoomLevel(un(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,ie).cameraSystem.isAnimating}cancelAnimation(){s(this,ie).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,ie).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,ie).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){s(this,ie).panBoundsSystem.autoMinZoomLevel=t,t&&(s(this,ie).panBoundsSystem.dirty=!0,s(this,ie).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,ie).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var n;e&&this.setAutoMinZoomLevel(!1);let i=un(t,Vr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Vr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));s(this,ie).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=s(this,Z).map)==null||n.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=un(t,this.minZoomLevel,Vr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Vr.MAX_MERCATOR_ZOOM_LEVEL,"."));s(this,ie).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=s(this,Z).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(t=s(this,Z).map)==null?void 0:t.getMaxPitch():ve.radToDeg(s(this,ie).cameraSystem.maxTilt)}get minPitch(){var t;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(t=s(this,Z).map)==null?void 0:t.getMinPitch():ve.radToDeg(s(this,ie).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(Zk,t);(i=s(this,Z).map)==null||i.setMinPitch(e),s(this,ie).cameraSystem.minTilt=ve.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(zk,t);(i=s(this,Z).map)==null||i.setMaxPitch(e),s(this,ie).cameraSystem.maxTilt=ve.degToRad(e)}get bearing(){var t;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(t=s(this,Z).map)==null?void 0:t.getBearing():ve.radToDeg(s(this,ie).cameraSystem.getRotation())}setBearing(t){var e;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map){(e=s(this,Z).map)==null||e.setBearing(t);return}s(this,ie).cameraSystem.setRotation(ve.degToRad(t))}get pitch(){var t;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(t=s(this,Z).map)==null?void 0:t.getPitch():ve.radToDeg(s(this,ie).cameraSystem.getTilt())}setPitch(t){var e;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map){(e=s(this,Z).map)==null||e.setPitch(t);return}s(this,ie).cameraSystem.setTilt(ve.degToRad(un(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,ie).cameraSystem.getPedestal()}setElevation(t){s(this,ie).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return s(this,Ci)&&s(this,Ci).stop(),new Promise(i=>{P(this,Ci,new ht({elevation:this.elevation}).to({elevation:t},(e==null?void 0:e.duration)||300).easing(cl[(e==null?void 0:e.easing)||"ease-in-out"]).onUpdate(({elevation:n})=>{this.setElevation(n)}).onComplete(()=>{s(this,Ci)&&s(this,Z).getTweenGroup().remove(s(this,Ci)),i()}).start()),s(this,Ci).cameraAnimation=!0,s(this,Z).getTweenGroup().add(s(this,Ci)),s(this,Z).render()})}get insetsPadding(){return s(this,ul).insetsPadding}get panMode(){return s(this,ie).cameraSystem.enablePan===!1&&s(this,ie).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,ie).cameraSystem.enablePan=!0,s(this,ie).cameraSystem.enablePedestal=!1):(s(this,ie).cameraSystem.enablePan=!1,s(this,ie).cameraSystem.enablePedestal=!0))}setInsetPadding(t){s(this,ul).insetsPadding=Object.assign({},wu,t)}animateTo(t){var a;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map)return(a=s(this,Z).map)==null||a.flyTo({center:t.center,zoom:t.zoomLevel,bearing:t.bearing,pitch:t.pitch,duration:t.duration}),Promise.resolve();let e=t.center?s(this,Z).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?s(this,ie).cameraSystem.convertZoomLevelToAltitude(un(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?ve.degToRad(t.bearing):void 0,o=t.pitch!==void 0?ve.degToRad(un(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(l=>{s(this,ie).cameraSystem.animateCamera({position:e,zoom:i,rotation:n,tilt:o},t.duration||0,cl[t.easing||"ease-in-out"],()=>{s(this,ie).interactionSystem.handleHover(),l()},l)})}focusOn(t,e){var i,n;return t==null||!Array.isArray(t)||t.length<=0?(L.error("focusOn coordinates are invalid:",t),Promise.resolve()):s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(t.length===1?(i=s(this,Z).map)==null||i.flyTo({center:t[0],duration:(e==null?void 0:e.duration)||s(this,Z).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?s(this,Z).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,Z).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||s(this,Z).map.getMaxZoom()}):(n=s(this,Z).map)==null||n.fitBounds(t,{duration:e==null?void 0:e.duration,animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?s(this,Z).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,Z).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||s(this,Z).map.getMaxZoom()}),s(this,ie).interactionSystem.handleHover(),Promise.resolve()):new Promise(o=>{s(this,ie).cameraSystem.focusOn(t.map(a=>s(this,Z).convertTo3DMapPosition(a[1],a[0],a[2]||0)),{minZoom:(e==null?void 0:e.maxZoomLevel)===void 0?void 0:s(this,ie).cameraSystem.convertZoomLevelToAltitude(un(e.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(e==null?void 0:e.minZoomLevel)===void 0?void 0:s(this,ie).cameraSystem.convertZoomLevelToAltitude(un(e.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:e!=null&&e.padding?Object.assign({},wu,e==null?void 0:e.padding):this.insetsPadding,curve:cl[(e==null?void 0:e.easing)||"ease-in-out"],rotation:(e==null?void 0:e.bearing)===void 0?void 0:ve.degToRad(e.bearing),tilt:(e==null?void 0:e.pitch)!==void 0?ve.degToRad(un(e.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:e==null?void 0:e.duration,callback:()=>{s(this,ie).interactionSystem.handleHover(),o()},cancelledCallback:o})})}};Z=new WeakMap,ie=new WeakMap,ul=new WeakMap,ju=new WeakMap,Ci=new WeakMap,u(Vv,"Camera");var Kf=Vv;m();var LT="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 AT="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 kT=4.291666666666667,FT=15,BT=25,RT=43/60;m();var NT=["horizontal","icon"],Jk=new Map([[NT[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>'],[NT[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>']]),Kk=/<svg([^>]*)>/g;function GT(r,t,e,i){let n=Jk.get(r);return n?n.replace(Kk,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}u(GT,"getLogoIcon");var VT=!1,Ce,pl,dl,ft,wt,Ma,jr,Si,Hr,Ti,jv=class jv extends q{constructor(e,i,n){super();S(this,Ce,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});S(this,pl,void 0);S(this,dl,void 0);S(this,ft,void 0);S(this,wt,void 0);S(this,Ma,void 0);S(this,jr,0);S(this,Si,0);S(this,Hr,0);S(this,Ti,0);d(this,"dirty",!0);d(this,"getPositionAlignedCanvasCoordinates",u((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,Ce).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",u(()=>{var n,o,a,l;let e=s(this,Ce).padding;if(typeof e=="number")return{"top-left":{x:e,y:e},"top-right":{x:-e,y:e},"bottom-left":{x:e,y:-e},"bottom-right":{x:-e,y:-e},center:{x:0,y:0},top:{x:0,y:e},bottom:{x:0,y:-e},left:{x:e,y:0},right:{x:-e,y:0}}[s(this,Ce).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:(l=e.left)!=null?l:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));P(this,Ce,Object.assign({},s(this,Ce),n)),P(this,dl,e),P(this,pl,i),P(this,Hr,i.canvasWidth),P(this,Ti,i.canvasHeight)}get color(){return s(this,Ce).color==="light"?"white":"#293136"}get iconName(){return s(this,Ce).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,Ce).iconOnly?FT:75}get defaultWidth(){return s(this,Ce).iconOnly?BT:150}get aspectRatio(){return s(this,Ce).iconOnly?RT:kT}get options(){return{...s(this,Ce)}}set options(e){P(this,Ce,{padding:e.padding||s(this,Ce).padding,position:e.position||s(this,Ce).position,iconOnly:e.iconOnly||s(this,Ce).iconOnly,color:e.color||s(this,Ce).color,scale:e.scale||s(this,Ce).scale,onClick:s(this,Ce).onClick,visible:s(this,Ce).visible})}get icon(){return GT(this.iconName,this.color,s(this,jr)*s(this,pl).pixelRatio,s(this,Si)*s(this,pl).pixelRatio)}setSize(e,i){s(this,wt)&&(s(this,wt).uniforms.uSize.value.x=e,s(this,wt).uniforms.uSize.value.y=i)}setXY(e,i){s(this,wt)&&(s(this,wt).uniforms.uSize.value.w=e,s(this,wt).uniforms.uSize.value.z=i)}get width(){return s(this,jr)}get height(){return s(this,Si)}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,Ce).position]}show(){s(this,Ce).visible=!0,this.dirty=!0}hide(){s(this,Ce).visible=!1,s(this,ft)&&(s(this,dl).remove(s(this,ft)),We(s(this,ft))),P(this,ft,void 0),s(this,wt)&&s(this,wt).dispose(),P(this,wt,void 0),P(this,Ma,void 0)}insertIntoQuadTree(e){s(this,Ma)!=null&&typeof s(this,Ce).onClick=="function"&&e.insert(s(this,Ma))}resize(e,i){if(s(this,Ce).visible!==!0)return;P(this,Hr,e),P(this,Ti,i);let n=this.getPositionAlignedCanvasCoordinates(s(this,Hr),s(this,Ti)),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,jr),s(this,Si)),l=Math.min(s(this,Hr)-s(this,jr),Math.max(0,n.x+o.x+a.x)),c=Math.min(s(this,Ti)-s(this,Si),Math.max(0,n.y+o.y+a.y));this.setSize(s(this,jr)/s(this,Hr),s(this,Si)/s(this,Ti)),this.setXY(l/s(this,Hr),c/s(this,Ti)),P(this,Ma,new rt(l,c,s(this,jr),s(this,Si),{entityId:"watermark"}))}update(){this.dirty&&s(this,Ce).visible===!0&&(P(this,jr,Math.min(s(this,Hr),Math.max(this.minWidth,this.defaultWidth*s(this,Ce).scale))),P(this,Si,s(this,jr)/this.aspectRatio),ol.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(P(this,wt,new Ql({uniforms:{uTexture:{value:e},uSize:{value:new F2(0,0,0,0)},uOpacity:{value:.7}},vertexShader:LT,fragmentShader:AT,depthWrite:!1,depthTest:!1,defines:{debug:VT},wireframe:VT,transparent:!0,visible:!0})),s(this,ft))s(this,ft).material=s(this,wt),s(this,ft).material.needsUpdate=!0;else{let i=new Cr(2,2,1,1);P(this,ft,new Te(i,s(this,wt))),s(this,ft).position.set(0,0,-1),s(this,ft).frustumCulled=!1,s(this,ft).renderOrder=999;let n=new yd(1,1,1),o=new Te(n,new qt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.layers.set(1),s(this,ft).add(o),s(this,dl).add(s(this,ft))}this.resize(s(this,Hr),s(this,Ti)),this.publish("texture-loaded")})),this.dirty=!1}destroy(){this.hide()}};Ce=new WeakMap,pl=new WeakMap,dl=new WeakMap,ft=new WeakMap,wt=new WeakMap,Ma=new WeakMap,jr=new WeakMap,Si=new WeakMap,Hr=new WeakMap,Ti=new WeakMap,u(jv,"WatermarkSystem");var Qf=jv;m();var Hv=100,tF=!1,Uv=class Uv extends q{constructor(e,i){super();d(this,"currentTotalBoundingBox");d(this,"state");d(this,"cameraSystem");d(this,"debugMesh",null);d(this,"dirty",!1);d(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Ni,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new J(0,0,0),new J(Hv*2,Hv*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Hv))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let e of this.state.geometry2DMap.values())e.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(e.position),e.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new J),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new R2).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,tF&&this.state.entityScene.parent instanceof za&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Te(new Y2(this.cameraSystem.panBounds.radius),new qt({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};u(Uv,"PanBoundsSystem");var em=Uv;m();var jT="\xA9 Mappedin",rF="https://info.mappedin.com/feedback",Wv=["top-left","top-right","bottom-left","bottom-right"],iF=640,nF=u(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),HT={custom:[],position:"bottom-right"},Xv=class Xv{constructor(t){d(this,"controlContainerEl");d(this,"controlPositions");d(this,"compact");d(this,"attribContainerEl");d(this,"attribInnerEl");d(this,"attribButtonEl");d(this,"feedbackLinkEl");d(this,"attribHTML",jT);d(this,"customAttributions",[]);d(this,"toggleAttribution",u(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Wv.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=HT){let e=t.position&&Wv.includes(t.position)?t.position:HT.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=nF(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=rF,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=[jT],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<=iF||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}};u(Xv,"HTMLControlsSystem");var tm=Xv;m();var Hu,Yv=class Yv{constructor(t,e){d(this,"mesh");d(this,"type","custom-geometry");d(this,"dirty",!0);d(this,"feature");d(this,"builder");d(this,"outline");d(this,"color",new we);S(this,Hu,0);this.mesh=new ti,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}setOpacity(){}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return s(this,Hu)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Hu,t))}};Hu=new WeakMap,u(Yv,"CustomGeometryComponent");var hl=Yv;m();var Zv=class Zv{constructor(t,e){d(this,"state");d(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(t=n.components[0],e=n.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};u(Zv,"CustomGeometrySystem");var rm=Zv;m();m();var zv=class zv extends Te{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};u(zv,"EntityMesh");var im=zv,oF=D.object({flipImageToFaceCamera:D.boolean().optional(),url:D.string()}),aF=D.object({type:D.enum(["Feature"]),properties:D.object({width:D.number(),height:D.number(),rotation:D.number().min(0).max(360).optional(),verticalOffset:D.number().optional()}),geometry:nl});function UT(r,t,e){D.union([D.number(),D.string()]).parse(r),aF.parse(t),oF.parse(e)}u(UT,"validateImage");var qv=class qv{constructor(t){d(this,"mesh",new ti);d(this,"imageMesh");d(this,"outline");d(this,"type","image");d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"position",new J);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)}};u(qv,"ImageComponent");var nm=qv;var WT=Math.PI*2,XT=Math.PI/2,YT=Math.PI*1.5,sF=.01,lF=!1,$v=class $v extends q{constructor(e,i){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}createImageMesh(e,i,n,o=0,a){var y,g;let l=new Kr({transparent:!0,depthWrite:!1,side:Bi}),c=new Cr(n.width,n.height),p=new im(c);p.visible=!1,(y=this.getOrDownloadImage(i))==null||y.then(v=>{l.map=v,l.needsUpdate=!0,l.map.colorSpace=Ri,p.visible=!0,this.publish("image-loaded")}),p.userData.entityId=e,p.material=l;let h=this.convertTo3DMapPosition(a);if(lF){let v=new Te(new Cr(n.width,n.height),new Kr({color:"gray"}));p.add(v);let C=new J2;p.add(C),C.scale.set(10,10,10)}return p.renderOrder=1,p.position.set(h.x,h.y,o+sF),p.rotation.z=-ve.degToRad((g=n.rotation)!=null?g:0),p}getOrDownloadImage(e){if(this.imageLoadingCache.has(e))return this.imageLoadingCache.get(e);{let i=new Promise(n=>{ol.getLoader().load(e,o=>{n(o)})});return this.imageLoadingCache.set(e,i),i}}flipIfNeeded(e,i){let o=(e.imageMesh.rotation.z-i+WT)%WT;(o>XT&&o<YT||o<-XT&&o>-YT)&&(e.imageMesh.rotation.z=e.imageMesh.rotation.z-Math.PI)}update(e){var a,l,c,p,h;let i,n,o;for(let y of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(y),(i==null?void 0:i.type)==="image")n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null&&(n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)),n.imageMesh&&o.flipImageToFaceCamera&&this.flipIfNeeded(n,e);else if((i==null?void 0:i.type)==="geometry"){if(n=i.components[0],o=i.components[1],o.showImage&&((a=n.feature.properties)!=null&&a.image)&&n.imageMesh==null&&n.mesh!=null&&n.mesh.parent!=null&&((l=n.feature.properties)==null?void 0:l.image.position)!=null){let g=this.createImageMesh(y,(c=n.feature.properties)==null?void 0:c.image.path,(p=n.feature.properties)==null?void 0:p.image,o.height,(h=n.feature.properties)==null?void 0:h.image.position);n.mesh.parent.add(g),n.imageMesh=g}n.imageMesh&&(o.showImage&&!n.imageMesh.visible?n.imageMesh.visible=!0:!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1),o.flipImageToFaceCamera&&this.flipIfNeeded(n,e))}}};u($v,"ImageSystem");var om=$v;m();var cF=!1,so,Jv=class Jv extends q{constructor(e,i){super();d(this,"cameraDirty",!0);d(this,"focusablesDirty",!0);d(this,"state");d(this,"camera");d(this,"debugEl",null);d(this,"raycasters",[]);d(this,"collisions",new Map);d(this,"focusableEntities",new Set);S(this,so,void 0);d(this,"update",u(()=>{s(this,so)&&cancelAnimationFrame(s(this,so)),P(this,so,requestAnimationFrame(()=>{this.updateRaf()}))},"update"));this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new re(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new re(e.x/1.2,e.y/1.2),n=new re(e.x+(e.x-i.x),i.y),o=new re(i.x,e.y+(e.y-i.y)),a=new re(n.x,o.y),l=new re(e.x,e.y/1.5),c=new re(e.x,e.y+(e.y-l.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,l,c,i,n,o,a].map((p,h)=>{if(cF){let M=document.createElement("div");M.style.position="absolute",M.style.top=p.y+"px",M.style.left=p.x+"px",M.style.width="10px",M.style.height="10px",M.style.backgroundColor="red",this.debugEl.append(M)}let y=p.x/this.state.canvasWidth*2-1,g=-(p.y/this.state.canvasHeight)*2+1,v=new re(y,g),C=new Qr;return C.setFromCamera(v,this.camera),[C,v,h===0?10:h<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null&&(e=i.components[0],e instanceof Re&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let o=new Te(e.geometry);o.userData={entityId:i.id},e.focusMesh=o}this.focusableEntities.add(e.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}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(l=>{var c;if((l==null?void 0:l.object)!=null&&"isMesh"in l.object&&(l!=null&&l.object.isMesh)){let p=l.object.userData.entityId,h=(c=this.collisions.get(p))!=null?c:0;this.collisions.set(p,h+o)}});let e=Array.from(this.collisions,([i,n])=>({entityId:i,weight:n})).sort((i,n)=>n.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}destroy(){s(this,so)&&cancelAnimationFrame(s(this,so)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};so=new WeakMap,u(Jv,"GeometryInFocusSystem");var am=Jv;m();var Kv=class Kv{constructor(t){d(this,"dirty",!0);d(this,"map");d(this,"stylesheetId","");d(this,"userHiddenLayers",new Set);d(this,"hiddenLayersInStyle",new Set);d(this,"centerPoint");d(this,"handleRender",u(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let t=[],e=this.map.project(this.centerPoint),i=this.map.queryRenderedFeatures(e,{layers:Array.from(this.hiddenLayersInStyle)});for(var n of i)t.push(["!=",["id"],n.id]);t.length>0&&(this.hiddenLayersInStyle.forEach(o=>{this.map.setFilter(o,["all",...t])}),this.dirty=!1)},"handleRender"));d(this,"handleStyleChange",u(t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};u(Kv,"OutdoorLayers");var sm=Kv;m();m();m();var Qv="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 eb='#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 ZT="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 hF=new $a;function zT(r,t,e){let{nearRadius:i,farRadius:n,accentColor:o,completeFraction:a,isVertical:l}=t,{color:c}=e,p=!0,h=0,y=1/0,g=t.displayArrowsOnPath,v=!l,C=!0,M=g,b=i/2+fF,x=0;r[0].z+=b;for(let de=1;de<r.length;++de){r[de].z+=b;let be=r[de].x-r[de-1].x,Ae=r[de].z-r[de-1].z;if(l)x+=Math.sqrt(be*be+Ae*Ae);else{let dr=r[de].y-r[de-1].y;x+=Math.sqrt(be*be+dr*dr+Ae*Ae)}}if(!l){let de=b-.01;r.push(r[r.length-1].clone().setZ(de)),r.unshift(r[0].clone().setZ(de))}let I=new k2;M&&(I=hF.load(ZT),I.colorSpace=Ri);let w=new we(c),E=new we(o),_={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new re(1,1)},cameraParameters:{type:"v2",value:new re(h,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:w},pathLength:{type:"f",value:x},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:n},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:y},pulseColor:{type:"c",value:E},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:I},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:C},opacityMultiplier:{type:"f",value:1}},O=new W2(r);O.curveType="catmullrom",O.tension=0;let F=30,G=8,N=F*r.length,H=new Z2(O,N,i,G,!1),Y=new Float32Array(H.attributes.position.count);for(let de=r.length;de<Y.length;de++)Y[de]=de;H.setAttribute("vertexIndex",new Kl(Y,1));let le=new Float32Array(H.attributes.position.count),ye=new Kl(le,1);for(let de=0;de<=N;de++)for(let be=0;be<=G;++be)ye.setX(de*(G+1)+be,de/N);H.setAttribute("pathDistance",ye);let Ie=new Float32Array(H.attributes.normal.count*3),Oe=new Kl(Ie,3);for(let de=0;de<N;de++){let be=H.tangents[de];for(let Ae=0;Ae<=G;++Ae)Oe.setXYZ(de*(G+1)+Ae,be.x,be.y,be.z)}H.setAttribute("pathTangent",Oe);let qe=new Float32Array(H.attributes.normal.count*3),Yt=new Kl(qe,3);for(let de=0;de<N;de++){let be=H.tangents[de];var Le,$e,He;l?(Le=be.x*be.y,$e=-1+be.y*be.y,He=be.z*be.y):(Le=-be.x*be.z,$e=-be.y*be.z,He=1-be.z*be.z);let Ae=Math.sqrt(Le*Le+$e*$e+He*He);Ae===0&&(Ae=1);let dr=Le/Ae,Ya=$e/Ae,zl=He/Ae;for(let zr=0;zr<=G;++zr)Yt.setXYZ(de*(G+1)+zr,dr,Ya,zl)}H.setAttribute("pathNormal",Yt);let Zt=new Ql({uniforms:_,vertexShader:Qv,fragmentShader:eb});Zt.transparent=!0,Zt.alphaTest=.5,_.resolution.value.x=1,_.resolution.value.y=1,_.vertexes.value=Y.length,_.arrowTexture.value.wrapS=qr,_.arrowTexture.value.wrapT=qr,_.arrowTexture.value.anisotropy=16,_.complete.value=a;let Fi=new Te(H,Zt),Ft=Fi.clone(),zt={..._,opacityMultiplier:{type:"f",value:.25}};zt.complete.value=1,Ft.material=new Ql({uniforms:zt,vertexShader:Qv,fragmentShader:eb}),Ft.material.transparent=!0,Ft.material.alphaTest=.5,Ft.material.depthWrite=!1,Ft.material.depthTest=!1,Ft.renderOrder=1,zt.resolution.value.x=1,zt.resolution.value.y=1,zt.vertexes.value=Y.length,zt.arrowTexture.value.wrapS=qr,zt.arrowTexture.value.wrapT=qr,zt.arrowTexture.value.anisotropy=16,zt.complete.value=a,Fi.userData=Ft.userData=t.mesh.userData;let Mo=t.mesh;Mo.add(Fi),Mo.add(Ft),H.computeBoundingBox();let Xa=new J;return H.boundingBox.getCenter(Xa),{mesh:Mo,material:Zt,center:Xa}}u(zT,"buildPath");var fF=.15;var tb=class tb extends q{constructor(e,i,n){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=n}update(e,i,n){let o,a=!1;for(let l of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(l),o&&o.type==="path"&&o.components[0].type==="path"){let c=o.components[0],p=o.components[1],h=c.isVertical&&this.altitudeDirty;if(!(c instanceof ao))continue;if(c.dirty||h){if(c.mesh.parent!=null)for(let g=c.mesh.children.length-1;g>=0;g--)We(c.mesh.children[0]);let y=[];if(c.feature.features.forEach(g=>{let v=g.geometry.coordinates[2]||0,C;if(g.properties.parentId&&(C=this.getParentContainer(g.properties.parentId,!0),C!=null&&C.altitude!=null&&(v+=C.altitude,c.isVertical=!0)),!g.properties.parentId||C!=null&&C.visible){let M=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],v);y.push(M)}}),y.length>1){let{mesh:g,material:v,center:C}=zT(y,c,{color:p.color});c.mesh=g,c.material=v,c.position=C}c.dirty=!1}p.dirty&&(c.mesh.children.forEach(y=>{y.material.uniforms.color.value.set(p.color),y.material.needsUpdate=!0}),c.mesh.position.z=p.altitude,p.dirty=!1),c.material&&(c.mesh.children.forEach(y=>{let g=y.material.uniforms;g.nearZoom.value=e,g.farZoom.value=i,g.cameraParameters.value.x=n,c.materialDirty&&(g.nearRadius.value=c.nearRadius,g.displayArrowsOnPath.value=c.displayArrowsOnPath,g.farRadius.value=c.farRadius,g.pulseColor.value.set(c.accentColor),g.complete.value=c.completeFraction),y.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(y=>{y.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,y.material.needsUpdate=!0}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};u(tb,"PathSystem");var Uu=tb;m();var Ze,fl,Ur,rb=class rb{constructor(t){d(this,"rendererState");d(this,"dirty",!1);S(this,Ze,void 0);S(this,fl,void 0);S(this,Ur,void 0);this.rendererState=t}updateOne(t){var e;if(t instanceof Me&&t.components[0]instanceof Re&&t.components[1]instanceof Sr&&t.parent instanceof tt&&(P(this,Ze,t.components[0]),P(this,Ur,t.components[1]),s(this,Ze).detached&&s(this,Ze).dirty&&s(this,Ze).geometry!=null&&s(this,Ze).material!=null)){P(this,fl,t.parent),(e=s(this,Ze).mesh)==null||e.setVisibleAt(s(this,Ze).instanceIndex,!1);let i=new we(s(this,Ur).color),n=new ga({color:i,side:Bi,opacity:s(this,Ur).opacity||1,transparent:s(this,Ur).opacity!==void 0?s(this,Ur).opacity<1:!1},1,s(this,Ze).material.repeatYFactor),o=new fi(1,s(this,Ze).geometry.attributes.position.count||0,0,n);o.addGeometry(s(this,Ze).geometry),o.userData={entities:{0:t.id},detached:!0},s(this,Ze).instanceIndex=0,s(this,Ze).material.setColor(s(this,Ze).instanceIndex,i,s(this,Ur).topColor?new we(s(this,Ur).topColor):i),s(this,Ze).mesh=o,s(this,Ze).material=n,s(this,fl).add(o),s(this,Ze).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){P(this,Ze,void 0),P(this,fl,void 0),P(this,Ur,void 0)}};Ze=new WeakMap,fl=new WeakMap,Ur=new WeakMap,u(rb,"MeshDetachmentSystem");var lm=rb;m();m();function qT(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}}u(qT,"updateHeight");var Pa,lo,ib=class ib{constructor(t){d(this,"rendererState");d(this,"dirty",!1);S(this,Pa,void 0);S(this,lo,void 0);this.rendererState=t}updateOne(t){var e;t instanceof Me&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(P(this,Pa,t.components[0]),P(this,lo,t.components[1]),t.type==="geometry"&&s(this,lo).height!==s(this,Pa).currentHeight&&qT(s(this,Pa),s(this,lo).height,s(this,lo).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){P(this,Pa,void 0),P(this,lo,void 0)}};Pa=new WeakMap,lo=new WeakMap,u(ib,"MeshModificationSystem");var cm=ib;m();var Wu,nb=class nb{constructor(t){S(this,Wu,void 0);P(this,Wu,t)}update(){var t;(t=s(this,Wu)._subscribers["pre-render"])==null||t.forEach(e=>e())}};Wu=new WeakMap,u(nb,"PreRenderSystem");var um=nb;m();var mF={showPolygonLabelTextAreaMesh:!1},ob=class ob{constructor(t){d(this,"state",mF);d(this,"core");this.core=t}update(t){let e={};for(let[i,n]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=n,e[i]=n);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh())}};u(ob,"Debug");var pm=ob;var $T=new Qr;var{DEFAULT_PITCH:cb,DEFAULT_BEARING:ub,DEFAULT_ZOOM_LEVEL:pb,DEFAULT_MIN_ZOOM_LEVEL:yF,DEFAULT_MAX_ZOOM_LEVEL:gF}=Vr,vF=ve.radToDeg(.698132),Ut,Xe,Xu,ml,co,Ia,yl,Yu,sb,k,Se,Wr,Ve,Mi,Wt,A,Zu,ze,De,dm,JT,hm,KT,fm,QT,uo,zu,qu,gl,mm,$u,Ju,Ku,vl,Qu,lb,wa,ep,Et,Dt,bl,tp,db=class db extends q{constructor(e,i={}){var g,v,C,M,b,x,I,w,E,_;super();S(this,Yu);S(this,dm);S(this,hm);S(this,fm);S(this,Qu);d(this,"options");d(this,"container");d(this,"Debug");S(this,Ut,void 0);S(this,Xe,void 0);S(this,Xu,void 0);S(this,ml,void 0);S(this,co,void 0);S(this,Ia,void 0);S(this,yl,void 0);d(this,"rendererDomElement");S(this,k,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ne("__scene"),hoverColor:"red",text3dHoverColor:"white",insetsPadding:wu,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new Iv,cameraObject:new Ym});d(this,"camera");S(this,Se,void 0);S(this,Wr,void 0);S(this,Ve,void 0);S(this,Mi,void 0);S(this,Wt,void 0);S(this,A,{});S(this,Zu,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");S(this,ze,u(()=>{s(this,A).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));S(this,De,u(()=>{s(this,A).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));S(this,uo,"standalone");S(this,zu,u(e=>Math.trunc(e*10)/10,"#round10"));S(this,qu,u(()=>{s(this,A).twoDDrawSystem.dirty=!0,j(this,Yu,sb).call(this,Ja()),s(this,A).watermarkSystem.dirty=!0,this.render()},"#handlePixelRatioChange"));S(this,gl,u(()=>{s(this,k).canvasWidth=this.rendererDomElement.clientWidth,s(this,k).canvasHeight=this.rendererDomElement.clientHeight,j(this,Yu,sb).call(this,Ja()),s(this,vl).call(this),j(this,fm,QT).call(this),s(this,A).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,A).cameraSystem.dirty=!0,s(this,A).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,A).htmlControlsSystem.resize(this.canvasWidth),s(this,A).geometryInFocusSystem.resize(),s(this,A).interactionSystem.resize(),this.render()},"#handleWindowResize"));S(this,mm,u(()=>{this.renderSync()},"#renderFull"));S(this,$u,new J);S(this,Ju,u((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,$u).copy(i);let o=s(this,$u).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,l=(-o.y+1)/2*this.canvasHeight-0/2,c=s(this,zu).call(this,a),p=s(this,zu).call(this,l);e.x=c,e.y=p}else e.x=-1e3,e.y=-1e3},"#project"));S(this,Ku,u((e,i)=>{s(this,Wt).setBufferSize(e,i),s(this,Xe).aspect=e/i,s(this,Xe).updateProjectionMatrix(),s(this,Xe).updateMatrixWorld(!0),s(this,ml).x=e,s(this,ml).y=i},"#setBufferSize"));S(this,vl,u(()=>{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,Ku).call(this,n,o),(a=this.map)==null||a.resize(),s(this,k).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",u((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 Ne?n:(L.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 Ne)return n}return i?s(this,k).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",u(()=>{s(this,A).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",u(()=>{s(this,A).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",u((e,i)=>{var c;let n=e/this.canvasWidth*2-1,o=-(i/this.canvasHeight)*2+1,a=new re(n,o);$T.setFromCamera(a,s(this,Xe).clone());let l=(c=$T.intersectObject(s(this,co),!1)[0])==null?void 0:c.point;return l!=null?this.convert3DMapPositionToCoordinate(l):void 0},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",u(e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n=new re;return s(this,Ju).call(this,n,i),{x:n.x,y:n.y}},"projectCoordinateToScreenXY"));d(this,"convert3DMapPositionToCoordinate",u(e=>{var o,a,l,c;let{lat:i,lon:n}=Cd((a=(o=s(this,k).center)==null?void 0:o[1])!=null?a:0,(c=(l=s(this,k).center)==null?void 0:l[0])!=null?c:0,e.x,e.y);return[n,i,e.z]},"convert3DMapPositionToCoordinate"));d(this,"setBackgroundColor",u((e,i)=>{s(this,Wt).setBackgroundColor(e,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",u(()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i),o=this.projectScreenXYToCoordinate(e,i);return n==null||o==null?void 0:wd(n,o)/e},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",u((e,i)=>{!this.map||(i==null?void 0:i.length)===0||(s(this,A).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())},"hideOutdoorLayersUnderPoint"));S(this,wa,new V2);S(this,ep,new Dn);d(this,"render",u(()=>{if(s(this,A).renderSystem!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return s(this,A).renderSystem.update()},"render"));d(this,"renderSync",u(()=>s(this,A).renderSystem.update(!0),"renderSync"));S(this,Et,Io(()=>{this.publish("user-interaction-start",void 0)},0,!0));S(this,Dt,Io(()=>{this.publish("user-interaction-end",void 0)},0,!0));d(this,"on",u((e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&T.env.NODE_ENV!=="test"&&(L.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))},"on"));d(this,"off",u((e,i)=>{super.off(e,i)},"off"));d(this,"getCursor",u(()=>s(this,A).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",u(()=>{s(this,A).cameraSystem.off("user-dolly-start",s(this,Et)),s(this,A).cameraSystem.off("user-pan-start",s(this,Et)),s(this,A).cameraSystem.off("user-rotate-start",s(this,Et)),s(this,A).cameraSystem.off("user-zoom-start",s(this,Et)),s(this,A).cameraSystem.off("user-tilt-start",s(this,Et)),s(this,A).cameraSystem.off("user-pedestal-start",s(this,Et)),s(this,A).cameraSystem.off("user-dolly-end",s(this,Dt)),s(this,A).cameraSystem.off("user-pan-end",s(this,Dt)),s(this,A).cameraSystem.off("user-rotate-end",s(this,Dt)),s(this,A).cameraSystem.off("user-zoom-end",s(this,Dt)),s(this,A).cameraSystem.off("user-tilt-end",s(this,Dt)),s(this,A).cameraSystem.off("user-pedestal-end",s(this,Dt)),s(this,A).renderSystem.off("measure-canvas",s(this,vl)),this.remove("__scene"),s(this,ze).call(this),s(this,De).call(this),this.renderSync(),s(this,A).renderSystem.destroy(),s(this,A).cameraSystem.off("change",this.render),s(this,A).pathSystem.off("animate:path",this.render),s(this,A).cameraSystem.dispose(),s(this,A).exporterSystem.destroy(),s(this,A).outdoorLayersSystem.destroy(),s(this,A).drawSystem.destroy(),window.removeEventListener("resize",s(this,gl),!1),s(this,Zu).removeEventListener("change",s(this,qu)),s(this,Ia)&&s(this,Ia).disconnect(),this._subscribers={},s(this,Wt).destroy(),s(this,Ut).traverse(e=>{We(e),"dispose"in e&&typeof e.dispose=="function"&&e.dispose()}),P(this,Ut,void 0),s(this,A).htmlControlsSystem.destroy(),s(this,A).collisionSystem.destroy(),s(this,A).domMutationSystem.destroy(),s(this,A).geometryInFocusSystem.destroy(),P(this,A,void 0),s(this,uo)!=="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,Mi)),this.container.removeChild(s(this,Se)),P(this,Wt,void 0)},"destroy"));S(this,bl,new J);S(this,tp,new J);if(this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(P(this,uo,i.mode),this.map=i.map),s(this,k).entityScene.addEventListener("childadded",()=>{s(this,De).call(this),s(this,ze).call(this)}),s(this,k).entityScene.addEventListener("childremoved",()=>{s(this,De).call(this),s(this,ze).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,j(this,dm,JT).call(this),j(this,hm,KT).call(this),s(this,A).htmlControlsSystem=new tm(this.container),s(this,uo)!=="outdoors-overlay"&&s(this,A).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),T.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),P(this,Wt,new gf({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(g=i.gl)==null?void 0:g.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:()=>{typeof i.onWebGLContextLost=="function"&&i.onWebGLContextLost()},onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),s(this,ze).call(this),s(this,De).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(v=i.backgroundAlpha)!=null?v:1})),P(this,Ut,new za),s(this,Ut).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,Ut)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Wt)}))),P(this,Xe,new Ym(vF,this.aspect,50,1e5)),s(this,k).cameraObject=s(this,Xe),P(this,Xu,new G2),s(this,Xe).renderOrder=999;let o=new Gi;o.add(s(this,Xe)),P(this,yl,new Gi),s(this,yl).add(o),s(this,Ut).add(s(this,yl)),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,Wt).domElement(),P(this,ml,new re);let a=new Cr(1e6,1e6),l=new qt({color:0,visible:!1});P(this,co,new Te(a,l)),s(this,Ut).add(s(this,co)),(C=i.gl)!=null&&C.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,gl),!1),s(this,Zu).addEventListener("change",s(this,qu)),typeof ResizeObserver=="function"&&((M=T.env)==null?void 0:M.NODE_ENV)!=="test"&&(P(this,Ia,new ResizeObserver(Io(()=>{s(this,gl).call(this)},0))),(b=s(this,Ia))==null||b.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(x=globalThis.MappedinDebug)!=null&&x.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(I=globalThis.MappedinDebug)!=null&&I.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 c=this.canvasWidth,p=this.canvasHeight;s(this,A).watermarkSystem=new Qf(s(this,Xe),s(this,k),i==null?void 0:i.watermark),s(this,A).watermarkSystem.on("texture-loaded",this.render),s(this,k).shouldMeasureCanvas=!0,s(this,k).pixelRatio=this.resolutionScale,s(this,Ku).call(this,Math.floor(c*this.resolutionScale),Math.floor(p*this.resolutionScale));let h=new xd(16777215,.3*Math.PI);h.position.set(-150,-150,350),s(this,Ut).add(h);let y=new q2(16777215,.741*Math.PI);s(this,Ut).add(y),s(this,A).cameraSystem=new ll(s(this,Xe),s(this,Ut),s(this,Wt).renderer,s(this,k),{mode:this.mode,canvasHeight:p,canvasWidth:c}),s(this,A).cameraSystem.on("user-dolly-start",s(this,Et)),s(this,A).cameraSystem.on("user-pan-start",s(this,Et)),s(this,A).cameraSystem.on("user-rotate-start",s(this,Et)),s(this,A).cameraSystem.on("user-zoom-start",s(this,Et)),s(this,A).cameraSystem.on("user-tilt-start",s(this,Et)),s(this,A).cameraSystem.on("user-pedestal-start",s(this,Et)),s(this,A).cameraSystem.on("user-dolly-end",s(this,Dt)),s(this,A).cameraSystem.on("user-pan-end",s(this,Dt)),s(this,A).cameraSystem.on("user-rotate-end",s(this,Dt)),s(this,A).cameraSystem.on("user-zoom-end",s(this,Dt)),s(this,A).cameraSystem.on("user-tilt-end",s(this,Dt)),s(this,A).cameraSystem.on("user-pedestal-end",s(this,Dt)),s(this,A).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,A).geometryInFocusSystem&&(s(this,A).geometryInFocusSystem.cameraDirty=!0),this.render()}),s(this,A).pathSystem=new Uu(s(this,k),this.convertTo3DMapPosition,this.getParentContainer),s(this,A).pathSystem.on("animate:path",this.render),s(this,A).panBoundsSystem=new em(s(this,k),s(this,A).cameraSystem),s(this,A).panBoundsSystem.on("update",()=>{let{panBounds:O,fov:F,convertAltitudeToZoomLevel:G}=s(this,A).cameraSystem;if(s(this,A).panBoundsSystem.autoMinZoomLevel){let N=F*Math.PI/180,H=Math.tan(N/2);if(O.radius<=0)return;let Y=G(O.radius/H);this.camera.setMinZoomLevel(Y)}}),this.camera=new Kf(this,s(this,A),s(this,k),s(this,co)),this.camera.setZoomLevel((w=i.zoomLevel)!=null?w:pb),this.camera.setBearing((E=i.bearing)!=null?E:ub),this.camera.setPitch((_=i.pitch)!=null?_:cb),this.camera.setMaxZoomLevel(gF),this.camera.setMinZoomLevel(yF),s(this,A).domVisiblitySystem=new Af(s(this,k),s(this,Mi)),s(this,A).domMutationSystem=new Jf(s(this,k),s(this,Mi)),s(this,A).domMutationSystem.on("dimensions-update",()=>{s(this,A).collisionSystem.collidersDirty=!0,this.render()}),s(this,A).domDrawSystem=new qf(s(this,k)),s(this,A).collisionSystem=new vf(s(this,Wr),s(this,k)),s(this,A).twoDDrawSystem=new Ff(s(this,k),s(this,Ve)),s(this,A).interactionSystem=new Cu(this.rendererDomElement,s(this,k),s(this,Xe),s(this,co),s(this,A).cameraSystem.isUserInteracting),s(this,A).interactionSystem.on("hover",this.render),s(this,A).interactionSystem.on("click",O=>{var F,G,N,H,Y,le;if(((F=O.entity2D)==null?void 0:F.id)==="watermark"&&typeof s(this,A).watermarkSystem.options.onClick=="function"){s(this,A).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(O.position),geometry:O.entity3D?[(G=O.entity3D)==null?void 0:G.id]:[],paths:((N=O.entity3D)==null?void 0:N.components[0])instanceof ao?[O.entity3D.id]:[],markers:((H=O.entity2D)==null?void 0:H.components[0])instanceof gi?[O.entity2D.id]:[],models:((Y=O.entity3D)==null?void 0:Y.components[0])instanceof no?[O.entity3D.id]:[],labels:((le=O.entity2D)==null?void 0:le.components[0])instanceof eo?[O.entity2D.id]:[],containers:Array.isArray(O.groupContainers)?O.groupContainers.map(ye=>ye.userData.entityId):[],pointerEvent:O.pointerEvent})}),s(this,A).interactionSystem.on("hover",O=>{var F,G,N,H,Y,le;O.position&&((F=O.entity2D)==null?void 0:F.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(O.position),geometry:O.entity3D?[(G=O.entity3D)==null?void 0:G.id]:[],paths:((N=O.entity3D)==null?void 0:N.components[0])instanceof ao?[O.entity3D.id]:[],markers:((H=O.entity2D)==null?void 0:H.components[0])instanceof gi?[O.entity2D.id]:[],models:((Y=O.entity3D)==null?void 0:Y.components[0])instanceof no?[O.entity3D.id]:[],labels:((le=O.entity2D)==null?void 0:le.components[0])instanceof eo?[O.entity2D.id]:[],containers:Array.isArray(O.groupContainers)?O.groupContainers.map(ye=>ye.userData.entityId):[]})}),s(this,A).geometryInFocusSystem=new am(s(this,k),s(this,Xe)),s(this,A).geometryInFocusSystem.on("geometry-in-focus",O=>{this.publish("geometry-in-focus",O)}),s(this,A).twoDVisiblitySystem=new Rf(s(this,k)),s(this,A).drawSystem=new Bf(s(this,k)),s(this,A).drawSystem.on("texture-loaded",this.render),s(this,A).stackSystem=new Gf(s(this,k)),s(this,A).twoDProjectionSystem=new kf(s(this,k),s(this,Ju)),s(this,A).exporterSystem=new Su(s(this,k)),s(this,A).meshOptimizationSystem=new Lf(s(this,k),this.convertTo3DMapPosition),s(this,A).meshOptimizationSystem.on("model-loaded",this.render),s(this,A).meshDetachmentSystem=new lm(s(this,k)),s(this,A).meshModificationSystem=new cm(s(this,k)),s(this,A).customGeometrySystem=new rm(s(this,k),this.convertTo3DMapPosition),s(this,A).outlineInterpolationSystem=new vu(s(this,k)),s(this,A).renderSystem=new Nf(s(this,Wt),s(this,k),this.mode,s(this,Ut),s(this,Xe),this.viewCamera,s(this,A)),s(this,A).preRenderSystem=new um(this),s(this,A).imageSystem=new om(s(this,k),this.convertTo3DMapPosition),s(this,A).text3DSystem=new hf(s(this,k),this.convertTo3DMapPosition),s(this,A).text3DSystem.on("render",this.render),s(this,A).imageSystem.on("image-loaded",this.render),s(this,A).renderSystem.on("measure-canvas",s(this,vl)),s(this,A).outdoorLayersSystem=new sm(this.map),this.Debug=new pm(this),s(this,mm).call(this)}get viewCamera(){return s(this,Xu)}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:Ja()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,uo)}addGroupContainer(e,i,n){var o;if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let a=new Ne(e);a.addEventListener("childadded",()=>{s(this,De).call(this),s(this,ze).call(this)}),a.addEventListener("childremoved",()=>{s(this,De).call(this),s(this,ze).call(this)}),(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&a.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&Tt(a,i.interactive,s(this,k)),s(this,k).geometry3DMap.set(e,a),(o=this.getParentContainer(n))==null||o.addEntity(a),s(this,De).call(this),this.render()}else L.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,n){var o;if(s(this,k).geometry3DMap.has(e))L.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let a=new Ne(e);a.addEventListener("childadded",()=>{s(this,De).call(this),s(this,ze).call(this)}),a.addEventListener("childremoved",()=>{s(this,De).call(this),s(this,ze).call(this)}),a.components[0]=new $f,(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),s(this,k).geometry3DMap.set(e,a),(o=this.getParentContainer(n))==null||o.addEntity(a)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,n,o,a){var l;if(s(this,k).geometry3DMap.has(e))L.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new hl(i,n),p=new Me(c,new Sr(o));p.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},s(this,k).geometry3DMap.set(p.id,p),(l=this.getParentContainer(a))==null||l.addEntity(p),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,n,o){var a,l;if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let c=new tt(e,new $o(n));c.addEventListener("childadded",()=>{s(this,De).call(this),s(this,ze).call(this)}),c.addEventListener("childremoved",()=>{s(this,De).call(this),s(this,ze).call(this)}),c.userData.dirty=!0,s(this,k).geometry3DMap.set(e,c);for(let p of i.features){if(p.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(p.geometry.type))continue;let h=p.id||p.properties.id||ue(),{visible:y,...g}=n||{color:K2},v=s(this,A).meshOptimizationSystem.createEntityFromFeature(h,p,g);s(this,k).geometry3DMap.set(h,v),c.userData.entities3D.add(h)}c.setVisible((a=n==null?void 0:n.visible)!=null?a:!0),(n==null?void 0:n.altitude)!=null&&c.setAltitude(n.altitude),(l=this.getParentContainer(o))==null||l.addEntity(c),s(this,De).call(this),this.render()}else L.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return s(this,A).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addImage(e,i,n,o){var a;try{UT(e,i,n)}catch(l){L.error(l);return}if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let l=new nm(i),c=new Me(l,new Sr(n));c.id=e||ue(),l.mesh.userData={entityId:c.id,type:"path"},s(this,k).geometry3DMap.set(c.id,c),(a=this.getParentContainer(o))==null||a.addEntity(c),s(this,De).call(this),this.render()}else L.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,n,o){var a;try{PT(e,i,n)}catch(l){L.error(l);return}if(!s(this,k).geometry3DMap.has(e)&&!s(this,k).geometry2DMap.has(e)){let l=new tt(e,new $o(n));l.addEventListener("childadded",()=>{s(this,De).call(this),s(this,ze).call(this)}),l.addEventListener("childremoved",()=>{s(this,De).call(this),s(this,ze).call(this)}),s(this,k).geometry3DMap.set(e,l),l.userData.dirty=!0,l.userData.modelURL=n.url;for(let c of i.features){let p=c.id||c.properties.id||ue(),h=s(this,A).meshOptimizationSystem.createModelFromFeature(p,c,n);c.properties.interactive!==void 0&&Tt(h,c.properties.interactive,s(this,k)),s(this,k).geometry3DMap.set(p,h),l.userData.entities3D.add(p)}(a=this.getParentContainer(o))==null||a.addEntity(l),s(this,De).call(this),this.render()}else L.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,n,o){var l;let a=n==null?void 0:n.id;try{k7(e,i,n||{})}catch(c){L.error(c);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let c=j(this,Qu,lb).call(this,e,new gi(i,n));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&n.interactive!=="pointer-events-auto"&&Tt(c,n==null?void 0:n.interactive,s(this,k)),(l=this.getParentContainer(o))==null||l.addEntity(c),this.render()}else L.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}labelText3D(e,i,n={}){var p,h;try{if(!i||!e)throw new Error("content and meshGeometryId are required");I6.parse(n)}catch(y){L.error(y);return}let o=s(this,k).geometry3DMap.get(e);if((o==null?void 0:o.type)!=="geometry"){L.error(".labelText3D failed: target incorrect");return}let a=o==null?void 0:o.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let y=s(this,k).geometry3DMap.get(a.textEntityId);if((y==null?void 0:y.type)!=="text3d"){L.error(".labelText3D failed: existing text3d not found");return}return{id:y.id,type:y.type}}let l=new Qs({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:ue()}});l.polygonEntityId=e;let c=new Me(l,new Md(n==null?void 0:n.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",s(this,k).geometry3DMap.set(c.id.toString(),c),n.parentId&&((h=this.getParentContainer(n.parentId))==null||h.addEntity(c)),this.render(),{id:c.id,type:"text3d"}}addLabel2D(e,i,n,o){var l;let a=n==null?void 0:n.id;try{T6(e,i,n||{})}catch(c){L.error(c);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let c=j(this,Qu,lb).call(this,e,new eo(i,n||{},s(this,k)));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&Tt(c,n==null?void 0:n.interactive,s(this,k)),(l=this.getParentContainer(o))==null||l.addEntity(c),s(this,ze).call(this),this.render()}else L.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(e,i={},n){var l,c;try{ET(e,i||{})}catch(p){L.error(p);return}let o=new ao(e,W0(i)),a=new Me(o,new Sr({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));return a.id=(i==null?void 0:i.id)||ue(),o.mesh.userData={entityId:a.id,type:"path"},s(this,k).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&Tt(a,i==null?void 0:i.interactive,s(this,k)),(c=this.getParentContainer(n))==null||c.addEntity(a),s(this,De).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(e){s(this,A).watermarkSystem.options=e,s(this,A).watermarkSystem.dirty=!0,s(this,A).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 o of i.childrenIds.values())this.remove(o),i.userData.entities2D.delete(o);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];i.object3d&&(((n=i.parent)==null?void 0:n.type)==="geometry-group"&&i.parent.userData.entities3D.delete(i.id),We(i.object3d)),"outline"in o&&o.outline&&We(o.outline),"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")i.object3d&&We(i.object3d),i.type==="label"&&delete s(this,A).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:l}=i.components[0];if(a&&(o&&o.removeText(a),We(a)),l){s(this,A).text3DSystem.remove(l);let c=s(this,k).geometry3DMap.get(l);(c==null?void 0:c.type)==="geometry"&&(c.components[0].textMesh=void 0,c.components[0].textEntityId=void 0)}s(this,k).geometry3DMap.delete(i.id)}s(this,De).call(this),s(this,ze).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(e){return s(this,A).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(s(this,A).renderSystem.threeDdirty||s(this,A).renderSystem.twoDdirty)&&this.renderSync();let i=new Ni;if(e==null)i.setFromObject(s(this,k).entityScene);else{let n=ec(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 Re?o.geometry:void 0;o.mesh instanceof qa&&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(d3(i))return e3(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var n,o,a,l,c;if(e==null)return{type:"map-view",hoverColor:s(this,k).hoverColor,text3dHoverColor:s(this,k).text3dHoverColor};let i=ec(s(this,k),e);if((i==null?void 0:i.type)==="custom-geometry"){let p=i.components[0],h=i.components[1];return{id:i.id,type:"custom-geometry",visible:h.visible,altitude:h.altitude,parent:(n=i.parent)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(p.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let p=[];for(let y of i.userData.entities3D.values()){let g=this.getState(y);((g==null?void 0:g.type)==="geometry"||(g==null?void 0:g.type)==="model")&&p.push(g)}let h=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:h.opacity,color:h.color,height:h.height,altitude:i.altitude,topColor:h.topColor,outline:h.outline,shading:h.shading,texture:h.texture,topTexture:h.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(y=>s(this,k).geometry3DMap.get(y)).every(y=>y&&y.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(y=>this.getState(y)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(p=>this.getState(p)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let p=i.components[0],h=i.object3d.parent,y=h==null?void 0:h.userData.entityId;return{id:i.id,type:"label",text:p.text||"",parent:{id:y,type:h==null?void 0:h.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:p.enabled,initialRank:Qc(p.initialRank),options:{rank:Qc(p.rank),appearance:p.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let p=i.components[0],h=i.object3d.parent,y=h==null?void 0:h.userData.entityId;return{id:i.id,type:"marker",enabled:p.enabled,parent:{id:y,type:h==null?void 0:h.type},position:this.convert3DMapPositionToCoordinate(i.position),element:p.containerEl,initialRank:Qc(p.initialRank),options:{rank:Qc(p.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:p,hoverColor:h,initialColor:y,topColor:g}=i.components[1],v=i.components[0],C=i.components[1],M=i.components[2];return{id:i.id,type:"geometry",opacity:C.opacity,color:p,focusable:v.focusable,topColor:g,initialColor:y,hoverColor:h,hovered:!!(M!=null&&M.hover),height:C.height,visible:C.visible,outline:C.outline,showImage:C.showImage,texture:C.texture,topTexture:C.topTexture,flipImageToFaceCamera:C.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(v.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let p=i.components[0],h=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(p.position),interactive:h!=null}}else if((i==null?void 0:i.type)==="path"){let p=i.components[0],h=i.components[2],y=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(p.position),visible:y.visible,interactive:h!=null,completeFraction:p.completeFraction,color:y.color,accentColor:p.accentColor,nearRadius:p.nearRadius,farRadius:p.farRadius,animateArrowsOnPath:p.animateArrowsOnPath,displayArrowsOnPath:p.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let p=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(p.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"){U6(i);let p=i.components[0],h=i.components[1],{textMesh:y}=p,g=(o=p.mesh)==null?void 0:o.parent;g instanceof Ne&&((a=g.children.find(M=>M.type==="batchedtext"))==null||a.getWorldPosition(s(this,tp))),s(this,bl).set(0,0,0);let v=y?y.getWorldPosition(s(this,bl)):s(this,bl);return Object.assign({},Qa,h.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(v.add(s(this,tp))),visible:(l=p.visible)!=null?l:!1,content:(c=p.feature.properties.content)!=null?c:""})}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=ec(s(this,k),e);if(n!=null){if(n.type==="custom-geometry"){let l=s(this,k).geometry3DMap.get(n.id);if(l instanceof Me&&l.components[0]instanceof hl){let c=i;to(n,c.visible),ff(n,c.altitude),V0(n,c.position,this.convertTo3DMapPosition),j0(n,this.getParentContainer(c.parent,!1))}}else if(n.type==="model"||n.type==="path"){let l=i;Tt(n,l.interactive,s(this,k))&&s(this,De).call(this),n.type==="path"&&(ff(n,l.altitude),H6(n,l))}else if(n.type==="group-container"){let l=i;to(n,l.visible)&&(s(this,A).outlineInterpolationSystem.dirty=!0,s(this,A).pathSystem.altitudeDirty=!0),ff(n,l.altitude)&&(s(this,A).pathSystem.altitudeDirty=!0),Tt(n,l.interactive,s(this,k))&&s(this,De).call(this)}else if(n.type==="geometry-group"){let l=i;to(n,l.visible)&&(s(this,A).outlineInterpolationSystem.dirty=!0),w6(n,s(this,k),l)&&(s(this,A).outlineInterpolationSystem.dirty=!0),U0(n,l.outline)&&(s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),l.height!=null&&(N0(n,s(this,k),l.height),s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),l.altitude!=null&&(n.setAltitude(l.altitude),n.userData.outlineDirty=!0),R6(n,l),E6(n,l.shading),B6(n,s(this,k),l.opacity)&&(n.userData.outlineDirty=!0,s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),Tt(n,l.interactive,s(this,k))&&(s(this,De).call(this),s(this,ze).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Re){let l=i;to(n,l.visible)&&(s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),U0(n,l.outline)&&(s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),D6(n,l),V6(n,l.focusable)&&(s(this,A).geometryInFocusSystem.focusablesDirty=!0),j6(n,l.renderOrder)&&(s(this,A).meshDetachmentSystem.dirty=!0),G6(n,l.opacity)&&(s(this,A).meshDetachmentSystem.dirty=!0,s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),H0(n,l.flipImageToFaceCamera),l.height!=null&&(N0(n,s(this,k),l.height),s(this,A).outlineInterpolationSystem.geometries3DDirty=!0),N6(n,l)&&(s(this,A).meshDetachmentSystem.dirty=!0),G0(n,l),k6(n,l.hoverColor),Tt(n,l.interactive,s(this,k)),F6(n,l.hovered)}s(this,De).call(this)}else if(n.type==="label"||n.type==="marker"){let l=i;A6(n,i,s(this,k)),O6(n,i,s(this,k))&&s(this,ze).call(this),V0(n,l.position,this.convertTo3DMapPosition),j0(n,this.getParentContainer(l.parent,!1))&&(s(this,ze).call(this),s(this,A).panBoundsSystem.dirty=!0),_6(n,l.enabled)}else if(n.type==="image"){let l=i;to(n,l.visible),H0(n,l.flipImageToFaceCamera)}else n.type==="text3d"&&W6(n,i);this.render()}}convertTo3DMapPosition(e,i,n=0,o){var c,p,h,y,g;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(c=e[2])!=null?c:n,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:l}=Sd((h=(p=s(this,k).center)==null?void 0:p[1])!=null?h:0,(g=(y=s(this,k).center)==null?void 0:y[0])!=null?g:0,e,i);return o?(o.set(a,l,n),o):new J(a,l,n)}get backgroundColor(){return s(this,Wt).backgroundColor}getThreeRenderer(){return s(this,Wt)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?p3(i):void 0}isInView(e){let i=ec(s(this,k),e);if(s(this,ep).identity().multiply(s(this,Xe).projectionMatrix).multiply(s(this,Xe).matrixWorldInverse),s(this,wa).setFromProjectionMatrix(s(this,ep)),i instanceof ei)return s(this,wa).containsPoint(i.position);if(i instanceof Me){let n=i==null?void 0:i.components[0];if(n instanceof hl||n instanceof no)return s(this,wa).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Re){let o=new Ni(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,wa).intersectsBox(o)}}return!1}getSystems(){return s(this,A)}getInternalState(){return s(this,k)}getTweenGroup(){return s(this,k).tweenGroup}};Ut=new WeakMap,Xe=new WeakMap,Xu=new WeakMap,ml=new WeakMap,co=new WeakMap,Ia=new WeakMap,yl=new WeakMap,Yu=new WeakSet,sb=u(function(e){var i;s(this,uo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),s(this,k).pixelRatio=this.resolutionScale},"#setResolutionScale"),k=new WeakMap,Se=new WeakMap,Wr=new WeakMap,Ve=new WeakMap,Mi=new WeakMap,Wt=new WeakMap,A=new WeakMap,Zu=new WeakMap,ze=new WeakMap,De=new WeakMap,dm=new WeakSet,JT=u(function(){P(this,Se,document.createElement("div")),s(this,Se).classList.add("mappedin__smart-collision-engine__container"),P(this,Wr,document.createElement("canvas")),s(this,Wr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,Se)),P(this,Ve,document.createElement("canvas")),s(this,Ve).classList.add("mappedin__smart-collision-engine__container"),s(this,Ve).width=s(this,Se).clientWidth*this.resolutionScale,s(this,Ve).height=s(this,Se).clientHeight*this.resolutionScale,s(this,Ve).style.width=s(this,Se).clientWidth+"px",s(this,Ve).style.height=s(this,Se).clientHeight+"px",s(this,Se).appendChild(s(this,Wr)),s(this,Se).appendChild(s(this,Ve)),s(this,Wr).width=s(this,Se).clientWidth,s(this,Wr).height=s(this,Se).clientHeight,s(this,Ve).width=s(this,Se).clientWidth*this.resolutionScale,s(this,Ve).height=s(this,Se).clientHeight*this.resolutionScale,s(this,Ve).style.width=s(this,Se).clientWidth+"px",s(this,Ve).style.height=s(this,Se).clientHeight+"px"},"#renderEntity2DContainer"),hm=new WeakSet,KT=u(function(){P(this,Mi,document.createElement("div")),s(this,Mi).classList.add("mappedin-2d-entities"),Object.assign(s(this,Mi).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,Mi))},"#renderEntityDOMContainer"),fm=new WeakSet,QT=u(function(){s(this,Ve).width=s(this,Se).clientWidth*this.resolutionScale,s(this,Ve).height=s(this,Se).clientHeight*this.resolutionScale,s(this,Ve).style.width=s(this,Se).clientWidth+"px",s(this,Ve).style.height=s(this,Se).clientHeight+"px",s(this,Wr).width=s(this,Se).clientWidth,s(this,Wr).height=s(this,Se).clientHeight,s(this,Ve).width=s(this,Se).clientWidth*this.resolutionScale,s(this,Ve).height=s(this,Se).clientHeight*this.resolutionScale,s(this,Ve).style.width=s(this,Se).clientWidth+"px",s(this,Ve).style.height=s(this,Se).clientHeight+"px",s(this,A).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),uo=new WeakMap,zu=new WeakMap,qu=new WeakMap,gl=new WeakMap,mm=new WeakMap,$u=new WeakMap,Ju=new WeakMap,Ku=new WeakMap,vl=new WeakMap,Qu=new WeakSet,lb=u(function(e,i,n){let o=new ei(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||n||0));return s(this,k).geometry2DMap.set(o.id,o),o},"#createEntity2D"),wa=new WeakMap,ep=new WeakMap,Et=new WeakMap,Dt=new WeakMap,bl=new WeakMap,tp=new WeakMap,u(db,"Core");var ab=db,rp=ab;m();function bF(r,t){xF(r,t)(r.getScene(),t),CF(r,t),t.addFolder("Export").add({export:async()=>{let a=await r.getCurrentSceneGLTF({binary:!0}),l=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let p=window.URL.createObjectURL(l);c.href=p,c.download="scene.glb",c.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)}u(bF,"mountSceneGraphVisualizer");function xF(r,t){let e=t;return u(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 l={get height(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.height:0},set height(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{height:c})},set flipImageToFaceCamera(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="image"&&r.setState(n,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="image"?c.flipImageToFaceCamera:!1},set visible(c){let 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:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?c.visible:!1},set outline(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{outline:c})},get outline(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.outline:!1},get opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.opacity:1},set opacity(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{opacity:c})},get color(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"&&c.color?X(c.color).toHexString():"#ffffff"},set color(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:c})},set interactive(c){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:c}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"?c.interactive:!1},get completeFraction(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="path"?c.completeFraction:1},set completeFraction(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{completeFraction:c})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?r.camera.focusOn([c.position]):(c==null?void 0:c.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(c))}),a.add(l,"visible"),n.type==="image"?a.add(l,"flipImageToFaceCamera"):(a.add(l,"interactive"),n.type==="path"&&a.add(l,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(l,"color"),a.add(l,"outline"))),n.type==="geometry"&&(a.add(l,"height"),a.add(l,"opacity",0,1,.1))}else if(n.type==="marker"){let l={get interactive(){var p;let c=r.getState(n.id);return(c==null?void 0:c.type)==="marker"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:c}}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="marker"&&r.camera.focusOn([c.position])}),a.add(l,"interactive")}else if(n.type==="label"){let l={get interactive(){var p;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:c}}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get text(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c})},get"Text Color"(){var p,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(h=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:h.foregroundColor:"#000000"},set"Text Color"(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(n.id,{text:l.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var p,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(h=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:h.size:10},set"Text Size"(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var p,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(h=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:h.iconSize:10},set"Icon Size"(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var p,h,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(h=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:h.foregroundColor)==null?void 0:y.active:"#000000"},set"Active Foreground Color"(c){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var p,h,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(h=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:h.foregroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Foreground Color"(c){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var p,h,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(h=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:h.backgroundColor)==null?void 0:y.active:"#000000"},set"Active Background Color"(c){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var p,h,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(h=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:h.backgroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Background Color"(c){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor,inactive:c}}}}})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="label"&&r.camera.focusOn([c.position])}),a.add(l,"interactive"),a.add(l,"text"),a.add(l,"Text Size",10,50),a.add(l,"Icon Size",10,50),a.addColor(l,"Text Color"),a.addColor(l,"Active Background Color"),a.addColor(l,"Inactive Background Color"),a.addColor(l,"Active Foreground Color"),a.addColor(l,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let l={get opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.opacity:1},set opacity(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{opacity:c})},set visible(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.visible:!1},set outline(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{outline:c})},get outline(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.outline:!1},set interactive(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(n,{interactive:c}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var p,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(h=(p=c.shading)==null?void 0:p.start)!=null?h:0},set shadingStart(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:c}})},get shadingEnd(){var p,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(h=(p=c.shading)==null?void 0:p.end)!=null?h:0},set shadingEnd(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:c}})},get shadingIntensity(){var p,h;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(h=(p=c.shading)==null?void 0:p.intensity)!=null?h:0},set shadingIntensity(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{intensity:c}})}};a.add(l,"visible"),a.add(l,"opacity",0,1,.1),a.add(l,"interactive"),a.add(l,"outline"),a.add(l,"shadingStart",0,1,.1),a.add(l,"shadingEnd",0,1,.1),a.add(l,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let l={set visible(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.visible:!1},set interactive(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:c}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.interactive:!1}};a.add(l,"visible"),a.add(l,"interactive")}if(a.close(),n.children)for(let l of n.children.values())i(l,a)},"parseChild")}u(xF,"createParseChild");function CF(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)})}u(CF,"createWatermarkChild");var eM="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",SF="https://auth.mappedin.com/oauth2/token";async function tM(r,t){var e,i,n,o,a;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled&&((i=t==null?void 0:t.outdoorView)!=null&&i.headers)){let{Map:l,MercatorCoordinate:c}=await import("./outdoor-context-v4-KP4UBYI7.js"),p=t.outdoorView.headers;p==null&&(p=await s3(SF));let h=t.center||[0,0],y=new l({container:r,style:t.outdoorView.style||eM,center:h,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:pb,pitch:(o=t.pitch)!=null?o:cb,bearing:(a=t.bearing)!=null?a:ub,transformRequest:i3(p),trackResize:!1,pixelRatio:Ja(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=y.painter.context.gl,v=new rp(r,{center:h,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:g,map:y,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias}),C={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(v.camera.minZoomLevel),y.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",E=>{C.center=E.center,C.zoom=E.zoomLevel,C.bearing=E.bearing,C.pitch=E.pitch,y.jumpTo(C)});let M=c.fromLngLat(h,0),b=Td(M,v.viewCamera,v.camera,()=>{v.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(b),v.renderSync())});let x=!1,I=!1;y.on("idle",()=>{y&&(x||(v.publish("outdoor-view-loaded"),x=!0),I||(I=!0,v.publish("outdoor-style-loaded")))});let w=u(E=>{E&&(E.sourceDataType==="metadata"||E.sourceDataType==="visibility"||E.dataType==="style"||E.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",E=>{y&&E&&E.dataType==="style"&&E.type==="styledata"&&(I=!1),w(E)}),y.on("sourcedata",w),y.on("terrain",w),y.on("error",E=>{var _;if(((_=E.error)==null?void 0:_.url)===eM){L.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}L.warn(E)}),v}else return new rp(r,t)}u(tM,"createRenderer");m();var ip=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(ip||{}),np=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(np||{});m();m();var xl=class xl{constructor(t,e,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",xl.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===xl.__type}};u(xl,"Label"),d(xl,"__type","Label");var po=xl;m();var Sl,Cl=class Cl{constructor(t,e,i){d(this,"id");S(this,Sl,void 0);d(this,"__type",Cl.__type);d(this,"contentEl");this.id=t,this.contentEl=e,P(this,Sl,i)}get target(){return s(this,Sl)}static is(t){return t.__type===Cl.__type}updateTarget(t){P(this,Sl,t)}};Sl=new WeakMap,u(Cl,"Marker"),d(Cl,"__type","Marker");var pn=Cl;m();var ap,sp,Tl=class Tl{constructor(t,e,i){S(this,ap,void 0);S(this,sp,void 0);d(this,"target");d(this,"__type",Tl.__type);P(this,ap,t),P(this,sp,e),this.target=i}static is(t){return t.__type===Tl.__type}get id(){return s(this,ap)}get url(){return s(this,sp)}};ap=new WeakMap,sp=new WeakMap,u(Tl,"Image"),d(Tl,"__type","Image");var op=Tl;m();var Ml=class Ml{constructor(t,e){d(this,"id");d(this,"groupId");d(this,"__type",Ml.__type);this.id=t,this.groupId=e}static is(t){return t.__type===Ml.__type}};u(Ml,"Model"),d(Ml,"__type","Model");var lp=Ml;m();var hb=class hb{constructor(t,e,i){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"__type");this.id=t,this.__type="Path",this.animation=e,this.coordinates=i}};u(hb,"Path");var Ea=hb;m();var ho,fb=class fb{constructor(t){S(this,ho,void 0);P(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,u(fb,"CameraTransform");var cp=fb;m();var Pl=class Pl{constructor(t){d(this,"id");d(this,"__type",Pl.__type);this.id=t}static is(t){return t.__type===Pl.__type}};u(Pl,"Shape"),d(Pl,"__type","Shape");var fo=Pl;m();var up=class up{constructor(t,e){d(this,"id");d(this,"target");d(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===up.__type}};u(up,"Text3D"),d(up,"__type","Text3D");var mo=up;m();m();m();var TF=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>']]),MF=/<svg([^>]*)>/g;function rM(r,t,e){let i=TF.get(r);return i?i.replace(MF,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}u(rM,"getStyledIcon");var PF=u(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),IF=u(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(r,'"\n />\n </svg>\n '),"getDestinationPin"),mb="#722ED1",yb="#1890FF",iM=u(({type:r="departure",color:t=yb})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?PF(t):IF(t),"\n </div>"),"DroppedPin"),wF=u(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),nM=u(({type:r="stairs",color:t=mb,direction:e="up"})=>{let i=wF("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(rM("connection-"+r+"-16x16","white",n)||"","\n </div>\n ").concat(o?'<div style="margin-left: -'.concat(i*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(i,"px; height: ").concat(i,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(n,"px; height: ").concat(n,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");m();var oM=u(async r=>new Promise(t=>setTimeout(t,r)),"ms");var Il={setMapOnConnectionClick:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},inactivePathOptions:{drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},markerOptions:{departureColor:yb,destinationColor:mb}},dn,hn,yo,_e,dp,fn,st,Pi,xr,mn,Da,vm,aM,wl,ym,El,gm,bm,sM,hp,gb=class gb{constructor(t,e,i){S(this,vm);S(this,wl);S(this,El);S(this,bm);S(this,dn,new Map);S(this,hn,void 0);S(this,yo,void 0);S(this,_e,Il);S(this,dp,void 0);S(this,fn,void 0);S(this,st,[]);S(this,Pi,void 0);S(this,xr,new Map);S(this,mn,new Map);S(this,Da,new Map);S(this,hp,u(t=>{var e;if((e=s(this,_e).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=s(this,dn).get(t.markers[0]);i!=null&&i.action.toFloor&&(s(this,_e).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}},"#handleClick"));P(this,hn,t),P(this,dp,i),P(this,yo,e)}get currentMap(){return s(this,dp).call(this)}get isMultiFloor(){if(!s(this,st).length)return!1;let t=new Set;for(let e of s(this,st))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,xr).get(t)}getMarkerById(t){return s(this,dn).get(t)}get paths(){let t=[];return s(this,xr).forEach(({path:e})=>t.push(e)),t}get activeDirections(){return s(this,Da).get(s(this,Pi))}get activePath(){var t;if(s(this,Pi))return(t=s(this,xr).get(s(this,Pi).id))==null?void 0:t.path}get floorStacks(){let t=s(this,yo).getMapData();if(!s(this,st).length||!t)return[];let e=new Set;for(let i of s(this,st))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,yo).getMapData();if(!s(this,st).length||!t)return[];let e=new Set;for(let i of s(this,st))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,st)[t];if(!s(this,st).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,st)[t]){L.warn("Direction #".concat(t," does not exist"));return}let i=s(this,mn).get(e);if(!i){L.warn("The direction is not a part of muli-direcional path");return}j(this,wl,ym).call(this,i)}setActivePath(t){if(!s(this,st).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,Da).get(t)){L.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}j(this,wl,ym).call(this,t)}setActivePathByDirections(t){if(!s(this,st).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=s(this,mn).get(t);if(!e){L.warn("The direction is not a part of muli-direcional path");return}j(this,wl,ym).call(this,e)}async draw(t,e={}){var c;let i=Array.isArray(t)?t:[t],n=i[0],o=i[i.length-1],a=n.coordinates[0];P(this,st,i),a.floorId&&this.currentMap.setFloor(a.floorId),s(this,fn)&&this.clear(),P(this,_e,{setMapOnConnectionClick:(c=e.setMapOnConnectionClick)!=null?c:Il.setMapOnConnectionClick,pathOptions:{...Il.pathOptions,...e.pathOptions},inactivePathOptions:{...Il.inactivePathOptions,...e.inactivePathOptions},createMarkers:{...Il.createMarkers,...e.createMarkers},markerOptions:{...Il.markerOptions,...e.markerOptions}});let l=!1;return P(this,fn,{promise:new Promise(async p=>{var h,y,g;if(T.env.NODE_ENV!=="test"&&await oM(500),l||!i.length){p();return}(h=s(this,_e).createMarkers)!=null&&h.departure&&j(this,El,gm).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let v=0;v<i.length;v++){let C=i[v],M=v?{...s(this,_e).inactivePathOptions}:{...s(this,_e).pathOptions};if(C.coordinates.length<2){L.warn("Directions must have at least 2 coordinates"),p();return}let b=this.currentMap.Paths.add(C.coordinates,M),x=b.paths.map(w=>w.id.toString()),I=new Ea(ue(),b.animation,C.coordinates);for(let w of x){s(this,xr).set(w,{path:I,entityIds:x});let E=v?{...s(this,_e).inactivePathOptions,altitude:0}:{...s(this,_e).pathOptions,altitude:.05};s(this,hn).setState(w,E)}if(s(this,xr).set(I.id,{path:I,entityIds:x}),s(this,mn).set(C,I),s(this,Da).set(I,C),T.env.NODE_ENV!=="test"&&await b.animation,l){p();return}(y=s(this,_e).createMarkers)!=null&&y.connection&&j(this,bm,sM).call(this,C.instructions,"connection"),v===0&&(P(this,Pi,s(this,mn).get(s(this,st)[0])),s(this,hn).on("click",s(this,hp)))}if((g=s(this,_e).createMarkers)!=null&&g.destination&&j(this,El,gm).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),l){p();return}s(this,yo).mapObjects.forEach(v=>{v.processFloorChange(v.currentFloorId)}),p()}),cancel:()=>{l=!0}}),s(this,fn).promise}clear(){s(this,dn).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),s(this,dn).clear(),s(this,xr).forEach(({path:t,entityIds:e})=>{s(this,xr).delete(t.id),e.forEach(i=>s(this,xr).delete(i)),this.currentMap.Paths.remove(e)}),s(this,fn)&&(s(this,fn).cancel(),P(this,fn,void 0)),P(this,st,[]),s(this,mn).clear(),s(this,Da).clear(),P(this,Pi,void 0),s(this,hn).off("click",s(this,hp)),s(this,yo).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};dn=new WeakMap,hn=new WeakMap,yo=new WeakMap,_e=new WeakMap,dp=new WeakMap,fn=new WeakMap,st=new WeakMap,Pi=new WeakMap,xr=new WeakMap,mn=new WeakMap,Da=new WeakMap,vm=new WeakSet,aM=u(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),wl=new WeakSet,ym=u(function(t){P(this,Pi,t),s(this,st).forEach(e=>{let i=s(this,mn).get(e);if(i){let n=s(this,xr).get(i.id),o=n.path.id===s(this,Pi).id?{...s(this,_e).pathOptions,altitude:.05}:{...s(this,_e).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,hn).setState(a,o)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),El=new WeakSet,gm=u(function(t,e,i){var n,o,a,l,c;if(e==="connection"&&i){let p=i.action.type==="ExitConnection"?s(this,_e).markerOptions.departureColor:s(this,_e).markerOptions.destinationColor,h;if(typeof((n=s(this,_e).createMarkers)==null?void 0:n.connection)=="function"){let g=s(this,_e).createMarkers.connection(i);s(this,hn).setState(g.id.toString(),{options:{interactive:!0}}),h={id:g.id,type:"marker"}}else h=this.currentMap.Markers.add(i.coordinate,nM({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 y=this.currentMap.Markers.getContentEl(h.id.toString());if(!y)throw new Error("marker component should exist");s(this,dn).set(h.id,{instruction:i,marker:new pn(h.id.toString(),y,i.coordinate)})}else{let p=e==="departure"?s(this,_e).markerOptions.departureColor:s(this,_e).markerOptions.destinationColor,h;typeof((l=s(this,_e).createMarkers)==null?void 0:l.departure)=="function"&&e==="departure"?h={id:s(this,_e).createMarkers.departure(i).id,type:"marker"}:typeof((c=s(this,_e).createMarkers)==null?void 0:c.destination)=="function"&&e==="destination"?h={id:s(this,_e).createMarkers.destination(i).id,type:"marker"}:h=this.currentMap.Markers.add(t,iM({type:e,color:p}),{anchor:"top",rank:"always-visible"}),s(this,dn).set(h.id,void 0)}},"#addMarker"),bm=new WeakSet,sM=u(function(t,e){t.filter(n=>j(this,vm,aM).call(this,n.action)).forEach(n=>{j(this,El,gm).call(this,n.coordinate,e,n)})},"#addMarkers"),hp=new WeakMap,u(gb,"Navigation");var pp=gb;m();m();m();var EF=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>']]),DF=/<svg([^>]*)>/g;function lM(r,t,e){let i=EF.get(r);return i?i.replace(DF,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}u(lM,"getStyledIcon");var _a,Dl,fp,vb,Cm,cM,Sm,uM,mp,bb,Tm,pM,xb=class xb{constructor(t,e){S(this,fp);S(this,Cm);S(this,Sm);S(this,mp);S(this,Tm);S(this,_a,void 0);S(this,Dl,void 0);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});P(this,_a,t),P(this,Dl,e)}auto(){let t=s(this,Dl)[Object.keys(s(this,Dl))[0]];[...t.getByType("connection"),...t.getByType("point-of-interest"),...t.getByType("space")].forEach(e=>{if(e.__type==="connection")e.coordinates.forEach(i=>{let n=e.name||e.externalId;n&&s(this,_a).Labels.add(i,n,j(this,fp,vb).call(this,e))});else{e.__type==="space"&&e.name!==""&&s(this,_a).updateState(e,{interactive:!0,hoverColor:"#F0F0F0"});let i=e.name||e.externalId;i&&s(this,_a).Labels.add(e,i,j(this,fp,vb).call(this,e))}})}};_a=new WeakMap,Dl=new WeakMap,fp=new WeakSet,vb=u(function(t){let e=lM(j(this,Cm,cM).call(this,t),"white",12);return{appearance:{text:{foregroundColor:j(this,mp,bb).call(this,t)},marker:{foregroundColor:{active:j(this,mp,bb).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:j(this,Tm,pM).call(this,t)}},"#generatLabelAppearance"),Cm=new WeakSet,cM=u(function(t){return t.__type==="connection"?j(this,Sm,uM).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),Sm=new WeakSet,uM=u(function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},"#attemptIconNameForConnection"),mp=new WeakSet,bb=u(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),Tm=new WeakSet,pM=u(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),u(xb,"Labels");var xm=xb;var Cb=class Cb{constructor(t,e){d(this,"Labels");d(this,"auto",u(()=>{this.Labels.auto()},"auto"));this.Labels=new xm(t,e)}};u(Cb,"DefaultTheme");var Mm=Cb;m();var se,Pm,dM,Sb=class Sb{constructor(t){S(this,Pm);S(this,se,void 0);d(this,"setMinPitch",u(t=>{s(this,se).camera.setMinPitch(t)},"setMinPitch"));d(this,"setMaxPitch",u(t=>{s(this,se).camera.setMaxPitch(t)},"setMaxPitch"));d(this,"setMinZoomLevel",u(t=>{s(this,se).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",u(t=>{s(this,se).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));P(this,se,t)}setScreenOffsets(t){s(this,se).camera.setInsetPadding(t)}get screenOffsets(){return s(this,se).camera.insetsPadding}get panMode(){return s(this,se).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&s(this,se).camera.setPanMode(t)}focusOn(t,e){var o,a,l;let i=[],n=Array.isArray(t)&&!uy(t)?t:[t];for(let c of n)if(c!=null)if(li.is(c)){let p;for(p of c.coordinates)if(p.floorId!=null){let h=s(this,se).getBoundingArea(p.floorId);h&&i.push([p.longitude,p.latitude,(o=h[0][2])!=null?o:s(this,se).camera.elevation])}else i.push([p.longitude,p.latitude,s(this,se).camera.elevation])}else if(oi.is(c)||ot.is(c)||vt.is(c)||ji.is(c)){let p=s(this,se).getBoundingArea(c.id),h=ot.is(c)||vt.is(c)?s(this,se).getBoundingArea(c.floor.id):s(this,se).getBoundingArea(c.id);p&&(h?i.push(...p.map(y=>{var g;return[y[0],y[1],(g=h[0][2])!=null?g:s(this,se).camera.elevation]})):i.push(...p))}else if(ne.is(c)||Pr.is(c)||Er.is(c)||Wi.is(c)||$t.is(c)){let p=Je(c);if(p)if(p.floorId!=null){let h=s(this,se).getBoundingArea(p.floorId);h&&i.push([p.longitude,p.latitude,(a=h[0][2])!=null?a:s(this,se).camera.elevation])}else i.push([p.longitude,p.latitude,s(this,se).camera.elevation])}else if(fr.is(c)||Rt.is(c))for(let p of c.spaces){let h=s(this,se).getBoundingArea(p.id);h&&i.push(...h)}else uy(c)&&i.push(c);return((l=e==null?void 0:e.axisAlignedPadding)==null?void 0:l.vertical)!==void 0&&(i=j(this,Pm,dM).call(this,i,e.axisAlignedPadding)),s(this,se).camera.focusOn(i,{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:e==null?void 0:e.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing})}animateTo(t,e){var p;let{center:i,zoomLevel:n,bearing:o,pitch:a}=t,l=i!=null?i:this.center,c=[l.longitude,l.latitude,this.elevation];return s(this,se).camera.animateTo({center:c,zoomLevel:n!=null?n:this.zoomLevel,bearing:o!=null?o:this.bearing,pitch:a!=null?a:this.pitch,duration:(p=e==null?void 0:e.duration)!=null?p: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,se).camera.setCenter(a),s(this,se).camera.setZoomLevel(i),s(this,se).camera.setBearing(n),s(this,se).camera.setPitch(o)}get center(){let t=s(this,se).camera.center;return new ne(t[1],t[0],void 0)}setAutoMinZoomLevel(t){s(this,se).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return s(this,se).camera.autoMinZoomLevel}get zoomLevel(){return s(this,se).camera.zoomLevel}get pitch(){return s(this,se).camera.pitch}get minPitch(){return s(this,se).camera.minPitch}get maxPitch(){return s(this,se).camera.maxPitch}get bearing(){let t=s(this,se).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return s(this,se).camera.minZoomLevel}get maxZoomLevel(){return s(this,se).camera.maxZoomLevel}setElevation(t){s(this,se).camera.setElevation(t)}get elevation(){return s(this,se).camera.elevation}animateElevation(t,e){return s(this,se).camera.animateElevation(t,e)}};se=new WeakMap,Pm=new WeakSet,dM=u(function(t,e){var o;let i=(o=e==null?void 0:e.vertical)!=null?o:0;return[t.map(a=>{var l;return[a[0],a[1],((l=a[2])!=null?l:0)-i]}),t.map(a=>{var l;return[a[0],a[1],(l=a[2])!=null?l:0]}),t.map(a=>{var l;return[a[0],a[1],((l=a[2])!=null?l:0)+i]})].flat()},"#expandCoordinateCloud"),u(Sb,"Camera");var yp=Sb;m();var _l,Tb=class Tb{constructor({currentMapGetter:t}){S(this,_l,void 0);P(this,_l,t)}get currentMap(){return s(this,_l).call(this)}async getCurrentSceneGLTF(t){let e=s(this,_l).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(L.error("There is no map to export. Please load a map first."),new Blob)}};_l=new WeakMap,u(Tb,"Exporter");var gp=Tb;m();var Ii,bp,Mb=class Mb{constructor({currentMapGetter:t}){S(this,Ii,new Map);S(this,bp,void 0);P(this,bp,t)}get currentMap(){return s(this,bp).call(this)}getById(t){return s(this,Ii).get(t)}add(t,e,i){let n=Je(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Labels.add(wi(n),e,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium"}),l=new po(a.id.toString(),e,t);return s(this,Ii).set(l.id,{label:l,entityId:l.id}),l}all(){var e;let t=[];return(e=this.currentMap)==null||e.Labels.all({onCreate:(i,n,o)=>{let a=new po(i.toString(),n,o);s(this,Ii).set(a.id,{label:a,entityId:a.id}),t.push(a)}}),t}remove(t){var i;let e=s(this,Ii).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e.entityId),s(this,Ii).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Ii).forEach(({label:e})=>{this.remove(e),t.push(e),s(this,Ii).delete(e.id.toString())}),t}};Ii=new WeakMap,bp=new WeakMap,u(Mb,"Labels");var vp=Mb;m();m();var hM={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},fM={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},mM=.5,wb=class wb{constructor(t,e=new Map){d(this,"containerId");d(this,"layers");this.containerId=t,this.layers=e}};u(wb,"Layer");var Ol=wb,Eb=class Eb{constructor(t,e,i,n,o,a,l){d(this,"id");d(this,"name");d(this,"elevation");d(this,"containerId");d(this,"externalId");d(this,"metadata");d(this,"shortName");d(this,"subtitle");d(this,"loaded",!1);d(this,"styleMap",{});d(this,"obstructions");d(this,"entrances");d(this,"spaces");d(this,"floorImages");d(this,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"footprint");d(this,"floorStackId");d(this,"multiFloorView");d(this,"load",u(()=>{var n,o,a,l;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Bn,"-").concat(this.id),{},this.id);this.layers.set(Bn,new Ol(t.id.toString()));let e=this.renderer.addGroupContainer("".concat(si,"-").concat(this.id),{},this.id);this.layers.set(si,new Ol(e.id.toString()));let i=this.renderer.addGroupContainer("".concat(Ue,"-").concat(this.id),{},this.id);if(this.layers.set(Ue,new Ol(i.id.toString())),this.spaces!=null&&this.spaces.features.length>0){let c=this.spaces.features.filter(g=>{var v;return g.geometry.type==="Polygon"&&((v=g.properties.kind)==null?void 0:v.toLowerCase())!=="void"}),p=Ib(c,this.styleMap),h=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),y=0;for(let[g,v]of p){let C=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(y),{features:v},xp(g,this.options),h);y++;let M=h.id.toString();this.layers.get(Ue).layers.set(g.id||M,C.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let c=this.obstructions.features.filter(x=>x.geometry.type==="Polygon"&&x.properties.kind==="object"),p=Ib(c,this.styleMap),h=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),y=0;for(let[x,I]of p){let w=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(y),{features:I},xp(x,this.options),h);y++;let E=h.id.toString();this.layers.get(Ue).layers.set(x.id||E,w.id.toString())}let g=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind==="Wall"&&x.properties.footprintComponent===!1),v=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind==="Wall"&&x.properties.footprintComponent===!0),C=this.entrances,M=hM,b=hM;if(g!=null&&g.length>0){let x=this.styleMap[(n=g[0].properties)==null?void 0:n.id];x!=null&&(M={...x}),b=M;let{walls:I,entrances:w}=Pb(g,(C==null?void 0:C.features)||[]),E=Math.max(M.height-.11,mM),_={...fM,height:E},O=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),w,_,i);this.layers.get(Ue).layers.set(us,O.id.toString());let F=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[I]},xp(M,this.options),i);this.layers.get(Ue).layers.set(Fn,F.id.toString())}if(v!=null&&v.length>0){let x=this.styleMap[(o=v[0].properties)==null?void 0:o.id];x!=null&&(b={...x,id:ai});let{walls:I,entrances:w}=Pb(v,(C==null?void 0:C.features)||[]),E=Math.max(b.height-.11,mM),_={...fM,height:E},O=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),w,_,i);this.layers.get(Ue).layers.set(ps,O.id.toString());let F=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[I]},xp(b,this.options),i);this.layers.get(Ue).layers.set(ai,F.id.toString())}}if(this.floorImages!=null){let c=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let p of this.floorImages.features||[])"anchorId"in p.properties||"anchorId"in p.properties&&((a=p.properties)==null?void 0:a.anchorId)==null||this.renderer.addImage(ue(),p,{url:p.properties.path,flipImageToFaceCamera:!0},c);this.layers.set(S3,new Ol(c.id.toString()))}return(l=this.multiFloorView)!=null&&l.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var p,h,y;this.id=e.id,this.options=o;let c=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);if(this.containerId=c.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&&l!=null&&(this.styleMap=l,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(p=a.floorImages)==null?void 0:p[this.id],this.footprint=(h=a["floor.geojson"])==null?void 0:h.features.find(g=>g.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=n,this.footprint&&(n!=null&&n.enabled)&&this.obstructions!=null&&this.obstructions.features.length>0){let g=this.obstructions.features.filter(v=>v.geometry.type==="LineString"&&v.properties.kind==="Wall"&&v.properties.footprintComponent===!0);if(g!=null&&g.length>0){let v=this.styleMap[(y=g[0].properties)==null?void 0:y.id],C=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...v,height:-n.floorHeight,altitude:n.floorHeight/2,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":v.color},this.id);this.layers.set(ds,{containerId:C.id.toString(),layers:new Map})}}}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};u(Eb,"FloorObject");var Cp=Eb;m();var yM=50,_F=1e3,je,Xr,Ll,Ei,Yr,_t,Tp,Al,Oa,Mp,Db,La,Pp,Ip,wp,Ep,yn,Im,gM,Dp,go,_p,_b,Ob=class Ob extends q{constructor({currentMapGetter:e}){super();S(this,Mp);S(this,Im);S(this,_p);S(this,je,void 0);S(this,Xr,yM);S(this,Ll,0);S(this,Ei,void 0);S(this,Yr,!1);S(this,_t,[]);S(this,Tp,0);S(this,Al,!1);S(this,Oa,"collapsed");d(this,"expandedFactor",0);S(this,La,"all-floors");S(this,Pp,u(()=>{let e=s(this,je).call(this);if(s(this,Tp)===this.expandedFactor||e==null||!s(this,Yr))return;P(this,Tp,this.expandedFactor);let i=ri(this.expandedFactor,0,1,0,s(this,Xr)),o=ri(this.expandedFactor,0,.1,0,1)===0;s(this,_t).forEach((a,l)=>{e.renderer.setState(a.containerId,{visible:o?a.id===e.currentFloorId:!0,altitude:i*l})}),this.expandedFactor===0?(P(this,Yr,!1),e.renderer.camera.setPanMode("default"),s(this,go)&&s(this,go).call(this)):this.expandedFactor===1&&(P(this,Yr,!1),s(this,go)&&s(this,go).call(this))},"#handlePreRender"));S(this,Ip,u(()=>{var e,i,n;this.expanded&&P(this,Ll,(i=(e=s(this,je).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(n=s(this,je).call(this))==null||n.renderer.on("user-interaction-end",s(this,Ep))},"#handleUserInteractionStart"));S(this,wp,u(()=>{var i;let e=s(this,je).call(this);if(e!=null&&this.expanded&&s(this,Al)&&!s(this,Yr)){let n=[1/0,e.currentFloorId];for(let o=0;o<s(this,_t).length;o++){let a=s(this,_t)[o],l=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-o*s(this,Xr));l<s(this,Xr)/3&&(n[0]=l,n[1]=a.id)}n[1]!==e.currentFloorId&&(e.currentFloorId=n[1],s(this,_t).forEach(o=>{e.renderer.setState(o.containerId,{visible:s(this,La)==="all-floors"?!0:e.currentFloor.id===o.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId}))}},"#determineCurrentMapBasedOnElevation"));S(this,Ep,u(()=>{var i,n;let e=s(this,je).call(this);if(this.expanded&&e&&s(this,Ll)!==((i=e.renderer.camera.elevation)!=null?i:0)){let o=[1/0,e.currentFloorId,0];for(let a=0;a<s(this,_t).length;a++){let l=s(this,_t)[a],c=Math.abs(((n=e.renderer.camera.elevation)!=null?n:0)-a*s(this,Xr));c<o[0]&&(o[0]=c,o[1]=l.id,o[2]=a*s(this,Xr))}s(this,Al)&&j(this,Im,gM).call(this,o[2]),P(this,Ll,0),e.renderer.off("user-interaction-end",s(this,Ep))}},"#handleUserInteractionEnd"));S(this,yn,null);S(this,Dp,null);S(this,go,void 0);P(this,je,e);let i=s(this,je).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",s(this,Ip)),i.renderer.on("camera-change",s(this,wp)),i.renderer.on("pre-render",s(this,Pp)))}get state(){return s(this,Oa)}get expanded(){return s(this,Oa)!=="collapsed"}get gapBelowFloors(){return s(this,Xr)}get includedFloors(){var e;return(e=s(this,Mp,Db))!=null&&e.api.mapData?s(this,_t).map(i=>{var n,o;return(o=(n=s(this,Mp,Db))==null?void 0:n.api.mapData)==null?void 0:o.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return s(this,La)}setFloorVisiblityMode(e){P(this,La,e);let i=s(this,je).call(this);i!=null&&s(this,_t).forEach(n=>{i.renderer.setState(n.containerId,{visible:s(this,La)==="all-floors"?!0:i.currentFloor.id===n.id})})}changeFloorOnElevationChanges(e){P(this,Al,e)}async expand(e){var n,o,a;let i=s(this,je).call(this);if(i!=null)return P(this,Xr,(n=e==null?void 0:e.distanceBetweenFloors)!=null?n:yM),P(this,_t,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(l=>i.floorsById.get(l.id)).filter(Boolean):i.currentFloorStack.floorObjects),s(this,_t).sort((l,c)=>l.elevation-c.elevation),s(this,_t).length<=1||this.expanded===!0?Promise.resolve():(P(this,Yr,!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),j(this,_p,_b).call(this,"expand",e).then(()=>{P(this,Oa,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{P(this,Yr,!1)}))}async collapse(e){let i=s(this,je).call(this);if(i!=null)return this.expanded===!0?(P(this,Yr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),j(this,_p,_b).call(this,"collapse",e).then(()=>{P(this,Oa,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{P(this,Yr,!1)})):Promise.resolve()}destroy(){let e=s(this,je).call(this);e!=null&&(e.renderer.off("user-interaction-start",s(this,Ip)),e.renderer.off("camera-change",s(this,wp)),e.renderer.off("pre-render",s(this,Pp)))}};je=new WeakMap,Xr=new WeakMap,Ll=new WeakMap,Ei=new WeakMap,Yr=new WeakMap,_t=new WeakMap,Tp=new WeakMap,Al=new WeakMap,Oa=new WeakMap,Mp=new WeakSet,Db=u(function(){return s(this,je).call(this)},"#currentMap"),La=new WeakMap,Pp=new WeakMap,Ip=new WeakMap,wp=new WeakMap,Ep=new WeakMap,yn=new WeakMap,Im=new WeakSet,gM=u(function(e){var n,o,a;s(this,yn)&&s(this,yn).stop();let i=s(this,je).call(this);i!=null&&(P(this,yn,new ht({elevation:(n=i.renderer.camera.elevation)!=null?n:0}).to({elevation:e},150).easing(Ge.Quadratic.Out).onComplete(()=>{var l;s(this,yn)&&((l=s(this,je).call(this))==null||l.renderer.getTweenGroup().remove(s(this,yn)))}).onUpdate(({elevation:l})=>{i.renderer.camera.setElevation(l)}).start()),(o=s(this,je).call(this))==null||o.renderer.getTweenGroup().add(s(this,yn)),(a=s(this,je).call(this))==null||a.renderer.render())},"#animateElevationTo"),Dp=new WeakMap,go=new WeakMap,_p=new WeakSet,_b=u(function(e,i){var l,c,p,h;s(this,Ei)&&s(this,Ei).stop();let n=s(this,je).call(this);if(n==null)return Promise.reject(new Error("No current map"));let o=s(this,_t).indexOf(n.currentFloor)*s(this,Xr),a=(l=n.renderer.camera.elevation)!=null?l:0;return P(this,Dp,new Promise(y=>{P(this,go,y)})),P(this,Ei,new ht({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(c=i==null?void 0:i.duration)!=null?c:_F).easing(cl[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:y})=>{this.expandedFactor=y,n.renderer.camera.setElevation(e==="expand"?o*y:a*y)}).onComplete(()=>{var y;s(this,Ei)&&((y=s(this,je).call(this))==null||y.renderer.getTweenGroup().remove(s(this,Ei)))}).start()),s(this,Ei).cameraAnimation=!0,(p=s(this,je).call(this))==null||p.renderer.getTweenGroup().add(s(this,Ei)),(h=s(this,je).call(this))==null||h.renderer.render(),s(this,Dp)},"#animate"),u(Ob,"StackedMaps");var Sp=Ob;m();var kl,Lb=class Lb{constructor(t,e,i,n){d(this,"id");d(this,"externalId");d(this,"name");d(this,"type");d(this,"floorIds");d(this,"defaultFloorId");d(this,"floorObjects",[]);d(this,"floorObjectsByElevation",new Map);d(this,"metadata");d(this,"footprint");d(this,"containerId");d(this,"facade");d(this,"renderer");S(this,kl,void 0);var a;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.footprint=t.footprint,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,kl)==null){this.floorObjects.length===0&&L.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),P(this,kl,t)}return s(this,kl)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){L.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(n=>{this.renderer.setState(n.spaceId,{visible:t})})}};kl=new WeakMap,u(Lb,"FloorStackObject");var Op=Lb;m();function vM(r,t,e){let i=[];for(let n of r){let o={floor:n,visible:!1,visibleLayers:[],expandFootprint:!1};n.id===t.id?(o.visible=!0,o.visibleLayers=[si,Ue,Bn],n.elevation<0&&(o.expandFootprint=!0,o.visibleLayers.push(ds))):e.includes(n.id)&&n.elevation<t.elevation?(o.visible=!0,o.visibleLayers=[ds,si,Ue],n.elevation<0&&(o.expandFootprint=!0)):t.elevation>0&&n.elevation<t.elevation&&n.elevation>=0&&(o.visible=!0,o.visibleLayers=[ds]),i.push(o)}return i}u(vM,"getVisiblityState");m();m();var OF=300,bM=17,ar,Aa,Ap,Fl,kp,ka,Ot,or,Fp,Ab,Bp,kb,Em,xM,Bl,wm,gn,Rp,Fb,Np,Bb,Rb=class Rb extends q{constructor(e,i,{currentMapGetter:n}){super();S(this,Ot);S(this,Fp);S(this,Bp);S(this,Em);S(this,Bl);S(this,Rp);S(this,Np);S(this,ar,void 0);S(this,Aa,!1);S(this,Ap,bM);S(this,Fl,{});S(this,kp,void 0);S(this,ka,void 0);S(this,gn,new Set);P(this,ar,e),P(this,kp,n),P(this,ka,i)}enable(e){var i;P(this,Ap,(i=e==null?void 0:e.minZoomLevel)!=null?i:bM),this.enabled||(s(this,ar).on("geometry-in-focus",n=>j(this,Rp,Fb).call(this,n)),j(this,Np,Bb).call(this,!0),P(this,Aa,!0))}disable(){P(this,Aa,!1),s(this,ar).off("geometry-in-focus",e=>j(this,Rp,Fb).call(this,e)),j(this,Np,Bb).call(this,!1)}get enabled(){return s(this,Aa)}setDefaultFloorForStack(e,i){s(this,Ot,or)==null&&L.throw("Current map does not exist.");let n=s(this,Ot,or).floorsById.get(i.id);if(n==null){L.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(n.floorStackId!==e.id){L.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}s(this,Fl)[e.id]=i.id}resetDefaultFloorForStack(e){delete s(this,Fl)[e.id]}};ar=new WeakMap,Aa=new WeakMap,Ap=new WeakMap,Fl=new WeakMap,kp=new WeakMap,ka=new WeakMap,Ot=new WeakSet,or=u(function(){return s(this,kp).call(this)},"#currentMap"),Fp=new WeakSet,Ab=u(function(e){var a;let i=s(this,Ot,or).floorStacksById.get(e);if(!i)return;let n=(a=s(this,Fl)[i.id])!=null?a:i.defaultFloor.id,o=s(this,Ot,or).floorsById.get(n);if(o)return o},"#getDefaultFloorForStack"),Bp=new WeakSet,kb=u(function(e){let i=s(this,Ot,or).floorStacksById.get(e);if(!i)return;let n=j(this,Fp,Ab).call(this,i.id);n&&s(this,Ot,or).setFloor(n.id)},"#setFloorStack"),Em=new WeakSet,xM=u(function(e){var i;return(i=s(this,ka).getMapDataInternal())==null?void 0:i.facadesBySpaceId[e]},"#getFacadeBySpaceId"),Bl=new WeakSet,wm=u(function(e,i,n=OF){var c;let o=(c=s(this,ka).getMapDataInternal())==null?void 0:c.getById("facade",e);if(!o)return;let a=s(this,Ot,or).floorStacksById.get(o.floorStack.id);if(!a)return;if(i==="open"){let p=j(this,Fp,Ab).call(this,o.floorStack.id);if(!p)return;p.setVisible(!0)}let l=new ht({opacity:i==="open"?1:0}).easing(Ge.Quadratic.In).to({opacity:i==="open"?0:1},n).onUpdate(({opacity:p})=>{o.spaces.forEach(h=>{let y=s(this,ar).getState(h.id);y&&s(this,ar).setState(y,{opacity:p})})}).onComplete(()=>{s(this,ar).getTweenGroup().remove(l),i==="close"&&a.floorObjects.forEach(p=>{p.setVisible(!1)})});l.start(),s(this,ar).getTweenGroup().add(l)},"#animate"),gn=new WeakMap,Rp=new WeakSet,Fb=u(function(e){if(!s(this,Aa)||e.length===0)return;if(s(this,ar).camera.zoomLevel<s(this,Ap)){for(let l of s(this,gn))j(this,Bl,wm).call(this,l,"close");s(this,gn).clear(),s(this,Ot,or).outdoorFloorStacks.size>0&&!s(this,Ot,or).outdoorFloorStacks.has(s(this,Ot,or).currentFloorStackId)&&(j(this,Bp,kb).call(this,s(this,Ot,or).outdoorFloorStacks.values().next().value),this.publish("focus-change",{facades:[],spaces:[]}));return}let i=-1/0,n,o=!1,a=new Set;e.forEach((l,c)=>{let p=j(this,Em,xM).call(this,l);if(!p)return;let h=(e.length-c)/e.length,g=(p.id===(n==null?void 0:n.id)?i:0)+h+1;g>i&&(i=g,n=p),s(this,gn).has(p.id)||(j(this,Bl,wm).call(this,p.id,"open"),o=!0),a.add(p.id)});for(let l of s(this,gn))a.has(l)||(j(this,Bl,wm).call(this,l,"close"),o=!0);n&&s(this,Ot,or).currentFloorStackId!==n.floorStack.id&&(j(this,Bp,kb).call(this,n.floorStack.id),o=!0),P(this,gn,a),o&&this.publish("focus-change",{facades:Array.from(s(this,gn)),spaces:e})},"#handleEntitiesInFocus"),Np=new WeakSet,Bb=u(function(e){var i;(i=s(this,ka).getMapDataInternal())==null||i.facades.forEach(n=>{n.spaces.forEach(o=>{let a=s(this,ar).getState(o.id);a&&s(this,ar).setState(a,{focusable:e,renderOrder:e?1:0})})})},"#setAllFacadesFocusable"),u(Rb,"DynamicFocus");var Lp=Rb;var LF=5,AF={linear:Ge.Linear.None,easeIn:Ge.Quadratic.In,easeOut:Ge.Quadratic.Out,easeInOut:Ge.Quadratic.InOut},sr,Gb=class Gb extends q{constructor(e,i,n,o){var p,h,y,g;super();d(this,"floorStacksById",new Map);d(this,"floorsById",new Map);d(this,"currentFloorId","");d(this,"currentFloorStackId","");d(this,"outdoorFloorStacks",new Set);d(this,"id");d(this,"renderer");d(this,"api");d(this,"mvf");d(this,"styleMap");d(this,"StackedMaps");d(this,"DynamicFocus");d(this,"animations",new Map);d(this,"Models",{add:(e,i,n)=>{let{floorId:o,...a}=n,l=o?this.floorsById.get(o):this.currentFloor,c=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(p=>{var h;return{type:"Feature",properties:{id:ue(),rotation:(h=p.rotation)==null?void 0:h.map(y=>y*(Math.PI/180)),scale:p.scale,interactive:p.interactive},geometry:{type:"Point",coordinates:wi(p.target)}}})},{url:a.url},l.id);if(c==null)throw new Error("error creating model");return this.renderer.getState(c).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});d(this,"Images",{add:(e,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...l}=n,c=o?this.floorsById.get(o):this.currentFloor,p={type:"Feature",properties:l,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(ue(),p,{url:i,flipImageToFaceCamera:a!=null?a:!1},c.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});d(this,"Markers",{add:(e,i,n)=>{var a;let o=e.floorId?this.floorsById.get(e.floorId):this.currentFloor;return this.renderer.addMarker2D(wi(e),i,n,(a=o==null?void 0:o.layers.get(si))==null?void 0:a.containerId)},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(e,i,n)=>{var l;let o=this.renderer.getState(e),a=n?this.floorsById.get(n):this.currentFloor;if(!o){L.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(o.type!=="marker"){L.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:(l=a==null?void 0:a.layers.get(si))==null?void 0:l.containerId})},animateTo:(e,i,n,o)=>{let a=this.renderer.getState(e),l=n?this.floorsById.get(n):this.currentFloor;if(!a)return L.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(a.type!=="marker")return L.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(e);let p=new ht({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},c.duration).easing(AF[c.easing]).onUpdate(({lon:h,lat:y})=>{var v;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let C=(v=l==null?void 0:l.layers.get(si))==null?void 0:v.containerId;C&&this.Markers.setPosition(e,[h,y],C)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(e,p),Nb(p).then(()=>{this.animations.delete(e)})}});d(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});d(this,"Shapes",{add:(e,i,n)=>{let o=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,a=ue();return this.renderer.addGeometryGroup(a,e,i,o.id),a},remove:e=>(this.renderer.remove(e.id),e.id)});d(this,"Text3D",{label:(e,i,n)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){L.warn("Enterprise mode is not enabled, skipping label creation");return}let o=CM(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 L.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let n=[];return i.getByType("space").forEach(a=>{var l,c;if(a.locations[0]){let p=CM(this.renderer,a,(c=(l=a.locations[0])==null?void 0:l.name)!=null?c:a.name,e);p&&n.push({textInfo:p,target:a})}}),n},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){L.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});d(this,"Labels",{all:({onCreate:e})=>{for(let i of Object.entries(this.mvf.space)){let[n,o]=i;o&&o.features.forEach(a=>{var g,v,C,M;let l=(g=this.api.getMapData())==null?void 0:g.getById("space",a.properties.id);if(!l)return;let c=(v=this.styleMap[a.properties.id])==null?void 0:v.showImage,p=(C=a.properties.details)==null?void 0:C.images,h={};c&&p&&p.length>0&&(h={marker:{icon:p[0].url}});let y=n?this.floorsById.get(n):this.currentFloor;if(a.properties.center&&a.properties.externalId!==""){let b=this.renderer.addLabel2D(a.properties.center,a.properties.externalId,{id:a.properties.id+"-label",appearance:h},(M=y.layers.get(Bn))==null?void 0:M.containerId);b&&e(b.id,a.properties.externalId,l)}})}},add:(e,i,n={})=>{var p;let{floorId:o,...a}=n,l=o?this.floorsById.get(o):this.currentFloor,c=this.renderer.addLabel2D(e,i,a,(p=l.layers.get(Bn))==null?void 0:p.containerId);if(!c)throw new Error("label creating failed");return c},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});d(this,"Paths",{add:(e,i)=>{var p;let n=[],o=e[0].floorId||"root",a=0;for(let h of e){let{floorId:y="root",latitude:g,longitude:v}=h;y!==o&&(a++,o=y),n[a]==null&&n.push({floorId:y,coordinates:[]}),n[a].coordinates.push([v,g])}let l=n.reduce((h,{floorId:y,coordinates:g},v)=>{if(v!==0){let M=n[v-1],b=g[0],x=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:M.floorId},geometry:{type:"Point",coordinates:M.coordinates[M.coordinates.length-1]}},{type:"Feature",properties:{parentId:y},geometry:{type:"Point",coordinates:b}}]},i,this.id);x&&h.push(x)}let C=this.renderer.addPath({type:"FeatureCollection",features:g.map(M=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:M}}))},i,y);return C&&h.push(C),h},[]),c=new ht({fraction:0}).to({fraction:1},(p=i==null?void 0:i.drawDuration)!=null?p:1e3).onUpdate(({fraction:h})=>{l.forEach(y=>{this.renderer.setState(y.id,{completeFraction:h})})}).start();return this.renderer.getTweenGroup().add(c),this.renderer.render(),this.animations.set(l[0].id.toString(),c),{paths:l,animation:Nb(c).then(()=>{this.animations.delete(l[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});S(this,sr,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=o.core,this.api=o,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.StackedMaps=new Sp({currentMapGetter:()=>this}),this.DynamicFocus=new Lp(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(p=i==null?void 0:i.mvf)!=null?p:{};let a=SM(this.mvf["styles.json"]||{});if(this.styleMap=a,P(this,sr,{enabled:!1,floorHeight:LF,updateCameraElevationOnFloorChange:!0,...n==null?void 0:n.multiFloorView}),!i){this.id!=="outdoors-container"&&L.warn("Map (".concat(this.id,") created with no data."));let v=new Op({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(v.id,v),this.currentFloorStackId=v.id;let C=new Cp(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,s(this,sr),n!=null?n:{});v.addFloor(C),this.floorsById.set(C.id,C),this.setFloor(C.id);return}let l=i.getMVFFeatureByType("floor-stack");(l==null||l.length===0)&&L.throw("MVF does not contain any Floor Stacks.");for(let v of l){let C=new Op(v,this.id,this.renderer,(h=this.mvf.facade)==null?void 0:h[v.id]);if(C.floorIds.length!==0){for(let M of C.floorIds){let b=i.getMVFFeatureById("floor",M);if(b!=null){let x=this.mvf.space[b.id],I=this.mvf.obstruction[b.id];if((x==null||x.features.length===0)&&(I==null||I.features.length===0))continue;let w=new Cp(C.id,b,this.renderer,s(this,sr),n!=null?n:{},this.mvf,a);C.addFloor(w),this.floorsById.set(w.id,w)}}this.floorStacksById.set(v.id,C),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(i.facadesBySpaceId)){let C=i.getById("space",v);C&&(this.outdoorFloorStacks.add(C.floor.floorStack.id),(y=this.floorsById.get(C.floor.id))==null||y.setVisible(!0))}let c=(g=this.mvf.enterprise)==null?void 0:g.venue.defaultMap;if(n!=null&&n.initialFloor){let v=pc(n.initialFloor);v&&this.floorsById.has(v)?c=v:L.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.setFloor(c)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);return e||L.throw('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found')),e}setFloorStack(e){if(this.currentFloorStackId===e)return;let i=this.floorStacksById.get(e);if(i==null){L.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){L.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);return e||L.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var o,a,l;let i=this.floorsById.get(e),n=this.floorStacksById.get(this.currentFloorStackId);i&&n&&(!((o=s(this,sr))!=null&&o.enabled)||i.floorStackId!==(n==null?void 0:n.id)?this.outdoorFloorStacks.has(n.id)||n==null||n.floorObjects.forEach(c=>{c.id!==e&&c.setVisible(!1)}):(vM(this.currentFloorStack.floorObjects,i,((l=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:l.map(p=>p.id))||[]).forEach(p=>{var h,y,g,v;p.floor.setVisible(p.visible),Array.from(p.floor.layers.keys()).forEach(C=>{var b;let M=(b=p.floor.layers.get(C))==null?void 0:b.containerId;M&&this.renderer.setState(M,{visible:p.visibleLayers.includes(C)})}),p.expandFootprint?(this.renderer.setState("Footprint-".concat(p.floor.id),{height:Math.abs(p.floor.elevation)*s(this,sr).floorHeight,altitude:-s(this,sr).floorHeight/2}),(y=(h=this.api)==null?void 0:h.Outdoor)==null||y.setOpacity(.2)):(this.renderer.setState("Footprint-".concat(p.floor.id),{height:-s(this,sr).floorHeight,altitude:s(this,sr).floorHeight/2}),i.elevation>=0&&((v=(g=this.api)==null?void 0:g.Outdoor)==null||v.setOpacity("initial")))}),s(this,sr).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*s(this,sr).floorHeight)))}setFloor(e,i){if(this.currentFloorId!==e){if(!this.floorsById.has(e)){L.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}if(this.publish("floor-change-start",{floorId:e}),this.DynamicFocus.enabled){let n=this.floorsById.get(e);if(!this.outdoorFloorStacks.has(this.currentFloorStack.id)&&(n==null?void 0:n.floorStackId)===this.currentFloorStack.id){let o=this.floorsById.get(this.currentFloorId);o==null||o.setVisible(!1)}}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};sr=new WeakMap,u(Gb,"GeojsonApiMapObject");var Gp=Gb;function CM(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}u(CM,"labelSpace");m();var Zr,jp,Vb=class Vb{constructor({currentMapGetter:t}){S(this,Zr,new Map);S(this,jp,void 0);P(this,jp,t)}get currentMap(){return s(this,jp).call(this)}getById(t){return s(this,Zr).get(t)}add(t,e,i){let n=Je(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Markers.add(n,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(a==null)throw new Error("error creating marker");let l=o.Markers.getContentEl(a.id.toString());if(!l)throw new Error("marker component should exist");let c=new pn(a.id.toString(),l,t);return s(this,Zr).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var i;let e=s(this,Zr).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),s(this,Zr).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Zr).forEach(({marker:e})=>{this.remove(e),t.push(e),s(this,Zr).delete(e.id.toString())}),t}setPosition(t,e){var a;let i=Je(e);if(!i){L.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){L.error("Cannot determine the current map.");return}let o=s(this,Zr).get(t.id);if(!o){L.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}n.Markers.setPosition(o.entityId,wi(i),(a=i.floorId)!=null?a:n.currentFloorId),o.marker.updateTarget(e)}animateTo(t,e,i){var l;let n=Je(e);if(!n)return L.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return L.error("Cannot determine the current map."),Promise.resolve();let a=s(this,Zr).get(t.id);return a?(a.marker.updateTarget(e),o.Markers.animateTo(a.entityId,wi(n),(l=n.floorId)!=null?l:o.currentFloorId,i)):(L.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Zr=new WeakMap,jp=new WeakMap,u(Vb,"Markers");var Vp=Vb;m();var vn,Up,jb=class jb{constructor({currentMapGetter:t}){S(this,vn,new Map);S(this,Up,void 0);P(this,Up,t)}get currentMap(){return s(this,Up).call(this)}getById(t){return s(this,vn).get(t)}add(t,e,i){let n=Je(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Images.add(wi(n),e,{...i,floorId:n.floorId});if(!a)throw new Error("image component should exist");let l=new op(a.id.toString(),e,t);return s(this,vn).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(t){var i;let e=s(this,vn).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),s(this,vn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,vn).forEach(({image:e})=>{this.remove(e),t.push(e),s(this,vn).delete(e.id.toString())}),t}};vn=new WeakMap,Up=new WeakMap,u(jb,"Images");var Hp=jb;m();var Di,Xp,Hb=class Hb{constructor({currentMapGetter:t}){S(this,Di,new Map);S(this,Xp,void 0);P(this,Xp,t)}get currentMap(){return s(this,Xp).call(this)}getById(t){return s(this,Di).get(t)}add(t,e){let i=Array.isArray(t)?t:[t],n=i.reduce((l,c)=>{var h;let p=Je(c.target);return p?(l.has(p.floorId)||l.set(p.floorId,[]),(h=l.get(p.floorId))==null||h.push({...c,target:p}),l):(L.error("Cannot determine coordinate from options."),l)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=[];return n.forEach((l,c)=>{let p=ue();o.Models.add(p,l,{...e,floorId:c}).forEach(({id:y})=>{let g=new lp(y.toString(),p);s(this,Di).set(g.id,{model:g,entityId:y.toString(),groupId:p}),a.push(g)})}),a}remove(t){var i;let e=s(this,Di).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),s(this,Di).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Di).forEach(({model:e})=>{var n;let i=s(this,Di).get(e.id);i&&(t.push(e),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),s(this,Di).delete(e.id.toString()))}),t}};Di=new WeakMap,Xp=new WeakMap,u(Hb,"Models");var Wp=Hb;m();var _i,Zp,Ub=class Ub{constructor({currentMapGetter:t}){S(this,_i,new Map);S(this,Zp,void 0);P(this,Zp,t)}get currentMap(){return s(this,Zp).call(this)}getById(t){return s(this,_i).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(l=>l.id.toString()),a=new Ea(ue(),n.animation,t);for(let l of o)s(this,_i).set(l,{path:a,entityIds:o});return s(this,_i).set(a.id,{path:a,entityIds:o}),a}remove(t){var i;let e=s(this,_i).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),s(this,_i).delete(t.id),e.entityIds.forEach(n=>s(this,_i).delete(n)))}removeAll(){let t=[];return s(this,_i).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};_i=new WeakMap,Zp=new WeakMap,u(Ub,"Paths");var Yp=Ub;m();var kM=$l(w0(),1);m();var Wb="#2266ff",kF="#808080",TM="#f5f5f5";var MM={radius:10,color:Wb,inactiveColor:kF,heading:{color:Wb,opacity:.7},accuracyRing:{color:Wb,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};m();var PM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var IM=u((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,l=new $r;l.moveTo(-n*Math.sin(r/2),n*Math.cos(r/2)-i);for(let c=0;c<a;c++)l.lineTo(-(o*Math.sin(r/2-r/a*c)),o*Math.cos(r/2-r/a*c)-i);for(let c=0;c<a;c++)l.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/a*c)),e*Math.cos(Math.PI/-2+Math.PI/a*c));return new Jr(l,{depth:.1,bevelEnabled:!1,UVGenerator:BF(t)})},"createSectorGeometry"),Xb=u((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 re(0,n)},"generateRadialUV"),BF=u(r=>({generateTopUV:(t,e,i,n,o)=>{let a=e[i*3],l=e[i*3+1],c=e[n*3],p=e[n*3+1],h=e[o*3],y=e[o*3+1];return[Xb(a,l,r),Xb(c,p,r),Xb(h,y,r)]},generateSideWallUV:()=>[new re(0,1),new re(0,1),new re(0,1),new re(0,1)]}),"radialUVGenerator");function wM(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}u(wM,"getPositionWithOverrides");function RF([r,t],[e,i],[n,o]){let a=e-r,l=i-t,c=a**2+l**2;if(c===0)return;let p=((n-r)*a+(o-t)*l)/c,h;p<=0?h=[r,t]:p>=1?h=[e,i]:h=[r+p*a,t+p*l];let y=wd([n,o],h);return{proportion:Math.max(0,Math.min(1,p)),intersection:h,distance:y}}u(RF,"getPointLineIntersection");function EM(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 l=r[a],c=r[a+1],p=RF(l,c,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}}u(EM,"findBlueDotOnPath");function DM(r,t){let e=new Kr({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=IM(Math.PI/6,n,i);new $a().load(PM,l=>{e.alphaMap=l,e.needsUpdate=!0});let a=new Te(o,e);return a.position.z=-.05,a.renderOrder=0,a}u(DM,"createHeadingCone");function _M(r,t){let e=new bd(1,1,.05,32),i=new Kr({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),n=new Te(e,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}u(_M,"createAccuracyRing");function OM(r){let t=new bd(.35,.35,.07,32),e=new Kr({transparent:!0,color:TM,depthTest:!1,depthWrite:!1}),i=new Te(t,e);i.renderOrder=2;let n=new bd(.35*.8,.35*.8,.01,32),o=new Kr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new Te(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}}u(OM,"createBlueDot");var FM=$l(LM(),1);var Fa,bn,lr,cr,xn,Ba,Ra,Na,Ye,Xt,zp,Cn,qp,$p,Jp,Kp,_m,Oi,Sn,Om,Ga,Qp,Li,Yb=class Yb extends q{constructor(e,i){super();this.core=e;this.geoJSONApi=i;S(this,Fa,null);d(this,"geometry");S(this,bn,void 0);S(this,lr,void 0);S(this,cr,void 0);S(this,xn,void 0);S(this,Ba,void 0);S(this,Ra,void 0);S(this,Na,void 0);S(this,Ye,MM);S(this,Xt,1);S(this,zp,void 0);S(this,Cn,void 0);d(this,"state","disabled");d(this,"following",!1);S(this,qp,u(e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)},"#getFloorByFloorId"));S(this,$p,u(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,qp).call(this,o.id):void 0}return i},"#getFloorByFloorLevel"));S(this,Jp,u(e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,n,o,a]=e.children;if(s(this,_m).call(this),n.scale.set(s(this,Xt),s(this,Xt),s(this,Xt)),n.position.z=.07/2*s(this,Xt),o.scale.set(s(this,Xt),s(this,Xt),s(this,Xt)),o.position.z=.07*s(this,Xt),this.state==="active"){o.material.color.set(s(this,Ye).color);let l=this.accuracy;l!=null?(i.visible=!0,s(this,Ra)&&s(this,Ra).stop(),P(this,Ra,new ht({scale:i.scale.x}).to({scale:l/2},150).onUpdate(({scale:p})=>{i.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(s(this,Ra))):i.visible=!1;let c=this.heading;if(c!=null){a.visible=!0,s(this,Na)&&s(this,Na).stop();let{start:p,end:h}=Ed(a.rotation.z,-ve.degToRad(c));P(this,Na,new ht({rotation:p}).to({rotation:h},150).onUpdate(({rotation:y})=>{a.rotation.z=y}).start()),this.core.getTweenGroup().add(s(this,Na)),a.scale.set(s(this,Xt),s(this,Xt),1)}else a.visible=!1}else this.state==="inactive"&&(o.material.color.set(s(this,Ye).inactiveColor),a.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));S(this,Kp,u(e=>{var a,l;let i;try{i=HF.parse(wM(e,s(this,lr)))}catch(c){s(this,Oi).call(this,"error"),L.error("BlueDot: Position parse failed",c instanceof D.ZodError?c.message:String(c)),this.publish("error");return}s(this,Ye).debug&&L.log("BlueDot: Parsed position",i),P(this,cr,i),s(this,Oi).call(this,"position-update"),s(this,xn)&&clearTimeout(s(this,xn)),typeof s(this,Ye).timeout=="number"&&s(this,Ye).timeout<1/0&&P(this,xn,setTimeout(()=>{s(this,Ye).debug&&L.log("BlueDot: Position timed out after ".concat(s(this,Ye).timeout,"ms")),s(this,Oi).call(this,"timeout"),this.core.render()},s(this,Ye).timeout)),(l=this.geoJSONApi.getMapDataInternal())==null||l.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("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:o}},{setup:c=>{let p=_M(s(this,Ye).accuracyRing.color,s(this,Ye).accuracyRing.opacity),{outerMesh:h,innerMesh:y}=OM(s(this,Ye).color),g=DM(s(this,Ye).heading.color,s(this,Ye).heading.opacity);c.add(p),p.visible=!1,c.add(h),c.add(y),c.add(g),g.visible=!1,s(this,Jp).call(this,c)},update:s(this,Jp)},{visible:!0},n);else{let c=this.core.getState(this.geometry);o=[c.position[0],c.position[1]]}s(this,Ba)&&s(this,Ba).stop(),P(this,Ba,new ht(o).to([i.longitude,i.latitude],1e3).easing(Ge.Cubic.Out).onUpdate(c=>{if(this.geometry){let p={position:[c[0],c[1]]};p.parent=n,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(s(this,Ba)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));d(this,"onPositionUpdate",u(e=>{var i,n,o,a,l;if(this.state!=="disabled"){try{jF.parse(e)}catch(c){s(this,Oi).call(this,"error"),L.error("BlueDot: Browser sent invalid position",c instanceof D.ZodError?c.message:String(c)),this.publish("error");return}P(this,bn,{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,$p).call(this,(l=e.coords)==null?void 0:l.floorLevel)}),s(this,Kp).call(this,s(this,bn))}},"onPositionUpdate"));d(this,"onPositionError",u(e=>{var i;switch(s(this,Oi).call(this,"error"),e.code){case e.PERMISSION_DENIED:L.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:L.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:L.error("Geolocation request timed out.",e);break;default:L.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)},"onPositionError"));S(this,_m,u(()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==s(this,zp)){P(this,zp,e);let n=(i=this.core.getMetresPerPixel())!=null?i:1;P(this,Xt,Math.max(s(this,Ye).radius/(.35/n),1))}},"#updateScale"));S(this,Oi,u(e=>{let i=VF[this.state].actions[e];if(i){switch(s(this,Ye).debug&&L.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(e)),i){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==i&&(this.publish("state-change",{state:i,action:e}),this.state=i)}else L.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))},"#transitionAction"));S(this,Sn,void 0);S(this,Om,u(()=>{if(s(this,Sn)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(n=>n.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(n=>n.floorId===this.geoJSONApi.currentFloor.id);P(this,Sn,(0,FM.default)(i.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,Sn)},"#getSimplifiedDirections"));S(this,Ga,u(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),s(this,Li)&&(this.off("position-update",s(this,Li)),P(this,Li,void 0)),this.following=!1,P(this,Sn,void 0),this.core.off("user-interaction-start",s(this,Ga)),this.geoJSONApi.currentMap.off("navigation-active-path-change",s(this,Qp)),this.publish("follow-change",{following:!1})},"#cancelFollow"));S(this,Qp,u(()=>{P(this,Sn,void 0)},"#pathChangeHandler"));S(this,Li,void 0);d(this,"follow",u((e,i)=>{var o,a,l,c;if(e===!1){s(this,Ga).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&L.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(o=i==null?void 0:i.zoomLevel)!=null?o:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(a=i==null?void 0:i.pitch)!=null?a:45,duration:(l=i==null?void 0:i.duration)!=null?l:1e3,easing:(c=i==null?void 0:i.easing)!=null?c:"ease-in-out"};this.following?s(this,Li)&&this.off("position-update",s(this,Li)):(this.following=!0,this.core.on("user-interaction-start",s(this,Ga)),this.geoJSONApi.currentMap.on("navigation-active-path-change",s(this,Qp))),P(this,Li,p=>{let{coordinate:h,heading:y,floor:g}=p;if(n.center=[h.longitude,h.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),P(this,Sn,void 0)),e==="position-and-heading")n.bearing=y!=null?y:void 0;else if(e==="position-and-path-direction"){let v=s(this,Om).call(this);if(v!=null){let C=EM(v,[h.longitude,h.latitude]);if(C!=null){let M=v[C.segmentIndex],b=v[C.segmentIndex+1];n.bearing=v3(M,b)}}}this.core.camera.animateTo(n)}),this.on("position-update",s(this,Li)),this.publish("follow-change",{following:!0,mode:e})},"follow"))}get heading(){var e;return(e=s(this,cr))==null?void 0:e.heading}get accuracy(){var e;return(e=s(this,cr))==null?void 0:e.accuracy}get coordinate(){var e,i;if(s(this,cr)!=null)return(s(this,Cn)==null||((e=this.floor)==null?void 0:e.id)!==s(this,Cn).floorId||s(this,cr).latitude!==s(this,Cn).latitude||s(this,cr).longitude!==s(this,Cn).longitude)&&P(this,Cn,new ne(s(this,cr).latitude,s(this,cr).longitude,(i=this.floor)==null?void 0:i.id)),s(this,Cn)}get floor(){var e;return(e=s(this,cr))==null?void 0:e.floor}enable(e){P(this,Ye,(0,kM.default)({},e,s(this,Ye))),s(this,Oi).call(this,"enable"),this.watchDevicePosition(s(this,Ye).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),s(this,xn)&&(clearTimeout(s(this,xn)),P(this,xn,void 0)),this.following&&s(this,Ga).call(this),this.watchDevicePosition(!1),P(this,cr,void 0),P(this,lr,void 0),s(this,Oi).call(this,"disable")}watchDevicePosition(e){if(s(this,Fa)&&(navigator.geolocation.clearWatch(s(this,Fa)),P(this,Fa,null)),s(this,bn)&&P(this,bn,void 0),e){if(this.state==="disabled"){L.warn("BlueDot must be enabled before watching browser position.");return}P(this,Fa,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var n,o;e==null?P(this,lr,void 0):"coords"in e?P(this,lr,Object.assign({},s(this,lr),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:s(this,$p).call(this,e.coords.floorLevel)})):(P(this,lr,Object.assign({},s(this,lr),e)),"floorOrFloorId"in e&&(s(this,lr).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?s(this,qp).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((n=s(this,lr))==null?void 0:n.latitude)!=null&&((o=s(this,lr))==null?void 0:o.longitude)!=null||s(this,bn)!=null)&&s(this,Kp).call(this,s(this,bn))}};Fa=new WeakMap,bn=new WeakMap,lr=new WeakMap,cr=new WeakMap,xn=new WeakMap,Ba=new WeakMap,Ra=new WeakMap,Na=new WeakMap,Ye=new WeakMap,Xt=new WeakMap,zp=new WeakMap,Cn=new WeakMap,qp=new WeakMap,$p=new WeakMap,Jp=new WeakMap,Kp=new WeakMap,_m=new WeakMap,Oi=new WeakMap,Sn=new WeakMap,Om=new WeakMap,Ga=new WeakMap,Qp=new WeakMap,Li=new WeakMap,u(Yb,"BlueDot");var Nl=Yb,VF={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"}}},jF=D.object({coords:D.object({latitude:D.number(),longitude:D.number(),accuracy:D.number(),altitude:D.number().optional().nullable(),altitudeAccuracy:D.number().optional().nullable(),heading:D.number().optional().nullable(),speed:D.number().optional().nullable(),floorLevel:D.number().optional().nullable()}),timestamp:D.number()}),HF=D.object({latitude:D.number(),longitude:D.number(),floor:D.custom().optional(),accuracy:D.number().optional(),heading:D.number().optional().nullable()});m();var Tn,td,Zb=class Zb{constructor({currentMapGetter:t}){S(this,Tn,new Map);S(this,td,void 0);P(this,td,t)}get currentMap(){return s(this,td).call(this)}getById(t){return s(this,Tn).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 fo(o);return s(this,Tn).set(a.id,a),a}remove(t){var i;s(this,Tn).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),s(this,Tn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Tn).forEach(e=>{this.remove(e),t.push(e.id),s(this,Tn).delete(e.id.toString())}),t}};Tn=new WeakMap,td=new WeakMap,u(Zb,"Shapes");var ed=Zb;m();var id,zb=class zb{constructor({currentMapGetter:t}){S(this,id,void 0);P(this,id,t)}get currentMap(){return s(this,id).call(this)}setFromStyleCollection(t){var e,i,n;for(let o in t)for(let a of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[o]==null||!a.layers.has(Ue))continue;let l=a.layers.get(Ue);if(l!=null&&l.layers.has(o)&&"color"in t[o]){let c=l.layers.get(o);(i=this.currentMap)==null||i.renderer.setState(c,{color:t[o].color})}if(l&&o===Fn&&!(ai in t)){let c=l.layers.get(ai);c&&"color"in t[o]&&((n=this.currentMap)==null||n.renderer.setState(c,{color:t[o].color}))}}}};id=new WeakMap,u(zb,"Style");var rd=zb;m();var qb={opacity:1},mt,nd,od,bo,Mn,ad,$b,Lm,BM,Jb=class Jb{constructor(t,e){S(this,ad);S(this,Lm);S(this,mt,void 0);S(this,nd,void 0);S(this,od,{opacity:"initial"});S(this,bo,{opacity:new Map});S(this,Mn,new Set);P(this,mt,t),P(this,nd,e||[]);let i=s(this,mt).map;i&&i.on("idle",()=>{s(this,bo).opacity.size||j(this,ad,$b).call(this,i)})}setStyle(t){var e,i;if(s(this,mt).map){(e=s(this,mt).map)==null||e.setStyle(t),s(this,Mn).size&&(s(this,Mn).clear(),this.hide()),j(this,Lm,BM).call(this),j(this,ad,$b).call(this,s(this,mt).map),this.setOpacity(s(this,od).opacity),(i=s(this,mt).map)==null||i.moveLayer(Zm);for(let[n,o]of s(this,nd)||[])s(this,mt).hideOutdoorLayersUnderPoint(n,o)}}get map(){return s(this,mt).map}get enabled(){return!!s(this,mt).map}get visible(){return s(this,Mn).size===0}show(){let t=s(this,mt).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{s(this,Mn).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),s(this,Mn).clear())}hide(t=[]){let e=s(this,mt).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,Mn).add(n.id))})}setOpacity(t,e=[]){var o,a;let i=s(this,mt).map;if(!i)return;let n=(a=(o=s(this,mt).map)==null?void 0:o.getStyle())==null?void 0:a.layers;n&&i.once("idle",()=>{n.forEach(l=>{let c=i.getLayoutProperty(l.id,"visibility");if(!e.includes(l.id)&&c!=="none")try{let p=s(this,bo).opacity.get(l.id);p!==void 0&&(l.id==="background"||(l.type==="symbol"?(i.setPaintProperty(l.id,"icon-opacity",t==="initial"?p[0]:t),i.setPaintProperty(l.id,"text-opacity",t==="initial"?p[1]:t)):i.setPaintProperty(l.id,"".concat(l.type,"-opacity"),t==="initial"?p[0]:t)),s(this,od).opacity=t)}catch(p){L.warn("Error setting opacity:",p)}})})}};mt=new WeakMap,nd=new WeakMap,od=new WeakMap,bo=new WeakMap,Mn=new WeakMap,ad=new WeakSet,$b=u(function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var o,a,l;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?s(this,bo).opacity.set(i.id,[(o=t.getPaintProperty(i.id,"icon-opacity"))!=null?o:qb.opacity,(a=t.getPaintProperty(i.id,"text-opacity"))!=null?a:qb.opacity]):s(this,bo).opacity.set(i.id,[(l=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?l:qb.opacity,void 0])))})},"#setInitialStyle"),Lm=new WeakSet,BM=u(function(){Object.values(s(this,bo)).forEach(t=>t.clear())},"#clearInitialStyle"),u(Jb,"Outdoor");var Gl=Jb;m();var Pn,In,xo,Kb=class Kb{constructor({currentMapGetter:t}){S(this,Pn,void 0);S(this,In,new Map);S(this,xo,new Map);P(this,Pn,t)}labelAll(t={}){var n,o;let e=[],i=new Set;return(o=(n=s(this,Pn).call(this))==null?void 0:n.Text3D.labelAll(t))==null||o.forEach(({textInfo:a,target:l})=>{let c=a.id.toString(),p=s(this,xo).get(c);if(p){i.has(c)||e.push(p.text3DView),i.add(c);return}i.add(c);let h=new mo(c,l);s(this,In).set(h.id,{targetId:l.id,text3d:c,text3DView:h}),s(this,xo).set(c,{text3DView:h}),e.push(h)}),e}label(t,e,i={}){var o;if(s(this,Pn).call(this))if(ot.is(t)){let a=(o=s(this,Pn).call(this))==null?void 0:o.Text3D.label(t,e,i);if(!a)return;let l=a.textInfo.id.toString(),c=s(this,xo).get(l);if(c)return c.text3DView;let p=new mo(l,a.target);return s(this,In).set(p.id,{targetId:a.target.id,text3d:l,text3DView:p}),s(this,xo).set(l,{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,In).get(e);i&&((n=s(this,Pn).call(this))==null||n.Text3D.remove(i.text3d),s(this,In).delete(e),s(this,xo).delete(i.text3d))}removeAll(){s(this,In).forEach(t=>{var e;(e=s(this,Pn).call(this))==null||e.Text3D.remove(t.text3d)}),s(this,In).clear()}};Pn=new WeakMap,In=new WeakMap,xo=new WeakMap,u(Kb,"Text3D");var Am=Kb;var km=.05,t2=class t2{constructor(t,e){d(this,"core");d(this,"mapObjects",[]);d(this,"id");d(this,"mapDataExternal",{});d(this,"mapsByFloorId",{});d(this,"mapData");d(this,"currentMap");d(this,"hiddenOutdoorGeometries",[]);d(this,"lastFacadeIntersected");d(this,"mapView");d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"Outdoor");d(this,"BlueDot");d(this,"Shapes");d(this,"Style");d(this,"Images");d(this,"update",u(()=>{this.core.render()},"update"));this.core=t,this.mapView=e,this.Camera=new yp(this.core),this.id=this.core.addGroupContainer("root").id.toString();let i=new Gp("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i;let n=new cp(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",n)});let o=u(c=>p=>{var w,E,_,O;let h=[],y=[],g=[],v=[];p.labels.forEach(F=>{let G=this.Labels.getById(F.toString());G&&h.push(G.label)}),p.markers.forEach(F=>{let G=this.Markers.getById(F.toString())||this.Navigation.getMarkerById(F.toString());G&&y.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&&v.push(G.path)});let C=p.geometry[0],M;C&&(M=(w=this.getMapDataInternal())==null?void 0:w.getById("space",C)),M||(M=(E=this.getMapDataInternal())==null?void 0:E.getById("object",C));let b=p.containers.reduce((F,G)=>{var H;let N=(H=this.getMapDataInternal())==null?void 0:H.getById("floor",G);return N&&oi.is(N)&&F.push(N),F},[]),x;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!1})}),M&&ot.is(M)&&(x=(_=this.getMapDataInternal())==null?void 0:_.facadesBySpaceId[C],x&&x.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!0})})),this.lastFacadeIntersected=x;let I={coordinate:new ne(p.coordinate[1],p.coordinate[0],(O=b==null?void 0:b[0])==null?void 0:O.id),spaces:M&&ot.is(M)?[M]:[],objects:M&&vt.is(M)?[M]:[],markers:y,labels:h,models:g,paths:v,floors:b,facades:x?[x]:[]};"pointerEvent"in p&&(I.pointerEvent=p.pointerEvent),this.mapView.publish(c,I)},"createHandler");this.core.on("hover",o("hover")),this.core.on("click",o("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let a={currentMapGetter:()=>this.currentMap};this.Markers=new Vp(a),this.Models=new Wp(a),this.Labels=new vp(a),this.Text3D=new Am(a),this.Exporter=new gp(a),this.Paths=new Yp(a),this.Navigation=new pp(this.core,this,a.currentMapGetter),this.BlueDot=new Nl(this.core,this),this.BlueDot.on("position-update",c=>{this.mapView.publish("blue-dot-position-update",c)}),this.BlueDot.on("state-change",c=>{this.mapView.publish("blue-dot-state-change",c)}),this.BlueDot.on("error",c=>{this.mapView.publish("blue-dot-error",c)}),this.BlueDot.on("follow-change",c=>{this.mapView.publish("blue-dot-follow-change",c)}),this.Outdoor=new Gl(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 Hp(a),this.Shapes=new ed(a),this.Style=new rd(a);let l=new Mm(e,this.mapDataExternal);this.auto=l.auto}get DynamicFocus(){return this.currentMap.DynamicFocus}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(Ue);if(o){let a=o.layers.get(Fn);a&&this.core.setState(a,Qb(e,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(Ue);if(o){let a=o.layers.get(ai);a&&this.core.setState(a,Qb(e,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(Ue);if(o){let a=o.layers.get(us);a&&this.core.setState(a,Fm(e,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(Ue);if(o){let a=o.layers.get(ps);a&&this.core.setState(a,Fm(e,this.core.getState(a)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(po.is(i))return this.core.setState(i.id,RM({...e,type:"label"},this.core.getState(i.id)));if(pn.is(i))return this.core.setState(i.id,NM({...e,type:"marker"},this.core.getState(i.id)));if((ot.is(i)||vt.is(i))&&this.core.setState(i.id,e2({...e,type:"geometry"},this.core.getState(i.id))),$t.is(i)&&this.core.setState(i.id,Fm({...e,type:"doors"},this.core.getState(i.id))),fo.is(i)&&this.core.setState(i.id,Ka(e,["altitude","color","opacity"])),Rt.is(i))for(let n of i.spaces)this.core.setState(n.id,e2({...e,type:"geometry"},this.core.getState(n.id)));mo.is(i)&&this.core.setState(i.id,Ka(e,mf))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Ps(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var y,g,v;let n;try{n=Ps(t)}catch(C){L.error("Error adding map",C),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ne(a[1],a[0])});let l=o["manifest.geojson"].features[0].properties.name,c=new Gp("mapObject-".concat(l),n,e,this),p=this.core.getBoundingArea(c.currentFloor.id);p==null&&L.error("Could not determine bounding box for map:",c.currentFloor.id);let h=(g=(y=e==null?void 0:e.outdoorView)==null?void 0:y.layersHiddenByGeometry)!=null?g:[];if(h.length>0){let C=(v=this.core.getCenter(p))!=null?v:a;this.core.hideOutdoorLayersUnderPoint(C,h),this.hiddenOutdoorGeometries.push([C,h])}this.mapObjects.push(c),n.getMVFFeatureByType("floor").forEach(C=>{this.mapsByFloorId[C.id]=c}),c.on("navigation-connection-click",C=>{this.mapView.publish("navigation-connection-click",C)}),c.on("navigation-active-path-change",C=>{this.mapView.publish("navigation-active-path-change",C)}),c.StackedMaps.on("stacked-maps-state-change",({state:C})=>{this.mapView.publish("stacked-maps-state-change",{state:C})}),c.on("floor-change-start",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),c.on("floor-change",C=>{this.mapView.publish("floor-change",{reason:C.reason,floor:this.currentFloor})}),this.currentMap=c,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null?(this.core.camera.setZoomLevel(e.zoomLevel),i(t)):this.core.mode!=="outdoors-overlay"&&p?this.core.camera.focusOn(p,{duration:C3,padding:{top:km*this.core.canvasHeight,left:km*this.core.canvasWidth,right:km*this.core.canvasWidth,bottom:km*this.core.canvasHeight}}).then(()=>{i(t)}):i(t)})}setFloor(t,e){return this.currentMap.setFloor(pc(t),e)}setFloorStack(t){return this.currentMap.setFloorStack(pc(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw L.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw L.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw L.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw L.throw("Missing currentFloor");return e}getState(t){var n,o;if(typeof t=="object"&&Rt.is(t)){L.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}let e=GM(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:a,topColor:l,texture:c,topTexture:p,visible:h,height:y,opacity:g}=i;return{type:"walls",visible:h,color:a,topColor:l,texture:c?{url:c}:void 0,topTexture:p?{url:p}:void 0,height:y,opacity:g}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:a,topColor:l,texture:c,topTexture:p,visible:h,opacity:y}=i;return{type:"doors",visible:h,color:a,topColor:l,opacity:y,texture:c?{url:c}:void 0,topTexture:p?{url:p}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let a=typeof i.parent=="object"?i.parent.id:i.parent,l=this.Markers.getById(i.id.toString()),c=l!=null&&l.marker.target?Je(l==null?void 0:l.marker.target):void 0;return c==null&&(c=new ne(i.position[1],i.position[0],a.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,coordinate:c}}else{if(i.type==="model")return{type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&fo.is(t)){let[a]=i.children;if(a.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(o=i.altitude)!=null?o:0,visible:i.visible,color:i.color,height:a.height,opacity:a.opacity}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinate(t,e,i){return new ne(t,e,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(t,e,i){let n=this.core.projectScreenXYToCoordinate(t,e);return n?new ne(n[1],n[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){this.Labels.all()}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};u(t2,"GeoJsonApi");var sd=t2;m();m();var r2=class r2{constructor(t){d(this,"state");d(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};u(r2,"Debug");var Rm=r2;m();var VM=D.object({text3d:D.object({hoverColor:D.string().optional()}).optional(),geometry:D.object({hoverColor:D.string().optional()}).optional()}).strict();var ld,Q,Va,i2=class i2 extends q{constructor(e){super();S(this,ld,{});S(this,Q,void 0);S(this,Va,void 0);d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Images");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"BlueDot");d(this,"Style");d(this,"Shapes");d(this,"Outdoor");d(this,"update",u(()=>{s(this,Q).core.render()},"update"));d(this,"getDirections",u((e,i,n)=>{var o;return(o=s(this,Q).getMapData())==null?void 0:o.getDirections(e,i,n)},"getDirections"));d(this,"getDirectionsMultiDestination",u((e,i,n)=>{var o;return(o=s(this,Q).getMapData())==null?void 0:o.getDirectionsMultiDestination(e,i,n)},"getDirectionsMultiDestination"));d(this,"on",u((e,i)=>{super.on(e,i)},"on"));d(this,"off",u((e,i)=>{super.off(e,i)},"off"));d(this,"Debug");P(this,Va,e);let i=new sd(e,this);P(this,Q,i),this.Camera=s(this,Q).Camera,P(this,ld,s(this,Q).mapDataExternal),this.Markers=s(this,Q).Markers,this.Models=s(this,Q).Models,this.Labels=s(this,Q).Labels,this.Text3D=s(this,Q).Text3D,this.Exporter=s(this,Q).Exporter,this.Paths=s(this,Q).Paths,this.Navigation=s(this,Q).Navigation,this.BlueDot=s(this,Q).BlueDot,this.Shapes=s(this,Q).Shapes,this.Style=s(this,Q).Style,this.auto=s(this,Q).auto,this.Outdoor=s(this,Q).Outdoor,this.Images=s(this,Q).Images,s(this,Va).container.dataset.version=T.env.npm_package_version,this.Debug=new Rm(s(this,Q).core)}get StackedMaps(){return s(this,Q).currentMap.StackedMaps}get DynamicFocus(){return s(this,Q).currentMap.DynamicFocus}updateState(e,i){return s(this,Q).updateState(e,i)}updateGlobalState(e){var i,n;try{VM.parse(e)}catch(o){L.error("updateGlobalState",o);return}if(typeof e=="object"&&!("id"in e)){let o={};(i=e.text3d)!=null&&i.hoverColor&&(o.text3dHoverColor=e.text3d.hoverColor),(n=e.geometry)!=null&&n.hoverColor&&(o.hoverColor=e.geometry.hoverColor),s(this,Q).core.setState(o)}}getGlobalState(){let e=s(this,Q).core.getState();return{geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return s(this,ld)}getDimensions(){return{width:s(this,Va).canvasWidth,height:s(this,Va).canvasHeight}}expand(e){var i;return(i=s(this,Q).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=s(this,Q).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return s(this,Q).addMap(e,i)}setFloor(e){return s(this,Q).setFloor(e)}setFloorStack(e){return s(this,Q).setFloorStack(e)}get currentFloorStack(){return s(this,Q).currentFloorStack}get currentFloor(){return s(this,Q).currentFloor}updateWatermark(e){s(this,Q).updateWatermark(e)}getState(e){return s(this,Q).getState(e)}setHoverColor(e){s(this,Q).setHoverColor(e)}getHoverColor(){return s(this,Q).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return s(this,Q).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return s(this,Q).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return s(this,Q).isInView(e)}getDistance(e,i){var n;return(n=s(this,Q).getMapData())==null?void 0:n.getDistance(e,i)}createCoordinate(e,i,n){return s(this,Q).createCoordinate(e,i,n)}createCoordinateFromScreenCoordinate(e,i,n){return s(this,Q).createCoordinateFromScreenCoordinate(e,i,n)}auto(){this.Labels.all()}get __core(){if(T.env.INTERNAL==="true")return s(this,Q).core;throw new Error("__core is not available.")}clear(){s(this,Q).clear()}destroy(){s(this,Q).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-TLP7SW7I.js");await new i(this,s(this,Q)).enable(e)}};ld=new WeakMap,Q=new WeakMap,Va=new WeakMap,u(i2,"MapView");var Vl=i2;m();m();var n2=class n2 extends q{constructor(e){super();d(this,"gl");d(this,"el",document.createElement("div"));d(this,"core");d(this,"origin");d(this,"map");d(this,"layer");d(this,"handleStyleChange",u(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));d(this,"handleMove",u(()=>{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(ve.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ve.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",u(e=>{L.warn(e)},"handleError"));this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new rp(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=Q2.fromLngLat(this.origin,0);return this.layer=Td(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}};u(n2,"MapLibreOverlay");var Nm=n2;var ja,jl,Co,Ha,cd=class cd extends q{constructor(e,i,n){super();S(this,ja,void 0);S(this,jl,void 0);S(this,Co,void 0);S(this,Ha,void 0);d(this,"on",u((e,i)=>{super.on(e,i)},"on"));d(this,"off",u((e,i)=>{super.off(e,i)},"off"));P(this,Ha,new Nm(e)),P(this,ja,i),P(this,jl,n)}onAdd(e){var o,a;let i=s(this,Ha).onAdd(e),n={...dc,...(o=s(this,jl))!=null?o:{},outdoorView:{token:s(this,ja).outdoorViewToken,...(a=s(this,jl))==null?void 0:a.outdoorView}};return P(this,Co,new Vl(s(this,Ha).core)),s(this,Co).addMap(s(this,ja),n).then(()=>{this.publish("loaded",{mapView:s(this,Co),mapData:s(this,ja)})}),i}onRemove(){s(this,Co)&&s(this,Co).clear(),cd.instance=null,s(this,Ha).onRemove()}};ja=new WeakMap,jl=new WeakMap,Co=new WeakMap,Ha=new WeakMap,u(cd,"MappedinMapLibreOverlay"),d(cd,"instance");var Hl=cd;var UF=u(async(r,t)=>{let e,i=Ho();t&&i.updateByUserOption(t);try{t&&(e=(await Sc({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(a){L.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new Ul(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new jd(n)},"hydrateMapDataFromMVF"),jM=!1;function WF(r){jM=r}u(WF,"setUseEnterpriseAPI");var XF=u(async(r,t)=>{var p,h,y,g;let e={...t||{}},i,n=Ho();n.updateByUserOption(e);let o={};if("type"in r&&typeof r.type=="string"){if(o.enterprise=(p=r.options)==null?void 0:p.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let v=await Mc(r.main);i=Tc(v),o.languagePacks=[];for(let C of(h=r.languagePacks)!=null?h:[])C.localePack instanceof Uint8Array&&o.languagePacks.push({language:C.language,localePack:await Ts(C.localePack)})}else if(r.type==="json")i=r.main,o.languagePacks=(y=r.languagePacks)!=null?y:[];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;if("accessToken"in e)a=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=n.getBaseAuthUri(o.enterprise);let v=await Sc(e,o.enterprise);a=(v==null?void 0:v.accessToken)||""}if(o.outdoorViewToken=a,o.env=n,a&&!o.enterprise)try{o.sasToken=(await Od(e,a)).token}catch(v){L.error("Failed to fetch SAS token.",v)}let l=new Ul(i,o);a&&l.Analytics.init({accessToken:a,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:(g=e.analytics)==null?void 0:g.context});let c=new jd(l);if("language"in e)try{await c.changeLanguage(e.language)}catch{}return c},"hydrateMapData"),HM=u(async r=>{var M;let t=jM,e,i=Ho();i.updateByUserOption(r);let n={...r};if("accessToken"in n){e=n.accessToken;let{aud:b,sub:x}=Id(e);(T3.some(I=>b.includes(I))||x&&x.startsWith("client"))&&(t=!0)}else if("key"in n&&"secret"in n)n.key.startsWith("mik_")||(t=!0),n.baseAuthUri=i.getBaseAuthUri(t),e=(await Sc(n,t)).accessToken;else throw new Error("Missing key or secret.");n.baseUri=i.getBaseUri(t);let o=performance.now(),a,l;if(t){let b={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0"},x=await wy(b);a=x.compressed,l=x.localePacks}else a=await Ey(n,e);let c=performance.now(),p=await Mc(a),h=Tc(p),y=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(h);let g;if(!t)try{g=(await Od(n,e)).token}catch(b){L.error("Failed to fetch SAS token.",b)}let v=new Ul(h,{env:i,outdoorViewToken:e,sasToken:g,enterprise:t,localePacksUrls:l,binaryBundle:a}),C=new jd(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:(M=n.analytics)==null?void 0:M.context}),v.Analytics.sendGetMapDataEvent({parseDuration:y-c,downloadDuration:c-o,viewId:n.viewId}),"language"in n)try{await C.changeLanguage(n.language)}catch{}return C},"getMapData"),YF=HM,ZF=u((r,t)=>{Hl.instance!=null&&L.warn("Only a single map venue is supported at this time.");let e=new Hl([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Hl.instance=e,e},"createMapLibreOverlay"),UM=u(async(r,t,e)=>{var p,h,y,g,v,C,M,b,x;let i=performance.now(),n=dy(e,t);try{e&&py(e)}catch(I){if(I instanceof Error&&I.name==="MissingOutdoorViewToken")L.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw I}let o=M3((p=t.outdoorViewToken)!=null?p:""),a=Ps(t);(h=n.outdoorView)!=null&&h.style&&a.envControl.updateTileServerBaseUrl((y=n.outdoorView)==null?void 0:y.style);let l=await tM(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(g=n.style)==null?void 0:g.backgroundAlpha,backgroundColor:(v=n.style)==null?void 0:v.backgroundColor,outdoorView:(C=n.outdoorView)!=null&&C.token?{headers:{"x-mappedin-tiles-key":(M=n.outdoorView)==null?void 0:M.token},style:t.getEnv().tileServerUri,enabled:!!((b=n.outdoorView)!=null&&b.enabled)}:void 0,watermark:{...n.watermark,visible:!o.remove_watermark},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((x=n.antialiasing)!=null&&x.enabled),accessToken:t.outdoorViewToken}),c=new Vl(l);return await c.addMap(t,n),Ps(t).Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:c.getDimensions()}),c},"show3dMap"),zF=UM;function wi(r){return[r.longitude,r.latitude]}u(wi,"convertCoordinateToPosition");function $F(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}u($F,"getEntranceMap");var Pb=u((r,t)=>{let e=$F(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((l,c)=>(e.has(c)&&l.push(e.get(c)),l),[]);if(a.length){let{entrances:l,obstructions:c}=A1(n,a);o=c.map(p=>p.geometry.coordinates),i.entrances.features.push(...l)}i.walls.geometry.coordinates.push(...o)}return i},"cutEntrancesFromLineStrings");function RM(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),e}u(RM,"translateLabelStateToGeojsonCore");function NM(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),e}u(NM,"translateMarkerStateToGeojsonCore");function Fm(r,t){var i,n;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}u(Fm,"translateDoorsStateToGeojsonCore");function Qb(r,t){var i,n;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}u(Qb,"translateWallsStateToGeojsonCore");function e2(r,t){var i,n;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}u(e2,"translateSpaceStateToGeojsonCore");function WM(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}u(WM,"differenceBetweenAngles");function XM(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}u(XM,"getRelativeBearing");function SM(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}u(SM,"extractStyleMap");function Ib(r,t){return r.reduce((e,i)=>{let n=t[i.properties.id];return n==null||(e.has(n)||e.set(n,[]),e.get(n).push(i)),e},new Map)}u(Ib,"groupGeometryByStyle");function xp(r,t={}){var n,o,a,l,c,p;let e={...r},i=(o=(n=t==null?void 0:t.style)==null?void 0:n.shading)!=null?o:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(l=(a=t==null?void 0:t.style)==null?void 0:a.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let h=(p=(c=t==null?void 0:t.style)==null?void 0:c.wallTopColor)!=null?p:t==null?void 0:t.wallTopColor;h!=null&&(e.topColor=h)}return e}u(xp,"translateToCoreStyle");var GM=u((r,t)=>{var n;let i=((n=t.currentMap)==null?void 0:n.currentFloor).layers.get(Ue);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(Fn);case"exterior-walls":return i==null?void 0:i.layers.get(ai);case"interior-doors":return i==null?void 0:i.layers.get(us);case"exterior-doors":return i==null?void 0:i.layers.get(ps);default:return typeof r=="string"?r:r.id}},"getTargetID");function Nb(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}u(Nb,"tweenToPromise");function YM(r){return[...new Set(r)]}u(YM,"unique");var ZM=Math.PI*.1,Lt,At,ur,wn,Ua,Vm,zM,So,Wl,jm,qM,o2=class o2{constructor(t,e){S(this,Vm);S(this,So);S(this,jm);S(this,Lt,{});S(this,At,void 0);S(this,ur,void 0);S(this,wn,void 0);S(this,Ua,void 0);P(this,At,e),P(this,ur,t.features),P(this,At,e),P(this,ur,t.features)}get path(){return s(this,ur).map(t=>s(this,At).getById("node",t.properties.id)).filter(Boolean)}get coordinates(){return s(this,Lt).coordinates?s(this,Lt).coordinates:(s(this,Lt).coordinates=s(this,ur).map(t=>new ne(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),s(this,Lt).coordinates)}get distance(){return s(this,Lt).distance?s(this,Lt).distance:(s(this,Lt).distance=s(this,ur).reduce((t,e)=>t+(e.properties.distance||0),0),s(this,Lt).distance)}get instructions(){if(s(this,ur).length<2)return[];if(s(this,Lt).instructions)return s(this,Lt).instructions;let t=[],e=0;for(let i=0;i<s(this,ur).length;i++){let n=s(this,ur)[i],o=s(this,ur)[i-1],a=s(this,ur)[i+1],l=new ne(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=j(this,Vm,zM).call(this,{prevDirection:o,direction:n,nextDirection:a});e+=(o==null?void 0:o.properties.distance)||0;for(let p of c)p&&(t.push({action:p,distance:e,coordinate:l,node:s(this,At).getById("node",n.properties.id)}),e=0)}return s(this,Lt).instructions=t,s(this,Lt).instructions}};Lt=new WeakMap,At=new WeakMap,ur=new WeakMap,wn=new WeakMap,Ua=new WeakMap,Vm=new WeakSet,zM=u(function(t){var g,v,C;let{prevDirection:e,direction:i,nextDirection:n}=t,o=e&&s(this,At).getById("floor",e.properties.groupBy),a=s(this,At).getById("floor",i.properties.groupBy),l=n&&s(this,At).getById("floor",n.properties.groupBy),c=[];e||c.push({type:"Departure"});let p=s(this,At).getMVFFeatureByNodeId("connection",i.properties.id),h=s(this,At).getMVFFeatureByNodeId("connection",(g=n==null?void 0:n.properties.id)!=null?g:""),y=p?s(this,At).getById("connection",p.id):void 0;if(p)if(!s(this,wn)||s(this,wn)==="exit")c.push(j(this,So,Wl).call(this,"TakeConnection",a,l,y,p)),P(this,wn,"take"),P(this,Ua,y);else{let M=s(this,At).getMVFFeatureByNodeId("connection",(v=e==null?void 0:e.properties.id)!=null?v:""),b=s(this,At).getById("connection",(C=M==null?void 0:M.id)!=null?C:"");c.push(j(this,So,Wl).call(this,"ExitConnection",a,o,b,M)),P(this,wn,"exit"),P(this,Ua,y)}else h&&s(this,wn)==="take"?(c.push(j(this,So,Wl).call(this,"ExitConnection",a,o,s(this,Ua))),P(this,wn,"exit"),P(this,Ua,y)):l&&a.id!==l.id?c.push(j(this,So,Wl).call(this,"TakeConnection",a,l,y)):o&&o.id!==a.id?c.push(j(this,So,Wl).call(this,"ExitConnection",a,o,y)):c.push(j(this,jm,qM).call(this,e,i));return n||c.push({type:"Arrival"}),c},"#getActions"),So=new WeakSet,Wl=u(function(t,e,i,n,o){var c,p;let a="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let h=e.elevation-i.elevation;h>0?a="down":h<0&&(a="up")}let l=(p=(c=n==null?void 0:n.type)!=null?c:o==null?void 0:o.type)!=null?p:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:a,connection:n,connectionType:l}},"#createConnectionAction"),jm=new WeakSet,qM=u(function(t,e){let i=t?-WM(t.properties.angle,e.properties.angle):0;return Math.abs(i)>=ZM?{type:"Turn",bearing:XM(i,ZM),referencePosition:"At"}:null},"#createTurnAction"),u(o2,"Directions");var Bm=o2,a2=class a2{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:n}){d(this,"navigator");d(this,"connections");d(this,"getDirections",u((t,e,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:l}}=i,c=t.flatMap(v=>this.getNodesFromTarget(v,n)),p=e.flatMap(v=>this.getNodesFromTarget(v,n)),h=this.getExcludedNodeIds(o).filter(v=>!c.includes(v)&&!p.includes(v)),y=this.navigator.getDirections({zones:i.zones.map(v=>{var C;return{geometry:v.geometry,cost:v.cost,map:(C=v.floor)==null?void 0:C.id}}),originIds:c,destinationNodeIds:p,excludedNodeIds:h,simplify:{enabled:a,bufferRadius:l}});this.addCoordinateDirections(y,t,e);let g=new Bm(y,n);if(!(g.distance===0&&new Set([...c,...p]).size===c.length+p.length))return g},"getDirections"));d(this,"getExcludedNodeIds",u(t=>t?this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]):[],"getExcludedNodeIds"));d(this,"addCoordinateDirections",u((t,[e],[i])=>{if(t.features.length){if(ne.is(e)){let n=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,n)}if(ne.is(i)){let n=this.createDirectionFeature(i,0,0),o=t.features[t.features.length-1];o.properties.distance=this.navigator.getDistance(o.geometry.coordinates,[i.longitude,i.latitude]),o.properties.angle=this.navigator.getAngle(o.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(n)}}},"addCoordinateDirections"));d(this,"getNodesFromTarget",u((t,e)=>{var i,n,o,a;if(ne.is(t)){let l=e.Query.nearest(t,{types:["node"]});return(i=l==null?void 0:l[0])!=null&&i.feature.id?[l[0].feature.id]:[]}else if(Er.is(t)){let l=e.Query.nearest(t,{types:["node"]});return(n=l==null?void 0:l[0])!=null&&n.feature.id?[l[0].feature.id]:[]}else if($t.is(t)){let l=e.Query.nearest(t,{types:["node"]});return(o=l==null?void 0:l[0])!=null&&o.feature.id?[l[0].feature.id]:[]}else if(ji.is(t)){let l=e==null?void 0:e.getMVFFeatureById("area",t.id);return(a=l==null?void 0:l.properties.destinationNodes)!=null?a:[]}else if(ot.is(t)){let l=e==null?void 0:e.getMVFFeatureById("space",t.id);return l==null?[]:l.properties.destinationNodes}else{if(li.is(t))return t.coordinates.reduce((l,c)=>{var h;let p=e.Query.nearest(c,{types:["node"]});return(h=p==null?void 0:p[0])!=null&&h.feature.id&&l.push(p[0].feature.id),l},[]);if(vt.is(t)){let l=e==null?void 0:e.objectEntranceNodeIdsByObstructionId[t.id];return l!=null?l:[]}else return Rt.is(t)?t.spaces.flatMap(l=>{var c,p;return(p=(c=e==null?void 0:e.getMVFFeatureById("space",l.id))==null?void 0:c.properties.destinationNodes)!=null?p:[]}).filter(l=>typeof l=="string"):fr.is(t)?t.nodes.map(l=>l.id):Pr.is(t)?[t.id]:[]}},"getNodesFromTarget"));d(this,"createDirectionFeature",u((t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i}}),"createDirectionFeature"));this.navigator=new Ms({nodes:t,geojsonCollection:this.createCollection(e),groupBy:n}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,n])=>e.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};u(a2,"DirectionsInternal");var Gm=a2;m();m();m();m();m();m();function s2(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return $M(this.cover(t,e),t,e,r)}u(s2,"default");function $M(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var n,o=r._root,a={data:i},l=r._x0,c=r._y0,p=r._x1,h=r._y1,y,g,v,C,M,b,x,I;if(!o)return r._root=a,r;for(;o.length;)if((M=t>=(y=(l+p)/2))?l=y:p=y,(b=e>=(g=(c+h)/2))?c=g:h=g,n=o,!(o=o[x=b<<1|M]))return n[x]=a,r;if(v=+r._x.call(null,o.data),C=+r._y.call(null,o.data),t===v&&e===C)return a.next=o,n?n[x]=a:r._root=a,r;do n=n?n[x]=new Array(4):r._root=new Array(4),(M=t>=(y=(l+p)/2))?l=y:p=y,(b=e>=(g=(c+h)/2))?c=g:h=g;while((x=b<<1|M)===(I=(C>=g)<<1|v>=y));return n[I]=o,n[x]=a,r}u($M,"add");function JM(r){var t,e,i=r.length,n,o,a=new Array(i),l=new Array(i),c=1/0,p=1/0,h=-1/0,y=-1/0;for(e=0;e<i;++e)isNaN(n=+this._x.call(null,t=r[e]))||isNaN(o=+this._y.call(null,t))||(a[e]=n,l[e]=o,n<c&&(c=n),n>h&&(h=n),o<p&&(p=o),o>y&&(y=o));if(c>h||p>y)return this;for(this.cover(c,p).cover(h,y),e=0;e<i;++e)$M(this,a[e],l[e],r[e]);return this}u(JM,"addAll");m();function l2(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,l=this._root,c,p;e>r||r>=n||i>t||t>=o;)switch(p=(t<i)<<1|r<e,c=new Array(4),c[p]=l,l=c,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=l)}return this._x0=e,this._y0=i,this._x1=n,this._y1=o,this}u(l2,"default");m();function c2(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}u(c2,"default");m();function u2(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]]}u(u2,"default");m();m();function nt(r,t,e,i,n){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=n}u(nt,"default");function p2(r,t,e){var i,n=this._x0,o=this._y0,a,l,c,p,h=this._x1,y=this._y1,g=[],v=this._root,C,M;for(v&&g.push(new nt(v,n,o,h,y)),e==null?e=1/0:(n=r-e,o=t-e,h=r+e,y=t+e,e*=e);C=g.pop();)if(!(!(v=C.node)||(a=C.x0)>h||(l=C.y0)>y||(c=C.x1)<n||(p=C.y1)<o))if(v.length){var b=(a+c)/2,x=(l+p)/2;g.push(new nt(v[3],b,x,c,p),new nt(v[2],a,x,b,p),new nt(v[1],b,l,c,x),new nt(v[0],a,l,b,x)),(M=(t>=x)<<1|r>=b)&&(C=g[g.length-1],g[g.length-1]=g[g.length-1-M],g[g.length-1-M]=C)}else{var I=r-+this._x.call(null,v.data),w=t-+this._y.call(null,v.data),E=I*I+w*w;if(E<e){var _=Math.sqrt(e=E);n=r-_,o=t-_,h=r+_,y=t+_,i=v.data}}return i}u(p2,"default");m();function d2(r){if(isNaN(h=+this._x.call(null,r))||isNaN(y=+this._y.call(null,r)))return this;var t,e=this._root,i,n,o,a=this._x0,l=this._y0,c=this._x1,p=this._y1,h,y,g,v,C,M,b,x;if(!e)return this;if(e.length)for(;;){if((C=h>=(g=(a+c)/2))?a=g:c=g,(M=y>=(v=(l+p)/2))?l=v:p=v,t=e,!(e=e[b=M<<1|C]))return this;if(!e.length)break;(t[b+1&3]||t[b+2&3]||t[b+3&3])&&(i=t,x=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[x]=e:this._root=e),this):(this._root=o,this)}u(d2,"default");function KM(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}u(KM,"removeAll");m();function h2(){return this._root}u(h2,"default");m();function f2(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}u(f2,"default");m();function m2(r){var t=[],e,i=this._root,n,o,a,l,c;for(i&&t.push(new nt(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,o=e.x0,a=e.y0,l=e.x1,c=e.y1)&&i.length){var p=(o+l)/2,h=(a+c)/2;(n=i[3])&&t.push(new nt(n,p,h,l,c)),(n=i[2])&&t.push(new nt(n,o,h,p,c)),(n=i[1])&&t.push(new nt(n,p,a,l,h)),(n=i[0])&&t.push(new nt(n,o,a,p,h))}return this}u(m2,"default");m();function y2(r){var t=[],e=[],i;for(this._root&&t.push(new nt(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,l=i.y0,c=i.x1,p=i.y1,h=(a+c)/2,y=(l+p)/2;(o=n[0])&&t.push(new nt(o,a,l,h,y)),(o=n[1])&&t.push(new nt(o,h,l,c,y)),(o=n[2])&&t.push(new nt(o,a,y,h,p)),(o=n[3])&&t.push(new nt(o,h,y,c,p))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}u(y2,"default");m();function QM(r){return r[0]}u(QM,"defaultX");function g2(r){return arguments.length?(this._x=r,this):this._x}u(g2,"default");m();function e8(r){return r[1]}u(e8,"defaultY");function v2(r){return arguments.length?(this._y=r,this):this._y}u(v2,"default");function ud(r,t,e){var i=new b2(t==null?QM:t,e==null?e8:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}u(ud,"quadtree");function b2(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}u(b2,"Quadtree");function t8(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}u(t8,"leaf_copy");var kt=ud.prototype=b2.prototype;kt.copy=function(){var r=new b2(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=t8(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]=t8(i));return r};kt.add=s2;kt.addAll=JM;kt.cover=l2;kt.data=c2;kt.extent=u2;kt.find=p2;kt.remove=d2;kt.removeAll=KM;kt.root=h2;kt.size=f2;kt.visit=m2;kt.visitAfter=y2;kt.x=g2;kt.y=v2;var pr,To,x2=class x2{constructor(t){S(this,pr,{});S(this,To,void 0);P(this,To,t)}getTreeByType(t,e,i){if(s(this,pr)[t]||(s(this,pr)[t]={}),s(this,pr)[t][e]&&s(this,pr)[t][e][i])return s(this,pr)[t][e][i];s(this,pr)[t][e]||(s(this,pr)[t][e]={}),s(this,pr)[t][e][i]||(s(this,pr)[t][e][i]=ud());let n=s(this,pr)[t][e][i];n.x(a=>a.geometry.coordinates[1]),n.y(a=>a.geometry.coordinates[0]);let o=[];switch(t){case"node":o=s(this,To).mvfNodesByFloorId[i]||[];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}};pr=new WeakMap,To=new WeakMap,u(x2,"QueryCache");var Hm=x2;var JF=D.object({limit:D.enum(["same-floor","same-elevation"]).optional(),radius:D.number().optional(),types:D.array(D.enum(["node","point-of-interest"])).min(1)}),Ai,dd,C2=class C2{constructor(t){S(this,Ai,void 0);S(this,dd,void 0);P(this,Ai,t),P(this,dd,new Hm(s(this,Ai)))}nearest(t,e){try{JF.parse(e)}catch(a){L.error(a);return}let i=Je(t);if(!i)return;let n=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let a of s(this,Ai).getByType("floor-stack")){let l=a.defaultFloor;l&&n.push(l.id)}else if(e.limit==="same-elevation"){let a=s(this,Ai).floorsById[i.floorId];if(a){let l=a==null?void 0:a.elevation;l&&(n=s(this,Ai).getByType("floor-stack").map(c=>{var p;return(p=c.floors.find(h=>h.elevation===l))==null?void 0:p.id}).filter(Boolean))}}let o=[];for(let a of YM(e.types))for(let l of n){let c=s(this,dd).getTreeByType(a,s(this,Ai).mapName,l).find(i.latitude,i.longitude,e.radius);if(c){let p=s(this,Ai).getById(a,c==null?void 0:c.properties.id);p&&o.push({distance:kr([i.longitude,i.latitude],c.geometry.coordinates),feature:p})}}return o.sort((a,l)=>a.distance-l.distance)}};Ai=new WeakMap,dd=new WeakMap,u(C2,"Query");var pd=C2;var te,Xl,S2=class S2 extends q{constructor(e,i){var l,c,p,h;super();d(this,"Analytics");S(this,te,{});d(this,"Query");d(this,"mvf");d(this,"outdoorViewToken");d(this,"spaceIdsByDestinationNodeId");d(this,"objectEntranceNodeIdsByObstructionId");d(this,"obstructionIdByEntranceId");d(this,"venue");d(this,"sasToken");d(this,"directions");d(this,"enterpriseMode",!1);d(this,"nodesById");d(this,"spacesById");d(this,"floorsById");d(this,"floorStacksById");d(this,"facadesById");d(this,"facadesBySpaceId");d(this,"connectionsById");d(this,"objectsById");d(this,"doorsById");d(this,"pointsOfInterestById");d(this,"annotationsById");d(this,"areasById");d(this,"locationsById");d(this,"categoriesById");d(this,"doorsByNodeId");d(this,"locationsBySpaceId");d(this,"locationIdsByNodeId");d(this,"mvfAnnotationsById");d(this,"mvfConnectionsById");d(this,"mvfConnectionsByNodeId");d(this,"mvfEntrancesById");d(this,"mvfNodesById");d(this,"mvfObstructionById");d(this,"mvfSpacesById");d(this,"mvfFloorsById");d(this,"mvfFloorStacksById");d(this,"mvfAreasById");d(this,"mvfNodesByFloorId");d(this,"mvfSpacesByFloorId");d(this,"mvfPoisByFloorId");d(this,"mvfEntrancesByFloorId");d(this,"mvfAnnotationsByFloorId");d(this,"localePacksUrls");d(this,"currentLanguage");d(this,"languagePacks",{});d(this,"binaryBundle");d(this,"envControl");S(this,Xl,void 0);d(this,"getDirectionsMultiDestination",u((e,i,n)=>this.getDirections(e,i,{...n,multiDestination:!0}),"getDirectionsMultiDestination"));d(this,"getDirections",u((e,i,n)=>{let{accessible:o=!1,smoothing:a=!0,multiDestination:l=!1}=n||{},c=typeof a=="object"?a.enabled:a,p=typeof a=="object"?a.radius:void 0,h=(n==null?void 0:n.zones)||[],y={accessible:o,zones:h,smoothing:{enabled:c!=null?c:!0,radius:p!=null?p:.75}};if(l&&Array.isArray(i)){let g=Array.isArray(e)?e:[e],v=[];for(let C of i){let M=Array.isArray(C)?C:[C],b=this.directions.getDirections(g,M,y,this);if(!b){L.error("getDirections failed due to missing directions for one of the segments");return}g=M,v.push(b)}return v}else{let g=Array.isArray(e)?e:[e],v=Array.isArray(i)?i:[i];if(Array.isArray(v[0])){L.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,v[0].id),this.directions.getDirections(g,v,y,this)}},"getDirections"));let n=(l=i==null?void 0:i.env)!=null?l:Ho();this.envControl=n,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new bs,this.localePacksUrls=(c=i==null?void 0:i.localePacksUrls)!=null?c:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.enterpriseMode=(p=i==null?void 0:i.enterprise)!=null?p:!1,this.sasToken=i==null?void 0:i.sasToken;let o=I3(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.mvfAnnotationsById=o.mvfAnnotationsById,this.mvfConnectionsById=o.mvfConnectionsById,this.mvfConnectionsByNodeId=o.mvfConnectionsByNodeId,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=P3(e,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.locationsBySpaceId=a.locationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,a.venue.name!=null){this.venue=new _d(this,{mvfData:a.venue});let y={};for(let g in a.mvfLocationsById)y[g]=a.mvfLocationsById[g];for(let g in a.locationInstancesById)y[g]=a.locationInstancesById[g];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:y,categories:a.mvfCategoriesById}},(h=i==null?void 0:i.languagePacks)==null||h.forEach(({language:g,localePack:v})=>{this.languagePacks[g.code]=_y(v)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new pd(this),this.directions=new Gm({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map"})}getEnv(){let e=this;return{get baseUri(){var i;return e.envControl.getBaseUri((i=e.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new ne(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return s(this,te).spaces==null&&(s(this,te).spaces=globalThis.Object.values(this.spacesById)),s(this,te).spaces}get objects(){return s(this,te).objects==null&&(s(this,te).objects=globalThis.Object.values(this.objectsById)),s(this,te).objects}get connections(){return s(this,te).connections==null&&(s(this,te).connections=globalThis.Object.values(this.connectionsById)),s(this,te).connections}get floors(){return s(this,te).floors==null&&(s(this,te).floors=globalThis.Object.values(this.floorsById)),s(this,te).floors}get floorStacks(){return s(this,te).floorStacks==null&&(s(this,te).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,te).floorStacks}get facades(){return s(this,te).facades==null&&(s(this,te).facades=globalThis.Object.values(this.facadesById)),s(this,te).facades}get doors(){return s(this,te).doors==null&&(s(this,te).doors=globalThis.Object.values(this.doorsById)),s(this,te).doors}get pointsOfInterest(){return s(this,te).pointsOfInterest==null&&(s(this,te).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,te).pointsOfInterest}get annotations(){return s(this,te).annotations==null&&(s(this,te).annotations=globalThis.Object.values(this.annotationsById)),s(this,te).annotations}get areas(){return s(this,te).areas==null&&(s(this,te).areas=globalThis.Object.values(this.areasById)),s(this,te).areas}get nodes(){return s(this,te).nodes==null&&(s(this,te).nodes=globalThis.Object.values(this.nodesById)),s(this,te).nodes}get locations(){return s(this,te).locations==null&&(s(this,te).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,te).categories==null&&(s(this,te).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get mvfFloors(){return s(this,te).mvfFloors==null&&(s(this,te).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,te).mvfFloors}get mvfFloorStacks(){return s(this,te).mvfFloorStacks==null&&(s(this,te).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,te).mvfFloorStacks}getByType(e){switch(e){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"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":return this.connectionsById[i];case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:throw new Error("Unknown type: ".concat(e))}}getMapDataById(e){var i,n,o,a,l,c,p,h,y,g;return(g=(y=(h=(p=(c=(l=(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?l:this.doorsById[e])!=null?c:this.connectionsById[e])!=null?p:this.objectsById[e])!=null?h:this.pointsOfInterestById[e])!=null?y:this.annotationsById[e])!=null?g:this.areasById[e]}getMVFFeatureById(e,i){switch(e){case"space":return this.mvfSpacesById[i];case"node":return this.mvfNodesById[i];case"obstruction":return this.mvfObstructionById[i];case"floor":return this.mvfFloorsById[i];case"floor-stack":return this.mvfFloorStacksById[i];case"connection":return this.mvfConnectionsById[i];case"entrance":return this.mvfEntrancesById[i];case"annotation":return this.mvfAnnotationsById[i];case"area":return this.mvfAreasById[i];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,i){switch(e){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,i,n,o){var p,h;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,l=e==="enterprise-category"?"categories":e==="enterprise-location"?"locations":void 0;if(!l)return o;let c=(h=(p=this.languagePacks[a])==null?void 0:p.optimized)==null?void 0:h[l];if(c){let y=c[n];if(y!=null&&y[i]!==void 0)return y[i]}return o}async changeLanguage(e){var l;let i=e.toLowerCase();if(!i){L.error("language code must be defined");return}if(!this.currentLanguage){L.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(l=this.venue)==null?void 0:l.languages.find(({code:c})=>c.toLowerCase()===i.toLowerCase());if(!o){L.warn("language not found");return}if(n===o.code)return;let a=this.languagePacks[o.code];if(!a){let c=this.localePacksUrls[o.code];if(!c){L.error("locale packs url not found for ".concat(o.code));return}s(this,Xl)&&s(this,Xl).abort();let p=new AbortController;P(this,Xl,p);let h;try{h=await X3(c,{signal:p.signal})}catch(y){L.error("failed downloading language pack",y);return}if(!h||p.signal.aborted)return;a=_y(h),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let n=Je(e),o=Je(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 l=await Iy(this.localePacksUrls[a.code],{signal:o.signal}),c=await Ts(l);c&&i.push({language:{code:a.code,name:a.name},localePack:c})}}catch(l){L.warn("failed downloading language pack",l)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var n;if(!this.binaryBundle){L.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await Iy(this.localePacksUrls[a.code],{signal:o.signal});l&&i.push({language:{code:a.code,name:a.name},localePack:l})}}catch(l){L.warn("failed downloading language pack",l)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(s(this,te)))s(this,te)[e]=null}};te=new WeakMap,Xl=new WeakMap,u(S2,"MapDataInternal");var Ul=S2;var Zl,Wa,hd,ki,Yl=class Yl extends Be{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",Yl.__type);S(this,Zl,void 0);S(this,Wa,void 0);S(this,hd,void 0);S(this,ki,{});P(this,Zl,i.mvfData),P(this,Wa,e),P(this,hd,i.floorStackId)}static is(e){return e.__type===Yl.__type}get floorStack(){return s(this,Wa).getById("floor-stack",s(this,hd))}get spaces(){if(!s(this,ki).spaces){s(this,ki).spaces=[];for(let e of s(this,Zl).spaces){let i=s(this,Wa).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,Wa).mvfSpacesById[n.id];o&&e.features.push(o)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=Wd(e);s(this,ki).center=new ne(i.geometry.coordinates[1],i.geometry.coordinates[0],s(this,Zl).spaces[0].floorId)}return s(this,ki).center}};Zl=new WeakMap,Wa=new WeakMap,hd=new WeakMap,ki=new WeakMap,u(Yl,"Facade"),d(Yl,"__type","facade");var T2=Yl,Rt=T2;export{L as a,h3 as b,q as c,ne as d,Pr as e,ot as f,lc as g,Rt as h,fr as i,gc as j,D as k,w0 as l,bF as m,HM as n,UM as o,qF as p};
|