@mappedin/react-sdk 6.0.1-beta.4 → 6.0.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-BMU6LTDX.js → GLTFExporter-4AFTQSTF.js} +1 -1
- package/lib/esm/{GLTFLoader-5SLMAWGO.js → GLTFLoader-2ILZ4XYA.js} +1 -1
- package/lib/esm/{browser-KZQSYQMW.js → browser-V5DRRCF6.js} +1 -1
- package/lib/esm/{chunk-DFTJP4RV.js → chunk-5NEYOCFF.js} +1 -1
- package/lib/esm/{chunk-UO4RCD3E.js → chunk-LZEQNJVH.js} +1 -1
- package/lib/esm/{chunk-LOZUNJVL.js → chunk-SX72ICSH.js} +1 -1
- package/lib/esm/{chunk-JLMM7TY3.js → chunk-UUNXGSCJ.js} +1 -1
- package/lib/esm/chunk-VEG6JSMV.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +1293 -275
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-IGN26JNY.js +1 -0
- package/lib/esm/{inspector-XYNFPRUR.css → inspector-OZDC5DPH.css} +1 -1
- package/lib/esm/{outdoor-context-v4-LAP7PEM5.js → outdoor-context-v4-WPXDFBZG.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-QGSOXOSP.js +0 -1
- package/lib/esm/inspector-6MGWZVYQ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as Dp,i as wy,j as Al}from"./chunk-LOZUNJVL.js";import{a as ar}from"./chunk-JLMM7TY3.js";import{A as sy,B as ly,C as cy,D as W,E as Ir,F as uy,G as Er,Ga as Xn,H as Vn,I as Rt,J as he,Ja as Ol,Ka as Sy,L as ti,M as na,Na as My,O as Me,P as py,Q as oa,Qa as or,R as hy,Ra as Py,S as dy,T as fy,U as Dr,X as my,Y as yy,Z as El,a as Il,c as wr,ca as gy,d as er,fa as Dl,ga as Hn,ha as Ll,ja as Bi,m as oy,n as ay,pa as vy,qa as ri,ra as _l,sa as by,ta as tr,u as Tr,ua as rr,va as Cy,w as ne,wa as xy,x as U,ya as nr}from"./chunk-UO4RCD3E.js";import{a as s,b as k,c as ny,d as Qt,e as h,f as u,g as P,h as I,i as X,j as m,k as b}from"./chunk-DFTJP4RV.js";var Uy=k((Vp,Hp)=>{m();(function(r,e){typeof Vp=="object"&&typeof Hp<"u"?Hp.exports=e():typeof define=="function"&&define.amd?define(e):(r=r||self).RBush=e()})(Vp,function(){"use strict";function r(v,x,E,T,w){s(function D(O,B,G,R,H){for(;R>G;){if(R-G>600){var j=R-G+1,Q=B-G+1,pe=Math.log(j),ge=.5*Math.exp(2*pe/3),xe=.5*Math.sqrt(pe*ge*(j-ge)/j)*(Q-j/2<0?-1:1),Ve=Math.max(G,Math.floor(B-Q*ge/j+xe)),kt=Math.min(R,Math.floor(B+(j-Q)*ge/j+xe));D(O,B,Ve,kt,H)}var ve=O[B],Fe=G,Te=R;for(e(O,G,B),H(O[R],ve)>0&&e(O,G,R);Fe<Te;){for(e(O,Fe,Te),Fe++,Te--;H(O[Fe],ve)<0;)Fe++;for(;H(O[Te],ve)>0;)Te--}H(O[G],ve)===0?e(O,G,Te):e(O,++Te,R),Te<=B&&(G=Te+1),B<=Te&&(R=Te-1)}},"t")(v,x,E||0,T||v.length-1,w||t)}s(r,"t");function e(v,x,E){var T=v[x];v[x]=v[E],v[E]=T}s(e,"i");function t(v,x){return v<x?-1:v>x?1:0}s(t,"n");var i=s(function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function n(v,x,E){if(!E)return x.indexOf(v);for(var T=0;T<x.length;T++)if(E(v,x[T]))return T;return-1}s(n,"e");function o(v,x){a(v,0,v.children.length,x,v)}s(o,"a");function a(v,x,E,T,w){w||(w=S(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var D=x;D<E;D++){var O=v.children[D];c(w,v.leaf?T(O):O)}return w}s(a,"h");function c(v,x){return v.minX=Math.min(v.minX,x.minX),v.minY=Math.min(v.minY,x.minY),v.maxX=Math.max(v.maxX,x.maxX),v.maxY=Math.max(v.maxY,x.maxY),v}s(c,"o");function l(v,x){return v.minX-x.minX}s(l,"s");function p(v,x){return v.minY-x.minY}s(p,"l");function f(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}s(f,"f");function y(v){return v.maxX-v.minX+(v.maxY-v.minY)}s(y,"u");function g(v,x){return v.minX<=x.minX&&v.minY<=x.minY&&x.maxX<=v.maxX&&x.maxY<=v.maxY}s(g,"m");function C(v,x){return x.minX<=v.maxX&&x.minY<=v.maxY&&x.maxX>=v.minX&&x.maxY>=v.minY}s(C,"c");function S(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}s(S,"p");function M(v,x,E,T,w){for(var D=[x,E];D.length;)if(!((E=D.pop())-(x=D.pop())<=T)){var O=x+Math.ceil((E-x)/T/2)*T;r(v,O,x,E,w),D.push(x,O,O,E)}}return s(M,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(v){var x=this.data,E=[];if(!C(v,x))return E;for(var T=this.toBBox,w=[];x;){for(var D=0;D<x.children.length;D++){var O=x.children[D],B=x.leaf?T(O):O;C(v,B)&&(x.leaf?E.push(O):g(v,B)?this._all(O,E):w.push(O))}x=w.pop()}return E},i.prototype.collides=function(v){var x=this.data;if(!C(v,x))return!1;for(var E=[];x;){for(var T=0;T<x.children.length;T++){var w=x.children[T],D=x.leaf?this.toBBox(w):w;if(C(v,D)){if(x.leaf||g(v,D))return!0;E.push(w)}}x=E.pop()}return!1},i.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var x=0;x<v.length;x++)this.insert(v[x]);return this}var E=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===E.height)this._splitRoot(this.data,E);else{if(this.data.height<E.height){var T=this.data;this.data=E,E=T}this._insert(E,this.data.height-E.height-1,!0)}else this.data=E;return this},i.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},i.prototype.clear=function(){return this.data=S([]),this},i.prototype.remove=function(v,x){if(!v)return this;for(var E,T,w,D=this.data,O=this.toBBox(v),B=[],G=[];D||B.length;){if(D||(D=B.pop(),T=B[B.length-1],E=G.pop(),w=!0),D.leaf){var R=n(v,D.children,x);if(R!==-1)return D.children.splice(R,1),B.push(D),this._condense(B),this}w||D.leaf||!g(D,O)?T?(E++,D=T.children[E],w=!1):D=null:(B.push(D),G.push(E),E=0,T=D,D=D.children[0])}return this},i.prototype.toBBox=function(v){return v},i.prototype.compareMinX=function(v,x){return v.minX-x.minX},i.prototype.compareMinY=function(v,x){return v.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(v){return this.data=v,this},i.prototype._all=function(v,x){for(var E=[];v;)v.leaf?x.push.apply(x,v.children):E.push.apply(E,v.children),v=E.pop();return x},i.prototype._build=function(v,x,E,T){var w,D=E-x+1,O=this._maxEntries;if(D<=O)return o(w=S(v.slice(x,E+1)),this.toBBox),w;T||(T=Math.ceil(Math.log(D)/Math.log(O)),O=Math.ceil(D/Math.pow(O,T-1))),(w=S([])).leaf=!1,w.height=T;var B=Math.ceil(D/O),G=B*Math.ceil(Math.sqrt(O));M(v,x,E,G,this.compareMinX);for(var R=x;R<=E;R+=G){var H=Math.min(R+G-1,E);M(v,R,H,B,this.compareMinY);for(var j=R;j<=H;j+=B){var Q=Math.min(j+B-1,H);w.children.push(this._build(v,j,Q,T-1))}}return o(w,this.toBBox),w},i.prototype._chooseSubtree=function(v,x,E,T){for(;T.push(x),!x.leaf&&T.length-1!==E;){for(var w=1/0,D=1/0,O=void 0,B=0;B<x.children.length;B++){var G=x.children[B],R=f(G),H=(j=v,Q=G,(Math.max(Q.maxX,j.maxX)-Math.min(Q.minX,j.minX))*(Math.max(Q.maxY,j.maxY)-Math.min(Q.minY,j.minY))-R);H<D?(D=H,w=R<w?R:w,O=G):H===D&&R<w&&(w=R,O=G)}x=O||x.children[0]}var j,Q;return x},i.prototype._insert=function(v,x,E){var T=E?v:this.toBBox(v),w=[],D=this._chooseSubtree(T,this.data,x,w);for(D.children.push(v),c(D,T);x>=0&&w[x].children.length>this._maxEntries;)this._split(w,x),x--;this._adjustParentBBoxes(T,w,x)},i.prototype._split=function(v,x){var E=v[x],T=E.children.length,w=this._minEntries;this._chooseSplitAxis(E,w,T);var D=this._chooseSplitIndex(E,w,T),O=S(E.children.splice(D,E.children.length-D));O.height=E.height,O.leaf=E.leaf,o(E,this.toBBox),o(O,this.toBBox),x?v[x-1].children.push(O):this._splitRoot(E,O)},i.prototype._splitRoot=function(v,x){this.data=S([v,x]),this.data.height=v.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(v,x,E){for(var T,w,D,O,B,G,R,H=1/0,j=1/0,Q=x;Q<=E-x;Q++){var pe=a(v,0,Q,this.toBBox),ge=a(v,Q,E,this.toBBox),xe=(w=pe,D=ge,O=void 0,B=void 0,G=void 0,R=void 0,O=Math.max(w.minX,D.minX),B=Math.max(w.minY,D.minY),G=Math.min(w.maxX,D.maxX),R=Math.min(w.maxY,D.maxY),Math.max(0,G-O)*Math.max(0,R-B)),Ve=f(pe)+f(ge);xe<H?(H=xe,T=Q,j=Ve<j?Ve:j):xe===H&&Ve<j&&(j=Ve,T=Q)}return T||E-x},i.prototype._chooseSplitAxis=function(v,x,E){var T=v.leaf?this.compareMinX:l,w=v.leaf?this.compareMinY:p;this._allDistMargin(v,x,E,T)<this._allDistMargin(v,x,E,w)&&v.children.sort(T)},i.prototype._allDistMargin=function(v,x,E,T){v.children.sort(T);for(var w=this.toBBox,D=a(v,0,x,w),O=a(v,E-x,E,w),B=y(D)+y(O),G=x;G<E-x;G++){var R=v.children[G];c(D,v.leaf?w(R):R),B+=y(D)}for(var H=E-x-1;H>=x;H--){var j=v.children[H];c(O,v.leaf?w(j):j),B+=y(O)}return B},i.prototype._adjustParentBBoxes=function(v,x,E){for(var T=E;T>=0;T--)c(x[T],v)},i.prototype._condense=function(v){for(var x=v.length-1,E=void 0;x>=0;x--)v[x].children.length===0?x>0?(E=v[x-1].children).splice(E.indexOf(v[x]),1):this.clear():o(v[x],this.toBBox)},i})});var Up=k(Y=>{"use strict";m();Object.defineProperty(Y,"__esModule",{value:!0});Y.earthRadius=63710088e-1;Y.factors={centimeters:Y.earthRadius*100,centimetres:Y.earthRadius*100,degrees:Y.earthRadius/111325,feet:Y.earthRadius*3.28084,inches:Y.earthRadius*39.37,kilometers:Y.earthRadius/1e3,kilometres:Y.earthRadius/1e3,meters:Y.earthRadius,metres:Y.earthRadius,miles:Y.earthRadius/1609.344,millimeters:Y.earthRadius*1e3,millimetres:Y.earthRadius*1e3,nauticalmiles:Y.earthRadius/1852,radians:1,yards:Y.earthRadius*1.0936};Y.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Y.earthRadius,yards:1.0936133};Y.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function ai(r,e,t){t===void 0&&(t={});var i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}s(ai,"feature");Y.feature=ai;function W7(r,e,t){switch(t===void 0&&(t={}),r){case"Point":return Xp(e).geometry;case"LineString":return Wp(e).geometry;case"Polygon":return jp(e).geometry;case"MultiPoint":return Zy(e).geometry;case"MultiLineString":return zy(e).geometry;case"MultiPolygon":return qy(e).geometry;default:throw new Error(r+" is invalid")}}s(W7,"geometry");Y.geometry=W7;function Xp(r,e,t){if(t===void 0&&(t={}),!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(!Hl(r[0])||!Hl(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return ai(i,e,t)}s(Xp,"point");Y.point=Xp;function Y7(r,e,t){return t===void 0&&(t={}),Xl(r.map(function(i){return Xp(i,e)}),t)}s(Y7,"points");Y.points=Y7;function jp(r,e,t){t===void 0&&(t={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return ai(c,e,t)}s(jp,"polygon");Y.polygon=jp;function U7(r,e,t){return t===void 0&&(t={}),Xl(r.map(function(i){return jp(i,e)}),t)}s(U7,"polygons");Y.polygons=U7;function Wp(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return ai(i,e,t)}s(Wp,"lineString");Y.lineString=Wp;function z7(r,e,t){return t===void 0&&(t={}),Xl(r.map(function(i){return Wp(i,e)}),t)}s(z7,"lineStrings");Y.lineStrings=z7;function Xl(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}s(Xl,"featureCollection");Y.featureCollection=Xl;function zy(r,e,t){t===void 0&&(t={});var i={type:"MultiLineString",coordinates:r};return ai(i,e,t)}s(zy,"multiLineString");Y.multiLineString=zy;function Zy(r,e,t){t===void 0&&(t={});var i={type:"MultiPoint",coordinates:r};return ai(i,e,t)}s(Zy,"multiPoint");Y.multiPoint=Zy;function qy(r,e,t){t===void 0&&(t={});var i={type:"MultiPolygon",coordinates:r};return ai(i,e,t)}s(qy,"multiPolygon");Y.multiPolygon=qy;function Z7(r,e,t){t===void 0&&(t={});var i={type:"GeometryCollection",geometries:r};return ai(i,e,t)}s(Z7,"geometryCollection");Y.geometryCollection=Z7;function q7(r,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(r*t)/t}s(q7,"round");Y.round=q7;function $y(r,e){e===void 0&&(e="kilometers");var t=Y.factors[e];if(!t)throw new Error(e+" units is invalid");return r*t}s($y,"radiansToLength");Y.radiansToLength=$y;function Yp(r,e){e===void 0&&(e="kilometers");var t=Y.factors[e];if(!t)throw new Error(e+" units is invalid");return r/t}s(Yp,"lengthToRadians");Y.lengthToRadians=Yp;function $7(r,e){return Jy(Yp(r,e))}s($7,"lengthToDegrees");Y.lengthToDegrees=$7;function J7(r){var e=r%360;return e<0&&(e+=360),e}s(J7,"bearingToAzimuth");Y.bearingToAzimuth=J7;function Jy(r){var e=r%(2*Math.PI);return e*180/Math.PI}s(Jy,"radiansToDegrees");Y.radiansToDegrees=Jy;function K7(r){var e=r%360;return e*Math.PI/180}s(K7,"degreesToRadians");Y.degreesToRadians=K7;function Q7(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return $y(Yp(r,e),t)}s(Q7,"convertLength");Y.convertLength=Q7;function e6(r,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=Y.areaFactors[e];if(!i)throw new Error("invalid original units");var n=Y.areaFactors[t];if(!n)throw new Error("invalid final units");return r/i*n}s(e6,"convertArea");Y.convertArea=e6;function Hl(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}s(Hl,"isNumber");Y.isNumber=Hl;function t6(r){return!!r&&r.constructor===Object}s(t6,"isObject");Y.isObject=t6;function r6(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(e){if(!Hl(e))throw new Error("bbox must only contain numbers")})}s(r6,"validateBBox");Y.validateBBox=r6;function i6(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}s(i6,"validateId");Y.validateId=i6});var rg=k(Le=>{"use strict";m();Object.defineProperty(Le,"__esModule",{value:!0});var We=Up();function da(r,e,t){if(r!==null)for(var i,n,o,a,c,l,p,f=0,y=0,g,C=r.type,S=C==="FeatureCollection",M=C==="Feature",v=S?r.features.length:1,x=0;x<v;x++){p=S?r.features[x].geometry:M?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var E=0;E<c;E++){var T=0,w=0;if(a=g?p.geometries[E]:p,a!==null){l=a.coordinates;var D=a.type;switch(f=t&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(e(l,y,x,T,w)===!1)return!1;y++,T++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(e(l[i],y,x,T,w)===!1)return!1;y++,D==="MultiPoint"&&T++}D==="LineString"&&T++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-f;n++){if(e(l[i][n],y,x,T,w)===!1)return!1;y++}D==="MultiLineString"&&T++,D==="Polygon"&&w++}D==="Polygon"&&T++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-f;o++){if(e(l[i][n][o],y,x,T,w)===!1)return!1;y++}w++}T++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(da(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(da,"coordEach");function n6(r,e,t,i){var n=t;return da(r,function(o,a,c,l,p){a===0&&t===void 0?n=o:n=e(n,o,a,c,l,p)},i),n}s(n6,"coordReduce");function Ky(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}s(Ky,"propEach");function o6(r,e,t){var i=t;return Ky(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}s(o6,"propReduce");function Qy(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}s(Qy,"featureEach");function a6(r,e,t){var i=t;return Qy(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}s(a6,"featureReduce");function s6(r){var e=[];return da(r,function(t){e.push(t)}),e}s(s6,"coordAll");function zp(r,e){var t,i,n,o,a,c,l,p,f,y,g=0,C=r.type==="FeatureCollection",S=r.type==="Feature",M=C?r.features.length:1;for(t=0;t<M;t++){for(c=C?r.features[t].geometry:S?r.geometry:r,p=C?r.features[t].properties:S?r.properties:{},f=C?r.features[t].bbox:S?r.bbox:void 0,y=C?r.features[t].id:S?r.id:void 0,l=c?c.type==="GeometryCollection":!1,a=l?c.geometries.length:1,n=0;n<a;n++){if(o=l?c.geometries[n]:c,o===null){if(e(null,g,p,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}s(zp,"geomEach");function l6(r,e,t){var i=t;return zp(r,function(n,o,a,c,l){o===0&&t===void 0?i=n:i=e(i,n,o,a,c,l)}),i}s(l6,"geomReduce");function jl(r,e){zp(r,function(t,i,n,o,a){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(We.feature(t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var f=t.coordinates[p],y={type:l,coordinates:f};if(e(We.feature(y,n),i,p)===!1)return!1}})}s(jl,"flattenEach");function c6(r,e,t){var i=t;return jl(r,function(n,o,a){o===0&&a===0&&t===void 0?i=n:i=e(i,n,o,a)}),i}s(c6,"flattenReduce");function eg(r,e){jl(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var c,l=0,p=0,f=0;if(da(t,function(y,g,C,S,M){if(c===void 0||i>l||S>p||M>f){c=y,l=i,p=S,f=M,o=0;return}var v=We.lineString([c,y],t.properties);if(e(v,i,n,M,o)===!1)return!1;o++,c=y})===!1)return!1}}})}s(eg,"segmentEach");function u6(r,e,t){var i=t,n=!1;return eg(r,function(o,a,c,l,p){n===!1&&t===void 0?i=o:i=e(i,o,a,c,l,p),n=!0}),i}s(u6,"segmentReduce");function tg(r,e){if(!r)throw new Error("geojson is required");jl(r,function(t,i,n){if(t.geometry!==null){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(e(t,i,n,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<a.length;c++)if(e(We.lineString(a[c],t.properties),i,n,c)===!1)return!1;break}}})}s(tg,"lineEach");function p6(r,e,t){var i=t;return tg(r,function(n,o,a,c){o===0&&t===void 0?i=n:i=e(i,n,o,a,c)}),i}s(p6,"lineReduce");function h6(r,e){if(e=e||{},!We.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.segmentIndex||0,a=e.properties,c;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,c=r.features[t].geometry;break;case"Feature":a=a||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=l.length+o-1),We.lineString([l[o],l[o+1]],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),We.lineString([l[n][o],l[n][o+1]],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),We.lineString([l[i][o],l[i][o+1]],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o-1),We.lineString([l[i][n][o],l[i][n][o+1]],a,e)}throw new Error("geojson is invalid")}s(h6,"findSegment");function d6(r,e){if(e=e||{},!We.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.coordIndex||0,a=e.properties,c;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,c=r.features[t].geometry;break;case"Feature":a=a||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return We.point(l,a,e);case"MultiPoint":return i<0&&(i=l.length+i),We.point(l[i],a,e);case"LineString":return o<0&&(o=l.length+o),We.point(l[o],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),We.point(l[n][o],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),We.point(l[i][o],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o),We.point(l[i][n][o],a,e)}throw new Error("geojson is invalid")}s(d6,"findPoint");Le.coordAll=s6;Le.coordEach=da;Le.coordReduce=n6;Le.featureEach=Qy;Le.featureReduce=a6;Le.findPoint=d6;Le.findSegment=h6;Le.flattenEach=jl;Le.flattenReduce=c6;Le.geomEach=zp;Le.geomReduce=l6;Le.lineEach=tg;Le.lineReduce=p6;Le.propEach=Ky;Le.propReduce=o6;Le.segmentEach=eg;Le.segmentReduce=u6});var Zp=k((hD,ng)=>{"use strict";m();var ig=Object.prototype.toString;ng.exports=s(function(e){var t=ig.call(e),i=t==="[object Arguments]";return i||(i=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&ig.call(e.callee)==="[object Function]"),i},"isArguments")});var dg=k((mD,hg)=>{"use strict";m();var pg;Object.keys||(fa=Object.prototype.hasOwnProperty,qp=Object.prototype.toString,og=Zp(),$p=Object.prototype.propertyIsEnumerable,ag=!$p.call({toString:null},"toString"),sg=$p.call(function(){},"prototype"),ma=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Wl=s(function(r){var e=r.constructor;return e&&e.prototype===r},"equalsConstructorPrototype"),lg={$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},cg=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!lg["$"+r]&&fa.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Wl(window[r])}catch{return!0}}catch{return!0}return!1}(),ug=s(function(r){if(typeof window>"u"||!cg)return Wl(r);try{return Wl(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),pg=s(function(e){var t=e!==null&&typeof e=="object",i=qp.call(e)==="[object Function]",n=og(e),o=t&&qp.call(e)==="[object String]",a=[];if(!t&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var c=sg&&i;if(o&&e.length>0&&!fa.call(e,0))for(var l=0;l<e.length;++l)a.push(String(l));if(n&&e.length>0)for(var p=0;p<e.length;++p)a.push(String(p));else for(var f in e)!(c&&f==="prototype")&&fa.call(e,f)&&a.push(String(f));if(ag)for(var y=ug(e),g=0;g<ma.length;++g)!(y&&ma[g]==="constructor")&&fa.call(e,ma[g])&&a.push(ma[g]);return a},"keys"));var fa,qp,og,$p,ag,sg,ma,Wl,lg,cg,ug;hg.exports=pg});var Ul=k((vD,yg)=>{"use strict";m();var f6=Array.prototype.slice,m6=Zp(),fg=Object.keys,Yl=fg?s(function(e){return fg(e)},"keys"):dg(),mg=Object.keys;Yl.shim=s(function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=s(function(i){return m6(i)?mg(f6.call(i)):mg(i)},"keys"))}else Object.keys=Yl;return Object.keys||Yl},"shimObjectKeys");yg.exports=Yl});var vg=k((xD,gg)=>{"use strict";m();gg.exports=Error});var Cg=k((MD,bg)=>{"use strict";m();bg.exports=EvalError});var Sg=k((wD,xg)=>{"use strict";m();xg.exports=RangeError});var Pg=k((ID,Mg)=>{"use strict";m();Mg.exports=ReferenceError});var Jp=k((DD,wg)=>{"use strict";m();wg.exports=SyntaxError});var _r=k((_D,Tg)=>{"use strict";m();Tg.exports=TypeError});var Eg=k((AD,Ig)=>{"use strict";m();Ig.exports=URIError});var ya=k((RD,Dg)=>{"use strict";m();Dg.exports=s(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==n||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var zl=k((FD,_g)=>{"use strict";m();var Lg=typeof Symbol<"u"&&Symbol,y6=ya();_g.exports=s(function(){return typeof Lg!="function"||typeof Symbol!="function"||typeof Lg("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:y6()},"hasNativeSymbols")});var Ag=k((HD,Og)=>{"use strict";m();var Kp={__proto__:null,foo:{}},g6=Object;Og.exports=s(function(){return{__proto__:Kp}.foo===Kp.foo&&!(Kp instanceof g6)},"hasProto")});var Ng=k((WD,Rg)=>{"use strict";m();var v6="Function.prototype.bind called on incompatible ",b6=Object.prototype.toString,C6=Math.max,x6="[object Function]",kg=s(function(e,t){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<t.length;o+=1)i[o+e.length]=t[o];return i},"concatty"),S6=s(function(e,t){for(var i=[],n=t||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),M6=s(function(r,e){for(var t="",i=0;i<r.length;i+=1)t+=r[i],i+1<r.length&&(t+=e);return t},"joiny");Rg.exports=s(function(e){var t=this;if(typeof t!="function"||b6.apply(t)!==x6)throw new TypeError(v6+t);for(var i=S6(arguments,1),n,o=s(function(){if(this instanceof n){var f=t.apply(this,kg(i,arguments));return Object(f)===f?f:this}return t.apply(e,kg(i,arguments))},"binder"),a=C6(0,t.length-i.length),c=[],l=0;l<a;l++)c[l]="$"+l;if(n=Function("binder","return function ("+M6(c,",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var p=s(function(){},"Empty");p.prototype=t.prototype,n.prototype=new p,p.prototype=null}return n},"bind")});var Zl=k((zD,Bg)=>{"use strict";m();var P6=Ng();Bg.exports=Function.prototype.bind||P6});var Qp=k((qD,Fg)=>{"use strict";m();var w6=Function.prototype.call,T6=Object.prototype.hasOwnProperty,I6=Zl();Fg.exports=I6.call(w6,T6)});var Gt=k((JD,jg)=>{"use strict";m();var J,E6=vg(),D6=Cg(),L6=Sg(),_6=Pg(),Un=Jp(),Yn=_r(),O6=Eg(),Xg=Function,eh=s(function(r){try{return Xg('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Vi=Object.getOwnPropertyDescriptor;if(Vi)try{Vi({},"")}catch{Vi=null}var th=s(function(){throw new Yn},"throwTypeError"),A6=Vi?function(){try{return arguments.callee,th}catch{try{return Vi(arguments,"callee").get}catch{return th}}}():th,jn=zl()(),k6=Ag()(),Ge=Object.getPrototypeOf||(k6?function(r){return r.__proto__}:null),Wn={},R6=typeof Uint8Array>"u"||!Ge?J:Ge(Uint8Array),Hi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":jn&&Ge?Ge([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":Wn,"%AsyncGenerator%":Wn,"%AsyncGeneratorFunction%":Wn,"%AsyncIteratorPrototype%":Wn,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":E6,"%eval%":eval,"%EvalError%":D6,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":Xg,"%GeneratorFunction%":Wn,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jn&&Ge?Ge(Ge([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!jn||!Ge?J:Ge(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":L6,"%ReferenceError%":_6,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!jn||!Ge?J:Ge(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jn&&Ge?Ge(""[Symbol.iterator]()):J,"%Symbol%":jn?Symbol:J,"%SyntaxError%":Un,"%ThrowTypeError%":A6,"%TypedArray%":R6,"%TypeError%":Yn,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":O6,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet};if(Ge)try{null.error}catch(r){Gg=Ge(Ge(r)),Hi["%Error.prototype%"]=Gg}var Gg,N6=s(function r(e){var t;if(e==="%AsyncFunction%")t=eh("async function () {}");else if(e==="%GeneratorFunction%")t=eh("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=eh("async function* () {}");else if(e==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&Ge&&(t=Ge(n.prototype))}return Hi[e]=t,t},"doEval"),Vg={__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"]},ga=Zl(),ql=Qp(),B6=ga.call(Function.call,Array.prototype.concat),F6=ga.call(Function.apply,Array.prototype.splice),Hg=ga.call(Function.call,String.prototype.replace),$l=ga.call(Function.call,String.prototype.slice),G6=ga.call(Function.call,RegExp.prototype.exec),V6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H6=/\\(\\)?/g,X6=s(function(e){var t=$l(e,0,1),i=$l(e,-1);if(t==="%"&&i!=="%")throw new Un("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new Un("invalid intrinsic syntax, expected opening `%`");var n=[];return Hg(e,V6,function(o,a,c,l){n[n.length]=c?Hg(l,H6,"$1"):a||o}),n},"stringToPath"),j6=s(function(e,t){var i=e,n;if(ql(Vg,i)&&(n=Vg[i],i="%"+n[0]+"%"),ql(Hi,i)){var o=Hi[i];if(o===Wn&&(o=N6(i)),typeof o>"u"&&!t)throw new Yn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Un("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");jg.exports=s(function(e,t){if(typeof e!="string"||e.length===0)throw new Yn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Yn('"allowMissing" argument must be a boolean');if(G6(/^%?[^%]*%?$/,e)===null)throw new Un("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=X6(e),n=i.length>0?i[0]:"",o=j6("%"+n+"%",t),a=o.name,c=o.value,l=!1,p=o.alias;p&&(n=p[0],F6(i,B6([0,1],p)));for(var f=1,y=!0;f<i.length;f+=1){var g=i[f],C=$l(g,0,1),S=$l(g,-1);if((C==='"'||C==="'"||C==="`"||S==='"'||S==="'"||S==="`")&&C!==S)throw new Un("property names with quotes must have matching quotes");if((g==="constructor"||!y)&&(l=!0),n+="."+g,a="%"+n+"%",ql(Hi,a))c=Hi[a];else if(c!=null){if(!(g in c)){if(!t)throw new Yn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Vi&&f+1>=i.length){var M=Vi(c,g);y=!!M,y&&"get"in M&&!("originalValue"in M.get)?c=M.get:c=c[g]}else y=ql(c,g),c=c[g];y&&!l&&(Hi[a]=c)}}return c},"GetIntrinsic")});var Kl=k((eL,Wg)=>{"use strict";m();var W6=Gt(),Jl=W6("%Object.defineProperty%",!0)||!1;if(Jl)try{Jl({},"a",{value:1})}catch{Jl=!1}Wg.exports=Jl});var ec=k((rL,Yg)=>{"use strict";m();var Y6=Gt(),Ql=Y6("%Object.getOwnPropertyDescriptor%",!0);if(Ql)try{Ql([],"length")}catch{Ql=null}Yg.exports=Ql});var tc=k((nL,Zg)=>{"use strict";m();var Ug=Kl(),U6=Jp(),zn=_r(),zg=ec();Zg.exports=s(function(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new zn("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new zn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new zn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new zn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new zn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new zn("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!zg&&zg(e,t);if(Ug)Ug(e,t,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:o===null&&l?l.writable:!o});else if(c||!n&&!o&&!a)e[t]=i;else throw new U6("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var rc=k((sL,$g)=>{"use strict";m();var rh=Kl(),qg=s(function(){return!!rh},"hasPropertyDescriptors");qg.hasArrayLengthDefineBug=s(function(){if(!rh)return null;try{return rh([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");$g.exports=qg});var si=k((uL,e0)=>{"use strict";m();var z6=Ul(),Z6=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",q6=Object.prototype.toString,$6=Array.prototype.concat,Jg=tc(),J6=s(function(r){return typeof r=="function"&&q6.call(r)==="[object Function]"},"isFunction"),Kg=rc()(),K6=s(function(r,e,t,i){if(e in r){if(i===!0){if(r[e]===t)return}else if(!J6(i)||!i())return}Kg?Jg(r,e,t,!0):Jg(r,e,t)},"defineProperty"),Qg=s(function(r,e){var t=arguments.length>2?arguments[2]:{},i=z6(e);Z6&&(i=$6.call(i,Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n+=1)K6(r,i[n],e[i[n]],t[i[n]])},"defineProperties");Qg.supportsDescriptors=!!Kg;e0.exports=Qg});var o0=k((dL,n0)=>{"use strict";m();var Q6=Gt(),t0=tc(),eC=rc()(),r0=ec(),i0=_r(),tC=Q6("%Math.floor%");n0.exports=s(function(e,t){if(typeof e!="function")throw new i0("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||tC(t)!==t)throw new i0("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&r0){var a=r0(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(eC?t0(e,"length",t,!0,!0):t0(e,"length",t)),e},"setFunctionLength")});var Xi=k((yL,ic)=>{"use strict";m();var ih=Zl(),nc=Gt(),rC=o0(),iC=_r(),l0=nc("%Function.prototype.apply%"),c0=nc("%Function.prototype.call%"),u0=nc("%Reflect.apply%",!0)||ih.call(c0,l0),a0=Kl(),nC=nc("%Math.max%");ic.exports=s(function(e){if(typeof e!="function")throw new iC("a function is required");var t=u0(ih,c0,arguments);return rC(t,1+nC(0,e.length-(arguments.length-1)),!0)},"callBind");var s0=s(function(){return u0(ih,l0,arguments)},"applyBind");a0?a0(ic.exports,"apply",{value:s0}):ic.exports.apply=s0});var bt=k((bL,d0)=>{"use strict";m();var p0=Gt(),h0=Xi(),oC=h0(p0("String.prototype.indexOf"));d0.exports=s(function(e,t){var i=p0(e,!!t);return typeof i=="function"&&oC(e,".prototype.")>-1?h0(i):i},"callBoundIntrinsic")});var nh=k((SL,v0)=>{"use strict";m();var aC=Ul(),y0=ya()(),g0=bt(),f0=Object,sC=g0("Array.prototype.push"),m0=g0("Object.prototype.propertyIsEnumerable"),lC=y0?Object.getOwnPropertySymbols:null;v0.exports=s(function(e,t){if(e==null)throw new TypeError("target must be an object");var i=f0(e);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=f0(arguments[n]),a=aC(o),c=y0&&(Object.getOwnPropertySymbols||lC);if(c)for(var l=c(o),p=0;p<l.length;++p){var f=l[p];m0(o,f)&&sC(a,f)}for(var y=0;y<a.length;++y){var g=a[y];if(m0(o,g)){var C=o[g];i[g]=C}}}return i},"assign")});var ah=k((wL,b0)=>{"use strict";m();var oh=nh(),cC=s(function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",e=r.split(""),t={},i=0;i<e.length;++i)t[e[i]]=e[i];var n=Object.assign({},t),o="";for(var a in n)o+=a;return r!==o},"lacksProperEnumerationOrder"),uC=s(function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1},"assignHasPendingExceptions");b0.exports=s(function(){return!Object.assign||cC()||uC()?oh:Object.assign},"getPolyfill")});var x0=k((EL,C0)=>{"use strict";m();var pC=si(),hC=ah();C0.exports=s(function(){var e=hC();return pC(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e},"shimAssign")});var w0=k((_L,P0)=>{"use strict";m();var dC=si(),fC=Xi(),mC=nh(),S0=ah(),yC=x0(),gC=fC.apply(S0()),M0=s(function(e,t){return gC(Object,arguments)},"assign");dC(M0,{getPolyfill:S0,implementation:mC,shim:yC});P0.exports=M0});var I0=k((kL,T0)=>{"use strict";m();var ba=s(function(){return typeof s(function(){},"f").name=="string"},"functionsHaveNames"),va=Object.getOwnPropertyDescriptor;if(va)try{va([],"length")}catch{va=null}ba.functionsHaveConfigurableNames=s(function(){if(!ba()||!va)return!1;var e=va(function(){},"name");return!!e&&!!e.configurable},"functionsHaveConfigurableNames");var vC=Function.prototype.bind;ba.boundFunctionsHaveNames=s(function(){return ba()&&typeof vC=="function"&&s(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");T0.exports=ba});var L0=k((BL,D0)=>{"use strict";m();var E0=tc(),bC=rc()(),CC=I0().functionsHaveConfigurableNames(),xC=_r();D0.exports=s(function(e,t){if(typeof e!="function")throw new xC("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||CC)&&(bC?E0(e,"name",t,!0,!0):E0(e,"name",t)),e},"setFunctionName")});var sh=k((VL,_0)=>{"use strict";m();var SC=L0(),MC=_r(),PC=Object;_0.exports=SC(s(function(){if(this==null||this!==PC(this))throw new MC("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"flags"),"get flags",!0)});var lh=k((jL,O0)=>{"use strict";m();var wC=sh(),TC=si().supportsDescriptors,IC=Object.getOwnPropertyDescriptor;O0.exports=s(function(){if(TC&&/a/mig.flags==="gim"){var e=IC(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var t="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(i,"sticky",{get:function(){t+="y"}}),t==="dy")return e.get}}return wC},"getPolyfill")});var R0=k((UL,k0)=>{"use strict";m();var EC=si().supportsDescriptors,DC=lh(),LC=Object.getOwnPropertyDescriptor,_C=Object.defineProperty,OC=TypeError,A0=Object.getPrototypeOf,AC=/a/;k0.exports=s(function(){if(!EC||!A0)throw new OC("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=DC(),t=A0(AC),i=LC(t,"flags");return(!i||i.get!==e)&&_C(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},"shimFlags")});var G0=k((qL,F0)=>{"use strict";m();var kC=si(),RC=Xi(),NC=sh(),N0=lh(),BC=R0(),B0=RC(N0());kC(B0,{getPolyfill:N0,implementation:NC,shim:BC});F0.exports=B0});var li=k((JL,V0)=>{"use strict";m();var FC=ya();V0.exports=s(function(){return FC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var uh=k((e_,X0)=>{"use strict";m();var GC=li()(),VC=bt(),ch=VC("Object.prototype.toString"),oc=s(function(e){return GC&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:ch(e)==="[object Arguments]"},"isArguments"),H0=s(function(e){return oc(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&ch(e)!=="[object Array]"&&ch(e.callee)==="[object Function]"},"isArguments"),HC=function(){return oc(arguments)}();oc.isLegacyArguments=H0;X0.exports=HC?oc:H0});var j0=k(()=>{m()});var c2=k((a_,l2)=>{m();var Ch=typeof Map=="function"&&Map.prototype,ph=Object.getOwnPropertyDescriptor&&Ch?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,sc=Ch&&ph&&typeof ph.get=="function"?ph.get:null,W0=Ch&&Map.prototype.forEach,xh=typeof Set=="function"&&Set.prototype,hh=Object.getOwnPropertyDescriptor&&xh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,lc=xh&&hh&&typeof hh.get=="function"?hh.get:null,Y0=xh&&Set.prototype.forEach,XC=typeof WeakMap=="function"&&WeakMap.prototype,xa=XC?WeakMap.prototype.has:null,jC=typeof WeakSet=="function"&&WeakSet.prototype,Sa=jC?WeakSet.prototype.has:null,WC=typeof WeakRef=="function"&&WeakRef.prototype,U0=WC?WeakRef.prototype.deref:null,YC=Boolean.prototype.valueOf,UC=Object.prototype.toString,zC=Function.prototype.toString,ZC=String.prototype.match,Sh=String.prototype.slice,ui=String.prototype.replace,qC=String.prototype.toUpperCase,z0=String.prototype.toLowerCase,r2=RegExp.prototype.test,Z0=Array.prototype.concat,sr=Array.prototype.join,$C=Array.prototype.slice,q0=Math.floor,mh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,dh=Object.getOwnPropertySymbols,yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Zn||!0)?Symbol.toStringTag:null,i2=Object.prototype.propertyIsEnumerable,$0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function J0(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||r2.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-q0(-r):q0(r);if(i!==r){var n=String(i),o=Sh.call(e,n.length+1);return ui.call(n,t,"$&_")+"."+ui.call(ui.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ui.call(e,t,"$&_")}s(J0,"addNumericSeparator");var gh=j0(),K0=gh.custom,Q0=o2(K0)?K0:null;l2.exports=s(function r(e,t,i,n){var o=t||{};if(ci(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ci(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=ci(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(ci(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(ci(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return s2(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return c?J0(e,l):l}if(typeof e=="bigint"){var p=String(e)+"n";return c?J0(e,p):p}var f=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=f&&f>0&&typeof e=="object")return vh(e)?"[Array]":"[Object]";var y=f8(o,i);if(typeof n>"u")n=[];else if(a2(n,e)>=0)return"[Circular]";function g(pe,ge,xe){if(ge&&(n=$C.call(n),n.push(ge)),xe){var Ve={depth:o.depth};return ci(o,"quoteStyle")&&(Ve.quoteStyle=o.quoteStyle),r(pe,Ve,i+1,n)}return r(pe,o,i+1,n)}if(s(g,"inspect"),typeof e=="function"&&!e2(e)){var C=o8(e),S=ac(e,g);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(S.length>0?" { "+sr.call(S,", ")+" }":"")}if(o2(e)){var M=Zn?ui.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):yh.call(e);return typeof e=="object"&&!Zn?Ca(M):M}if(p8(e)){for(var v="<"+z0.call(String(e.nodeName)),x=e.attributes||[],E=0;E<x.length;E++)v+=" "+x[E].name+"="+n2(JC(x[E].value),"double",o);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+z0.call(String(e.nodeName))+">",v}if(vh(e)){if(e.length===0)return"[]";var T=ac(e,g);return y&&!d8(T)?"["+bh(T,y)+"]":"[ "+sr.call(T,", ")+" ]"}if(QC(e)){var w=ac(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!i2.call(e,"cause")?"{ ["+String(e)+"] "+sr.call(Z0.call("[cause]: "+g(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+sr.call(w,", ")+" }"}if(typeof e=="object"&&a){if(Q0&&typeof e[Q0]=="function"&&gh)return gh(e,{depth:f-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(a8(e)){var D=[];return W0&&W0.call(e,function(pe,ge){D.push(g(ge,e,!0)+" => "+g(pe,e))}),t2("Map",sc.call(e),D,y)}if(c8(e)){var O=[];return Y0&&Y0.call(e,function(pe){O.push(g(pe,e))}),t2("Set",lc.call(e),O,y)}if(s8(e))return fh("WeakMap");if(u8(e))return fh("WeakSet");if(l8(e))return fh("WeakRef");if(t8(e))return Ca(g(Number(e)));if(i8(e))return Ca(g(mh.call(e)));if(r8(e))return Ca(YC.call(e));if(e8(e))return Ca(g(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===global)return"{ [object globalThis] }";if(!KC(e)&&!e2(e)){var B=ac(e,g),G=$0?$0(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",H=!G&&Ye&&Object(e)===e&&Ye in e?Sh.call(pi(e),8,-1):R?"Object":"",j=G||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Q=j+(H||R?"["+sr.call(Z0.call([],H||[],R||[]),": ")+"] ":"");return B.length===0?Q+"{}":y?Q+"{"+bh(B,y)+"}":Q+"{ "+sr.call(B,", ")+" }"}return String(e)},"inspect_");function n2(r,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+r+i}s(n2,"wrapQuotes");function JC(r){return ui.call(String(r),/"/g,""")}s(JC,"quote");function vh(r){return pi(r)==="[object Array]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(vh,"isArray");function KC(r){return pi(r)==="[object Date]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(KC,"isDate");function e2(r){return pi(r)==="[object RegExp]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(e2,"isRegExp");function QC(r){return pi(r)==="[object Error]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(QC,"isError");function e8(r){return pi(r)==="[object String]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(e8,"isString");function t8(r){return pi(r)==="[object Number]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(t8,"isNumber");function r8(r){return pi(r)==="[object Boolean]"&&(!Ye||!(typeof r=="object"&&Ye in r))}s(r8,"isBoolean");function o2(r){if(Zn)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!yh)return!1;try{return yh.call(r),!0}catch{}return!1}s(o2,"isSymbol");function i8(r){if(!r||typeof r!="object"||!mh)return!1;try{return mh.call(r),!0}catch{}return!1}s(i8,"isBigInt");var n8=Object.prototype.hasOwnProperty||function(r){return r in this};function ci(r,e){return n8.call(r,e)}s(ci,"has");function pi(r){return UC.call(r)}s(pi,"toStr");function o8(r){if(r.name)return r.name;var e=ZC.call(zC.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}s(o8,"nameOf");function a2(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}s(a2,"indexOf");function a8(r){if(!sc||!r||typeof r!="object")return!1;try{sc.call(r);try{lc.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}s(a8,"isMap");function s8(r){if(!xa||!r||typeof r!="object")return!1;try{xa.call(r,xa);try{Sa.call(r,Sa)}catch{return!0}return r instanceof WeakMap}catch{}return!1}s(s8,"isWeakMap");function l8(r){if(!U0||!r||typeof r!="object")return!1;try{return U0.call(r),!0}catch{}return!1}s(l8,"isWeakRef");function c8(r){if(!lc||!r||typeof r!="object")return!1;try{lc.call(r);try{sc.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}s(c8,"isSet");function u8(r){if(!Sa||!r||typeof r!="object")return!1;try{Sa.call(r,Sa);try{xa.call(r,xa)}catch{return!0}return r instanceof WeakSet}catch{}return!1}s(u8,"isWeakSet");function p8(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}s(p8,"isElement");function s2(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return s2(Sh.call(r,0,e.maxStringLength),e)+i}var n=ui.call(ui.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,h8);return n2(n,"single",e)}s(s2,"inspectString");function h8(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+qC.call(e.toString(16))}s(h8,"lowbyte");function Ca(r){return"Object("+r+")"}s(Ca,"markBoxed");function fh(r){return r+" { ? }"}s(fh,"weakCollectionOf");function t2(r,e,t,i){var n=i?bh(t,i):sr.call(t,", ");return r+" ("+e+") {"+n+"}"}s(t2,"collectionOf");function d8(r){for(var e=0;e<r.length;e++)if(a2(r[e],"\n")>=0)return!1;return!0}s(d8,"singleLineValues");function f8(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=sr.call(Array(r.indent+1)," ");else return null;return{base:t,prev:sr.call(Array(e+1),t)}}s(f8,"getIndent");function bh(r,e){if(r.length===0)return"";var t="\n"+e.prev+e.base;return t+sr.call(r,","+t)+"\n"+e.prev}s(bh,"indentedJoin");function ac(r,e){var t=vh(r),i=[];if(t){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=ci(r,n)?e(r[n],r):""}var o=typeof dh=="function"?dh(r):[],a;if(Zn){a={};for(var c=0;c<o.length;c++)a["$"+o[c]]=o[c]}for(var l in r)ci(r,l)&&(t&&String(Number(l))===l&&l<r.length||Zn&&a["$"+l]instanceof Symbol||(r2.call(/[^\w$]/,l)?i.push(e(l,r)+": "+e(r[l],r)):i.push(l+": "+e(r[l],r))));if(typeof dh=="function")for(var p=0;p<o.length;p++)i2.call(r,o[p])&&i.push("["+e(o[p])+"]: "+e(r[o[p]],r));return i}s(ac,"arrObjKeys")});var Ph=k((c_,p2)=>{"use strict";m();var u2=Gt(),qn=bt(),m8=c2(),y8=_r(),cc=u2("%WeakMap%",!0),uc=u2("%Map%",!0),g8=qn("WeakMap.prototype.get",!0),v8=qn("WeakMap.prototype.set",!0),b8=qn("WeakMap.prototype.has",!0),C8=qn("Map.prototype.get",!0),x8=qn("Map.prototype.set",!0),S8=qn("Map.prototype.has",!0),Mh=s(function(r,e){for(var t=r,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),M8=s(function(r,e){var t=Mh(r,e);return t&&t.value},"listGet"),P8=s(function(r,e,t){var i=Mh(r,e);i?i.value=t:r.next={key:e,next:r.next,value:t}},"listSet"),w8=s(function(r,e){return!!Mh(r,e)},"listHas");p2.exports=s(function(){var e,t,i,n={assert:function(o){if(!n.has(o))throw new y8("Side channel does not contain "+m8(o))},get:function(o){if(cc&&o&&(typeof o=="object"||typeof o=="function")){if(e)return g8(e,o)}else if(uc){if(t)return C8(t,o)}else if(i)return M8(i,o)},has:function(o){if(cc&&o&&(typeof o=="object"||typeof o=="function")){if(e)return b8(e,o)}else if(uc){if(t)return S8(t,o)}else if(i)return w8(i,o);return!1},set:function(o,a){cc&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new cc),v8(e,o,a)):uc?(t||(t=new uc),x8(t,o,a)):(i||(i={key:{},next:null}),P8(i,o,a))}};return n},"getSideChannel")});var d2=k((h_,h2)=>{"use strict";m();var T8=Qp(),Ma=Ph()(),Or=_r(),wh={assert:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Or("`O` is not an object");if(typeof e!="string")throw new Or("`slot` must be a string");if(Ma.assert(r),!wh.has(r,e))throw new Or("`"+e+"` is not present on `O`")},get:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Or("`O` is not an object");if(typeof e!="string")throw new Or("`slot` must be a string");var t=Ma.get(r);return t&&t["$"+e]},has:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Or("`O` is not an object");if(typeof e!="string")throw new Or("`slot` must be a string");var t=Ma.get(r);return!!t&&T8(t,"$"+e)},set:function(r,e,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Or("`O` is not an object");if(typeof e!="string")throw new Or("`slot` must be a string");var i=Ma.get(r);i||(i={},Ma.set(r,i)),i["$"+e]=t}};Object.freeze&&Object.freeze(wh);h2.exports=wh});var y2=k((f_,m2)=>{"use strict";m();var Pa=d2(),I8=SyntaxError,f2=typeof StopIteration=="object"?StopIteration:null;m2.exports=s(function(e){if(!f2)throw new I8("this environment lacks StopIteration");Pa.set(e,"[[Done]]",!1);var t={next:s(function(){var n=Pa.get(this,"[[Iterator]]"),o=Pa.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(Pa.set(n,"[[Done]]",!0),a!==f2)throw a;return{done:!0,value:void 0}}},"next")};return Pa.set(t,"[[Iterator]]",e),t},"getStopIterationIterator")});var Th=k((g_,g2)=>{m();var E8={}.toString;g2.exports=Array.isArray||function(r){return E8.call(r)=="[object Array]"}});var Ih=k((b_,v2)=>{"use strict";m();var D8=String.prototype.valueOf,L8=s(function(e){try{return D8.call(e),!0}catch{return!1}},"tryStringObject"),_8=Object.prototype.toString,O8="[object String]",A8=li()();v2.exports=s(function(e){return typeof e=="string"?!0:typeof e!="object"?!1:A8?L8(e):_8.call(e)===O8},"isString")});var Dh=k((S_,x2)=>{"use strict";m();var Eh=typeof Map=="function"&&Map.prototype?Map:null,k8=typeof Set=="function"&&Set.prototype?Set:null,pc;Eh||(pc=s(function(e){return!1},"isMap"));var C2=Eh?Map.prototype.has:null,b2=k8?Set.prototype.has:null;!pc&&!C2&&(pc=s(function(e){return!1},"isMap"));x2.exports=pc||s(function(e){if(!e||typeof e!="object")return!1;try{if(C2.call(e),b2)try{b2.call(e)}catch{return!0}return e instanceof Eh}catch{}return!1},"isMap")});var _h=k((w_,P2)=>{"use strict";m();var R8=typeof Map=="function"&&Map.prototype?Map:null,Lh=typeof Set=="function"&&Set.prototype?Set:null,hc;Lh||(hc=s(function(e){return!1},"isSet"));var S2=R8?Map.prototype.has:null,M2=Lh?Set.prototype.has:null;!hc&&!M2&&(hc=s(function(e){return!1},"isSet"));P2.exports=hc||s(function(e){if(!e||typeof e!="object")return!1;try{if(M2.call(e),S2)try{S2.call(e)}catch{return!0}return e instanceof Lh}catch{}return!1},"isSet")});var N2=k((E_,mc)=>{"use strict";m();var w2=uh(),T2=y2();zl()()||ya()()?(dc=Symbol.iterator,mc.exports=s(function(e){if(e!=null&&typeof e[dc]<"u")return e[dc]();if(w2(e))return Array.prototype[dc].call(e)},"getIterator")):(I2=Th(),E2=Ih(),Oh=Gt(),D2=Oh("%Map%",!0),L2=Oh("%Set%",!0),Pt=bt(),Ah=Pt("Array.prototype.push"),kh=Pt("String.prototype.charCodeAt"),_2=Pt("String.prototype.slice"),O2=s(function(e,t){var i=e.length;if(t+1>=i)return t+1;var n=kh(e,t);if(n<55296||n>56319)return t+1;var o=kh(e,t+1);return o<56320||o>57343?t+1:t+2},"advanceStringIndex"),fc=s(function(e){var t=0;return{next:s(function(){var n=t>=e.length,o;return n||(o=e[t],t+=1),{done:n,value:o}},"next")}},"getArrayIterator"),Rh=s(function(e,t){if(I2(e)||w2(e))return fc(e);if(E2(e)){var i=0;return{next:s(function(){var o=O2(e,i),a=_2(e,i,o);return i=o,{done:o>e.length,value:a}},"next")}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()},"getNonCollectionIterator"),!D2&&!L2?mc.exports=s(function(e){if(e!=null)return Rh(e,!0)},"getIterator"):(A2=Dh(),k2=_h(),Nh=Pt("Map.prototype.forEach",!0),Bh=Pt("Set.prototype.forEach",!0),(typeof b>"u"||!b.versions||!b.versions.node)&&(Fh=Pt("Map.prototype.iterator",!0),Gh=Pt("Set.prototype.iterator",!0)),Vh=Pt("Map.prototype.@@iterator",!0)||Pt("Map.prototype._es6-shim iterator_",!0),Hh=Pt("Set.prototype.@@iterator",!0)||Pt("Set.prototype._es6-shim iterator_",!0),R2=s(function(e){if(A2(e)){if(Fh)return T2(Fh(e));if(Vh)return Vh(e);if(Nh){var t=[];return Nh(e,function(n,o){Ah(t,[o,n])}),fc(t)}}if(k2(e)){if(Gh)return T2(Gh(e));if(Hh)return Hh(e);if(Bh){var i=[];return Bh(e,function(n){Ah(i,n)}),fc(i)}}},"getCollectionIterator"),mc.exports=s(function(e){return R2(e)||Rh(e)},"getIterator")));var dc,I2,E2,Oh,D2,L2,Pt,Ah,kh,_2,O2,fc,Rh,A2,k2,Nh,Bh,Fh,Gh,Vh,Hh,R2});var Xh=k((__,F2)=>{"use strict";m();var B2=s(function(r){return r!==r},"numberIsNaN");F2.exports=s(function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||B2(e)&&B2(t))},"is")});var jh=k((k_,G2)=>{"use strict";m();var N8=Xh();G2.exports=s(function(){return typeof Object.is=="function"?Object.is:N8},"getPolyfill")});var H2=k((B_,V2)=>{"use strict";m();var B8=jh(),F8=si();V2.exports=s(function(){var e=B8();return F8(Object,{is:e},{is:s(function(){return Object.is!==e},"testObjectIs")}),e},"shimObjectIs")});var Y2=k((V_,W2)=>{"use strict";m();var G8=si(),V8=Xi(),H8=Xh(),X2=jh(),X8=H2(),j2=V8(X2(),Object);G8(j2,{getPolyfill:X2,implementation:H8,shim:X8});W2.exports=j2});var Yh=k((X_,q2)=>{"use strict";m();var j8=Xi(),Z2=bt(),W8=Gt(),Wh=W8("%ArrayBuffer%",!0),yc=Z2("ArrayBuffer.prototype.byteLength",!0),Y8=Z2("Object.prototype.toString"),U2=!!Wh&&!yc&&new Wh(0).slice,z2=!!U2&&j8(U2);q2.exports=s(yc||z2?function(e){if(!e||typeof e!="object")return!1;try{return yc?yc(e):z2(e,0),!0}catch{return!1}}:Wh?function(e){return Y8(e)==="[object ArrayBuffer]"}:function(e){return!1},"isArrayBuffer")});var J2=k((Y_,$2)=>{"use strict";m();var U8=Date.prototype.getDay,z8=s(function(e){try{return U8.call(e),!0}catch{return!1}},"tryDateGetDayCall"),Z8=Object.prototype.toString,q8="[object Date]",$8=li()();$2.exports=s(function(e){return typeof e!="object"||e===null?!1:$8?z8(e):Z8.call(e)===q8},"isDateObject")});var rv=k((Z_,tv)=>{"use strict";m();var Uh=bt(),K2=li()(),Q2,ev,zh,Zh;K2&&(Q2=Uh("Object.prototype.hasOwnProperty"),ev=Uh("RegExp.prototype.exec"),zh={},gc=s(function(){throw zh},"throwRegexMarker"),Zh={toString:gc,valueOf:gc},typeof Symbol.toPrimitive=="symbol"&&(Zh[Symbol.toPrimitive]=gc));var gc,J8=Uh("Object.prototype.toString"),K8=Object.getOwnPropertyDescriptor,Q8="[object RegExp]";tv.exports=s(K2?function(e){if(!e||typeof e!="object")return!1;var t=K8(e,"lastIndex"),i=t&&Q2(t,"value");if(!i)return!1;try{ev(e,Zh)}catch(n){return n===zh}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:J8(e)===Q8},"isRegex")});var ov=k((J_,nv)=>{"use strict";m();var e9=bt(),iv=e9("SharedArrayBuffer.prototype.byteLength",!0);nv.exports=s(iv?function(e){if(!e||typeof e!="object")return!1;try{return iv(e),!0}catch{return!1}}:function(e){return!1},"isSharedArrayBuffer")});var sv=k((eO,av)=>{"use strict";m();var t9=Number.prototype.toString,r9=s(function(e){try{return t9.call(e),!0}catch{return!1}},"tryNumberObject"),i9=Object.prototype.toString,n9="[object Number]",o9=li()();av.exports=s(function(e){return typeof e=="number"?!0:typeof e!="object"?!1:o9?r9(e):i9.call(e)===n9},"isNumberObject")});var uv=k((iO,cv)=>{"use strict";m();var lv=bt(),a9=lv("Boolean.prototype.toString"),s9=lv("Object.prototype.toString"),l9=s(function(e){try{return a9(e),!0}catch{return!1}},"booleanBrandCheck"),c9="[object Boolean]",u9=li()();cv.exports=s(function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:u9&&Symbol.toStringTag in e?l9(e):s9(e)===c9},"isBoolean")});var fv=k((aO,qh)=>{"use strict";m();var p9=Object.prototype.toString,h9=zl()();h9?(pv=Symbol.prototype.toString,hv=/^Symbol\(.*\)$/,dv=s(function(e){return typeof e.valueOf()!="symbol"?!1:hv.test(pv.call(e))},"isRealSymbolObject"),qh.exports=s(function(e){if(typeof e=="symbol")return!0;if(p9.call(e)!=="[object Symbol]")return!1;try{return dv(e)}catch{return!1}},"isSymbol")):qh.exports=s(function(e){return!1},"isSymbol");var pv,hv,dv});var gv=k((cO,yv)=>{"use strict";m();var mv=typeof BigInt<"u"&&BigInt;yv.exports=s(function(){return typeof mv=="function"&&typeof BigInt=="function"&&typeof mv(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var Cv=k((hO,$h)=>{"use strict";m();var d9=gv()();d9?(vv=BigInt.prototype.valueOf,bv=s(function(e){try{return vv.call(e),!0}catch{}return!1},"tryBigIntObject"),$h.exports=s(function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:bv(e)},"isBigInt")):$h.exports=s(function(e){return!1},"isBigInt");var vv,bv});var Sv=k((mO,xv)=>{"use strict";m();var f9=Ih(),m9=sv(),y9=uv(),g9=fv(),v9=Cv();xv.exports=s(function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(f9(e))return"String";if(m9(e))return"Number";if(y9(e))return"Boolean";if(g9(e))return"Symbol";if(v9(e))return"BigInt"},"whichBoxedPrimitive")});var wv=k((vO,Pv)=>{"use strict";m();var vc=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Mv=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,bc;vc||(bc=s(function(e){return!1},"isWeakMap"));var Kh=vc?vc.prototype.has:null,Jh=Mv?Mv.prototype.has:null;!bc&&!Kh&&(bc=s(function(e){return!1},"isWeakMap"));Pv.exports=bc||s(function(e){if(!e||typeof e!="object")return!1;try{if(Kh.call(e,Kh),Jh)try{Jh.call(e,Jh)}catch{return!0}return e instanceof vc}catch{}return!1},"isWeakMap")});var Iv=k((xO,ed)=>{"use strict";m();var b9=Gt(),Tv=bt(),C9=b9("%WeakSet%",!0),Qh=Tv("WeakSet.prototype.has",!0);Qh?(Cc=Tv("WeakMap.prototype.has",!0),ed.exports=s(function(e){if(!e||typeof e!="object")return!1;try{if(Qh(e,Qh),Cc)try{Cc(e,Cc)}catch{return!0}return e instanceof C9}catch{}return!1},"isWeakSet")):ed.exports=s(function(e){return!1},"isWeakSet");var Cc});var Dv=k((PO,Ev)=>{"use strict";m();var x9=Dh(),S9=_h(),M9=wv(),P9=Iv();Ev.exports=s(function(e){if(e&&typeof e=="object"){if(x9(e))return"Map";if(S9(e))return"Set";if(M9(e))return"WeakMap";if(P9(e))return"WeakSet"}return!1},"whichCollection")});var Av=k((IO,Ov)=>{"use strict";m();var _v=Function.prototype.toString,$n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,rd,xc;if(typeof $n=="function"&&typeof Object.defineProperty=="function")try{rd=Object.defineProperty({},"length",{get:function(){throw xc}}),xc={},$n(function(){throw 42},null,rd)}catch(r){r!==xc&&($n=null)}else $n=null;var w9=/^\s*class\b/,id=s(function(e){try{var t=_v.call(e);return w9.test(t)}catch{return!1}},"isES6ClassFunction"),td=s(function(e){try{return id(e)?!1:(_v.call(e),!0)}catch{return!1}},"tryFunctionToStr"),Sc=Object.prototype.toString,T9="[object Object]",I9="[object Function]",E9="[object GeneratorFunction]",D9="[object HTMLAllCollection]",L9="[object HTML document.all class]",_9="[object HTMLCollection]",O9=typeof Symbol=="function"&&!!Symbol.toStringTag,A9=!(0 in[,]),nd=s(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(Lv=document.all,Sc.call(Lv)===Sc.call(document.all)&&(nd=s(function(e){if((A9||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Sc.call(e);return(t===D9||t===L9||t===_9||t===T9)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var Lv;Ov.exports=s($n?function(e){if(nd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{$n(e,null,rd)}catch(t){if(t!==xc)return!1}return!id(e)&&td(e)}:function(e){if(nd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(O9)return td(e);if(id(e))return!1;var t=Sc.call(e);return t!==I9&&t!==E9&&!/^\[object HTML/.test(t)?!1:td(e)},"isCallable")});var Nv=k((LO,Rv)=>{"use strict";m();var k9=Av(),R9=Object.prototype.toString,kv=Object.prototype.hasOwnProperty,N9=s(function(e,t,i){for(var n=0,o=e.length;n<o;n++)kv.call(e,n)&&(i==null?t(e[n],n,e):t.call(i,e[n],n,e))},"forEachArray"),B9=s(function(e,t,i){for(var n=0,o=e.length;n<o;n++)i==null?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)},"forEachString"),F9=s(function(e,t,i){for(var n in e)kv.call(e,n)&&(i==null?t(e[n],n,e):t.call(i,e[n],n,e))},"forEachObject"),G9=s(function(e,t,i){if(!k9(t))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),R9.call(e)==="[object Array]"?N9(e,t,n):typeof e=="string"?B9(e,t,n):F9(e,t,n)},"forEach");Rv.exports=G9});var Fv=k((AO,Bv)=>{"use strict";m();Bv.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Vv=k((RO,Gv)=>{"use strict";m();var od=Fv(),V9=typeof globalThis>"u"?global:globalThis;Gv.exports=s(function(){for(var e=[],t=0;t<od.length;t++)typeof V9[od[t]]=="function"&&(e[e.length]=od[t]);return e},"availableTypedArrays")});var Yv=k((FO,Wv)=>{"use strict";m();var Pc=Nv(),H9=Vv(),Hv=Xi(),ld=bt(),Mc=ec(),X9=ld("Object.prototype.toString"),jv=li()(),Xv=typeof globalThis>"u"?global:globalThis,sd=H9(),cd=ld("String.prototype.slice"),ad=Object.getPrototypeOf,j9=ld("Array.prototype.indexOf",!0)||s(function(e,t){for(var i=0;i<e.length;i+=1)if(e[i]===t)return i;return-1},"indexOf"),wc={__proto__:null};jv&&Mc&&ad?Pc(sd,function(r){var e=new Xv[r];if(Symbol.toStringTag in e){var t=ad(e),i=Mc(t,Symbol.toStringTag);if(!i){var n=ad(t);i=Mc(n,Symbol.toStringTag)}wc["$"+r]=Hv(i.get)}}):Pc(sd,function(r){var e=new Xv[r],t=e.slice||e.set;t&&(wc["$"+r]=Hv(t))});var W9=s(function(e){var t=!1;return Pc(wc,function(i,n){if(!t)try{"$"+i(e)===n&&(t=cd(n,1))}catch{}}),t},"tryAllTypedArrays"),Y9=s(function(e){var t=!1;return Pc(wc,function(i,n){if(!t)try{i(e),t=cd(n,1)}catch{}}),t},"tryAllSlices");Wv.exports=s(function(e){if(!e||typeof e!="object")return!1;if(!jv){var t=cd(X9(e),8,-1);return j9(sd,t)>-1?t:t!=="Object"?!1:Y9(e)}return Mc?W9(e):null},"whichTypedArray")});var Zv=k((HO,zv)=>{"use strict";m();var U9=bt(),Uv=U9("ArrayBuffer.prototype.byteLength",!0),z9=Yh();zv.exports=s(function(e){return z9(e)?Uv?Uv(e):e.byteLength:NaN},"byteLength")});var b3=k((WO,v3)=>{"use strict";m();var m3=w0(),lr=bt(),qv=G0(),Z9=Gt(),Jn=N2(),q9=Ph(),$v=Y2(),Jv=uh(),Kv=Th(),Qv=Yh(),e3=J2(),t3=rv(),r3=ov(),i3=Ul(),n3=Sv(),o3=Dv(),a3=Yv(),s3=Zv(),l3=lr("SharedArrayBuffer.prototype.byteLength",!0),c3=lr("Date.prototype.getTime"),ud=Object.getPrototypeOf,u3=lr("Object.prototype.toString"),Ic=Z9("%Set%",!0),pd=lr("Map.prototype.has",!0),Ec=lr("Map.prototype.get",!0),p3=lr("Map.prototype.size",!0),Dc=lr("Set.prototype.add",!0),y3=lr("Set.prototype.delete",!0),Lc=lr("Set.prototype.has",!0),Tc=lr("Set.prototype.size",!0);function h3(r,e,t,i){for(var n=Jn(r),o;(o=n.next())&&!o.done;)if(Vt(e,o.value,t,i))return y3(r,o.value),!0;return!1}s(h3,"setHasEqualElement");function g3(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}s(g3,"findLooseMatchingPrimitives");function $9(r,e,t,i,n,o){var a=g3(t);if(a!=null)return a;var c=Ec(e,a),l=m3({},n,{strict:!1});return typeof c>"u"&&!pd(e,a)||!Vt(i,c,l,o)?!1:!pd(r,a)&&Vt(i,c,l,o)}s($9,"mapMightHaveLoosePrim");function J9(r,e,t){var i=g3(t);return i!=null?i:Lc(e,i)&&!Lc(r,i)}s(J9,"setMightHaveLoosePrim");function d3(r,e,t,i,n,o){for(var a=Jn(r),c,l;(c=a.next())&&!c.done;)if(l=c.value,Vt(t,l,n,o)&&Vt(i,Ec(e,l),n,o))return y3(r,l),!0;return!1}s(d3,"mapHasEqualEntry");function Vt(r,e,t,i){var n=t||{};if(n.strict?$v(r,e):r===e)return!0;var o=n3(r),a=n3(e);if(o!==a)return!1;if(!r||!e||typeof r!="object"&&typeof e!="object")return n.strict?$v(r,e):r==e;var c=i.has(r),l=i.has(e),p;if(c&&l){if(i.get(r)===i.get(e))return!0}else p={};return c||i.set(r,p),l||i.set(e,p),ex(r,e,n,i)}s(Vt,"internalDeepEqual");function f3(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}s(f3,"isBuffer");function K9(r,e,t,i){if(Tc(r)!==Tc(e))return!1;for(var n=Jn(r),o=Jn(e),a,c,l;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")l||(l=new Ic),Dc(l,a.value);else if(!Lc(e,a.value)){if(t.strict||!J9(r,e,a.value))return!1;l||(l=new Ic),Dc(l,a.value)}if(l){for(;(c=o.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!h3(l,c.value,t.strict,i))return!1}else if(!t.strict&&!Lc(r,c.value)&&!h3(l,c.value,t.strict,i))return!1;return Tc(l)===0}return!0}s(K9,"setEquiv");function Q9(r,e,t,i){if(p3(r)!==p3(e))return!1;for(var n=Jn(r),o=Jn(e),a,c,l,p,f,y;(a=n.next())&&!a.done;)if(p=a.value[0],f=a.value[1],p&&typeof p=="object")l||(l=new Ic),Dc(l,p);else if(y=Ec(e,p),typeof y>"u"&&!pd(e,p)||!Vt(f,y,t,i)){if(t.strict||!$9(r,e,p,f,t,i))return!1;l||(l=new Ic),Dc(l,p)}if(l){for(;(c=o.next())&&!c.done;)if(p=c.value[0],y=c.value[1],p&&typeof p=="object"){if(!d3(l,r,p,y,t,i))return!1}else if(!t.strict&&(!r.has(p)||!Vt(Ec(r,p),y,t,i))&&!d3(l,r,p,y,m3({},t,{strict:!1}),i))return!1;return Tc(l)===0}return!0}s(Q9,"mapEquiv");function ex(r,e,t,i){var n,o;if(typeof r!=typeof e||r==null||e==null||u3(r)!==u3(e)||Jv(r)!==Jv(e))return!1;var a=Kv(r),c=Kv(e);if(a!==c)return!1;var l=r instanceof Error,p=e instanceof Error;if(l!==p||(l||p)&&(r.name!==e.name||r.message!==e.message))return!1;var f=t3(r),y=t3(e);if(f!==y||(f||y)&&(r.source!==e.source||qv(r)!==qv(e)))return!1;var g=e3(r),C=e3(e);if(g!==C||(g||C)&&c3(r)!==c3(e)||t.strict&&ud&&ud(r)!==ud(e))return!1;var S=a3(r),M=a3(e);if(S!==M)return!1;if(S||M){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var v=f3(r),x=f3(e);if(v!==x)return!1;if(v||x){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var E=Qv(r),T=Qv(e);if(E!==T)return!1;if(E||T)return s3(r)!==s3(e)?!1:typeof Uint8Array=="function"&&Vt(new Uint8Array(r),new Uint8Array(e),t,i);var w=r3(r),D=r3(e);if(w!==D)return!1;if(w||D)return l3(r)!==l3(e)?!1:typeof Uint8Array=="function"&&Vt(new Uint8Array(r),new Uint8Array(e),t,i);if(typeof r!=typeof e)return!1;var O=i3(r),B=i3(e);if(O.length!==B.length)return!1;for(O.sort(),B.sort(),n=O.length-1;n>=0;n--)if(O[n]!=B[n])return!1;for(n=O.length-1;n>=0;n--)if(o=O[n],!Vt(r[o],e[o],t,i))return!1;var G=o3(r),R=o3(e);return G!==R?!1:G==="Set"||R==="Set"?K9(r,e,t,i):G==="Map"?Q9(r,e,t,i):!0}s(ex,"objEquiv");v3.exports=s(function(e,t,i){return Vt(e,t,i,q9())},"deepEqual")});var R3=k(oe=>{"use strict";m();Object.defineProperty(oe,"__esModule",{value:!0});function tx(r){return r&&r.__esModule?r:{default:r}}s(tx,"_interopRequireDefault");var rx=Object.defineProperty,ae=s((r,e)=>rx(r,"name",{value:e,configurable:!0}),"__name"),ix=b3(),nx=tx(ix),Ia,C3=(Ia=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,i,n;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(i=e==null?void 0:e.direction)!=null?i:!1,this.compareProperties=(n=e==null?void 0:e.compareProperties)!=null?n:!0}compare(e,t){if(e.type!==t.type||!wa(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){let i=hd(e),n=hd(t);return i.every(o=>n.some(a=>this.compare(o,a)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((i,n)=>Math.abs(i-t[n])<this.precision)}compareLine(e,t,i=0,n=!1){if(!wa(e,t))return!1;let o=e,a=t;if(n&&!this.compareCoord(o[0],a[0])){let l=this.fixStartIndex(a,o);if(l)a=l;else return!1}let c=this.compareCoord(o[i],a[i]);return this.direction||c?this.comparePath(o,a):this.compareCoord(o[i],a[a.length-(1+i)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(e,t){let i,n=-1;for(let o=0;o<e.length;o++)if(this.compareCoord(e[o],t[0])){n=o;break}return n>=0&&(i=[].concat(e.slice(n,e.length),e.slice(1,n+1))),i}comparePath(e,t){return e.every((i,n)=>this.compareCoord(i,t[n]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){let i=e.coordinates.slice(1,e.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length);return i.every(o=>n.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(e,t){return wa(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((i,n)=>this.compare(i,t.geometries[n]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?nx.default.call(void 0,e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return wa(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((i,n)=>this.compare(i,t.features[n]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}},s(Ia,"_GeojsonEquality"),Ia);ae(C3,"GeojsonEquality");var ox=C3;function wa(r,e){return r.coordinates?r.coordinates.length===e.coordinates.length:r.length===e.length}s(wa,"sameLength");ae(wa,"sameLength");function hd(r){return r.coordinates.map(e=>({type:r.type.replace("Multi",""),coordinates:e}))}s(hd,"explode");ae(hd,"explode");var at=63710088e-1,fd={centimeters:at*100,centimetres:at*100,degrees:360/(2*Math.PI),feet:at*3.28084,inches:at*39.37,kilometers:at/1e3,kilometres:at/1e3,meters:at,metres:at,miles:at/1609.344,millimeters:at*1e3,millimetres:at*1e3,nauticalmiles:at/1852,radians:1,yards:at*1.0936},dd={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 Ar(r,e,t={}){let i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}s(Ar,"feature");ae(Ar,"feature");function x3(r,e,t={}){switch(r){case"Point":return _c(e).geometry;case"LineString":return Ac(e).geometry;case"Polygon":return Oc(e).geometry;case"MultiPoint":return yd(e).geometry;case"MultiLineString":return md(e).geometry;case"MultiPolygon":return gd(e).geometry;default:throw new Error(r+" is invalid")}}s(x3,"geometry");ae(x3,"geometry");function _c(r,e,t={}){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(!Ta(r[0])||!Ta(r[1]))throw new Error("coordinates must contain numbers");return Ar({type:"Point",coordinates:r},e,t)}s(_c,"point");ae(_c,"point");function S3(r,e,t={}){return Ea(r.map(i=>_c(i,e)),t)}s(S3,"points");ae(S3,"points");function Oc(r,e,t={}){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 Ar({type:"Polygon",coordinates:r},e,t)}s(Oc,"polygon");ae(Oc,"polygon");function M3(r,e,t={}){return Ea(r.map(i=>Oc(i,e)),t)}s(M3,"polygons");ae(M3,"polygons");function Ac(r,e,t={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Ar({type:"LineString",coordinates:r},e,t)}s(Ac,"lineString");ae(Ac,"lineString");function P3(r,e,t={}){return Ea(r.map(i=>Ac(i,e)),t)}s(P3,"lineStrings");ae(P3,"lineStrings");function Ea(r,e={}){let t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}s(Ea,"featureCollection");ae(Ea,"featureCollection");function md(r,e,t={}){return Ar({type:"MultiLineString",coordinates:r},e,t)}s(md,"multiLineString");ae(md,"multiLineString");function yd(r,e,t={}){return Ar({type:"MultiPoint",coordinates:r},e,t)}s(yd,"multiPoint");ae(yd,"multiPoint");function gd(r,e,t={}){return Ar({type:"MultiPolygon",coordinates:r},e,t)}s(gd,"multiPolygon");ae(gd,"multiPolygon");function w3(r,e,t={}){return Ar({type:"GeometryCollection",geometries:r},e,t)}s(w3,"geometryCollection");ae(w3,"geometryCollection");function T3(r,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let t=Math.pow(10,e||0);return Math.round(r*t)/t}s(T3,"round");ae(T3,"round");function vd(r,e="kilometers"){let t=fd[e];if(!t)throw new Error(e+" units is invalid");return r*t}s(vd,"radiansToLength");ae(vd,"radiansToLength");function kc(r,e="kilometers"){let t=fd[e];if(!t)throw new Error(e+" units is invalid");return r/t}s(kc,"lengthToRadians");ae(kc,"lengthToRadians");function I3(r,e){return bd(kc(r,e))}s(I3,"lengthToDegrees");ae(I3,"lengthToDegrees");function E3(r){let e=r%360;return e<0&&(e+=360),e}s(E3,"bearingToAzimuth");ae(E3,"bearingToAzimuth");function bd(r){return r%(2*Math.PI)*180/Math.PI}s(bd,"radiansToDegrees");ae(bd,"radiansToDegrees");function D3(r){return r%360*Math.PI/180}s(D3,"degreesToRadians");ae(D3,"degreesToRadians");function L3(r,e="kilometers",t="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return vd(kc(r,e),t)}s(L3,"convertLength");ae(L3,"convertLength");function _3(r,e="meters",t="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=dd[e];if(!i)throw new Error("invalid original units");let n=dd[t];if(!n)throw new Error("invalid final units");return r/i*n}s(_3,"convertArea");ae(_3,"convertArea");function Ta(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}s(Ta,"isNumber");ae(Ta,"isNumber");function O3(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}s(O3,"isObject");ae(O3,"isObject");function A3(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(e=>{if(!Ta(e))throw new Error("bbox must only contain numbers")})}s(A3,"validateBBox");ae(A3,"validateBBox");function k3(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}s(k3,"validateId");ae(k3,"validateId");oe.GeojsonEquality=ox;oe.areaFactors=dd;oe.bearingToAzimuth=E3;oe.convertArea=_3;oe.convertLength=L3;oe.degreesToRadians=D3;oe.earthRadius=at;oe.factors=fd;oe.feature=Ar;oe.featureCollection=Ea;oe.geometry=x3;oe.geometryCollection=w3;oe.isNumber=Ta;oe.isObject=O3;oe.lengthToDegrees=I3;oe.lengthToRadians=kc;oe.lineString=Ac;oe.lineStrings=P3;oe.multiLineString=md;oe.multiPoint=yd;oe.multiPolygon=gd;oe.point=_c;oe.points=S3;oe.polygon=Oc;oe.polygons=M3;oe.radiansToDegrees=bd;oe.radiansToLength=vd;oe.round=T3;oe.validateBBox=A3;oe.validateId=k3});var U3=k(_e=>{"use strict";m();Object.defineProperty(_e,"__esModule",{value:!0});var ax=Object.defineProperty,He=s((r,e)=>ax(r,"name",{value:e,configurable:!0}),"__name"),Ue=R3();function Kn(r,e,t){if(r!==null)for(var i,n,o,a,c,l,p,f=0,y=0,g,C=r.type,S=C==="FeatureCollection",M=C==="Feature",v=S?r.features.length:1,x=0;x<v;x++){p=S?r.features[x].geometry:M?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var E=0;E<c;E++){var T=0,w=0;if(a=g?p.geometries[E]:p,a!==null){l=a.coordinates;var D=a.type;switch(f=t&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(e(l,y,x,T,w)===!1)return!1;y++,T++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(e(l[i],y,x,T,w)===!1)return!1;y++,D==="MultiPoint"&&T++}D==="LineString"&&T++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-f;n++){if(e(l[i][n],y,x,T,w)===!1)return!1;y++}D==="MultiLineString"&&T++,D==="Polygon"&&w++}D==="Polygon"&&T++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-f;o++){if(e(l[i][n][o],y,x,T,w)===!1)return!1;y++}w++}T++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Kn(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(Kn,"coordEach");He(Kn,"coordEach");function N3(r,e,t,i){var n=t;return Kn(r,function(o,a,c,l,p){a===0&&t===void 0?n=o:n=e(n,o,a,c,l,p)},i),n}s(N3,"coordReduce");He(N3,"coordReduce");function Cd(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}s(Cd,"propEach");He(Cd,"propEach");function B3(r,e,t){var i=t;return Cd(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}s(B3,"propReduce");He(B3,"propReduce");function xd(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}s(xd,"featureEach");He(xd,"featureEach");function F3(r,e,t){var i=t;return xd(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}s(F3,"featureReduce");He(F3,"featureReduce");function G3(r){var e=[];return Kn(r,function(t){e.push(t)}),e}s(G3,"coordAll");He(G3,"coordAll");function Rc(r,e){var t,i,n,o,a,c,l,p,f,y,g=0,C=r.type==="FeatureCollection",S=r.type==="Feature",M=C?r.features.length:1;for(t=0;t<M;t++){for(c=C?r.features[t].geometry:S?r.geometry:r,p=C?r.features[t].properties:S?r.properties:{},f=C?r.features[t].bbox:S?r.bbox:void 0,y=C?r.features[t].id:S?r.id:void 0,l=c?c.type==="GeometryCollection":!1,a=l?c.geometries.length:1,n=0;n<a;n++){if(o=l?c.geometries[n]:c,o===null){if(e(null,g,p,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}s(Rc,"geomEach");He(Rc,"geomEach");function V3(r,e,t){var i=t;return Rc(r,function(n,o,a,c,l){o===0&&t===void 0?i=n:i=e(i,n,o,a,c,l)}),i}s(V3,"geomReduce");He(V3,"geomReduce");function Da(r,e){Rc(r,function(t,i,n,o,a){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(Ue.feature.call(void 0,t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var f=t.coordinates[p],y={type:l,coordinates:f};if(e(Ue.feature.call(void 0,y,n),i,p)===!1)return!1}})}s(Da,"flattenEach");He(Da,"flattenEach");function H3(r,e,t){var i=t;return Da(r,function(n,o,a){o===0&&a===0&&t===void 0?i=n:i=e(i,n,o,a)}),i}s(H3,"flattenReduce");He(H3,"flattenReduce");function Sd(r,e){Da(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var c,l=0,p=0,f=0;if(Kn(t,function(y,g,C,S,M){if(c===void 0||i>l||S>p||M>f){c=y,l=i,p=S,f=M,o=0;return}var v=Ue.lineString.call(void 0,[c,y],t.properties);if(e(v,i,n,M,o)===!1)return!1;o++,c=y})===!1)return!1}}})}s(Sd,"segmentEach");He(Sd,"segmentEach");function X3(r,e,t){var i=t,n=!1;return Sd(r,function(o,a,c,l,p){n===!1&&t===void 0?i=o:i=e(i,o,a,c,l,p),n=!0}),i}s(X3,"segmentReduce");He(X3,"segmentReduce");function Md(r,e){if(!r)throw new Error("geojson is required");Da(r,function(t,i,n){if(t.geometry!==null){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(e(t,i,n,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<a.length;c++)if(e(Ue.lineString.call(void 0,a[c],t.properties),i,n,c)===!1)return!1;break}}})}s(Md,"lineEach");He(Md,"lineEach");function j3(r,e,t){var i=t;return Md(r,function(n,o,a,c){o===0&&t===void 0?i=n:i=e(i,n,o,a,c)}),i}s(j3,"lineReduce");He(j3,"lineReduce");function W3(r,e){if(e=e||{},!Ue.isObject.call(void 0,e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.segmentIndex||0,a=e.properties,c;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,c=r.features[t].geometry;break;case"Feature":a=a||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=l.length+o-1),Ue.lineString.call(void 0,[l[o],l[o+1]],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),Ue.lineString.call(void 0,[l[n][o],l[n][o+1]],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),Ue.lineString.call(void 0,[l[i][o],l[i][o+1]],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o-1),Ue.lineString.call(void 0,[l[i][n][o],l[i][n][o+1]],a,e)}throw new Error("geojson is invalid")}s(W3,"findSegment");He(W3,"findSegment");function Y3(r,e){if(e=e||{},!Ue.isObject.call(void 0,e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.coordIndex||0,a=e.properties,c;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,c=r.features[t].geometry;break;case"Feature":a=a||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return Ue.point.call(void 0,l,a,e);case"MultiPoint":return i<0&&(i=l.length+i),Ue.point.call(void 0,l[i],a,e);case"LineString":return o<0&&(o=l.length+o),Ue.point.call(void 0,l[o],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),Ue.point.call(void 0,l[n][o],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),Ue.point.call(void 0,l[i][o],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o),Ue.point.call(void 0,l[i][n][o],a,e)}throw new Error("geojson is invalid")}s(Y3,"findPoint");He(Y3,"findPoint");_e.coordAll=G3;_e.coordEach=Kn;_e.coordReduce=N3;_e.featureEach=xd;_e.featureReduce=F3;_e.findPoint=Y3;_e.findSegment=W3;_e.flattenEach=Da;_e.flattenReduce=H3;_e.geomEach=Rc;_e.geomReduce=V3;_e.lineEach=Md;_e.lineReduce=j3;_e.propEach=Cd;_e.propReduce=B3;_e.segmentEach=Sd;_e.segmentReduce=X3});var z3=k(Nc=>{"use strict";m();Object.defineProperty(Nc,"__esModule",{value:!0});var sx=Object.defineProperty,lx=s((r,e)=>sx(r,"name",{value:e,configurable:!0}),"__name"),cx=U3();function Pd(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;let t=[1/0,1/0,-1/0,-1/0];return cx.coordEach.call(void 0,r,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}s(Pd,"bbox");lx(Pd,"bbox");var ux=Pd;Nc.bbox=Pd;Nc.default=ux});var K3=k((nA,wd)=>{m();var cr=Uy(),q3=Up(),$3=rg(),Qn=z3().default,px=$3.featureEach,rA=$3.coordEach,iA=q3.polygon,Z3=q3.featureCollection;function J3(r){var e=new cr(r);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Qn(t),cr.prototype.insert.call(this,t)},e.load=function(t){var i=[];return Array.isArray(t)?t.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Qn(n),i.push(n)}):px(t,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Qn(n),i.push(n)}),cr.prototype.load.call(this,i)},e.remove=function(t,i){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Qn(t),cr.prototype.remove.call(this,t,i)},e.clear=function(){return cr.prototype.clear.call(this)},e.search=function(t){var i=cr.prototype.search.call(this,this.toBBox(t));return Z3(i)},e.collides=function(t){return cr.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=cr.prototype.all.call(this);return Z3(t)},e.toJSON=function(){return cr.prototype.toJSON.call(this)},e.fromJSON=function(t){return cr.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var i;if(t.bbox)i=t.bbox;else if(Array.isArray(t)&&t.length===4)i=t;else if(Array.isArray(t)&&t.length===6)i=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")i=Qn(t);else if(t.type==="FeatureCollection")i=Qn(t);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},e}s(J3,"geojsonRbush");wd.exports=J3;wd.exports.default=J3});var dn=k((Of,Af)=>{m();var kf=s(function(){this._tweens={},this._tweensAddedDuringUpdate={}},"_Group");kf.prototype={getAll:function(){return Object.keys(this._tweens).map((function(r){return this._tweens[r]}).bind(this))},removeAll:function(){this._tweens={}},add:function(r){this._tweens[r.getId()]=r,this._tweensAddedDuringUpdate[r.getId()]=r},remove:function(r){delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]},update:function(r,e){var t=Object.keys(this._tweens);if(t.length===0)return!1;for(r=r!==void 0?r:le.now();t.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<t.length;i++){var n=this._tweens[t[i]];n&&n.update(r)===!1&&(n._isPlaying=!1,e||delete this._tweens[t[i]])}t=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var le=new kf;le.Group=kf;le._nextId=0;le.nextId=function(){return le._nextId++};typeof self>"u"&&typeof b<"u"&&b.hrtime?le.now=function(){var r=b.hrtime();return r[0]*1e3+r[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?le.now=self.performance.now.bind(self.performance):Date.now!==void 0?le.now=Date.now:le.now=function(){return new Date().getTime()};le.Tween=function(r,e){this._object=r,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=le.Easing.Linear.None,this._interpolationFunction=le.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=e||le,this._id=le.nextId()};le.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(r,e){return this._valuesEnd=r,e!==void 0&&(this._duration=e),this},duration:s(function(e){return this._duration=e,this},"duration"),start:function(r){this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=r!==void 0?typeof r=="string"?le.now()+parseFloat(r):r:le.now(),this._startTime+=this._delayTime;for(var e in this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(this._valuesEnd[e].length===0)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}this._object[e]!==void 0&&(this._valuesStart[e]=this._object[e],this._valuesStart[e]instanceof Array||(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,this._onStopCallback!==null&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var r=0,e=this._chainedTweens.length;r<e;r++)this._chainedTweens[r].stop()},group:function(r){return this._group=r,this},delay:function(r){return this._delayTime=r,this},repeat:function(r){return this._repeat=r,this},repeatDelay:function(r){return this._repeatDelayTime=r,this},yoyo:function(r){return this._yoyo=r,this},easing:function(r){return this._easingFunction=r,this},interpolation:function(r){return this._interpolationFunction=r,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(r){return this._onStartCallback=r,this},onUpdate:function(r){return this._onUpdateCallback=r,this},onRepeat:s(function(e){return this._onRepeatCallback=e,this},"onRepeat"),onComplete:function(r){return this._onCompleteCallback=r,this},onStop:function(r){return this._onStopCallback=r,this},update:function(r){var e,t,i;if(r<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback!==null&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),t=(r-this._startTime)/this._duration,t=this._duration===0||t>1?1:t,i=this._easingFunction(t);for(e in this._valuesEnd)if(this._valuesStart[e]!==void 0){var n=this._valuesStart[e]||0,o=this._valuesEnd[e];o instanceof Array?this._object[e]=this._interpolationFunction(o,i):(typeof o=="string"&&(o.charAt(0)==="+"||o.charAt(0)==="-"?o=n+parseFloat(o):o=parseFloat(o)),typeof o=="number"&&(this._object[e]=n+(o-n)*i))}if(this._onUpdateCallback!==null&&this._onUpdateCallback(this._object,t),t===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(e in this._valuesStartRepeat){if(typeof this._valuesEnd[e]=="string"&&(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo){var a=this._valuesStartRepeat[e];this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=a}this._valuesStart[e]=this._valuesStartRepeat[e]}return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=r+this._repeatDelayTime:this._startTime=r+this._delayTime,this._onRepeatCallback!==null&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback!==null&&this._onCompleteCallback(this._object);for(var c=0,l=this._chainedTweens.length;c<l;c++)this._chainedTweens[c].start(this._startTime+this._duration);return!1}return!0}};le.Easing={Linear:{None:function(r){return r}},Quadratic:{In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}},Cubic:{In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}},Quartic:{In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}},Quintic:{In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}},Sinusoidal:{In:function(r){return 1-Math.cos(r*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.cos(Math.PI*r))}},Exponential:{In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}},Circular:{In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}},Elastic:{In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}},Back:{In:function(r){var e=1.70158;return r*r*((e+1)*r-e)},Out:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},InOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)}},Bounce:{In:function(r){return 1-le.Easing.Bounce.Out(1-r)},Out:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},InOut:function(r){return r<.5?le.Easing.Bounce.In(r*2)*.5:le.Easing.Bounce.Out(r*2-1)*.5+.5}}};le.Interpolation={Linear:function(r,e){var t=r.length-1,i=t*e,n=Math.floor(i),o=le.Interpolation.Utils.Linear;return e<0?o(r[0],r[1],i):e>1?o(r[t],r[t-1],t-i):o(r[n],r[n+1>t?t:n+1],i-n)},Bezier:function(r,e){for(var t=0,i=r.length-1,n=Math.pow,o=le.Interpolation.Utils.Bernstein,a=0;a<=i;a++)t+=n(1-e,i-a)*n(e,a)*r[a]*o(i,a);return t},CatmullRom:function(r,e){var t=r.length-1,i=t*e,n=Math.floor(i),o=le.Interpolation.Utils.CatmullRom;return r[0]===r[t]?(e<0&&(n=Math.floor(i=t*(1+e))),o(r[(n-1+t)%t],r[n],r[(n+1)%t],r[(n+2)%t],i-n)):e<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):e>1?r[t]-(o(r[t],r[t],r[t-1],r[t-1],i-t)-r[t]):o(r[n?n-1:0],r[n],r[t<n+1?t:n+1],r[t<n+2?t:n+2],i-n)},Utils:{Linear:function(r,e,t){return(e-r)*t+r},Bernstein:function(r,e){var t=le.Interpolation.Utils.Factorial;return t(r)/t(e)/t(r-e)},Factorial:function(){var r=[1];return function(e){var t=1;if(r[e])return r[e];for(var i=e;i>1;i--)t*=i;return r[e]=t,t}}(),CatmullRom:function(r,e,t,i,n){var o=(t-r)*.5,a=(i-e)*.5,c=n*n,l=n*c;return(2*e-2*t+o+a)*l+(-3*e+3*t-2*o-a)*c+o*n+e}}};(function(r){typeof define=="function"&&define.amd?define([],function(){return le}):typeof Af<"u"&&typeof Of=="object"?Af.exports=le:r!==void 0&&(r.TWEEN=le)})(Of)});var Am=k((Ps,Oo)=>{m();var IS=200,X4="__lodash_hash_undefined__",ES=800,DS=16,j4=9007199254740991,W4="[object Arguments]",LS="[object Array]",_S="[object AsyncFunction]",OS="[object Boolean]",AS="[object Date]",kS="[object Error]",Y4="[object Function]",RS="[object GeneratorFunction]",NS="[object Map]",BS="[object Number]",FS="[object Null]",U4="[object Object]",GS="[object Proxy]",VS="[object RegExp]",HS="[object Set]",XS="[object String]",jS="[object Undefined]",WS="[object WeakMap]",YS="[object ArrayBuffer]",US="[object DataView]",zS="[object Float32Array]",ZS="[object Float64Array]",qS="[object Int8Array]",$S="[object Int16Array]",JS="[object Int32Array]",KS="[object Uint8Array]",QS="[object Uint8ClampedArray]",eM="[object Uint16Array]",tM="[object Uint32Array]",rM=/[\\^$.*+?()[\]{}|]/g,iM=/^\[object .+?Constructor\]$/,nM=/^(?:0|[1-9]\d*)$/,fe={};fe[zS]=fe[ZS]=fe[qS]=fe[$S]=fe[JS]=fe[KS]=fe[QS]=fe[eM]=fe[tM]=!0;fe[W4]=fe[LS]=fe[YS]=fe[OS]=fe[US]=fe[AS]=fe[kS]=fe[Y4]=fe[NS]=fe[BS]=fe[U4]=fe[VS]=fe[HS]=fe[XS]=fe[WS]=!1;var z4=typeof global=="object"&&global&&global.Object===Object&&global,oM=typeof self=="object"&&self&&self.Object===Object&&self,Is=z4||oM||Function("return this")(),Z4=typeof Ps=="object"&&Ps&&!Ps.nodeType&&Ps,ws=Z4&&typeof Oo=="object"&&Oo&&!Oo.nodeType&&Oo,q4=ws&&ws.exports===Z4,Sm=q4&&z4.process,A4=function(){try{var r=ws&&ws.require&&ws.require("util").types;return r||Sm&&Sm.binding&&Sm.binding("util")}catch{}}(),k4=A4&&A4.isTypedArray;function $4(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}s($4,"apply");function aM(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}s(aM,"baseTimes");function sM(r){return function(e){return r(e)}}s(sM,"baseUnary");function lM(r,e){return r==null?void 0:r[e]}s(lM,"getValue");function cM(r,e){return function(t){return r(e(t))}}s(cM,"overArg");var uM=Array.prototype,pM=Function.prototype,Iu=Object.prototype,Mm=Is["__core-js_shared__"],Eu=pM.toString,qr=Iu.hasOwnProperty,R4=function(){var r=/[^.]+$/.exec(Mm&&Mm.keys&&Mm.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),J4=Iu.toString,hM=Eu.call(Object),dM=RegExp("^"+Eu.call(qr).replace(rM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wu=q4?Is.Buffer:void 0,N4=Is.Symbol,B4=Is.Uint8Array,F4=wu?wu.allocUnsafe:void 0,K4=cM(Object.getPrototypeOf,Object),G4=Object.create,fM=Iu.propertyIsEnumerable,mM=uM.splice,bn=N4?N4.toStringTag:void 0,Tu=function(){try{var r=Lm(Object,"defineProperty");return r({},"",{}),r}catch{}}(),yM=wu?wu.isBuffer:void 0,V4=Math.max,gM=Date.now,Q4=Lm(Is,"Map"),Ts=Lm(Object,"create"),vM=function(){function r(){}return s(r,"object"),function(e){if(!Zr(e))return{};if(G4)return G4(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function Cn(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}s(Cn,"Hash");function bM(){this.__data__=Ts?Ts(null):{},this.size=0}s(bM,"hashClear");function CM(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}s(CM,"hashDelete");function xM(r){var e=this.__data__;if(Ts){var t=e[r];return t===X4?void 0:t}return qr.call(e,r)?e[r]:void 0}s(xM,"hashGet");function SM(r){var e=this.__data__;return Ts?e[r]!==void 0:qr.call(e,r)}s(SM,"hashHas");function MM(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Ts&&e===void 0?X4:e,this}s(MM,"hashSet");Cn.prototype.clear=bM;Cn.prototype.delete=CM;Cn.prototype.get=xM;Cn.prototype.has=SM;Cn.prototype.set=MM;function $r(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}s($r,"ListCache");function PM(){this.__data__=[],this.size=0}s(PM,"listCacheClear");function wM(r){var e=this.__data__,t=Du(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():mM.call(e,t,1),--this.size,!0}s(wM,"listCacheDelete");function TM(r){var e=this.__data__,t=Du(e,r);return t<0?void 0:e[t][1]}s(TM,"listCacheGet");function IM(r){return Du(this.__data__,r)>-1}s(IM,"listCacheHas");function EM(r,e){var t=this.__data__,i=Du(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}s(EM,"listCacheSet");$r.prototype.clear=PM;$r.prototype.delete=wM;$r.prototype.get=TM;$r.prototype.has=IM;$r.prototype.set=EM;function Ao(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}s(Ao,"MapCache");function DM(){this.size=0,this.__data__={hash:new Cn,map:new(Q4||$r),string:new Cn}}s(DM,"mapCacheClear");function LM(r){var e=_u(this,r).delete(r);return this.size-=e?1:0,e}s(LM,"mapCacheDelete");function _M(r){return _u(this,r).get(r)}s(_M,"mapCacheGet");function OM(r){return _u(this,r).has(r)}s(OM,"mapCacheHas");function AM(r,e){var t=_u(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}s(AM,"mapCacheSet");Ao.prototype.clear=DM;Ao.prototype.delete=LM;Ao.prototype.get=_M;Ao.prototype.has=OM;Ao.prototype.set=AM;function ko(r){var e=this.__data__=new $r(r);this.size=e.size}s(ko,"Stack");function kM(){this.__data__=new $r,this.size=0}s(kM,"stackClear");function RM(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}s(RM,"stackDelete");function NM(r){return this.__data__.get(r)}s(NM,"stackGet");function BM(r){return this.__data__.has(r)}s(BM,"stackHas");function FM(r,e){var t=this.__data__;if(t instanceof $r){var i=t.__data__;if(!Q4||i.length<IS-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new Ao(i)}return t.set(r,e),this.size=t.size,this}s(FM,"stackSet");ko.prototype.clear=kM;ko.prototype.delete=RM;ko.prototype.get=NM;ko.prototype.has=BM;ko.prototype.set=FM;function GM(r,e){var t=Im(r),i=!t&&Tm(r),n=!t&&!i&&n5(r),o=!t&&!i&&!n&&a5(r),a=t||i||n||o,c=a?aM(r.length,String):[],l=c.length;for(var p in r)(e||qr.call(r,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||r5(p,l)))&&c.push(p);return c}s(GM,"arrayLikeKeys");function Pm(r,e,t){(t!==void 0&&!Ou(r[e],t)||t===void 0&&!(e in r))&&Em(r,e,t)}s(Pm,"assignMergeValue");function VM(r,e,t){var i=r[e];(!(qr.call(r,e)&&Ou(i,t))||t===void 0&&!(e in r))&&Em(r,e,t)}s(VM,"assignValue");function Du(r,e){for(var t=r.length;t--;)if(Ou(r[t][0],e))return t;return-1}s(Du,"assocIndexOf");function Em(r,e,t){e=="__proto__"&&Tu?Tu(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}s(Em,"baseAssignValue");var HM=QM();function Lu(r){return r==null?r===void 0?jS:FS:bn&&bn in Object(r)?eP(r):aP(r)}s(Lu,"baseGetTag");function H4(r){return Es(r)&&Lu(r)==W4}s(H4,"baseIsArguments");function XM(r){if(!Zr(r)||nP(r))return!1;var e=Om(r)?dM:iM;return e.test(uP(r))}s(XM,"baseIsNative");function jM(r){return Es(r)&&o5(r.length)&&!!fe[Lu(r)]}s(jM,"baseIsTypedArray");function WM(r){if(!Zr(r))return oP(r);var e=i5(r),t=[];for(var i in r)i=="constructor"&&(e||!qr.call(r,i))||t.push(i);return t}s(WM,"baseKeysIn");function Dm(r,e,t,i,n){r!==e&&HM(e,function(o,a){if(n||(n=new ko),Zr(o))YM(r,e,a,t,Dm,i,n);else{var c=i?i(wm(r,a),o,a+"",r,e,n):void 0;c===void 0&&(c=o),Pm(r,a,c)}},s5)}s(Dm,"baseMerge");function YM(r,e,t,i,n,o,a){var c=wm(r,t),l=wm(e,t),p=a.get(l);if(p){Pm(r,t,p);return}var f=o?o(c,l,t+"",r,e,a):void 0,y=f===void 0;if(y){var g=Im(l),C=!g&&n5(l),S=!g&&!C&&a5(l);f=l,g||C||S?Im(c)?f=c:pP(c)?f=$M(c):C?(y=!1,f=zM(l,!0)):S?(y=!1,f=qM(l,!0)):f=[]:hP(l)||Tm(l)?(f=c,Tm(c)?f=dP(c):(!Zr(c)||Om(c))&&(f=tP(l))):y=!1}y&&(a.set(l,f),n(f,l,i,o,a),a.delete(l)),Pm(r,t,f)}s(YM,"baseMergeDeep");function e5(r,e){return lP(sP(r,e,l5),r+"")}s(e5,"baseRest");var UM=Tu?function(r,e){return Tu(r,"toString",{configurable:!0,enumerable:!1,value:yP(e),writable:!0})}:l5;function zM(r,e){if(e)return r.slice();var t=r.length,i=F4?F4(t):new r.constructor(t);return r.copy(i),i}s(zM,"cloneBuffer");function ZM(r){var e=new r.constructor(r.byteLength);return new B4(e).set(new B4(r)),e}s(ZM,"cloneArrayBuffer");function qM(r,e){var t=e?ZM(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}s(qM,"cloneTypedArray");function $M(r,e){var t=-1,i=r.length;for(e||(e=Array(i));++t<i;)e[t]=r[t];return e}s($M,"copyArray");function JM(r,e,t,i){var n=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var c=e[o],l=i?i(t[c],r[c],c,t,r):void 0;l===void 0&&(l=r[c]),n?Em(t,c,l):VM(t,c,l)}return t}s(JM,"copyObject");function KM(r){return e5(function(e,t){var i=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&rP(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++i<n;){var c=t[i];c&&r(e,c,i,o)}return e})}s(KM,"createAssigner");function QM(r){return function(e,t,i){for(var n=-1,o=Object(e),a=i(e),c=a.length;c--;){var l=a[r?c:++n];if(t(o[l],l,o)===!1)break}return e}}s(QM,"createBaseFor");function t5(r,e,t,i,n,o){return Zr(r)&&Zr(e)&&(o.set(e,r),Dm(r,e,void 0,t5,o),o.delete(e)),r}s(t5,"customDefaultsMerge");function _u(r,e){var t=r.__data__;return iP(e)?t[typeof e=="string"?"string":"hash"]:t.map}s(_u,"getMapData");function Lm(r,e){var t=lM(r,e);return XM(t)?t:void 0}s(Lm,"getNative");function eP(r){var e=qr.call(r,bn),t=r[bn];try{r[bn]=void 0;var i=!0}catch{}var n=J4.call(r);return i&&(e?r[bn]=t:delete r[bn]),n}s(eP,"getRawTag");function tP(r){return typeof r.constructor=="function"&&!i5(r)?vM(K4(r)):{}}s(tP,"initCloneObject");function r5(r,e){var t=typeof r;return e=e==null?j4:e,!!e&&(t=="number"||t!="symbol"&&nM.test(r))&&r>-1&&r%1==0&&r<e}s(r5,"isIndex");function rP(r,e,t){if(!Zr(t))return!1;var i=typeof e;return(i=="number"?_m(t)&&r5(e,t.length):i=="string"&&e in t)?Ou(t[e],r):!1}s(rP,"isIterateeCall");function iP(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}s(iP,"isKeyable");function nP(r){return!!R4&&R4 in r}s(nP,"isMasked");function i5(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Iu;return r===t}s(i5,"isPrototype");function oP(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}s(oP,"nativeKeysIn");function aP(r){return J4.call(r)}s(aP,"objectToString");function sP(r,e,t){return e=V4(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,o=V4(i.length-e,0),a=Array(o);++n<o;)a[n]=i[e+n];n=-1;for(var c=Array(e+1);++n<e;)c[n]=i[n];return c[e]=t(a),$4(r,this,c)}}s(sP,"overRest");function wm(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}s(wm,"safeGet");var lP=cP(UM);function cP(r){var e=0,t=0;return function(){var i=gM(),n=DS-(i-t);if(t=i,n>0){if(++e>=ES)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}s(cP,"shortOut");function uP(r){if(r!=null){try{return Eu.call(r)}catch{}try{return r+""}catch{}}return""}s(uP,"toSource");function Ou(r,e){return r===e||r!==r&&e!==e}s(Ou,"eq");var Tm=H4(function(){return arguments}())?H4:function(r){return Es(r)&&qr.call(r,"callee")&&!fM.call(r,"callee")},Im=Array.isArray;function _m(r){return r!=null&&o5(r.length)&&!Om(r)}s(_m,"isArrayLike");function pP(r){return Es(r)&&_m(r)}s(pP,"isArrayLikeObject");var n5=yM||gP;function Om(r){if(!Zr(r))return!1;var e=Lu(r);return e==Y4||e==RS||e==_S||e==GS}s(Om,"isFunction");function o5(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=j4}s(o5,"isLength");function Zr(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}s(Zr,"isObject");function Es(r){return r!=null&&typeof r=="object"}s(Es,"isObjectLike");function hP(r){if(!Es(r)||Lu(r)!=U4)return!1;var e=K4(r);if(e===null)return!0;var t=qr.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Eu.call(t)==hM}s(hP,"isPlainObject");var a5=k4?sM(k4):jM;function dP(r){return JM(r,s5(r))}s(dP,"toPlainObject");var fP=e5(function(r){return r.push(void 0,t5),$4(mP,void 0,r)});function s5(r){return _m(r)?GM(r,!0):WM(r)}s(s5,"keysIn");var mP=KM(function(r,e,t,i){Dm(r,e,t,i)});function yP(r){return function(){return r}}s(yP,"constant");function l5(r){return r}s(l5,"identity");function gP(){return!1}s(gP,"stubFalse");Oo.exports=fP});var T5=k((oY,ks)=>{"use strict";m();var LP=!1,Pn=!1,b5=!0,C5=!1,d={},x5=!1;typeof ks<"u"&&ks.exports?(ks.exports=d,x5=!0):typeof document<"u"?window.ClipperLib=d:self.ClipperLib=d;var Xu;x5?(Ne="chrome",Xu="Netscape"):(Ne=navigator.userAgent.toString().toLowerCase(),Xu=navigator.appName);var Ne,$={};Ne.indexOf("chrome")!=-1&&Ne.indexOf("chromium")==-1?$.chrome=1:$.chrome=0;Ne.indexOf("chromium")!=-1?$.chromium=1:$.chromium=0;Ne.indexOf("safari")!=-1&&Ne.indexOf("chrome")==-1&&Ne.indexOf("chromium")==-1?$.safari=1:$.safari=0;Ne.indexOf("firefox")!=-1?$.firefox=1:$.firefox=0;Ne.indexOf("firefox/17")!=-1?$.firefox17=1:$.firefox17=0;Ne.indexOf("firefox/15")!=-1?$.firefox15=1:$.firefox15=0;Ne.indexOf("firefox/3")!=-1?$.firefox3=1:$.firefox3=0;Ne.indexOf("opera")!=-1?$.opera=1:$.opera=0;Ne.indexOf("msie 10")!=-1?$.msie10=1:$.msie10=0;Ne.indexOf("msie 9")!=-1?$.msie9=1:$.msie9=0;Ne.indexOf("msie 8")!=-1?$.msie8=1:$.msie8=0;Ne.indexOf("msie 7")!=-1?$.msie7=1:$.msie7=0;Ne.indexOf("msie ")!=-1?$.msie=1:$.msie=0;d.biginteger_used=null;var Ti,_P=0xdeadbeefcafe,g5=(_P&16777215)==15715070;function A(r,e,t){d.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof e>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}s(A,"BigInteger");function te(){return new A(null)}s(te,"nbi");function OP(r,e,t,i,n,o){for(;--o>=0;){var a=e*this[r++]+t[i]+n;n=Math.floor(a/67108864),t[i++]=a&67108863}return n}s(OP,"am1");function AP(r,e,t,i,n,o){for(var a=e&32767,c=e>>15;--o>=0;){var l=this[r]&32767,p=this[r++]>>15,f=c*l+p*a;l=a*l+((f&32767)<<15)+t[i]+(n&1073741823),n=(l>>>30)+(f>>>15)+c*p+(n>>>30),t[i++]=l&1073741823}return n}s(AP,"am2");function kP(r,e,t,i,n,o){for(var a=e&16383,c=e>>14;--o>=0;){var l=this[r]&16383,p=this[r++]>>14,f=c*l+p*a;l=a*l+((f&16383)<<14)+t[i]+n,n=(l>>28)+(f>>14)+c*p,t[i++]=l&268435455}return n}s(kP,"am3");g5&&Xu=="Microsoft Internet Explorer"?(A.prototype.am=AP,Ti=30):g5&&Xu!="Netscape"?(A.prototype.am=OP,Ti=26):(A.prototype.am=kP,Ti=28);A.prototype.DB=Ti;A.prototype.DM=(1<<Ti)-1;A.prototype.DV=1<<Ti;var Gm=52;A.prototype.FV=Math.pow(2,Gm);A.prototype.F1=Gm-Ti;A.prototype.F2=2*Ti-Gm;var RP="0123456789abcdefghijklmnopqrstuvwxyz",Wu=new Array,No,Dt;No=48;for(Dt=0;Dt<=9;++Dt)Wu[No++]=Dt;No=97;for(Dt=10;Dt<36;++Dt)Wu[No++]=Dt;No=65;for(Dt=10;Dt<36;++Dt)Wu[No++]=Dt;function v5(r){return RP.charAt(r)}s(v5,"int2char");function S5(r,e){var t=Wu[r.charCodeAt(e)];return t==null?-1:t}s(S5,"intAt");function NP(r){for(var e=this.t-1;e>=0;--e)r[e]=this[e];r.t=this.t,r.s=this.s}s(NP,"bnpCopyTo");function BP(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}s(BP,"bnpFromInt");function wi(r){var e=te();return e.fromInt(r),e}s(wi,"nbv");function FP(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var i=r.length,n=!1,o=0;--i>=0;){var a=t==8?r[i]&255:S5(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+t>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+=t,o>=this.DB&&(o-=this.DB)}t==8&&r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&A.ZERO.subTo(this,this)}s(FP,"bnpFromString");function GP(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}s(GP,"bnpClamp");function VP(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,i,n=!1,o="",a=this.t,c=this.DB-a*this.DB%e;if(a-- >0)for(c<this.DB&&(i=this[a]>>c)>0&&(n=!0,o=v5(i));a>=0;)c<e?(i=(this[a]&(1<<c)-1)<<e-c,i|=this[--a]>>(c+=this.DB-e)):(i=this[a]>>(c-=e)&t,c<=0&&(c+=this.DB,--a)),i>0&&(n=!0),n&&(o+=v5(i));return n?o:"0"}s(VP,"bnToString");function HP(){var r=te();return A.ZERO.subTo(this,r),r}s(HP,"bnNegate");function XP(){return this.s<0?this.negate():this}s(XP,"bnAbs");function jP(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this[t]-r[t])!=0)return e;return 0}s(jP,"bnCompareTo");function Yu(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}s(Yu,"nbits");function WP(){return this.t<=0?0:this.DB*(this.t-1)+Yu(this[this.t-1]^this.s&this.DM)}s(WP,"bnBitLength");function YP(r,e){var t;for(t=this.t-1;t>=0;--t)e[t+r]=this[t];for(t=r-1;t>=0;--t)e[t]=0;e.t=this.t+r,e.s=this.s}s(YP,"bnpDLShiftTo");function UP(r,e){for(var t=r;t<this.t;++t)e[t-r]=this[t];e.t=Math.max(this.t-r,0),e.s=this.s}s(UP,"bnpDRShiftTo");function zP(r,e){var t=r%this.DB,i=this.DB-t,n=(1<<i)-1,o=Math.floor(r/this.DB),a=this.s<<t&this.DM,c;for(c=this.t-1;c>=0;--c)e[c+o+1]=this[c]>>i|a,a=(this[c]&n)<<t;for(c=o-1;c>=0;--c)e[c]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}s(zP,"bnpLShiftTo");function ZP(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var i=r%this.DB,n=this.DB-i,o=(1<<i)-1;e[0]=this[t]>>i;for(var a=t+1;a<this.t;++a)e[a-t-1]|=(this[a]&o)<<n,e[a-t]=this[a]>>i;i>0&&(e[this.t-t-1]|=(this.s&o)<<n),e.t=this.t-t,e.clamp()}s(ZP,"bnpRShiftTo");function qP(r,e){for(var t=0,i=0,n=Math.min(r.t,this.t);t<n;)i+=this[t]-r[t],e[t++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;t<this.t;)i+=this[t],e[t++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t<r.t;)i-=r[t],e[t++]=i&this.DM,i>>=this.DB;i-=r.s}e.s=i<0?-1:0,i<-1?e[t++]=this.DV+i:i>0&&(e[t++]=i),e.t=t,e.clamp()}s(qP,"bnpSubTo");function $P(r,e){var t=this.abs(),i=r.abs(),n=t.t;for(e.t=n+i.t;--n>=0;)e[n]=0;for(n=0;n<i.t;++n)e[n+t.t]=t.am(0,i[n],e,n,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&A.ZERO.subTo(e,e)}s($P,"bnpMultiplyTo");function JP(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r[t]=0;for(t=0;t<e.t-1;++t){var i=e.am(t,e[t],r,2*t,0,1);(r[t+e.t]+=e.am(t+1,2*e[t],r,2*t+1,i,e.t-t-1))>=e.DV&&(r[t+e.t]-=e.DV,r[t+e.t+1]=1)}r.t>0&&(r[r.t-1]+=e.am(t,e[t],r,2*t,0,1)),r.s=0,r.clamp()}s(JP,"bnpSquareTo");function KP(r,e,t){var i=r.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){e!=null&&e.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=te());var o=te(),a=this.s,c=r.s,l=this.DB-Yu(i[i.t-1]);l>0?(i.lShiftTo(l,o),n.lShiftTo(l,t)):(i.copyTo(o),n.copyTo(t));var p=o.t,f=o[p-1];if(f!=0){var y=f*(1<<this.F1)+(p>1?o[p-2]>>this.F2:0),g=this.FV/y,C=(1<<this.F1)/y,S=1<<this.F2,M=t.t,v=M-p,x=e==null?te():e;for(o.dlShiftTo(v,x),t.compareTo(x)>=0&&(t[t.t++]=1,t.subTo(x,t)),A.ONE.dlShiftTo(p,x),x.subTo(o,o);o.t<p;)o[o.t++]=0;for(;--v>=0;){var E=t[--M]==f?this.DM:Math.floor(t[M]*g+(t[M-1]+S)*C);if((t[M]+=o.am(0,E,t,v,0,p))<E)for(o.dlShiftTo(v,x),t.subTo(x,t);t[M]<--E;)t.subTo(x,t)}e!=null&&(t.drShiftTo(p,e),a!=c&&A.ZERO.subTo(e,e)),t.t=p,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&A.ZERO.subTo(t,t)}}}s(KP,"bnpDivRemTo");function QP(r){var e=te();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(A.ZERO)>0&&r.subTo(e,e),e}s(QP,"bnMod");function wn(r){this.m=r}s(wn,"Classic");function ew(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}s(ew,"cConvert");function tw(r){return r}s(tw,"cRevert");function rw(r){r.divRemTo(this.m,null,r)}s(rw,"cReduce");function iw(r,e,t){r.multiplyTo(e,t),this.reduce(t)}s(iw,"cMulTo");function nw(r,e){r.squareTo(e),this.reduce(e)}s(nw,"cSqrTo");wn.prototype.convert=ew;wn.prototype.revert=tw;wn.prototype.reduce=rw;wn.prototype.mulTo=iw;wn.prototype.sqrTo=nw;function ow(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}s(ow,"bnpInvDigit");function Tn(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}s(Tn,"Montgomery");function aw(r){var e=te();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(A.ZERO)>0&&this.m.subTo(e,e),e}s(aw,"montConvert");function sw(r){var e=te();return r.copyTo(e),this.reduce(e),e}s(sw,"montRevert");function lw(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r[e]&32767,i=t*this.mpl+((t*this.mph+(r[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r[t]+=this.m.am(0,i,r,e,0,this.m.t);r[t]>=r.DV;)r[t]-=r.DV,r[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}s(lw,"montReduce");function cw(r,e){r.squareTo(e),this.reduce(e)}s(cw,"montSqrTo");function uw(r,e,t){r.multiplyTo(e,t),this.reduce(t)}s(uw,"montMulTo");Tn.prototype.convert=aw;Tn.prototype.revert=sw;Tn.prototype.reduce=lw;Tn.prototype.mulTo=uw;Tn.prototype.sqrTo=cw;function pw(){return(this.t>0?this[0]&1:this.s)==0}s(pw,"bnpIsEven");function hw(r,e){if(r>4294967295||r<1)return A.ONE;var t=te(),i=te(),n=e.convert(this),o=Yu(r)-1;for(n.copyTo(t);--o>=0;)if(e.sqrTo(t,i),(r&1<<o)>0)e.mulTo(i,n,t);else{var a=t;t=i,i=a}return e.revert(t)}s(hw,"bnpExp");function dw(r,e){var t;return r<256||e.isEven()?t=new wn(e):t=new Tn(e),this.exp(r,t)}s(dw,"bnModPowInt");A.prototype.copyTo=NP;A.prototype.fromInt=BP;A.prototype.fromString=FP;A.prototype.clamp=GP;A.prototype.dlShiftTo=YP;A.prototype.drShiftTo=UP;A.prototype.lShiftTo=zP;A.prototype.rShiftTo=ZP;A.prototype.subTo=qP;A.prototype.multiplyTo=$P;A.prototype.squareTo=JP;A.prototype.divRemTo=KP;A.prototype.invDigit=ow;A.prototype.isEven=pw;A.prototype.exp=hw;A.prototype.toString=VP;A.prototype.negate=HP;A.prototype.abs=XP;A.prototype.compareTo=jP;A.prototype.bitLength=WP;A.prototype.mod=QP;A.prototype.modPowInt=dw;A.ZERO=wi(0);A.ONE=wi(1);function fw(){var r=te();return this.copyTo(r),r}s(fw,"bnClone");function mw(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}s(mw,"bnIntValue");function yw(){return this.t==0?this.s:this[0]<<24>>24}s(yw,"bnByteValue");function gw(){return this.t==0?this.s:this[0]<<16>>16}s(gw,"bnShortValue");function vw(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}s(vw,"bnpChunkSize");function bw(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}s(bw,"bnSigNum");function Cw(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),i=wi(t),n=te(),o=te(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(t+o.intValue()).toString(r).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(r)+a}s(Cw,"bnpToRadix");function xw(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),i=Math.pow(e,t),n=!1,o=0,a=0,c=0;c<r.length;++c){var l=S5(r,c);if(l<0){r.charAt(c)=="-"&&this.signum()==0&&(n=!0);continue}a=e*a+l,++o>=t&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),n&&A.ZERO.subTo(this,this)}s(xw,"bnpFromRadix");function Sw(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(A.ONE.shiftLeft(r-1),Vm,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(A.ONE.shiftLeft(r-1),this);else{var i=new Array,n=r&7;i.length=(r>>3)+1,e.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}s(Sw,"bnpFromNumber");function Mw(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(t<this.DB&&(i=this[r]>>t)!=(this.s&this.DM)>>t&&(e[n++]=i|this.s<<this.DB-t);r>=0;)t<8?(i=(this[r]&(1<<t)-1)<<8-t,i|=this[--r]>>(t+=this.DB-8)):(i=this[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),i&128&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}s(Mw,"bnToByteArray");function Pw(r){return this.compareTo(r)==0}s(Pw,"bnEquals");function ww(r){return this.compareTo(r)<0?this:r}s(ww,"bnMin");function Tw(r){return this.compareTo(r)>0?this:r}s(Tw,"bnMax");function Iw(r,e,t){var i,n,o=Math.min(r.t,this.t);for(i=0;i<o;++i)t[i]=e(this[i],r[i]);if(r.t<this.t){for(n=r.s&this.DM,i=o;i<this.t;++i)t[i]=e(this[i],n);t.t=this.t}else{for(n=this.s&this.DM,i=o;i<r.t;++i)t[i]=e(n,r[i]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}s(Iw,"bnpBitwiseTo");function Ew(r,e){return r&e}s(Ew,"op_and");function Dw(r){var e=te();return this.bitwiseTo(r,Ew,e),e}s(Dw,"bnAnd");function Vm(r,e){return r|e}s(Vm,"op_or");function Lw(r){var e=te();return this.bitwiseTo(r,Vm,e),e}s(Lw,"bnOr");function M5(r,e){return r^e}s(M5,"op_xor");function _w(r){var e=te();return this.bitwiseTo(r,M5,e),e}s(_w,"bnXor");function P5(r,e){return r&~e}s(P5,"op_andnot");function Ow(r){var e=te();return this.bitwiseTo(r,P5,e),e}s(Ow,"bnAndNot");function Aw(){for(var r=te(),e=0;e<this.t;++e)r[e]=this.DM&~this[e];return r.t=this.t,r.s=~this.s,r}s(Aw,"bnNot");function kw(r){var e=te();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}s(kw,"bnShiftLeft");function Rw(r){var e=te();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}s(Rw,"bnShiftRight");function Nw(r){if(r==0)return-1;var e=0;return r&65535||(r>>=16,e+=16),r&255||(r>>=8,e+=8),r&15||(r>>=4,e+=4),r&3||(r>>=2,e+=2),r&1||++e,e}s(Nw,"lbit");function Bw(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+Nw(this[r]);return this.s<0?this.t*this.DB:-1}s(Bw,"bnGetLowestSetBit");function Fw(r){for(var e=0;r!=0;)r&=r-1,++e;return e}s(Fw,"cbit");function Gw(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=Fw(this[t]^e);return r}s(Gw,"bnBitCount");function Vw(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<r%this.DB)!=0}s(Vw,"bnTestBit");function Hw(r,e){var t=A.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}s(Hw,"bnpChangeBit");function Xw(r){return this.changeBit(r,Vm)}s(Xw,"bnSetBit");function jw(r){return this.changeBit(r,P5)}s(jw,"bnClearBit");function Ww(r){return this.changeBit(r,M5)}s(Ww,"bnFlipBit");function Yw(r,e){for(var t=0,i=0,n=Math.min(r.t,this.t);t<n;)i+=this[t]+r[t],e[t++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;t<this.t;)i+=this[t],e[t++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t<r.t;)i+=r[t],e[t++]=i&this.DM,i>>=this.DB;i+=r.s}e.s=i<0?-1:0,i>0?e[t++]=i:i<-1&&(e[t++]=this.DV+i),e.t=t,e.clamp()}s(Yw,"bnpAddTo");function Uw(r){var e=te();return this.addTo(r,e),e}s(Uw,"bnAdd");function zw(r){var e=te();return this.subTo(r,e),e}s(zw,"bnSubtract");function Zw(r){var e=te();return this.multiplyTo(r,e),e}s(Zw,"bnMultiply");function qw(){var r=te();return this.squareTo(r),r}s(qw,"bnSquare");function $w(r){var e=te();return this.divRemTo(r,e,null),e}s($w,"bnDivide");function Jw(r){var e=te();return this.divRemTo(r,null,e),e}s(Jw,"bnRemainder");function Kw(r){var e=te(),t=te();return this.divRemTo(r,e,t),new Array(e,t)}s(Kw,"bnDivideAndRemainder");function Qw(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}s(Qw,"bnpDMultiply");function eT(r,e){if(r!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=r;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}s(eT,"bnpDAddOffset");function Rs(){}s(Rs,"NullExp");function w5(r){return r}s(w5,"nNop");function tT(r,e,t){r.multiplyTo(e,t)}s(tT,"nMulTo");function rT(r,e){r.squareTo(e)}s(rT,"nSqrTo");Rs.prototype.convert=w5;Rs.prototype.revert=w5;Rs.prototype.mulTo=tT;Rs.prototype.sqrTo=rT;function iT(r){return this.exp(r,new Rs)}s(iT,"bnPow");function nT(r,e,t){var i=Math.min(this.t+r.t,e);for(t.s=0,t.t=i;i>0;)t[--i]=0;var n;for(n=t.t-this.t;i<n;++i)t[i+this.t]=this.am(0,r[i],t,i,0,this.t);for(n=Math.min(r.t,e);i<n;++i)this.am(0,r[i],t,i,0,e-i);t.clamp()}s(nT,"bnpMultiplyLowerTo");function oT(r,e,t){--e;var i=t.t=this.t+r.t-e;for(t.s=0;--i>=0;)t[i]=0;for(i=Math.max(e-this.t,0);i<r.t;++i)t[this.t+i-e]=this.am(e-i,r[i],t,0,0,this.t+i-e);t.clamp(),t.drShiftTo(1,t)}s(oT,"bnpMultiplyUpperTo");function Bo(r){this.r2=te(),this.q3=te(),A.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}s(Bo,"Barrett");function aT(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 e=te();return r.copyTo(e),this.reduce(e),e}s(aT,"barrettConvert");function sT(r){return r}s(sT,"barrettRevert");function lT(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}s(lT,"barrettReduce");function cT(r,e){r.squareTo(e),this.reduce(e)}s(cT,"barrettSqrTo");function uT(r,e,t){r.multiplyTo(e,t),this.reduce(t)}s(uT,"barrettMulTo");Bo.prototype.convert=aT;Bo.prototype.revert=sT;Bo.prototype.reduce=lT;Bo.prototype.mulTo=uT;Bo.prototype.sqrTo=cT;function pT(r,e){var t=r.bitLength(),i,n=wi(1),o;if(t<=0)return n;t<18?i=1:t<48?i=3:t<144?i=4:t<768?i=5:i=6,t<8?o=new wn(e):e.isEven()?o=new Bo(e):o=new Tn(e);var a=new Array,c=3,l=i-1,p=(1<<i)-1;if(a[1]=o.convert(this),i>1){var f=te();for(o.sqrTo(a[1],f);c<=p;)a[c]=te(),o.mulTo(f,a[c-2],a[c]),c+=2}var y=r.t-1,g,C=!0,S=te(),M;for(t=Yu(r[y])-1;y>=0;){for(t>=l?g=r[y]>>t-l&p:(g=(r[y]&(1<<t+1)-1)<<l-t,y>0&&(g|=r[y-1]>>this.DB+t-l)),c=i;!(g&1);)g>>=1,--c;if((t-=c)<0&&(t+=this.DB,--y),C)a[g].copyTo(n),C=!1;else{for(;c>1;)o.sqrTo(n,S),o.sqrTo(S,n),c-=2;c>0?o.sqrTo(n,S):(M=n,n=S,S=M),o.mulTo(S,a[g],n)}for(;y>=0&&!(r[y]&1<<t);)o.sqrTo(n,S),M=n,n=S,S=M,--t<0&&(t=this.DB-1,--y)}return o.revert(n)}s(pT,"bnModPow");function hT(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var i=e;e=t,t=i}var n=e.getLowestSetBit(),o=t.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),t.rShiftTo(o,t));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return o>0&&t.lShiftTo(o,t),t}s(hT,"bnGCD");function dT(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this[0]%r;else for(var i=this.t-1;i>=0;--i)t=(e*t+this[i])%r;return t}s(dT,"bnpModInt");function fT(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return A.ZERO;for(var t=r.clone(),i=this.clone(),n=wi(1),o=wi(0),a=wi(0),c=wi(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!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),e?((!a.isEven()||!c.isEven())&&(a.addTo(this,a),c.subTo(r,c)),a.rShiftTo(1,a)):c.isEven()||c.subTo(r,c),c.rShiftTo(1,c);t.compareTo(i)>=0?(t.subTo(i,t),e&&n.subTo(a,n),o.subTo(c,o)):(i.subTo(t,i),e&&a.subTo(n,a),c.subTo(o,c))}if(i.compareTo(A.ONE)!=0)return A.ZERO;if(c.compareTo(r)>=0)return c.subtract(r);if(c.signum()<0)c.addTo(r,c);else return c;return c.signum()<0?c.add(r):c}s(fT,"bnModInverse");var et=[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],mT=(1<<26)/et[et.length-1];function yT(r){var e,t=this.abs();if(t.t==1&&t[0]<=et[et.length-1]){for(e=0;e<et.length;++e)if(t[0]==et[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<et.length;){for(var i=et[e],n=e+1;n<et.length&&i<mT;)i*=et[n++];for(i=t.modInt(i);e<n;)if(i%et[e++]==0)return!1}return t.millerRabin(r)}s(yT,"bnIsProbablePrime");function gT(r){var e=this.subtract(A.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var i=e.shiftRight(t);r=r+1>>1,r>et.length&&(r=et.length);for(var n=te(),o=0;o<r;++o){n.fromInt(et[Math.floor(Math.random()*et.length)]);var a=n.modPow(i,this);if(a.compareTo(A.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++<t&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(A.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0}s(gT,"bnpMillerRabin");A.prototype.chunkSize=vw;A.prototype.toRadix=Cw;A.prototype.fromRadix=xw;A.prototype.fromNumber=Sw;A.prototype.bitwiseTo=Iw;A.prototype.changeBit=Hw;A.prototype.addTo=Yw;A.prototype.dMultiply=Qw;A.prototype.dAddOffset=eT;A.prototype.multiplyLowerTo=nT;A.prototype.multiplyUpperTo=oT;A.prototype.modInt=dT;A.prototype.millerRabin=gT;A.prototype.clone=fw;A.prototype.intValue=mw;A.prototype.byteValue=yw;A.prototype.shortValue=gw;A.prototype.signum=bw;A.prototype.toByteArray=Mw;A.prototype.equals=Pw;A.prototype.min=ww;A.prototype.max=Tw;A.prototype.and=Dw;A.prototype.or=Lw;A.prototype.xor=_w;A.prototype.andNot=Ow;A.prototype.not=Aw;A.prototype.shiftLeft=kw;A.prototype.shiftRight=Rw;A.prototype.getLowestSetBit=Bw;A.prototype.bitCount=Gw;A.prototype.testBit=Vw;A.prototype.setBit=Xw;A.prototype.clearBit=jw;A.prototype.flipBit=Ww;A.prototype.add=Uw;A.prototype.subtract=zw;A.prototype.multiply=Zw;A.prototype.divide=$w;A.prototype.remainder=Jw;A.prototype.divideAndRemainder=Kw;A.prototype.modPow=pT;A.prototype.modInverse=fT;A.prototype.pow=iT;A.prototype.gcd=hT;A.prototype.isProbablePrime=yT;A.prototype.square=qw;var Z=A;Z.prototype.IsNegative=function(){return this.compareTo(Z.ZERO)==-1};Z.op_Equality=function(r,e){return r.compareTo(e)==0};Z.op_Inequality=function(r,e){return r.compareTo(e)!=0};Z.op_GreaterThan=function(r,e){return r.compareTo(e)>0};Z.op_LessThan=function(r,e){return r.compareTo(e)<0};Z.op_Addition=function(r,e){return new Z(r).add(new Z(e))};Z.op_Subtraction=function(r,e){return new Z(r).subtract(new Z(e))};Z.Int128Mul=function(r,e){return new Z(r).multiply(new Z(e))};Z.op_Division=function(r,e){return r.divide(e)};Z.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof ju>"u"&&(ju=s(function(r,e){var t;if(typeof Object.getOwnPropertyNames>"u"){for(t in e.prototype)(typeof r.prototype[t]>"u"||r.prototype[t]==Object.prototype[t])&&(r.prototype[t]=e.prototype[t]);for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}else{for(var i=Object.getOwnPropertyNames(e.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(e.prototype,i[n]));for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}},"Inherit"));var ju;d.Path=function(){return[]};d.Paths=function(){return[]};d.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};d.DoublePoint0=function(){this.X=0,this.Y=0};d.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};d.DoublePoint2=function(r,e){this.X=r,this.Y=e};d.PolyNode=function(){this.m_Parent=null,this.m_polygon=new d.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};d.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,e=this.m_Parent;e!==null;)r=!r,e=e.m_Parent;return r};d.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};d.PolyNode.prototype.Contour=function(){return this.m_polygon};d.PolyNode.prototype.AddChild=function(r){var e=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=e};d.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};d.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};d.PolyNode.prototype.Childs=function(){return this.m_Childs};d.PolyNode.prototype.Parent=function(){return this.m_Parent};d.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};d.PolyTree=function(){this.m_AllPolys=[],d.PolyNode.call(this)};d.PolyTree.prototype.Clear=function(){for(var r=0,e=this.m_AllPolys.length;r<e;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};d.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};d.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};ju(d.PolyTree,d.PolyNode);d.Math_Abs_Int64=d.Math_Abs_Int32=d.Math_Abs_Double=function(r){return Math.abs(r)};d.Math_Max_Int32_Int32=function(r,e){return Math.max(r,e)};$.msie||$.opera||$.safari?d.Cast_Int32=function(r){return r|0}:d.Cast_Int32=function(r){return~~r};$.chrome?d.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:$.firefox&&typeof Number.toInteger=="function"?d.Cast_Int64=function(r){return Number.toInteger(r)}:$.msie7||$.msie8?d.Cast_Int64=function(r){return parseInt(r,10)}:$.msie?d.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:d.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};d.Clear=function(r){r.length=0};d.PI=3.141592653589793;d.PI2=2*3.141592653589793;d.IntPoint=function(){var r=arguments,e=r.length;if(this.X=0,this.Y=0,Pn)if(this.Z=0,e==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(e==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(e==1)if(r[0]instanceof d.DoublePoint){var t=r[0];this.X=d.Clipper.Round(t.X),this.Y=d.Clipper.Round(t.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(e==2)this.X=r[0],this.Y=r[1];else if(e==1)if(r[0]instanceof d.DoublePoint){var t=r[0];this.X=d.Clipper.Round(t.X),this.Y=d.Clipper.Round(t.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};d.IntPoint.op_Equality=function(r,e){return r.X==e.X&&r.Y==e.Y};d.IntPoint.op_Inequality=function(r,e){return r.X!=e.X||r.Y!=e.Y};Pn?(d.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},d.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},d.IntPoint1dp=function(r){this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y),this.Z=0},d.IntPoint2=function(r,e){this.X=r,this.Y=e,this.Z=0},d.IntPoint3=function(r,e,t){this.X=r,this.Y=e,this.Z=t}):(d.IntPoint0=function(){this.X=0,this.Y=0},d.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},d.IntPoint1dp=function(r){this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y)},d.IntPoint2=function(r,e){this.X=r,this.Y=e});d.IntRect=function(){var r=arguments,e=r.length;e==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):e==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};d.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};d.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};d.IntRect4=function(r,e,t,i){this.left=r,this.top=e,this.right=t,this.bottom=i};d.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};d.PolyType={ptSubject:0,ptClip:1};d.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};d.JoinType={jtSquare:0,jtRound:1,jtMiter:2};d.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};C5&&(d.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});d.EdgeSide={esLeft:0,esRight:1};d.Direction={dRightToLeft:0,dLeftToRight:1};d.TEdge=function(){this.Bot=new d.IntPoint,this.Curr=new d.IntPoint,this.Top=new d.IntPoint,this.Delta=new d.IntPoint,this.Dx=0,this.PolyTyp=d.PolyType.ptSubject,this.Side=d.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};d.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new d.IntPoint};d.MyIntersectNodeSort=function(){};d.MyIntersectNodeSort.Compare=function(r,e){return e.Pt.Y-r.Pt.Y};d.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};d.Scanbeam=function(){this.Y=0,this.Next=null};d.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};d.OutPt=function(){this.Idx=0,this.Pt=new d.IntPoint,this.Next=null,this.Prev=null};d.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new d.IntPoint};d.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.ClipperBase.horizontal=-9007199254740992;d.ClipperBase.Skip=-2;d.ClipperBase.Unassigned=-1;d.ClipperBase.tolerance=1e-20;LP?(d.ClipperBase.loRange=46340,d.ClipperBase.hiRange=46340):(d.ClipperBase.loRange=47453132,d.ClipperBase.hiRange=0xfffffffffffff);d.ClipperBase.near_zero=function(r){return r>-d.ClipperBase.tolerance&&r<d.ClipperBase.tolerance};d.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};d.ClipperBase.prototype.PointIsVertex=function(r,e){var t=e;do{if(d.IntPoint.op_Equality(t.Pt,r))return!0;t=t.Next}while(t!=e);return!1};d.ClipperBase.prototype.PointOnLineSegment=function(r,e,t,i){return i?r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&Z.op_Equality(Z.Int128Mul(r.X-e.X,t.Y-e.Y),Z.Int128Mul(t.X-e.X,r.Y-e.Y)):r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&(r.X-e.X)*(t.Y-e.Y)==(t.X-e.X)*(r.Y-e.Y)};d.ClipperBase.prototype.PointOnPolygon=function(r,e,t){for(var i=e;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,t))return!0;if(i=i.Next,i==e)break}return!1};d.ClipperBase.prototype.SlopesEqual=d.ClipperBase.SlopesEqual=function(){var r=arguments,e=r.length,t,i,n,o,a,c,l;return e==3?(t=r[0],i=r[1],l=r[2],l?Z.op_Equality(Z.Int128Mul(t.Delta.Y,i.Delta.X),Z.Int128Mul(t.Delta.X,i.Delta.Y)):d.Cast_Int64(t.Delta.Y*i.Delta.X)==d.Cast_Int64(t.Delta.X*i.Delta.Y)):e==4?(n=r[0],o=r[1],a=r[2],l=r[3],l?Z.op_Equality(Z.Int128Mul(n.Y-o.Y,o.X-a.X),Z.Int128Mul(n.X-o.X,o.Y-a.Y)):d.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-d.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=r[0],o=r[1],a=r[2],c=r[3],l=r[4],l?Z.op_Equality(Z.Int128Mul(n.Y-o.Y,a.X-c.X),Z.Int128Mul(n.X-o.X,a.Y-c.Y)):d.Cast_Int64((n.Y-o.Y)*(a.X-c.X))-d.Cast_Int64((n.X-o.X)*(a.Y-c.Y))===0)};d.ClipperBase.SlopesEqual3=function(r,e,t){return t?Z.op_Equality(Z.Int128Mul(r.Delta.Y,e.Delta.X),Z.Int128Mul(r.Delta.X,e.Delta.Y)):d.Cast_Int64(r.Delta.Y*e.Delta.X)==d.Cast_Int64(r.Delta.X*e.Delta.Y)};d.ClipperBase.SlopesEqual4=function(r,e,t,i){return i?Z.op_Equality(Z.Int128Mul(r.Y-e.Y,e.X-t.X),Z.Int128Mul(r.X-e.X,e.Y-t.Y)):d.Cast_Int64((r.Y-e.Y)*(e.X-t.X))-d.Cast_Int64((r.X-e.X)*(e.Y-t.Y))===0};d.ClipperBase.SlopesEqual5=function(r,e,t,i,n){return n?Z.op_Equality(Z.Int128Mul(r.Y-e.Y,t.X-i.X),Z.Int128Mul(r.X-e.X,t.Y-i.Y)):d.Cast_Int64((r.Y-e.Y)*(t.X-i.X))-d.Cast_Int64((r.X-e.X)*(t.Y-i.Y))===0};d.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,e=this.m_edges.length;r<e;++r){for(var t=0,i=this.m_edges[r].length;t<i;++t)this.m_edges[r][t]=null;d.Clear(this.m_edges[r])}d.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};d.ClipperBase.prototype.RangeTest=function(r,e){e.Value?(r.X>d.ClipperBase.hiRange||r.Y>d.ClipperBase.hiRange||-r.X>d.ClipperBase.hiRange||-r.Y>d.ClipperBase.hiRange)&&d.Error("Coordinate outside allowed range in RangeTest()."):(r.X>d.ClipperBase.loRange||r.Y>d.ClipperBase.loRange||-r.X>d.ClipperBase.loRange||-r.Y>d.ClipperBase.loRange)&&(e.Value=!0,this.RangeTest(r,e))};d.ClipperBase.prototype.InitEdge=function(r,e,t,i){r.Next=e,r.Prev=t,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};d.ClipperBase.prototype.InitEdge2=function(r,e){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=e};d.ClipperBase.prototype.FindNextLocMin=function(r){for(var e;;){for(;d.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||d.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=d.ClipperBase.horizontal&&r.Prev.Dx!=d.ClipperBase.horizontal)break;for(;r.Prev.Dx==d.ClipperBase.horizontal;)r=r.Prev;for(e=r;r.Dx==d.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){e.Prev.Bot.X<r.Bot.X&&(r=e);break}}return r};d.ClipperBase.prototype.ProcessBound=function(r,e){var t=r,i=r,n,o;if(r.Dx==d.ClipperBase.horizontal&&(e?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=d.ClipperBase.Skip)if(e){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=d.ClipperBase.Skip;)i=i.Next;if(i.Dx==d.ClipperBase.horizontal&&i.Next.OutIdx!=d.ClipperBase.Skip){for(n=i;n.Prev.Dx==d.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?e||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==d.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==d.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=d.ClipperBase.Skip;)i=i.Prev;if(i.Dx==d.ClipperBase.horizontal&&i.Prev.OutIdx!=d.ClipperBase.Skip){for(n=i;n.Next.Dx==d.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?e||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==d.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==d.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==d.ClipperBase.Skip){if(r=i,e){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==d.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==d.ClipperBase.horizontal;)r=r.Next}if(r==i)e?i=r.Next:i=r.Prev;else{e?r=i.Next:r=i.Prev;var a=new d.LocalMinima;a.Next=null,a.Y=r.Bot.Y,a.LeftBound=null,a.RightBound=r,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,e),this.InsertLocalMinima(a)}}return i};d.ClipperBase.prototype.AddPath=function(r,e,t){b5?!t&&e==d.PolyType.ptClip&&d.Error("AddPath: Open paths must be subject."):t||d.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(t)for(;i>0&&d.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&d.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(t&&i<2||!t&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new d.TEdge);var a=!0;n[1].Curr.X=r[1].X,n[1].Curr.Y=r[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(r[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(r[i],c),this.m_UseFullRange=c.Value,this.InitEdge(n[0],n[1],n[i],r[0]),this.InitEdge(n[i],n[0],n[i-1],r[i]);for(var o=i-1;o>=1;--o)c.Value=this.m_UseFullRange,this.RangeTest(r[o],c),this.m_UseFullRange=c.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var l=n[0],p=l,f=l;;){if(d.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==l&&(l=p.Next),p=this.RemoveEdge(p),f=p;continue}if(p.Prev==p.Next)break;if(t&&d.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==l&&(l=p.Next),p=this.RemoveEdge(p),p=p.Prev,f=p;continue}if(p=p.Next,p==f)break}if(!t&&p==p.Next||t&&p.Prev==p.Next)return!1;t||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=d.ClipperBase.Skip);var y=l;p=l;do this.InitEdge2(p,e),p=p.Next,a&&p.Curr.Y!=l.Curr.Y&&(a=!1);while(p!=l);if(a){if(t)return!1;p.Prev.OutIdx=d.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var g=new d.LocalMinima;for(g.Next=null,g.Y=p.Bot.Y,g.LeftBound=null,g.RightBound=p,g.RightBound.Side=d.EdgeSide.esRight,g.RightBound.WindDelta=0;p.Next.OutIdx!=d.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 C,S=null;p=this.FindNextLocMin(p),p!=S;){S==null&&(S=p);var g=new d.LocalMinima;g.Next=null,g.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(g.LeftBound=p.Prev,g.RightBound=p,C=!1):(g.LeftBound=p,g.RightBound=p.Prev,C=!0),g.LeftBound.Side=d.EdgeSide.esLeft,g.RightBound.Side=d.EdgeSide.esRight,t?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,C);var M=this.ProcessBound(g.RightBound,!C);g.LeftBound.OutIdx==d.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==d.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),C||(p=M)}return!0};d.ClipperBase.prototype.AddPaths=function(r,e,t){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],e,t)&&(i=!0);return i};d.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,e,t){return d.IntPoint.op_Equality(r,t)||d.IntPoint.op_Equality(r,e)||d.IntPoint.op_Equality(t,e)?!1:r.X!=t.X?e.X>r.X==e.X<t.X:e.Y>r.Y==e.Y<t.Y};d.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var e=r.Next;return r.Prev=null,e};d.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=d.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};d.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var e=this.m_MinimaList;e.Next!==null&&r.Y<e.Next.Y;)e=e.Next;r.Next=e.Next,e.Next=r}};d.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};d.ClipperBase.prototype.ReverseHorizontal=function(r){var e=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=e,Pn&&(e=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=e)};d.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var e=r.LeftBound;e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=d.EdgeSide.esLeft,e.OutIdx=d.ClipperBase.Unassigned),e=r.RightBound,e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=d.EdgeSide.esRight,e.OutIdx=d.ClipperBase.Unassigned),r=r.Next}};d.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=d.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=d.PolyFillType.pftEvenOdd,this.m_SubjFillType=d.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,d.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=d.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,Pn&&(this.ZFillFunction=null)};d.Clipper.ioReverseSolution=1;d.Clipper.ioStrictlySimple=2;d.Clipper.ioPreserveCollinear=4;d.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),d.ClipperBase.prototype.Clear.call(this))};d.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};d.Clipper.prototype.Reset=function(){d.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};d.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new d.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var e=new d.Scanbeam;e.Y=r,e.Next=this.m_Scanbeam,this.m_Scanbeam=e}else{for(var t=this.m_Scanbeam;t.Next!==null&&r<=t.Next.Y;)t=t.Next;if(r==t.Y)return;var e=new d.Scanbeam;e.Y=r,e.Next=t.Next,t.Next=e}};d.Clipper.prototype.Execute=function(){var r=arguments,e=r.length,t=r[1]instanceof d.PolyTree;if(e==4&&!t){var i=r[0],n=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&d.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,d.Clear(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(e==4&&t){var i=r[0],l=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(e==2&&!t){var i=r[0],n=r[1];return this.Execute(i,n,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}else if(e==2&&t){var i=r[0],l=r[1];return this.Execute(i,l,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}};d.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var e=r.FirstLeft;e!==null&&(e.IsHole==r.IsHole||e.Pts===null);)e=e.FirstLeft;r.FirstLeft=e}};d.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),d.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var e=this.PopScanbeam();if(!this.ProcessIntersections(r,e))return!1;this.ProcessEdgesAtTopOfScanbeam(e),r=e}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{d.Clear(this.m_Joins),d.Clear(this.m_GhostJoins)}};d.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,e=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,e=null,r};d.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,e=this.m_PolyOuts.length;r<e;++r)this.DisposeOutRec(r);d.Clear(this.m_PolyOuts)};d.Clipper.prototype.DisposeOutRec=function(r){var e=this.m_PolyOuts[r];e.Pts!==null&&this.DisposeOutPts(e.Pts),e=null,this.m_PolyOuts[r]=null};d.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var e=null;for(r.Prev.Next=null;r!==null;)e=r,r=r.Next,e=null}};d.Clipper.prototype.AddJoin=function(r,e,t){var i=new d.Join;i.OutPt1=r,i.OutPt2=e,i.OffPt.X=t.X,i.OffPt.Y=t.Y,this.m_Joins.push(i)};d.Clipper.prototype.AddGhostJoin=function(r,e){var t=new d.Join;t.OutPt1=r,t.OffPt.X=e.X,t.OffPt.Y=e.Y,this.m_GhostJoins.push(t)};Pn&&(d.Clipper.prototype.SetZ=function(r,e){r.Z=0,this.ZFillFunction!==null&&(e.OutIdx<0?this.ZFillFunction(e.Bot,e.Top,r):this.ZFillFunction(e.Top,e.Bot,r))});d.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var e=this.m_CurrentLM.LeftBound,t=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(e===null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot))):t==null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(t,e),this.SetWindingCount(e),t.WindCnt=e.WindCnt,t.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(i=this.AddLocalMinPoly(e,t,e.Bot)),this.InsertScanbeam(e.Top.Y)),t!=null&&(d.ClipperBase.IsHorizontal(t)?this.AddEdgeToSEL(t):this.InsertScanbeam(t.Top.Y)),!(e==null||t==null)){if(i!==null&&d.ClipperBase.IsHorizontal(t)&&this.m_GhostJoins.length>0&&t.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,t.Bot,t.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(e.OutIdx>=0&&e.PrevInAEL!==null&&e.PrevInAEL.Curr.X==e.Bot.X&&e.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,c,e.Top)}if(e.NextInAEL!=t){if(t.OutIdx>=0&&t.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,c,t.Top)}var l=e.NextInAEL;if(l!==null)for(;l!=t;)this.IntersectEdges(t,l,e.Curr,!1),l=l.NextInAEL}}}};d.Clipper.prototype.InsertEdgeIntoAEL=function(r,e){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(e===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(e===null&&(e=this.m_ActiveEdges);e.NextInAEL!==null&&!this.E2InsertsBeforeE1(e.NextInAEL,r);)e=e.NextInAEL;r.NextInAEL=e.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=r),r.PrevInAEL=e,e.NextInAEL=r}};d.Clipper.prototype.E2InsertsBeforeE1=function(r,e){return e.Curr.X==r.Curr.X?e.Top.Y>r.Top.Y?e.Top.X<d.Clipper.TopX(r,e.Top.Y):r.Top.X>d.Clipper.TopX(e,r.Top.Y):e.Curr.X<r.Curr.X};d.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==d.PolyType.ptSubject?this.m_SubjFillType==d.PolyFillType.pftEvenOdd:this.m_ClipFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==d.PolyType.ptSubject?this.m_ClipFillType==d.PolyFillType.pftEvenOdd:this.m_SubjFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsContributing=function(r){var e,t;switch(r.PolyTyp==d.PolyType.ptSubject?(e=this.m_SubjFillType,t=this.m_ClipFillType):(e=this.m_ClipFillType,t=this.m_SubjFillType),e){case d.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case d.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case d.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case d.ClipType.ctIntersection:switch(t){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2!==0;case d.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case d.ClipType.ctUnion:switch(t){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case d.ClipType.ctDifference:if(r.PolyTyp==d.PolyType.ptSubject)switch(t){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(t){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2!==0;case d.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case d.ClipType.ctXor:if(r.WindDelta===0)switch(t){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};d.Clipper.prototype.SetWindingCount=function(r){for(var e=r.PrevInAEL;e!==null&&(e.PolyTyp!=r.PolyTyp||e.WindDelta===0);)e=e.PrevInAEL;if(e===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,e=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=d.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var t=!0,i=e.PrevInAEL;i!==null;)i.PolyTyp==e.PolyTyp&&i.WindDelta!==0&&(t=!t),i=i.PrevInAEL;r.WindCnt=t?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=e.WindCnt2,e=e.NextInAEL}else e.WindCnt*e.WindDelta<0?Math.abs(e.WindCnt)>1?e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=e.WindCnt<0?e.WindCnt-1:e.WindCnt+1:e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;e!=r;)e.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),e=e.NextInAEL;else for(;e!=r;)r.WindCnt2+=e.WindDelta,e=e.NextInAEL};d.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};d.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};d.Clipper.prototype.SwapPositionsInAEL=function(r,e){if(!(r.NextInAEL==r.PrevInAEL||e.NextInAEL==e.PrevInAEL)){if(r.NextInAEL==e){var t=e.NextInAEL;t!==null&&(t.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=e),e.PrevInAEL=i,e.NextInAEL=r,r.PrevInAEL=e,r.NextInAEL=t}else if(e.NextInAEL==r){var t=r.NextInAEL;t!==null&&(t.PrevInAEL=e);var i=e.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=e,e.PrevInAEL=r,e.NextInAEL=t}else{var t=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=e.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=e.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),e.NextInAEL=t,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=i,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e)}r.PrevInAEL===null?this.m_ActiveEdges=r:e.PrevInAEL===null&&(this.m_ActiveEdges=e)}};d.Clipper.prototype.SwapPositionsInSEL=function(r,e){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(e.NextInSEL===null&&e.PrevInSEL===null)){if(r.NextInSEL==e){var t=e.NextInSEL;t!==null&&(t.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=e),e.PrevInSEL=i,e.NextInSEL=r,r.PrevInSEL=e,r.NextInSEL=t}else if(e.NextInSEL==r){var t=r.NextInSEL;t!==null&&(t.PrevInSEL=e);var i=e.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=e,e.PrevInSEL=r,e.NextInSEL=t}else{var t=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=e.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=e.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),e.NextInSEL=t,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=i,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e)}r.PrevInSEL===null?this.m_SortedEdges=r:e.PrevInSEL===null&&(this.m_SortedEdges=e)}};d.Clipper.prototype.AddLocalMaxPoly=function(r,e,t){this.AddOutPt(r,t),e.WindDelta==0&&this.AddOutPt(e,t),r.OutIdx==e.OutIdx?(r.OutIdx=-1,e.OutIdx=-1):r.OutIdx<e.OutIdx?this.AppendPolygon(r,e):this.AppendPolygon(e,r)};d.Clipper.prototype.AddLocalMinPoly=function(r,e,t){var i,n,o;if(d.ClipperBase.IsHorizontal(e)||r.Dx>e.Dx?(i=this.AddOutPt(r,t),e.OutIdx=r.OutIdx,r.Side=d.EdgeSide.esLeft,e.Side=d.EdgeSide.esRight,n=r,n.PrevInAEL==e?o=e.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(e,t),r.OutIdx=e.OutIdx,r.Side=d.EdgeSide.esRight,e.Side=d.EdgeSide.esLeft,n=e,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&d.Clipper.TopX(o,t.Y)==d.Clipper.TopX(n,t.Y)&&d.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,t);this.AddJoin(i,a,n.Top)}return i};d.Clipper.prototype.CreateOutRec=function(){var r=new d.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};d.Clipper.prototype.AddOutPt=function(r,e){var t=r.Side==d.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var n=new d.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),Pn&&(d.IntPoint.op_Equality(e,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):d.IntPoint.op_Equality(e,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(t&&d.IntPoint.op_Equality(e,o.Pt))return o;if(!t&&d.IntPoint.op_Equality(e,o.Prev.Pt))return o.Prev;var n=new d.OutPt;return n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,t&&(i.Pts=n),Pn&&(d.IntPoint.op_Equality(e,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):d.IntPoint.op_Equality(e,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),n}};d.Clipper.prototype.SwapPoints=function(r,e){var t=new d.IntPoint(r.Value);r.Value.X=e.Value.X,r.Value.Y=e.Value.Y,e.Value.X=t.X,e.Value.Y=t.Y};d.Clipper.prototype.HorzSegmentsOverlap=function(r,e,t,i){return r.X>t.X==r.X<i.X||e.X>t.X==e.X<i.X||t.X>r.X==t.X<e.X||i.X>r.X==i.X<e.X||r.X==t.X&&e.X==i.X?!0:r.X==i.X&&e.X==t.X};d.Clipper.prototype.InsertPolyPtBetween=function(r,e,t){var i=new d.OutPt;return i.Pt.X=t.X,i.Pt.Y=t.Y,e==r.Next?(r.Next=i,e.Prev=i,i.Next=e,i.Prev=r):(e.Next=i,r.Prev=i,i.Next=r,i.Prev=e),i};d.Clipper.prototype.SetHoleState=function(r,e){for(var t=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(t=!t,e.FirstLeft===null&&(e.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;t&&(e.IsHole=!0)};d.Clipper.prototype.GetDx=function(r,e){return r.Y==e.Y?d.ClipperBase.horizontal:(e.X-r.X)/(e.Y-r.Y)};d.Clipper.prototype.FirstIsBottomPt=function(r,e){for(var t=r.Prev;d.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Prev;var i=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=r.Next;d.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Next;var n=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=e.Prev;d.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Prev;var o=Math.abs(this.GetDx(e.Pt,t.Pt));for(t=e.Next;d.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Next;var a=Math.abs(this.GetDx(e.Pt,t.Pt));return i>=o&&i>=a||n>=o&&n>=a};d.Clipper.prototype.GetBottomPt=function(r){for(var e=null,t=r.Next;t!=r;)t.Pt.Y>r.Pt.Y?(r=t,e=null):t.Pt.Y==r.Pt.Y&&t.Pt.X<=r.Pt.X&&(t.Pt.X<r.Pt.X?(e=null,r=t):t.Next!=r&&t.Prev!=r&&(e=t)),t=t.Next;if(e!==null)for(;e!=t;)for(this.FirstIsBottomPt(t,e)||(r=e),e=e.Next;d.IntPoint.op_Inequality(e.Pt,r.Pt);)e=e.Next;return r};d.Clipper.prototype.GetLowermostRec=function(r,e){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts));var t=r.BottomPt,i=e.BottomPt;return t.Pt.Y>i.Pt.Y?r:t.Pt.Y<i.Pt.Y?e:t.Pt.X<i.Pt.X?r:t.Pt.X>i.Pt.X||t.Next==t?e:i.Next==i||this.FirstIsBottomPt(t,i)?r:e};d.Clipper.prototype.Param1RightOfParam2=function(r,e){do if(r=r.FirstLeft,r==e)return!0;while(r!==null);return!1};d.Clipper.prototype.GetOutRec=function(r){for(var e=this.m_PolyOuts[r];e!=this.m_PolyOuts[e.Idx];)e=this.m_PolyOuts[e.Idx];return e};d.Clipper.prototype.AppendPolygon=function(r,e){var t=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[e.OutIdx],n;this.Param1RightOfParam2(t,i)?n=i:this.Param1RightOfParam2(i,t)?n=t:n=this.GetLowermostRec(t,i);var o=t.Pts,a=o.Prev,c=i.Pts,l=c.Prev,p;r.Side==d.EdgeSide.esLeft?(e.Side==d.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=o,o.Prev=c,a.Next=l,l.Prev=a,t.Pts=l):(l.Next=o,o.Prev=l,c.Prev=a,a.Next=c,t.Pts=c),p=d.EdgeSide.esLeft):(e.Side==d.EdgeSide.esRight?(this.ReversePolyPtLinks(c),a.Next=l,l.Prev=a,c.Next=o,o.Prev=c):(a.Next=c,c.Prev=a,o.Prev=l,l.Next=o),p=d.EdgeSide.esRight),t.BottomPt=null,n==i&&(i.FirstLeft!=t&&(t.FirstLeft=i.FirstLeft),t.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=t;var f=r.OutIdx,y=e.OutIdx;r.OutIdx=-1,e.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==y){g.OutIdx=f,g.Side=p;break}g=g.NextInAEL}i.Idx=t.Idx};d.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var e,t;e=r;do t=e.Next,e.Next=e.Prev,e.Prev=t,e=t;while(e!=r)}};d.Clipper.SwapSides=function(r,e){var t=r.Side;r.Side=e.Side,e.Side=t};d.Clipper.SwapPolyIndexes=function(r,e){var t=r.OutIdx;r.OutIdx=e.OutIdx,e.OutIdx=t};d.Clipper.prototype.IntersectEdges=function(r,e,t,i){var n=!i&&r.NextInLML===null&&r.Top.X==t.X&&r.Top.Y==t.Y,o=!i&&e.NextInLML===null&&e.Top.X==t.X&&e.Top.Y==t.Y,a=r.OutIdx>=0,c=e.OutIdx>=0;if(b5&&(r.WindDelta===0||e.WindDelta===0)){r.WindDelta===0&&e.WindDelta===0?(n||o)&&a&&c&&this.AddLocalMaxPoly(r,e,t):r.PolyTyp==e.PolyTyp&&r.WindDelta!=e.WindDelta&&this.m_ClipType==d.ClipType.ctUnion?r.WindDelta===0?c&&(this.AddOutPt(r,t),a&&(r.OutIdx=-1)):a&&(this.AddOutPt(e,t),c&&(e.OutIdx=-1)):r.PolyTyp!=e.PolyTyp&&(r.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||e.WindCnt2===0)?(this.AddOutPt(r,t),a&&(r.OutIdx=-1)):e.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(e,t),c&&(e.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):d.Error("Error intersecting polylines")),o&&(e.OutIdx<0?this.DeleteFromAEL(e):d.Error("Error intersecting polylines"));return}if(r.PolyTyp==e.PolyTyp)if(this.IsEvenOddFillType(r)){var l=r.WindCnt;r.WindCnt=e.WindCnt,e.WindCnt=l}else r.WindCnt+e.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=e.WindDelta,e.WindCnt-r.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(e)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(r)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2-=r.WindDelta;var p,f,y,g;r.PolyTyp==d.PolyType.ptSubject?(p=this.m_SubjFillType,y=this.m_ClipFillType):(p=this.m_ClipFillType,y=this.m_SubjFillType),e.PolyTyp==d.PolyType.ptSubject?(f=this.m_SubjFillType,g=this.m_ClipFillType):(f=this.m_ClipFillType,g=this.m_SubjFillType);var C,S;switch(p){case d.PolyFillType.pftPositive:C=r.WindCnt;break;case d.PolyFillType.pftNegative:C=-r.WindCnt;break;default:C=Math.abs(r.WindCnt);break}switch(f){case d.PolyFillType.pftPositive:S=e.WindCnt;break;case d.PolyFillType.pftNegative:S=-e.WindCnt;break;default:S=Math.abs(e.WindCnt);break}if(a&&c)n||o||C!==0&&C!=1||S!==0&&S!=1||r.PolyTyp!=e.PolyTyp&&this.m_ClipType!=d.ClipType.ctXor?this.AddLocalMaxPoly(r,e,t):(this.AddOutPt(r,t),this.AddOutPt(e,t),d.Clipper.SwapSides(r,e),d.Clipper.SwapPolyIndexes(r,e));else if(a)(S===0||S==1)&&(this.AddOutPt(r,t),d.Clipper.SwapSides(r,e),d.Clipper.SwapPolyIndexes(r,e));else if(c)(C===0||C==1)&&(this.AddOutPt(e,t),d.Clipper.SwapSides(r,e),d.Clipper.SwapPolyIndexes(r,e));else if((C===0||C==1)&&(S===0||S==1)&&!n&&!o){var M,v;switch(y){case d.PolyFillType.pftPositive:M=r.WindCnt2;break;case d.PolyFillType.pftNegative:M=-r.WindCnt2;break;default:M=Math.abs(r.WindCnt2);break}switch(g){case d.PolyFillType.pftPositive:v=e.WindCnt2;break;case d.PolyFillType.pftNegative:v=-e.WindCnt2;break;default:v=Math.abs(e.WindCnt2);break}if(r.PolyTyp!=e.PolyTyp)this.AddLocalMinPoly(r,e,t);else if(C==1&&S==1)switch(this.m_ClipType){case d.ClipType.ctIntersection:M>0&&v>0&&this.AddLocalMinPoly(r,e,t);break;case d.ClipType.ctUnion:M<=0&&v<=0&&this.AddLocalMinPoly(r,e,t);break;case d.ClipType.ctDifference:(r.PolyTyp==d.PolyType.ptClip&&M>0&&v>0||r.PolyTyp==d.PolyType.ptSubject&&M<=0&&v<=0)&&this.AddLocalMinPoly(r,e,t);break;case d.ClipType.ctXor:this.AddLocalMinPoly(r,e,t);break}else d.Clipper.SwapSides(r,e)}n!=o&&(n&&r.OutIdx>=0||o&&e.OutIdx>=0)&&(d.Clipper.SwapSides(r,e),d.Clipper.SwapPolyIndexes(r,e)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(e)};d.Clipper.prototype.DeleteFromAEL=function(r){var e=r.PrevInAEL,t=r.NextInAEL;e===null&&t===null&&r!=this.m_ActiveEdges||(e!==null?e.NextInAEL=t:this.m_ActiveEdges=t,t!==null&&(t.PrevInAEL=e),r.NextInAEL=null,r.PrevInAEL=null)};d.Clipper.prototype.DeleteFromSEL=function(r){var e=r.PrevInSEL,t=r.NextInSEL;e===null&&t===null&&r!=this.m_SortedEdges||(e!==null?e.NextInSEL=t:this.m_SortedEdges=t,t!==null&&(t.PrevInSEL=e),r.NextInSEL=null,r.PrevInSEL=null)};d.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&d.Error("UpdateEdgeIntoAEL: invalid call");var e=r.PrevInAEL,t=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,e!==null?e.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,t!==null&&(t.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=e,r.NextInAEL=t,d.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};d.Clipper.prototype.ProcessHorizontals=function(r){for(var e=this.m_SortedEdges;e!==null;)this.DeleteFromSEL(e),this.ProcessHorizontal(e,r),e=this.m_SortedEdges};d.Clipper.prototype.GetHorzDirection=function(r,e){r.Bot.X<r.Top.X?(e.Left=r.Bot.X,e.Right=r.Top.X,e.Dir=d.Direction.dLeftToRight):(e.Left=r.Top.X,e.Right=r.Bot.X,e.Dir=d.Direction.dRightToLeft)};d.Clipper.prototype.PrepareHorzJoins=function(r,e){var t=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=d.EdgeSide.esLeft&&(t=t.Prev),e&&(d.IntPoint.op_Equality(t.Pt,r.Top)?this.AddGhostJoin(t,r.Bot):this.AddGhostJoin(t,r.Top))};d.Clipper.prototype.ProcessHorizontal=function(r,e){var t={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,t);for(var i=t.Dir,n=t.Left,o=t.Right,a=r,c=null;a.NextInLML!==null&&d.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(c=this.GetMaximaPair(a));;){for(var l=r==a,p=this.GetNextInAEL(r,i);p!==null&&!(p.Curr.X==r.Top.X&&r.NextInLML!==null&&p.Dx<r.NextInLML.Dx);){var f=this.GetNextInAEL(p,i);if(i==d.Direction.dLeftToRight&&p.Curr.X<=o||i==d.Direction.dRightToLeft&&p.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,e),p==c&&l){i==d.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),c.OutIdx>=0&&d.Error("ProcessHorizontal error");return}else if(i==d.Direction.dLeftToRight){var y=new d.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,y,!0)}else{var y=new d.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,y,!0)}this.SwapPositionsInAEL(r,p)}else if(i==d.Direction.dLeftToRight&&p.Curr.X>=o||i==d.Direction.dRightToLeft&&p.Curr.X<=n)break;p=f}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,e),r.NextInLML!==null&&d.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var t={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,t),i=t.Dir,n=t.Left,o=t.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var g=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var C=r.PrevInAEL,f=r.NextInAEL;if(C!==null&&C.Curr.X==r.Bot.X&&C.Curr.Y==r.Bot.Y&&C.WindDelta!==0&&C.OutIdx>=0&&C.Curr.Y>C.Top.Y&&d.ClipperBase.SlopesEqual(r,C,this.m_UseFullRange)){var S=this.AddOutPt(C,r.Bot);this.AddJoin(g,S,r.Top)}else if(f!==null&&f.Curr.X==r.Bot.X&&f.Curr.Y==r.Bot.Y&&f.WindDelta!==0&&f.OutIdx>=0&&f.Curr.Y>f.Top.Y&&d.ClipperBase.SlopesEqual(r,f,this.m_UseFullRange)){var S=this.AddOutPt(f,r.Bot);this.AddJoin(g,S,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else c!==null?c.OutIdx>=0?(i==d.Direction.dLeftToRight?this.IntersectEdges(r,c,r.Top,!1):this.IntersectEdges(c,r,r.Top,!1),c.OutIdx>=0&&d.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(c)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};d.Clipper.prototype.GetNextInAEL=function(r,e){return e==d.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};d.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};d.Clipper.prototype.IsMaxima=function(r,e){return r!==null&&r.Top.Y==e&&r.NextInLML===null};d.Clipper.prototype.IsIntermediate=function(r,e){return r.Top.Y==e&&r.NextInLML!==null};d.Clipper.prototype.GetMaximaPair=function(r){var e=null;return d.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?e=r.Next:d.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(e=r.Prev),e!==null&&(e.OutIdx==-2||e.NextInAEL==e.PrevInAEL&&!d.ClipperBase.IsHorizontal(e))?null:e};d.Clipper.prototype.ProcessIntersections=function(r,e){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,e),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,d.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};d.Clipper.prototype.BuildIntersectList=function(r,e){if(this.m_ActiveEdges!==null){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;t!==null;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t.Curr.X=d.Clipper.TopX(t,e),t=t.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,t=this.m_SortedEdges;t.NextInSEL!==null;){var n=t.NextInSEL,o=new d.IntPoint;if(t.Curr.X>n.Curr.X){!this.IntersectPoint(t,n,o)&&t.Curr.X>n.Curr.X+1&&d.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(t.Dx)>Math.abs(n.Dx)?o.X=d.Clipper.TopX(n,r):o.X=d.Clipper.TopX(t,r));var a=new d.IntersectNode;a.Edge1=t,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(t,n),i=!0}else t=n}if(t.PrevInSEL!==null)t.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};d.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};d.Clipper.IntersectNodeSort=function(r,e){return e.Pt.Y-r.Pt.Y};d.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,e=0;e<r;e++){if(!this.EdgesAdjacent(this.m_IntersectList[e])){for(var t=e+1;t<r&&!this.EdgesAdjacent(this.m_IntersectList[t]);)t++;if(t==r)return!1;var i=this.m_IntersectList[e];this.m_IntersectList[e]=this.m_IntersectList[t],this.m_IntersectList[t]=i}this.SwapPositionsInSEL(this.m_IntersectList[e].Edge1,this.m_IntersectList[e].Edge2)}return!0};d.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,e=this.m_IntersectList.length;r<e;r++){var t=this.m_IntersectList[r];this.IntersectEdges(t.Edge1,t.Edge2,t.Pt,!0),this.SwapPositionsInAEL(t.Edge1,t.Edge2)}this.m_IntersectList.length=0};var vT=s(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),bT=s(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),CT=s(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),xT=s(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");$.msie?d.Clipper.Round=vT:$.chromium?d.Clipper.Round=CT:$.safari?d.Clipper.Round=xT:d.Clipper.Round=bT;d.Clipper.TopX=function(r,e){return e==r.Top.Y?r.Top.X:r.Bot.X+d.Clipper.Round(r.Dx*(e-r.Bot.Y))};d.Clipper.prototype.IntersectPoint=function(r,e,t){t.X=0,t.Y=0;var i,n;if(d.ClipperBase.SlopesEqual(r,e,this.m_UseFullRange)||r.Dx==e.Dx)return e.Bot.Y>r.Bot.Y?(t.X=e.Bot.X,t.Y=e.Bot.Y):(t.X=r.Bot.X,t.Y=r.Bot.Y),!1;if(r.Delta.X===0)t.X=r.Bot.X,d.ClipperBase.IsHorizontal(e)?t.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,t.Y=d.Clipper.Round(t.X/e.Dx+n));else if(e.Delta.X===0)t.X=e.Bot.X,d.ClipperBase.IsHorizontal(r)?t.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,t.Y=d.Clipper.Round(t.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=e.Bot.X-e.Bot.Y*e.Dx;var o=(n-i)/(r.Dx-e.Dx);t.Y=d.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=d.Clipper.Round(r.Dx*o+i):t.X=d.Clipper.Round(e.Dx*o+n)}if(t.Y<r.Top.Y||t.Y<e.Top.Y){if(r.Top.Y>e.Top.Y)return t.Y=r.Top.Y,t.X=d.Clipper.TopX(e,r.Top.Y),t.X<r.Top.X;t.Y=e.Top.Y,Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=d.Clipper.TopX(r,t.Y):t.X=d.Clipper.TopX(e,t.Y)}return!0};d.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var e=this.m_ActiveEdges;e!==null;){var t=this.IsMaxima(e,r);if(t){var i=this.GetMaximaPair(e);t=i===null||!d.ClipperBase.IsHorizontal(i)}if(t){var n=e.PrevInAEL;this.DoMaxima(e),n===null?e=this.m_ActiveEdges:e=n.NextInAEL}else{if(this.IsIntermediate(e,r)&&d.ClipperBase.IsHorizontal(e.NextInLML)?(e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot),this.AddEdgeToSEL(e)):(e.Curr.X=d.Clipper.TopX(e,r),e.Curr.Y=r),this.StrictlySimple){var n=e.PrevInAEL;if(e.OutIdx>=0&&e.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==e.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,e.Curr),a=this.AddOutPt(e,e.Curr);this.AddJoin(o,a,e.Curr)}}e=e.NextInAEL}}for(this.ProcessHorizontals(!0),e=this.m_ActiveEdges;e!==null;){if(this.IsIntermediate(e,r)){var o=null;e.OutIdx>=0&&(o=this.AddOutPt(e,e.Top)),e=this.UpdateEdgeIntoAEL(e);var n=e.PrevInAEL,c=e.NextInAEL;if(n!==null&&n.Curr.X==e.Bot.X&&n.Curr.Y==e.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&d.ClipperBase.SlopesEqual(e,n,this.m_UseFullRange)&&e.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,e.Bot);this.AddJoin(o,a,e.Top)}else if(c!==null&&c.Curr.X==e.Bot.X&&c.Curr.Y==e.Bot.Y&&o!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&d.ClipperBase.SlopesEqual(e,c,this.m_UseFullRange)&&e.WindDelta!==0&&c.WindDelta!==0){var a=this.AddOutPt(c,e.Bot);this.AddJoin(o,a,e.Top)}}e=e.NextInAEL}};d.Clipper.prototype.DoMaxima=function(r){var e=this.GetMaximaPair(r);if(e===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var t=r.NextInAEL,i=!0;t!==null&&t!=e;)this.IntersectEdges(r,t,r.Top,!0),this.SwapPositionsInAEL(r,t),t=r.NextInAEL;r.OutIdx==-1&&e.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(e)):r.OutIdx>=0&&e.OutIdx>=0?this.IntersectEdges(r,e,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),e.OutIdx>=0&&(this.AddOutPt(e,r.Top),e.OutIdx=-1),this.DeleteFromAEL(e)):d.Error("DoMaxima error")};d.Clipper.ReversePaths=function(r){for(var e=0,t=r.length;e<t;e++)r[e].reverse()};d.Clipper.Orientation=function(r){return d.Clipper.Area(r)>=0};d.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var e=0,t=r;do e++,t=t.Next;while(t!=r);return e};d.Clipper.prototype.BuildResult=function(r){d.Clear(r);for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e];if(i.Pts!==null){var n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),c=0;c<o;c++)a[c]=n.Pt,n=n.Prev;r.push(a)}}}};d.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new d.PolyNode;r.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,c=0;c<n;c++)o.m_polygon[c]=a.Pt,a=a.Prev}}for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};d.Clipper.prototype.FixupOutPolygon=function(r){var e=null;r.BottomPt=null;for(var t=r.Pts;;){if(t.Prev==t||t.Prev==t.Next){this.DisposeOutPts(t),r.Pts=null;return}if(d.IntPoint.op_Equality(t.Pt,t.Next.Pt)||d.IntPoint.op_Equality(t.Pt,t.Prev.Pt)||d.ClipperBase.SlopesEqual(t.Prev.Pt,t.Pt,t.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(t.Prev.Pt,t.Pt,t.Next.Pt))){e=null;var i=t;t.Prev.Next=t.Next,t.Next.Prev=t.Prev,t=t.Prev,i=null}else{if(t==e)break;e===null&&(e=t),t=t.Next}}r.Pts=t};d.Clipper.prototype.DupOutPt=function(r,e){var t=new d.OutPt;return t.Pt.X=r.Pt.X,t.Pt.Y=r.Pt.Y,t.Idx=r.Idx,e?(t.Next=r.Next,t.Prev=r,r.Next.Prev=t,r.Next=t):(t.Prev=r.Prev,t.Next=r,r.Prev.Next=t,r.Prev=t),t};d.Clipper.prototype.GetOverlap=function(r,e,t,i,n){return r<e?t<i?(n.Left=Math.max(r,t),n.Right=Math.min(e,i)):(n.Left=Math.max(r,i),n.Right=Math.min(e,t)):t<i?(n.Left=Math.max(e,t),n.Right=Math.min(r,i)):(n.Left=Math.max(e,i),n.Right=Math.min(r,t)),n.Left<n.Right};d.Clipper.prototype.JoinHorz=function(r,e,t,i,n,o){var a=r.Pt.X>e.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight,c=t.Pt.X>i.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight;if(a==c)return!1;if(a==d.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),e=this.DupOutPt(r,!o),d.IntPoint.op_Inequality(e.Pt,n)&&(r=e,r.Pt.X=n.X,r.Pt.Y=n.Y,e=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),e=this.DupOutPt(r,o),d.IntPoint.op_Inequality(e.Pt,n)&&(r=e,r.Pt.X=n.X,r.Pt.Y=n.Y,e=this.DupOutPt(r,o))}if(c==d.Direction.dLeftToRight){for(;t.Next.Pt.X<=n.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;o&&t.Pt.X!=n.X&&(t=t.Next),i=this.DupOutPt(t,!o),d.IntPoint.op_Inequality(i.Pt,n)&&(t=i,t.Pt.X=n.X,t.Pt.Y=n.Y,i=this.DupOutPt(t,!o))}else{for(;t.Next.Pt.X>=n.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;!o&&t.Pt.X!=n.X&&(t=t.Next),i=this.DupOutPt(t,o),d.IntPoint.op_Inequality(i.Pt,n)&&(t=i,t.Pt.X=n.X,t.Pt.Y=n.Y,i=this.DupOutPt(t,o))}return a==d.Direction.dLeftToRight==o?(r.Prev=t,t.Next=r,e.Next=i,i.Prev=e):(r.Next=t,t.Prev=r,e.Prev=i,i.Next=e),!0};d.Clipper.prototype.JoinPoints=function(r,e,t){var i=r.OutPt1,n=new d.OutPt,o=r.OutPt2,a=new d.OutPt,c=r.OutPt1.Pt.Y==r.OffPt.Y;if(c&&d.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&d.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(n=r.OutPt1.Next;n!=i&&d.IntPoint.op_Equality(n.Pt,r.OffPt);)n=n.Next;var l=n.Pt.Y>r.OffPt.Y;for(a=r.OutPt2.Next;a!=o&&d.IntPoint.op_Equality(a.Pt,r.OffPt);)a=a.Next;var p=a.Pt.Y>r.OffPt.Y;return l==p?!1:l?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}else if(c){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var f={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,f))return!1;var y=f.Left,g=f.Right,C=new d.IntPoint,S;return i.Pt.X>=y&&i.Pt.X<=g?(C.X=i.Pt.X,C.Y=i.Pt.Y,S=i.Pt.X>n.Pt.X):o.Pt.X>=y&&o.Pt.X<=g?(C.X=o.Pt.X,C.Y=o.Pt.Y,S=o.Pt.X>a.Pt.X):n.Pt.X>=y&&n.Pt.X<=g?(C.X=n.Pt.X,C.Y=n.Pt.Y,S=n.Pt.X>i.Pt.X):(C.X=a.Pt.X,C.Y=a.Pt.Y,S=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,C,S)}else{for(n=i.Next;d.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var M=n.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(M){for(n=i.Prev;d.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;d.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var v=a.Pt.Y>o.Pt.Y||!d.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(v){for(a=o.Prev;d.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!d.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||e==t&&M==v?!1:M?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}};d.Clipper.GetBounds=function(r){for(var e=0,t=r.length;e<t&&r[e].length==0;)e++;if(e==t)return new d.IntRect(0,0,0,0);var i=new d.IntRect;for(i.left=r[e][0].X,i.right=i.left,i.top=r[e][0].Y,i.bottom=i.top;e<t;e++)for(var n=0,o=r[e].length;n<o;n++)r[e][n].X<i.left?i.left=r[e][n].X:r[e][n].X>i.right&&(i.right=r[e][n].X),r[e][n].Y<i.top?i.top=r[e][n].Y:r[e][n].Y>i.bottom&&(i.bottom=r[e][n].Y);return i};d.Clipper.prototype.GetBounds2=function(r){var e=r,t=new d.IntRect;for(t.left=r.Pt.X,t.right=r.Pt.X,t.top=r.Pt.Y,t.bottom=r.Pt.Y,r=r.Next;r!=e;)r.Pt.X<t.left&&(t.left=r.Pt.X),r.Pt.X>t.right&&(t.right=r.Pt.X),r.Pt.Y<t.top&&(t.top=r.Pt.Y),r.Pt.Y>t.bottom&&(t.bottom=r.Pt.Y),r=r.Next;return t};d.Clipper.PointInPolygon=function(r,e){var t=0,i=e.length;if(i<3)return 0;for(var n=e[0],o=1;o<=i;++o){var a=o==i?e[0]:e[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)t=1-t;else{var c=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(c==0)return-1;c>0==a.Y>n.Y&&(t=1-t)}else if(a.X>r.X){var c=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(c==0)return-1;c>0==a.Y>n.Y&&(t=1-t)}}n=a}return t};d.Clipper.prototype.PointInPolygon=function(r,e){for(var t=0,i=e;;){var n=e.Pt.X,o=e.Pt.Y,a=e.Next.Pt.X,c=e.Next.Pt.Y;if(c==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=c<r.Y){if(n>=r.X)if(a>r.X)t=1-t;else{var l=(n-r.X)*(c-r.Y)-(a-r.X)*(o-r.Y);if(l==0)return-1;l>0==c>o&&(t=1-t)}else if(a>r.X){var l=(n-r.X)*(c-r.Y)-(a-r.X)*(o-r.Y);if(l==0)return-1;l>0==c>o&&(t=1-t)}}if(e=e.Next,i==e)break}return t};d.Clipper.prototype.Poly2ContainsPoly1=function(r,e){var t=r;do{var i=this.PointInPolygon(t.Pt,e);if(i>=0)return i!=0;t=t.Next}while(t!=r);return!0};d.Clipper.prototype.FixupFirstLefts1=function(r,e){for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,e.Pts)&&(n.FirstLeft=e)}};d.Clipper.prototype.FixupFirstLefts2=function(r,e){for(var t=0,i=this.m_PolyOuts,n=i.length,o=i[t];t<n;t++,o=i[t])o.FirstLeft==r&&(o.FirstLeft=e)};d.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};d.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,e=this.m_Joins.length;r<e;r++){var t=this.m_Joins[r],i=this.GetOutRec(t.OutPt1.Idx),n=this.GetOutRec(t.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(t,i,n))if(i==n){if(i.Pts=t.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=t.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,c=this.m_PolyOuts.length;a<c-1;a++){var l=this.m_PolyOuts[a];l.Pts==null||d.Clipper.ParseFirstLeft(l.FirstLeft)!=i||l.IsHole==i.IsHole||this.Poly2ContainsPoly1(l.Pts,t.OutPt2)&&(l.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};d.Clipper.prototype.UpdateOutPtIdxs=function(r){var e=r.Pts;do e.Idx=r.Idx,e=e.Prev;while(e!=r.Pts)};d.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var e=this.m_PolyOuts[r++],t=e.Pts;if(t!==null)do{for(var i=t.Next;i!=e.Pts;){if(d.IntPoint.op_Equality(t.Pt,i.Pt)&&i.Next!=t&&i.Prev!=t){var n=t.Prev,o=i.Prev;t.Prev=o,o.Next=t,i.Prev=n,n.Next=i,e.Pts=t;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,e.Pts)?(a.IsHole=!e.IsHole,a.FirstLeft=e):this.Poly2ContainsPoly1(e.Pts,a.Pts)?(a.IsHole=e.IsHole,e.IsHole=!a.IsHole,a.FirstLeft=e.FirstLeft,e.FirstLeft=a):(a.IsHole=e.IsHole,a.FirstLeft=e.FirstLeft),i=t}i=i.Next}t=t.Next}while(t!=e.Pts)}};d.Clipper.Area=function(r){var e=r.length;if(e<3)return 0;for(var t=0,i=0,n=e-1;i<e;++i)t+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-t*.5};d.Clipper.prototype.Area=function(r){var e=r.Pts;if(e==null)return 0;var t=0;do t=t+(e.Prev.Pt.X+e.Pt.X)*(e.Prev.Pt.Y-e.Pt.Y),e=e.Next;while(e!=r.Pts);return t*.5};C5&&(d.Clipper.OffsetPaths=function(r,e,t,i,n){var o=new d.Paths,a=new d.ClipperOffset(n,n);return a.AddPaths(r,t,i),a.Execute(o,e),o});d.Clipper.SimplifyPolygon=function(r,e){var t=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,t,e,e),t};d.Clipper.SimplifyPolygons=function(r,e){typeof e>"u"&&(e=d.PolyFillType.pftEvenOdd);var t=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,t,e,e),t};d.Clipper.DistanceSqrd=function(r,e){var t=r.X-e.X,i=r.Y-e.Y;return t*t+i*i};d.Clipper.DistanceFromLineSqrd=function(r,e,t){var i=e.Y-t.Y,n=t.X-e.X,o=i*e.X+n*e.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};d.Clipper.SlopesNearCollinear=function(r,e,t,i){return d.Clipper.DistanceFromLineSqrd(e,r,t)<i};d.Clipper.PointsAreClose=function(r,e,t){var i=r.X-e.X,n=r.Y-e.Y;return i*i+n*n<=t};d.Clipper.ExcludeOp=function(r){var e=r.Prev;return e.Next=r.Next,r.Next.Prev=e,e.Idx=0,e};d.Clipper.CleanPolygon=function(r,e){typeof e>"u"&&(e=1.415);var t=r.length;if(t==0)return new Array;for(var i=new Array(t),n=0;n<t;++n)i[n]=new d.OutPt;for(var n=0;n<t;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%t],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=e*e,a=i[0];a.Idx==0&&a.Next!=a.Prev;)d.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=d.Clipper.ExcludeOp(a),t--):d.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(d.Clipper.ExcludeOp(a.Next),a=d.Clipper.ExcludeOp(a),t-=2):d.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=d.Clipper.ExcludeOp(a),t--):(a.Idx=1,a=a.Next);t<3&&(t=0);for(var c=new Array(t),n=0;n<t;++n)c[n]=new d.IntPoint(a.Pt),a=a.Next;return i=null,c};d.Clipper.CleanPolygons=function(r,e){for(var t=new Array(r.length),i=0,n=r.length;i<n;i++)t[i]=d.Clipper.CleanPolygon(r[i],e);return t};d.Clipper.Minkowski=function(r,e,t,i){var n=i?1:0,o=r.length,a=e.length,c=new Array;if(t)for(var l=0;l<a;l++){for(var p=new Array(o),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])p[f]=new d.IntPoint(e[l].X+g.X,e[l].Y+g.Y);c.push(p)}else for(var l=0;l<a;l++){for(var p=new Array(o),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])p[f]=new d.IntPoint(e[l].X-g.X,e[l].Y-g.Y);c.push(p)}for(var C=new Array,l=0;l<a-1+n;l++)for(var f=0;f<o;f++){var S=new Array;S.push(c[l%a][f%o]),S.push(c[(l+1)%a][f%o]),S.push(c[(l+1)%a][(f+1)%o]),S.push(c[l%a][(f+1)%o]),d.Clipper.Orientation(S)||S.reverse(),C.push(S)}var M=new d.Clipper(0);return M.AddPaths(C,d.PolyType.ptSubject,!0),M.Execute(d.ClipType.ctUnion,c,d.PolyFillType.pftNonZero,d.PolyFillType.pftNonZero),c};d.Clipper.MinkowskiSum=function(){var r=arguments,e=r.length;if(e==3){var t=r[0],i=r[1],n=r[2];return d.Clipper.Minkowski(t,i,!0,n)}else if(e==4){for(var t=r[0],o=r[1],a=r[2],n=r[3],c=new d.Clipper,l,p=0,f=o.length;p<f;++p){var l=d.Clipper.Minkowski(t,o[p],!0,n);c.AddPaths(l,d.PolyType.ptSubject,!0)}n&&c.AddPaths(o,d.PolyType.ptClip,!0);var y=new d.Paths;return c.Execute(d.ClipType.ctUnion,y,a,a),y}};d.Clipper.MinkowskiDiff=function(r,e,t){return d.Clipper.Minkowski(r,e,!1,t)};d.Clipper.PolyTreeToPaths=function(r){var e=new Array;return d.Clipper.AddPolyNodeToPaths(r,d.Clipper.NodeType.ntAny,e),e};d.Clipper.AddPolyNodeToPaths=function(r,e,t){var i=!0;switch(e){case d.Clipper.NodeType.ntOpen:return;case d.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&t.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,c=o[n];n<a;n++,c=o[n])d.Clipper.AddPolyNodeToPaths(c,e,t)};d.Clipper.OpenPathsFromPolyTree=function(r){for(var e=new d.Paths,t=0,i=r.ChildCount();t<i;t++)r.Childs()[t].IsOpen&&e.push(r.Childs()[t].m_polygon);return e};d.Clipper.ClosedPathsFromPolyTree=function(r){var e=new d.Paths;return d.Clipper.AddPolyNodeToPaths(r,d.Clipper.NodeType.ntClosed,e),e};ju(d.Clipper,d.ClipperBase);d.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};d.ClipperOffset=function(r,e){typeof r>"u"&&(r=2),typeof e>"u"&&(e=d.ClipperOffset.def_arc_tolerance),this.m_destPolys=new d.Paths,this.m_srcPoly=new d.Path,this.m_destPoly=new d.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new d.IntPoint,this.m_polyNodes=new d.PolyNode,this.MiterLimit=r,this.ArcTolerance=e,this.m_lowest.X=-1};d.ClipperOffset.two_pi=6.28318530717959;d.ClipperOffset.def_arc_tolerance=.25;d.ClipperOffset.prototype.Clear=function(){d.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};d.ClipperOffset.Round=d.Clipper.Round;d.ClipperOffset.prototype.AddPath=function(r,e,t){var i=r.length-1;if(!(i<0)){var n=new d.PolyNode;if(n.m_jointype=e,n.m_endtype=t,t==d.EndType.etClosedLine||t==d.EndType.etClosedPolygon)for(;i>0&&d.IntPoint.op_Equality(r[0],r[i]);)i--;n.m_polygon.push(r[0]);for(var o=0,a=0,c=1;c<=i;c++)d.IntPoint.op_Inequality(n.m_polygon[o],r[c])&&(o++,n.m_polygon.push(r[c]),(r[c].Y>n.m_polygon[a].Y||r[c].Y==n.m_polygon[a].Y&&r[c].X<n.m_polygon[a].X)&&(a=o));if(!(t==d.EndType.etClosedPolygon&&o<2||t!=d.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),t==d.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new d.IntPoint(0,a);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>l.Y||n.m_polygon[a].Y==l.Y&&n.m_polygon[a].X<l.X)&&(this.m_lowest=new d.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};d.ClipperOffset.prototype.AddPaths=function(r,e,t){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],e,t)};d.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!d.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var e=this.m_polyNodes.Childs()[r];(e.m_endtype==d.EndType.etClosedPolygon||e.m_endtype==d.EndType.etClosedLine&&d.Clipper.Orientation(e.m_polygon))&&e.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var e=this.m_polyNodes.Childs()[r];e.m_endtype==d.EndType.etClosedLine&&!d.Clipper.Orientation(e.m_polygon)&&e.m_polygon.reverse()}};d.ClipperOffset.GetUnitNormal=function(r,e){var t=e.X-r.X,i=e.Y-r.Y;if(t==0&&i==0)return new d.DoublePoint(0,0);var n=1/Math.sqrt(t*t+i*i);return t*=n,i*=n,new d.DoublePoint(i,-t)};d.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,d.ClipperBase.near_zero(r)){for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==d.EndType.etClosedPolygon&&this.m_destPolys.push(t.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=d.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*d.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*d.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(d.ClipperOffset.two_pi/n),this.m_cos=Math.cos(d.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/d.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];this.m_srcPoly=t.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||t.m_endtype!=d.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(t.m_jointype==d.JoinType.jtRound)for(var a=1,c=0,l=1;l<=n;l++){this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r)));var p=a;a=a*this.m_cos-this.m_sin*c,c=p*this.m_sin+c*this.m_cos}else for(var a=-1,c=-1,l=0;l<4;++l)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r))),a<0?a=1:c<0?c=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<o-1;l++)this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(t.m_endtype==d.EndType.etClosedLine||t.m_endtype==d.EndType.etClosedPolygon?this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new d.DoublePoint(this.m_normals[o-2])),t.m_endtype==d.EndType.etClosedPolygon){for(var f=o-1,l=0;l<o;l++)f=this.OffsetPoint(l,f,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(t.m_endtype==d.EndType.etClosedLine){for(var f=o-1,l=0;l<o;l++)f=this.OffsetPoint(l,f,t.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var y=this.m_normals[o-1],l=o-1;l>0;l--)this.m_normals[l]=new d.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new d.DoublePoint(-y.X,-y.Y),f=0;for(var l=o-1;l>=0;l--)f=this.OffsetPoint(l,f,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var f=0,l=1;l<o-1;++l)f=this.OffsetPoint(l,f,t.m_jointype);var g;if(t.m_endtype==d.EndType.etOpenButt){var l=o-1;g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*r),d.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*r)),this.m_destPoly.push(g),g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*r),d.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*r)),this.m_destPoly.push(g)}else{var l=o-1;f=o-2,this.m_sinA=0,this.m_normals[l]=new d.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),t.m_endtype==d.EndType.etOpenSquare?this.DoSquare(l,f):this.DoRound(l,f)}for(var l=o-1;l>0;l--)this.m_normals[l]=new d.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new d.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),f=o-1;for(var l=f-1;l>0;--l)f=this.OffsetPoint(l,f,t.m_jointype);t.m_endtype==d.EndType.etOpenButt?(g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(f=1,this.m_sinA=0,t.m_endtype==d.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};d.ClipperOffset.prototype.Execute=function(){var r=arguments,e=r[0]instanceof d.PolyTree;if(e){var t=r[0],i=r[1];t.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new d.Clipper(0);if(n.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)n.Execute(d.ClipType.ctUnion,t,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var o=d.Clipper.GetBounds(this.m_destPolys),a=new d.Path;if(a.push(new d.IntPoint(o.left-10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.top-10)),a.push(new d.IntPoint(o.left-10,o.top-10)),n.AddPath(a,d.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(d.ClipType.ctUnion,t,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),t.ChildCount()==1&&t.Childs()[0].ChildCount()>0){var c=t.Childs()[0];t.Childs()[0]=c.Childs()[0];for(var l=1;l<c.ChildCount();l++)t.AddChild(c.Childs()[l])}else t.Clear()}}else{var t=r[0],i=r[1];d.Clear(t),this.FixOrientations(),this.DoOffset(i);var n=new d.Clipper(0);if(n.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)n.Execute(d.ClipType.ctUnion,t,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var o=d.Clipper.GetBounds(this.m_destPolys),a=new d.Path;a.push(new d.IntPoint(o.left-10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.top-10)),a.push(new d.IntPoint(o.left-10,o.top-10)),n.AddPath(a,d.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(d.ClipType.ctUnion,t,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),t.length>0&&t.splice(0,1)}}};d.ClipperOffset.prototype.OffsetPoint=function(r,e,t){if(this.m_sinA=this.m_normals[e].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[e].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return e;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[e].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[e].Y*this.m_delta))),this.m_destPoly.push(new d.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(t){case d.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[e].X+this.m_normals[r].Y*this.m_normals[e].Y);i>=this.m_miterLim?this.DoMiter(r,e,i):this.DoSquare(r,e);break}case d.JoinType.jtSquare:this.DoSquare(r,e);break;case d.JoinType.jtRound:this.DoRound(r,e);break}return e=r,e};d.ClipperOffset.prototype.DoSquare=function(r,e){var t=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[e].X-this.m_normals[e].Y*t)),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*t)))),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*t)),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*t))))};d.ClipperOffset.prototype.DoMiter=function(r,e,t){var i=this.m_delta/t;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[e].X+this.m_normals[r].X)*i),d.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[e].Y+this.m_normals[r].Y)*i)))};d.ClipperOffset.prototype.DoRound=function(r,e){for(var t=Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y),i=d.Cast_Int32(d.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(t))),n=this.m_normals[e].X,o=this.m_normals[e].Y,a,c=0;c<i;++c)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};d.Error=function(r){try{throw new Error(r)}catch(e){alert(e.message)}};d.JS={};d.JS.AreaOfPolygon=function(r,e){return e||(e=1),d.Clipper.Area(r)/(e*e)};d.JS.AreaOfPolygons=function(r,e){e||(e=1);for(var t=0,i=0;i<r.length;i++)t+=d.Clipper.Area(r[i]);return t/(e*e)};d.JS.BoundsOfPath=function(r,e){return d.JS.BoundsOfPaths([r],e)};d.JS.BoundsOfPaths=function(r,e){e||(e=1);var t=d.Clipper.GetBounds(r);return t.left/=e,t.bottom/=e,t.right/=e,t.top/=e,t};d.JS.Clean=function(i,e){if(!(i instanceof Array))return[];var t=i[0]instanceof Array,i=d.JS.Clone(i);if(typeof e!="number"||e===null)return d.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||e<0)return i;t||(i=[i]);for(var n=i.length,o,a,c,l,p,f,y,g=[],C=0;C<n;C++)if(a=i[C],o=a.length,o!==0){if(o<3){c=a,g.push(c);continue}for(c=a,l=e*e,p=a[0],f=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)<=l||(c[f]=a[y],p=a[y],f++);p=a[f-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=l&&f--,f<o&&c.splice(f,o-f),c.length&&g.push(c)}return!t&&g.length?g=g[0]:!t&&g.length===0?g=[]:t&&g.length===0&&(g=[[]]),g};d.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var e=r[0]instanceof Array;e||(r=[r]);var t=r.length,i,n,o,a,c=new Array(t);for(n=0;n<t;n++){for(i=r[n].length,a=new Array(i),o=0;o<i;o++)a[o]={X:r[n][o].X,Y:r[n][o].Y};c[n]=a}return e||(c=c[0]),c};d.JS.Lighten=function(r,e){if(!(r instanceof Array))return[];if(typeof e!="number"||e===null)return d.Error("Tolerance is not a number in Lighten()."),d.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||e<0)return d.JS.Clone(r);r[0]instanceof Array||(r=[r]);var t,i,n,o,a,c,l,p,f,y,g,C,S,M,v,x,E,T=r.length,w=e*e,D=[];for(t=0;t<T;t++)if(n=r[t],c=n.length,c!=0){for(o=0;o<1e6;o++){for(a=[],c=n.length,n[c-1].X!=n[0].X||n[c-1].Y!=n[0].Y?(C=1,n.push({X:n[0].X,Y:n[0].Y}),c=n.length):C=0,g=[],i=0;i<c-2;i++)l=n[i],f=n[i+1],p=n[i+2],x=l.X,E=l.Y,S=p.X-x,M=p.Y-E,(S!==0||M!==0)&&(v=((f.X-x)*S+(f.Y-E)*M)/(S*S+M*M),v>1?(x=p.X,E=p.Y):v>0&&(x+=S*v,E+=M*v)),S=f.X-x,M=f.Y-E,y=S*S+M*M,y<=w&&(g[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<c-1;i++)g[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[c-1].X,Y:n[c-1].Y}),C&&n.pop(),g.length)n=a;else break}c=a.length,a[c-1].X==a[0].X&&a[c-1].Y==a[0].Y&&a.pop(),a.length>2&&D.push(a)}return!r[0]instanceof Array&&(D=D[0]),typeof D>"u"&&(D=[[]]),D};d.JS.PerimeterOfPath=function(r,e,t){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,c=0,l=0,p=0,f=0,y=r.length;if(y<2)return 0;for(e&&(r[y]=r[0],y++);--y;)o=r[y],c=o.X,l=o.Y,a=r[y-1],p=a.X,f=a.Y,n+=i((c-p)*(c-p)+(l-f)*(l-f));return e&&r.pop(),n/t};d.JS.PerimeterOfPaths=function(r,e,t){t||(t=1);for(var i=0,n=0;n<r.length;n++)i+=d.JS.PerimeterOfPath(r[n],e,t);return i};d.JS.ScaleDownPath=function(r,e){var t,i;for(e||(e=1),t=r.length;t--;)i=r[t],i.X=i.X/e,i.Y=i.Y/e};d.JS.ScaleDownPaths=function(r,e){var t,i,n,o=Math.round;for(e||(e=1),t=r.length;t--;)for(i=r[t].length;i--;)n=r[t][i],n.X=n.X/e,n.Y=n.Y/e};d.JS.ScaleUpPath=function(r,e){var t,i,n=Math.round;for(e||(e=1),t=r.length;t--;)i=r[t],i.X=n(i.X*e),i.Y=n(i.Y*e)};d.JS.ScaleUpPaths=function(r,e){var t,i,n,o=Math.round;for(e||(e=1),t=r.length;t--;)for(i=r[t].length;i--;)n=r[t][i],n.X=o(n.X*e),n.Y=o(n.Y*e)};d.ExPolygons=function(){return[]};d.ExPolygon=function(){this.outer=null,this.holes=null};d.JS.AddOuterPolyNodeToExPolygons=function(r,e){var t=new d.ExPolygon;t.outer=r.Contour();var i=r.Childs(),n=i.length;t.holes=new Array(n);var o,a,c,l,p,f;for(c=0;c<n;c++)for(o=i[c],t.holes[c]=o.Contour(),l=0,p=o.Childs(),f=p.length;l<f;l++)a=p[l],d.JS.AddOuterPolyNodeToExPolygons(a,e);e.push(t)};d.JS.ExPolygonsToPaths=function(r){var e,t,i,n,o=new d.Paths;for(e=0,i=r.length;e<i;e++)for(o.push(r[e].outer),t=0,n=r[e].holes.length;t<n;t++)o.push(r[e].holes[t]);return o};d.JS.PolyTreeToExPolygons=function(r){var e=new d.ExPolygons,t,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)t=n[i],d.JS.AddOuterPolyNodeToExPolygons(t,e);return e};ks.exports=d});var DI={};ny(DI,{Annotation:()=>zi,Connection:()=>Vr,Coordinate:()=>ee,Door:()=>Rr,E_SDK_LOG_LEVEL:()=>Op,Floor:()=>Nr,Hyperlink:()=>Aa,Image:()=>Va,MapObject:()=>lt,PointOfInterest:()=>Br,Space:()=>st,analytics:()=>j1,createMapLibreOverlay:()=>II,enableTestMode:()=>dm,getMapData:()=>TI,getMapDataEnterprise:()=>m7,hydrateMapDataFromMVF:()=>MI,parseMVF:()=>la,setLoggerLevel:()=>Ty,setUseEnterpriseAPI:()=>wI,show3dMap:()=>EI,show3dMapGeojson:()=>g7,unzipMVF:()=>ca});m();m();var kl=new WeakMap,je,_p=class _p{constructor(e){P(this,je,void 0);I(this,je,e),kl.set(this,e)}get mapName(){return u(this,je).mapName}get mapCenter(){return u(this,je).mapCenter}get organizationId(){return u(this,je).organizationId}get outdoorViewToken(){return u(this,je).outdoorViewToken}getByType(e){switch(e){case"space":return u(this,je).spaces;case"door":return u(this,je).doors;case"floor":return u(this,je).floors;case"connection":return u(this,je).connections;case"object":return u(this,je).objects;case"point-of-interest":return u(this,je).pointsOfInterest;case"annotation":return u(this,je).annotations;default:return[]}}getById(e,t){return u(this,je).getById(e,t)}};je=new WeakMap,s(_p,"MapData");var Lp=_p,Rl=Lp;m();m();m();m();var Op=(n=>(n[n.LOG=0]="LOG",n[n.WARN=1]="WARN",n[n.ERROR=2]="ERROR",n[n.SILENT=3]="SILENT",n))(Op||{});function Ty(r){0<=r&&r<=3&&(Iy.logState=r)}s(Ty,"setLoggerLevel");var Iy={logState:b.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log("[MappedinJS]",...r)},warn(...r){this.logState<=1&&console.warn("[MappedinJS]",...r)},error(...r){this.logState<=2&&console.error("[MappedinJS]",...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)}},N=Iy;m();m();var Ap=class Ap{constructor(){h(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(i){typeof i=="function"&&i(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let i=this._subscribers[e].indexOf(t);i!==-1&&this._subscribers[e].splice(i,1)}destroy(){this._subscribers={}}};s(Ap,"PubSub");var z=Ap;m();m();var kp=[0,4,6,8,10],q=s(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let i=0;i<r.length;i++)i>0&&!(i&3)&&(e=Math.random()*4294967296),r[i]=e>>>((i&3)<<3)&255;let t=r.map(i=>i.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],kp.map((i,n)=>t.slice(i,n===kp.length-1?void 0:kp[n+1]).join("")).join("-")},"randomId");var Ey="mi-session-data",Dy="mi-local-data",Fi,Nt,Bt,aa=class aa{constructor(){P(this,Nt,void 0);P(this,Bt,void 0);try{let e=sessionStorage.getItem(Ey);e?I(this,Nt,JSON.parse(e)):I(this,Nt,{id:q()})}catch{I(this,Nt,{id:q()})}try{let e=localStorage.getItem(Dy);e?I(this,Bt,JSON.parse(e)):I(this,Bt,{deviceId:q()})}catch{I(this,Bt,{deviceId:q()})}u(this,Nt).id||(u(this,Nt).id=q()),u(this,Bt).deviceId||(u(this,Bt).deviceId=q())}static getInstance(){return u(this,Fi)||I(this,Fi,new aa),u(this,Fi)}static ___clearInstance(){I(this,Fi,void 0)}saveSessionData(e,t){u(this,Nt)[e]=t;try{return sessionStorage.setItem(Ey,JSON.stringify(u(this,Nt))),!0}catch{return!1}}loadSessionData(e){let t=u(this,Nt)[e];if(t!=null)return t}saveLocalData(e,t){u(this,Bt)[e]=t;try{return localStorage.setItem(Dy,JSON.stringify(u(this,Bt))),!0}catch{return!1}}loadLocalData(e){let t=u(this,Bt)[e];if(t!=null)return t}};Fi=new WeakMap,Nt=new WeakMap,Bt=new WeakMap,s(aa,"SafeStorage"),P(aa,Fi,void 0);var ii=aa;var Ly=globalThis.fetch,Oy,T7=(Oy=b==null?void 0:b.env)==null?void 0:Oy.npm_package_version,Ay="https://app.mappedin.com/",_y="accessTokens";function sa(){if(Ly==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Ly}s(sa,"isomorphicFetch");var ky={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Ry(r){var t;let e={...ky,...r};return e.headers={...e.headers,"mappedin-sdk-version":T7},e.things=[],"platformString"in r&&(e.headers={...e.headers,"mappedin-platform-version":r.platformString}),e.noAuth||(e.accessToken?e.authorization="Bearer ".concat(e.accessToken):e.clientId&&e.clientSecret&&(e.authorization="Basic ".concat(globalThis.btoa("".concat(e.clientId,":").concat(e.clientSecret))))),e.language=(t=e.language)==null?void 0:t.toLowerCase(),e}s(Ry,"parseOptions");function I7(r,e,t=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};t&&delete i.language,i.language&&(e+="&lang=".concat(encodeURIComponent(i.language)));let{headers:n}=r;n["Content-Type"]=n["Content-Type"]||"text/json",r.accessToken?n.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(n["x-mappedin-key"]=btoa(r.clientId),n["x-mappedin-secret"]=btoa(r.clientSecret)),i.language&&(n["Accept-Language"]=i.language);let o={method:"GET",headers:n};return r.secure&&(e+="&withcdntoken"),{req:o,url:e}}s(I7,"constructParamsForRequest");async function E7(r,e,t=!1){let i=I7(r,e,t),n=await sa()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}s(E7,"generateAPIRequest");async function D7(r,e="exports/mvf/1/bundle"){var o;let t=Ry({baseUri:"https://api-gateway.mappedin.com/",...ky,...r}),i="".concat(t.baseUri+e,"?venue=").concat(t.venue,"&version=").concat((o=t.version)!=null?o:"2.0.0");return t.headers["Content-Type"]="application/zip",await E7(t,i)}s(D7,"getVenueMVFURL");async function Ny(r){return new Promise(async(e,t)=>{try{let{url:i}=await D7(r,"exports/mvf2/1/bundle"),n=await sa()(i).then(a=>a.arrayBuffer()),o=new Uint8Array(n);e(o)}catch(i){t(i)}})}s(Ny,"downloadVenueBundleMVFAPIGateway");async function Rp(r,e){return new Promise(async(t,i)=>{try{let{url:n}=await L7(r,e),o=await sa()(n).then(c=>c.arrayBuffer()),a=new Uint8Array(o);t(a)}catch(n){i(n)}})}s(Rp,"downloadMVF");function By(r){return r.endsWith("/")?r:"".concat(r,"/")}s(By,"normalizeUrl");async function L7(r,e){let t="".concat(r.baseUri?By(r.baseUri):Ay,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await sa()(t,{headers:{Authorization:"Bearer ".concat(e)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}s(L7,"getMakerBundleURL");async function Nl(r){let e=r.key,t=ii.getInstance(),i=(t==null?void 0:t.loadSessionData(_y))||{},n=Math.floor(Date.now()/1e3);if(i[e]&&n<i[e].expiresTimestamp)return i[e];let o=await _7(r,n),a={...i,[e]:o};return t==null||t.saveSessionData(_y,a),o}s(Nl,"getAccessToken");async function _7(r,e){let t="".concat(r.baseUri?By(r.baseUri):Ay,"api/api-key/token"),i=await sa()(t,{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:e+n.expires_in}}s(_7,"fetchAccessToken");function la(r){let e=new TextDecoder,t=e.decode.bind(e);try{let i={"connection.json":JSON.parse(t(r["connection.json"])),"manifest.geojson":JSON.parse(t(r["manifest.geojson"])),"map.geojson":JSON.parse(t(r["map.geojson"])),"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(t(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(t(r["node.geojson"])),obstruction:{},space:{},entrance:{}};if((i["mapstack.geojson"]==null||"mapstack.json"in r)&&(i["mapstack.json"]=JSON.parse(t(r["mapstack.json"]))),"styles.json"in r&&(i["styles.json"]=JSON.parse(t(r["styles.json"]))),"shapes.json"in r&&(i["shapes.json"]=JSON.parse(t(r["shapes.json"]))),r.annotation!=null){i.annotation={};let o=Object.keys(r.annotation);for(let a of o){let c=a.replace(/\.json|\.geojson/g,"");i.annotation[c]=JSON.parse(t(r.annotation[a]))}}let n=Object.keys(r.space);for(let o of n){let a=o.replace(/\.json|\.geojson/g,"");i.space[a]=JSON.parse(t(r.space[o]))}if(r.obstruction!=null){let o=Object.keys(r.obstruction);for(let a of o){let c=a.replace(/\.json|\.geojson/g,"");i.obstruction[c]=JSON.parse(t(r.obstruction[a]))}}else i.obstruction={};if(r.entrance!=null){let o=Object.keys(r.entrance);for(let a of o){let c=a.replace(/\.json|\.geojson/g,"");i.entrance[c]=JSON.parse(t(r.entrance[a]))}}else i.entrance={};if("mapImages"in r&&r.mapImages!=null){i.mapImages={};for(let o of Object.keys(r.mapImages)){let a=o.replace(/\.json|\.geojson/g,"");i.mapImages[a]=JSON.parse(t(r.mapImages[o]))}}return i}catch(i){throw N.error(i),new Error("MVF parsing failed! Probably encountered a bad file.")}}s(la,"parseMVF");function O7(r){if(r==null||typeof r!="object")return!1;let e=["connection.json","manifest.geojson","map.geojson","node.geojson","mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&e.push("styles.json"),"shapes.json"in r&&e.push("shapes.json");for(let t of e)if(r[t]==null||r[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}s(O7,"validateStaticMVFFiles");async function ca(r){return new Promise(async(e,t)=>{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-KZQSYQMW.js")).unzipSync(r);if(!O7(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let c of a){if(n[c].length===0)continue;let l=c.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){o[l[0]]=n[c];continue}if(l[0]==="image"){N.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[l[0]]==null&&(o[l[0]]={}),o[l[0]][l[1]]=n[c]}e(o)}catch(i){t(i)}})}s(ca,"unzipMVF");m();m();m();m();var Je=63710088e-1,Fy={centimeters:Je*100,centimetres:Je*100,degrees:Je/111325,feet:Je*3.28084,inches:Je*39.37,kilometers:Je/1e3,kilometres:Je/1e3,meters:Je,metres:Je,miles:Je/1609.344,millimeters:Je*1e3,millimetres:Je*1e3,nauticalmiles:Je/1852,radians:1,yards:Je*1.0936},aE={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/Je,yards:1.0936133};function ni(r,e,t){t===void 0&&(t={});var i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}s(ni,"feature");function Ft(r,e,t){if(t===void 0&&(t={}),!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(!Np(r[0])||!Np(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return ni(i,e,t)}s(Ft,"point");function Lr(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return ni(i,e,t)}s(Lr,"lineString");function ua(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}s(ua,"featureCollection");function Gy(r,e){e===void 0&&(e="kilometers");var t=Fy[e];if(!t)throw new Error(e+" units is invalid");return r*t}s(Gy,"radiansToLength");function Vy(r,e){e===void 0&&(e="kilometers");var t=Fy[e];if(!t)throw new Error(e+" units is invalid");return r/t}s(Vy,"lengthToRadians");function pa(r){var e=r%(2*Math.PI);return e*180/Math.PI}s(pa,"radiansToDegrees");function ot(r){var e=r%360;return e*Math.PI/180}s(ot,"degreesToRadians");function Np(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}s(Np,"isNumber");function Mt(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}s(Mt,"getCoord");function vt(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}s(vt,"getCoords");function Hy(r){return r.type==="Feature"?r.geometry:r}s(Hy,"getGeom");function Xy(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}s(Xy,"getType");function A7(r,e,t){t===void 0&&(t={});for(var i=Mt(r),n=vt(e),o=0;o<n.length-1;o++){var a=!1;if(t.ignoreEndVertices&&(o===0&&(a="start"),o===n.length-2&&(a="end"),o===0&&o+1===n.length-1&&(a="both")),k7(n[o],n[o+1],i,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}s(A7,"booleanPointOnLine");function k7(r,e,t,i,n){var o=t[0],a=t[1],c=r[0],l=r[1],p=e[0],f=e[1],y=t[0]-c,g=t[1]-l,C=p-c,S=f-l,M=y*S-g*C;if(n!==null){if(Math.abs(M)>n)return!1}else if(M!==0)return!1;if(i){if(i==="start")return Math.abs(C)>=Math.abs(S)?C>0?c<o&&o<=p:p<=o&&o<c:S>0?l<a&&a<=f:f<=a&&a<l;if(i==="end")return Math.abs(C)>=Math.abs(S)?C>0?c<=o&&o<p:p<o&&o<=c:S>0?l<=a&&a<f:f<a&&a<=l;if(i==="both")return Math.abs(C)>=Math.abs(S)?C>0?c<o&&o<p:p<o&&o<c:S>0?l<a&&a<f:f<a&&a<l}else return Math.abs(C)>=Math.abs(S)?C>0?c<=o&&o<=p:p<=o&&o<=c:S>0?l<=a&&a<=f:f<=a&&a<=l;return!1}s(k7,"isPointOnLineSegment");var jy=A7;m();m();m();function Bl(r,e,t){if(r!==null)for(var i,n,o,a,c,l,p,f=0,y=0,g,C=r.type,S=C==="FeatureCollection",M=C==="Feature",v=S?r.features.length:1,x=0;x<v;x++){p=S?r.features[x].geometry:M?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var E=0;E<c;E++){var T=0,w=0;if(a=g?p.geometries[E]:p,a!==null){l=a.coordinates;var D=a.type;switch(f=t&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(e(l,y,x,T,w)===!1)return!1;y++,T++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(e(l[i],y,x,T,w)===!1)return!1;y++,D==="MultiPoint"&&T++}D==="LineString"&&T++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-f;n++){if(e(l[i][n],y,x,T,w)===!1)return!1;y++}D==="MultiLineString"&&T++,D==="Polygon"&&w++}D==="Polygon"&&T++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-f;o++){if(e(l[i][n][o],y,x,T,w)===!1)return!1;y++}w++}T++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Bl(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(Bl,"coordEach");function Bp(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}s(Bp,"featureEach");function R7(r,e){var t,i,n,o,a,c,l,p,f,y,g=0,C=r.type==="FeatureCollection",S=r.type==="Feature",M=C?r.features.length:1;for(t=0;t<M;t++){for(c=C?r.features[t].geometry:S?r.geometry:r,p=C?r.features[t].properties:S?r.properties:{},f=C?r.features[t].bbox:S?r.bbox:void 0,y=C?r.features[t].id:S?r.id:void 0,l=c?c.type==="GeometryCollection":!1,a=l?c.geometries.length:1,n=0;n<a;n++){if(o=l?c.geometries[n]:c,o===null){if(e(null,g,p,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}s(R7,"geomEach");function ha(r,e){R7(r,function(t,i,n,o,a){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(ni(t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var f=t.coordinates[p],y={type:l,coordinates:f};if(e(ni(y,n),i,p)===!1)return!1}})}s(ha,"flattenEach");function N7(r,e){ha(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var c,l=0,p=0,f=0;if(Bl(t,function(y,g,C,S,M){if(c===void 0||i>l||S>p||M>f){c=y,l=i,p=S,f=M,o=0;return}var v=Lr([c,y],t.properties);if(e(v,i,n,M,o)===!1)return!1;o++,c=y})===!1)return!1}}})}s(N7,"segmentEach");function Wy(r,e,t){var i=t,n=!1;return N7(r,function(o,a,c,l,p){n===!1&&t===void 0?i=o:i=e(i,o,a,c,l,p),n=!0}),i}s(Wy,"segmentReduce");function Fp(r){var e=[1/0,1/0,-1/0,-1/0];return Bl(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}s(Fp,"bbox");Fp.default=Fp;var Fl=Fp;function B7(r,e){e===void 0&&(e={});var t=Fl(r),i=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return Ft([i,n],e.properties,e)}s(B7,"center");var Yy=B7;m();m();function F7(r,e,t){t===void 0&&(t={});var i=Mt(r),n=Mt(e),o=ot(n[1]-i[1]),a=ot(n[0]-i[0]),c=ot(i[1]),l=ot(n[1]),p=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(c)*Math.cos(l);return Gy(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),t.units)}s(F7,"distance");var oi=F7;function Gl(r,e){return e===void 0&&(e={}),Wy(r,function(t,i){var n=i.geometry.coordinates;return t+oi(n[0],n[1],e)},0)}s(Gl,"length");m();m();m();function Vl(r,e,t){if(t===void 0&&(t={}),t.final===!0)return G7(r,e);var i=Mt(r),n=Mt(e),o=ot(i[0]),a=ot(n[0]),c=ot(i[1]),l=ot(n[1]),p=Math.sin(a-o)*Math.cos(l),f=Math.cos(c)*Math.sin(l)-Math.sin(c)*Math.cos(l)*Math.cos(a-o);return pa(Math.atan2(p,f))}s(Vl,"bearing");function G7(r,e){var t=Vl(e,r);return t=(t+180)%360,t}s(G7,"calculateFinalBearing");m();function Gi(r,e,t,i){i===void 0&&(i={});var n=Mt(r),o=ot(n[0]),a=ot(n[1]),c=ot(t),l=Vy(e,i.units),p=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(c)),f=o+Math.atan2(Math.sin(c)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(p)),y=pa(f),g=pa(p);return Ft([y,g],i.properties)}s(Gi,"destination");m();m();function V7(r){if(!r)throw new Error("geojson is required");var e=[];return ha(r,function(t){H7(t,e)}),ua(e)}s(V7,"lineSegment");function H7(r,e){var t=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":t=vt(i);break;case"LineString":t=[vt(i)]}t.forEach(function(n){var o=X7(n,r.properties);o.forEach(function(a){a.id=e.length,e.push(a)})})}}s(H7,"lineSegmentFeature");function X7(r,e){var t=[];return r.reduce(function(i,n){var o=Lr([i,n],e);return o.bbox=j7(i,n),t.push(o),n}),t}s(X7,"createSegments");function j7(r,e){var t=r[0],i=r[1],n=e[0],o=e[1],a=t<n?t:n,c=i<o?i:o,l=t>n?t:n,p=i>o?i:o;return[a,c,l,p]}s(j7,"bbox");var Gp=V7;var eb=Qt(K3(),1);function hx(r,e){var t={},i=[];if(r.type==="LineString"&&(r=ni(r)),e.type==="LineString"&&(e=ni(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var n=Q3(r,e);return n&&i.push(n),ua(i)}var o=(0,eb.default)();return o.load(Gp(e)),Bp(Gp(r),function(a){Bp(o.search(a),function(c){var l=Q3(a,c);if(l){var p=vt(l).join(",");t[p]||(t[p]=!0,i.push(l))}})}),ua(i)}s(hx,"lineIntersect");function Q3(r,e){var t=vt(r),i=vt(e);if(t.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=t[0][0],o=t[0][1],a=t[1][0],c=t[1][1],l=i[0][0],p=i[0][1],f=i[1][0],y=i[1][1],g=(y-p)*(a-n)-(f-l)*(c-o),C=(f-l)*(o-p)-(y-p)*(n-l),S=(a-n)*(o-p)-(c-o)*(n-l);if(g===0)return null;var M=C/g,v=S/g;if(M>=0&&M<=1&&v>=0&&v<=1){var x=n+M*(a-n),E=o+M*(c-o);return Ft([x,E])}return null}s(Q3,"intersects");var tb=hx;function dx(r,e,t){t===void 0&&(t={});var i=Ft([1/0,1/0],{dist:1/0}),n=0;return ha(r,function(o){for(var a=vt(o),c=0;c<a.length-1;c++){var l=Ft(a[c]);l.properties.dist=oi(e,l,t);var p=Ft(a[c+1]);p.properties.dist=oi(e,p,t);var f=oi(l,p,t),y=Math.max(l.properties.dist,p.properties.dist),g=Vl(l,p),C=Gi(e,y,g+90,t),S=Gi(e,y,g-90,t),M=tb(Lr([C.geometry.coordinates,S.geometry.coordinates]),Lr([l.geometry.coordinates,p.geometry.coordinates])),v=null;M.features.length>0&&(v=M.features[0],v.properties.dist=oi(e,v,t),v.properties.location=n+oi(l,v,t)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=c,i.properties.location=n),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=c+1,i.properties.location=n+f),v&&v.properties.dist<i.properties.dist&&(i=v,i.properties.index=c),n+=f}}),i}s(dx,"nearestPointOnLine");var La=dx;function fx(r,e,t){var i=vt(t);if(Xy(t)!=="LineString")throw new Error("line must be a LineString");var n=La(t,r),o=La(t,e),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var c=[a[0].geometry.coordinates],l=a[0].properties.index+1;l<a[1].properties.index+1;l++)c.push(i[l]);return c.push(a[1].geometry.coordinates),Lr(c,t.properties)}s(fx,"lineSlice");var Td=fx;var mx=1e-7;function Id(r){return{type:"Point",coordinates:r}}s(Id,"point");function yx(r,e){let{coordinates:t}=e.geometry,{coordinates:i}=r.geometry,n=t.map(o=>La(r,Id(o)));return i.reduce((o,a)=>{let c=Td(Id(a),n[0],r),l=Td(Id(a),n[1],r),p=Gl(c)<Gl(l)?c:l;return p.properties={...r.properties,entrances:[]},o.concat([p])},[])}s(yx,"splitObstructionByEntrance");function Ed(r,e){return e.reduce((t,i)=>{let n={epsilon:mx},o=t.findIndex(c=>jy(Yy(i),c,n)),a=t[o];if(a){let[c,l]=yx(a,i);t.splice(o,1,c,l)}return t},[r])}s(Ed,"splitObstructionByAllEntrances");m();m();m();var eo=class eo{constructor(e,t,i){h(this,"__type",eo.__type);h(this,"id",q());h(this,"latitude");h(this,"longitude");h(this,"floorId");this.latitude=e,this.longitude=t,this.floorId=i}static is(e){return e.__type===eo.__type}isEqual(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.floorId===e.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId}}destroy(){}};s(eo,"Coordinate"),h(eo,"__type","coordinate");var Dd=eo,ee=Dd;m();m();m();m();var Ld=class Ld{constructor(e){h(this,"id");this.id=e}};s(Ld,"BaseMetaData");var ji=Ld;var Oa,to,_a=class _a extends ji{constructor(t){super(String(q()));P(this,Oa,{});P(this,to,void 0);I(this,to,t.mvfData)}static is(t){return t.__type===_a.__type}get url(){return u(this,to).url}get name(){return u(this,to).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(u(this,Oa)))delete u(this,Oa)[t]}};Oa=new WeakMap,to=new WeakMap,s(_a,"Hyperlink"),h(_a,"__type","hyperlink");var _d=_a,Aa=_d;var Od=class Od{constructor(e,t){h(this,"id");h(this,"links",[]);var n;this.id=e;let i=(n=t==null?void 0:t.links)!=null?n:[];i.length>0&&(this.links=i.map(o=>new Aa({mvfData:o})))}};s(Od,"BaseMapData");var Oe=Od;var Wi,kr,Yi,hi,ro=class ro extends Oe{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",ro.__type);P(this,Wi,void 0);P(this,kr,void 0);P(this,Yi,void 0);P(this,hi,void 0);I(this,kr,{}),I(this,hi,i.mvfData),I(this,Wi,t),I(this,Yi,i.floorId)}static is(t){return t.__type===ro.__type}get name(){var t,i;return(i=(t=u(this,hi).properties.details)==null?void 0:t.name)!=null?i:""}get description(){var t,i;return(i=(t=u(this,hi).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=u(this,hi).properties.details)==null?void 0:t.images)!=null?i:[]}get floor(){let t=u(this,Wi).getById("floor",u(this,Yi));if(t==null)throw new Error("Floor ".concat(u(this,Yi)," not found!"));return t}get center(){if(u(this,kr).center==null){let[[t,i],[n,o]]=u(this,hi).geometry.coordinates,a=(t+n)/2,c=(i+o)/2;u(this,kr).center=new ee(c,a,u(this,Yi))}return u(this,kr).center}get isExterior(){var n;let t=u(this,Wi).obstructionIdByEntranceId[this.id],i=u(this,Wi).getMVFFeatureById("obstruction",t);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 t of Object.keys(u(this,kr)))delete u(this,kr)[t]}};Wi=new WeakMap,kr=new WeakMap,Yi=new WeakMap,hi=new WeakMap,s(ro,"Door"),h(ro,"__type","door");var Ad=ro,Rr=Ad;m();var no,Ui,di,ur,io=class io extends Oe{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",io.__type);P(this,no,void 0);P(this,Ui,void 0);P(this,di,{});P(this,ur,void 0);I(this,no,t),I(this,Ui,i.floorId),I(this,ur,i.mvfData)}static is(t){return t.__type===io.__type}get name(){var i,n;let{properties:t}=u(this,ur);return(n=(i=t.details)==null?void 0:i.name)!=null?n:t.externalId}get type(){return vx(u(this,ur).properties.kind)}get description(){var t,i;return(i=(t=u(this,ur).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=u(this,ur).properties.details)==null?void 0:t.images)!=null?i:[]}get floor(){let t=u(this,no).getById("floor",u(this,Ui));if(t==null)throw new Error("Floor ".concat(u(this,Ui)," not found!"));return t}get doors(){return u(this,ur).properties.destinationNodes.reduce((t,i)=>{let n=u(this,no).doorsByNodeId[i];return n&&t.push(n),t},[])}get center(){var t;if(u(this,di).center==null){let[i,n]=(t=u(this,ur).properties.center)!=null?t:[0,0];u(this,di).center=new ee(n,i,u(this,Ui))}return u(this,di).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(u(this,di)))delete u(this,di)[t]}};no=new WeakMap,Ui=new WeakMap,di=new WeakMap,ur=new WeakMap,s(io,"Space"),h(io,"__type","space");var kd=io,gx=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function vx(r){if(r==null||r==="default")return"room";let e=r.toLowerCase();return gx.includes(e)?e:"room"}s(vx,"validateSpaceType");var st=kd;m();var pr,be,ao,oo=class oo extends Oe{constructor(t,i){super(i.mvfData.id);h(this,"__type",oo.__type);P(this,pr,void 0);P(this,be,{});P(this,ao,void 0);I(this,pr,t),I(this,ao,i.mvfData)}static is(t){return t.__type===oo.__type}get name(){return u(this,ao).externalId}get elevation(){return u(this,ao).elevation}get spaces(){if(u(this,be).spaces==null){let t=u(this,pr).spaces.filter(i=>i.floor.id===this.id);u(this,be).spaces=t}return u(this,be).spaces}get objects(){if(u(this,be).objects==null){let t=u(this,pr).objects.filter(i=>i.floor.id===this.id);u(this,be).objects=t}return u(this,be).objects}get connections(){if(u(this,be).connections==null){let t=u(this,pr).connections.filter(i=>i.floors.includes(this));u(this,be).connections=t}return u(this,be).connections}get doors(){if(u(this,be).doors==null){let t=u(this,pr).doors.filter(i=>i.floor.id===this.id);u(this,be).doors=t}return u(this,be).doors}get annotations(){if(u(this,be).annotations==null){let t=u(this,pr).annotations.filter(i=>i.floor.id===this.id);u(this,be).annotations=t}return u(this,be).annotations}get pois(){if(u(this,be).pois==null){let t=u(this,pr).pointsOfInterest.filter(i=>i.floor.id===this.id);u(this,be).pois=t}return u(this,be).pois}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(t=>t.id),objects:this.objects.map(t=>t.id),connections:this.connections.map(t=>t.id),doors:this.doors.map(t=>t.id),annotations:this.annotations.map(t=>t.id),pois:this.pois.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(u(this,be)))delete u(this,be)[t]}};pr=new WeakMap,be=new WeakMap,ao=new WeakMap,s(oo,"Floor"),h(oo,"__type","floor");var Rd=oo,Nr=Rd;m();m();m();var ka=s(r=>r!=null,"notNull");m();function rb(r){return typeof r=="string"?r:r.id}s(rb,"getId");m();function hr(r){let e;if(st.is(r)||Rr.is(r)||lt.is(r))e=r.center;else if(Br.is(r)||zi.is(r))e=r.coordinate;else if(ee.is(r))e=r;else return;return e}s(hr,"getCoordinateFromStuffs");m();m();var Ra={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},fi="ExteriorWalls",so="Walls",ib=0;function Nd(r){var e,t;if((e=r.outdoorView)!=null&&e.enabled&&!((t=r.outdoorView)!=null&&t.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}s(Nd,"validateOptions");function Bd(r,e){var n,o,a,c;let t=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||e.outdoorViewToken,i={...Ra,...r!=null?r:{},outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!t:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(c=Ra.outdoorView)==null?void 0:c.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return t&&i.outdoorView&&(i.outdoorView.token=t),i}s(Bd,"handleDefault");var Na,Fr,Gr,lo=class lo extends Oe{constructor(t,i){let n=Object.values(i.mvfDataByFloorId)[0];super(n.properties.id,n.properties.details);h(this,"__type",lo.__type);P(this,Na,void 0);P(this,Fr,void 0);P(this,Gr,void 0);I(this,Fr,{}),I(this,Na,t),I(this,Gr,i.mvfDataByFloorId)}static is(t){return t.__type===lo.__type}get name(){var t,i;return(i=(t=Object.values(u(this,Gr))[0].properties.details)==null?void 0:t.name)!=null?i:""}get description(){var t,i;return(i=(t=Object.values(u(this,Gr))[0].properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=Object.values(u(this,Gr))[0].properties.details)==null?void 0:t.images)!=null?i:[]}get type(){var t,i;return(i=(t=Object.values(u(this,Gr))[0].properties.kind)==null?void 0:t.split(".")[1])!=null?i:"unknown"}get coordinates(){return u(this,Fr).coordinates==null&&(u(this,Fr).coordinates=Object.entries(u(this,Gr)).map(([t,i])=>new ee(i.geometry.coordinates[1],i.geometry.coordinates[0],t))),u(this,Fr).coordinates}get floors(){return this.coordinates.map(t=>t.floorId?u(this,Na).getById("floor",t.floorId):void 0).filter(ka)}toJSON(){return{id:this.id,name:this.name,type:this.type,coordinates:this.coordinates.map(t=>t.toJSON()),floors:this.floors.map(t=>t.id)}}destroy(){for(let t of Object.keys(u(this,Fr)))delete u(this,Fr)[t]}};Na=new WeakMap,Fr=new WeakMap,Gr=new WeakMap,s(lo,"Connection"),h(lo,"__type","connection");var Fd=lo,Vr=Fd;m();var Ba,Zi,mi,Hr,co=class co extends Oe{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",co.__type);P(this,Ba,void 0);P(this,Zi,void 0);P(this,mi,{});P(this,Hr,void 0);I(this,Ba,t),I(this,Zi,i.floorId),I(this,Hr,i.mvfData)}static is(t){return t.__type===co.__type}get name(){var t,i;return(i=(t=u(this,Hr).properties.details)==null?void 0:t.name)!=null?i:""}get description(){var t,i;return(i=(t=u(this,Hr).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=u(this,Hr).properties.details)==null?void 0:t.images)!=null?i:[]}get type(){let t=u(this,Hr).properties.kind;return t==null&&(t="object"),t==="Desks"&&(t="desk"),t.toLowerCase()}get floor(){let t=u(this,Ba).getById("floor",u(this,Zi));if(t==null)throw new Error("Floor ".concat(u(this,Zi)," not found!"));return t}get center(){var t;if(u(this,mi).center==null){let[i,n]=(t=u(this,Hr).properties.center)!=null?t:[0,0];u(this,mi).center=new ee(n,i,u(this,Zi))}return u(this,mi).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of globalThis.Object.keys(u(this,mi)))u(this,mi)[t]=null}};Ba=new WeakMap,Zi=new WeakMap,mi=new WeakMap,Hr=new WeakMap,s(co,"MapObject"),h(co,"__type","object");var Gd=co,lt=Gd;m();m();var Ga,uo,Fa=class Fa extends ji{constructor(t){super(String(q()));P(this,Ga,{});P(this,uo,void 0);I(this,uo,t.mvfData)}static is(t){return t.__type===Fa.__type}get url(){return u(this,uo).url}get name(){return u(this,uo).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(u(this,Ga)))delete u(this,Ga)[t]}};Ga=new WeakMap,uo=new WeakMap,s(Fa,"Image"),h(Fa,"__type","image");var Vd=Fa,Va=Vd;var Ha,qi,Ht,yi,po=class po extends Oe{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",po.__type);P(this,Ha,void 0);P(this,qi,void 0);P(this,Ht,{});P(this,yi,void 0);I(this,Ha,t),I(this,yi,i.mvfData),I(this,qi,i.floorId)}static is(t){return t.__type===po.__type}get name(){var t,i;return(i=(t=u(this,yi).properties.details)==null?void 0:t.name)!=null?i:""}get description(){var t,i;return(i=(t=u(this,yi).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;if(u(this,Ht).images==null){let n=(i=(t=u(this,yi).properties.details)==null?void 0:t.images)!=null?i:[];u(this,Ht).images=n.map(o=>new Va({mvfData:o}))}return u(this,Ht).images}get floor(){let t=u(this,Ha).getById("floor",u(this,qi));if(t==null)throw new Error("Floor ".concat(u(this,qi)," not found!"));return t}get coordinate(){var t;if(u(this,Ht).coordinate==null){let[i,n]=(t=u(this,yi).geometry.coordinates)!=null?t:[0,0];u(this,Ht).coordinate=new ee(n,i,u(this,qi))}return u(this,Ht).coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let t in u(this,Ht))u(this,Ht)[t]=null}};Ha=new WeakMap,qi=new WeakMap,Ht=new WeakMap,yi=new WeakMap,s(po,"PointOfInterest"),h(po,"__type","point-of-interest");var Hd=po,Br=Hd;m();var Xa,$i,gi,fo,ja,jd,ho=class ho extends Oe{constructor(t,i){super(i.mvfData.properties.id);P(this,ja);h(this,"__type",ho.__type);P(this,Xa,void 0);P(this,$i,void 0);P(this,gi,{});P(this,fo,void 0);I(this,Xa,t),I(this,$i,i.floorId),I(this,fo,i.mvfData)}static is(t){return t.__type===ho.__type}get group(){return X(this,ja,jd).call(this).group}get type(){return X(this,ja,jd).call(this).type}get coordinate(){if(u(this,gi).coordinate==null){let[t,i]=u(this,fo).geometry.coordinates;u(this,gi).coordinate=new ee(i,t,u(this,$i))}return u(this,gi).coordinate}get floor(){let t=u(this,Xa).getById("floor",u(this,$i));if(t==null)throw new Error("Floor ".concat(u(this,$i)," not found!"));return t}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let t of Object.keys(u(this,gi)))delete u(this,gi)[t]}};Xa=new WeakMap,$i=new WeakMap,gi=new WeakMap,fo=new WeakMap,ja=new WeakSet,jd=s(function(){let[t,i]=u(this,fo).properties.symbolId.split("--");return{group:t,type:i}},"#getGroupAndTypeFromSymbolId"),s(ho,"Annotation"),h(ho,"__type","annotation");var Xd=ho,zi=Xd;m();m();var yo,Xt,Ji,go,mo=class mo extends Oe{constructor(t,i){super(i.mvfData.properties.id);h(this,"__type",mo.__type);P(this,yo,void 0);P(this,Xt,{});P(this,Ji,void 0);P(this,go,void 0);I(this,yo,t),I(this,Ji,i.floorId),I(this,go,i.mvfData)}static is(t){return t.__type===mo.__type}get floor(){let t=u(this,yo).getById("floor",u(this,Ji));if(t==null)throw new Error("Floor ".concat(u(this,Ji)," not found!"));return t}get coordinate(){if(u(this,Xt).coordinate==null){let[t,i]=u(this,go).geometry.coordinates;u(this,Xt).coordinate=new ee(i,t,u(this,Ji))}return u(this,Xt).coordinate}get neighbors(){if(u(this,Xt).neighbours==null){let t=u(this,go).properties.neighbors.map(i=>{let n=u(this,yo).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});u(this,Xt).neighbours=t}return u(this,Xt).neighbours}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(t=>t.id)}}destroy(){for(let t of Object.keys(u(this,Xt)))delete u(this,Xt)[t]}};yo=new WeakMap,Xt=new WeakMap,Ji=new WeakMap,go=new WeakMap,s(mo,"Node"),h(mo,"__type","node");var Wd=mo,nb=Wd;var bx=s((r,e)=>{var y,g;let t={},i={},n={},o={},a={},c={},l={},p={},f=globalThis.Object.keys(r.space);for(let C of f){let S=r.space[C];if(S!=null)for(let M of S.features){p[M.properties.id]=C,a[M.properties.id]=M;for(let v of M.properties.destinationNodes)n[v]==null&&(n[v]=[]),n[v].push(M.properties.id);if(M.properties.kind==="desk-entrance"&&(o[M.properties.externalId]==null&&(o[M.properties.externalId]=[]),o[M.properties.externalId].push(...M.properties.destinationNodes)),!["void","desk-entrance"].includes((y=M.properties.kind)!=null?y:"")){if((g=M.properties.kind)!=null&&g.includes("connection")){let v="".concat(M.geometry.coordinates[1],"-").concat(M.geometry.coordinates[0]);c[v]==null&&(c[v]=[]),c[v].push(M.properties.id);continue}if(M.properties.kind==="poi"){let v=new Br(e,{floorId:C,mvfData:M});i[M.properties.id]=v}else{let v=new st(e,{floorId:C,mvfData:M});t[M.properties.id]=v}}}}for(let C in c){let S=c[C],M={};for(let x of S){let E=p[x],T=a[x];M[E]=T}let v=new Vr(e,{mvfDataByFloorId:M});l[v.id]=v}return{spacesById:t,poisById:i,connectionsById:l,spaceIdsByDestinationNodeId:n,objectEntranceNodeIdsByObstructionId:o,mvfSpacesById:a,connectionIdsByLatLon:c}},"processMVFSpaces"),Cx=s((r,e)=>{let t={},i={};for(let n of r["node.geojson"].features){i[n.properties.id]=n;let o=new nb(e,{mvfData:n,floorId:n.properties.map});t[n.properties.id]=o}return{nodesById:t,mvfNodesById:i}},"processMVFNodes"),xx=s((r,e)=>{let t={},i={},n={},o=globalThis.Object.keys(r.obstruction);for(let a of o){let c=r.obstruction[a];if(c!=null)for(let l of c.features){i[l.properties.id]=l;for(let f of l.properties.entrances)n[f]=l.properties.id;if(l.properties.kind==="Wall")continue;let p=new lt(e,{floorId:a,mvfData:l});t[l.properties.id]=p}}return{objectsById:t,mvfObstructionById:i,obstructionIdByEntranceId:n}},"processMVFObstructions"),Sx=s((r,e)=>{let t={},i={};for(let n of r["map.geojson"]){i[n.id]=n;let o=new Nr(e,{mvfData:n});t[n.id]=o}return{floorsById:t,mvfMapsById:i}},"processMVFMaps"),Mx=s((r,e)=>{let t={},i=r["connection.json"].reduce((n,o)=>(o.nodes.forEach(a=>n[a]=o),t[o.id]=o,n),{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:i}},"processMVFConnections"),Px=s((r,e)=>{let t={},i={},n={},o=globalThis.Object.keys(r.entrance);for(let a of o){let c=r.entrance[a];if(c!=null)for(let l of c.features){n[l.properties.id]=l;let p=new Rr(e,{floorId:a,mvfData:l});l.properties.node&&(i[l.properties.node]=p),t[l.properties.id]=p}}return{doorsById:t,doorsByNodeId:i,mvfEntrancesById:n}},"processMVFEntrances"),wx=s((r,e,t)=>{var i,n;if(r.mapImages!=null)for(let o in r.mapImages){let a=(n=(i=r.mapImages)==null?void 0:i[o])==null?void 0:n.features;if(a!=null){for(let c of a)if("anchorId"in c.properties){let l=c==null?void 0:c.properties,p=e[l.anchorId]||t[l.anchorId];if(p!=null&&l!=null){let f=p.properties;f.image=l,f.image&&(f.image.position=c.geometry.coordinates)}}}}},"processMVFPolygonImages"),Tx=s((r,e)=>{let t={},i={};if(r.annotation==null)return{annotationsById:t,mvfAnnotationsById:i};let n=globalThis.Object.keys(r.annotation);for(let o of n){let a=r.annotation[o];if(a!=null)for(let c of a.features){i[c.properties.id]=c;let l=new zi(e,{floorId:o,mvfData:c});t[c.properties.id]=l}}return{annotationsById:t,mvfAnnotationsById:i}},"processMVFAnnotations"),ob=s((r,e)=>{let{spacesById:t,spaceIdsByDestinationNodeId:i,poisById:n,mvfSpacesById:o,objectEntranceNodeIdsByObstructionId:a,connectionsById:c,connectionIdsByLatLon:l}=bx(r,e),{nodesById:p,mvfNodesById:f}=Cx(r,e),{objectsById:y,mvfObstructionById:g,obstructionIdByEntranceId:C}=xx(r,e),{floorsById:S,mvfMapsById:M}=Sx(r,e),{mvfConnectionsById:v,mvfConnectionsByNodeId:x}=Mx(r,e),{doorsById:E,doorsByNodeId:T,mvfEntrancesById:w}=Px(r,e),{annotationsById:D,mvfAnnotationsById:O}=Tx(r,e);return wx(r,o,g),{spacesById:t,nodesById:p,objectsById:y,floorsById:S,connectionsById:c,doorsById:E,doorsByNodeId:T,poisById:n,annotationsById:D,spaceIdsByDestinationNodeId:i,objectEntranceNodeIdsByObstructionId:a,obstructionIdByEntranceId:C,connectionIdsByLatLon:l,mvfSpacesById:o,mvfNodesById:f,mvfObstructionById:g,mvfMapsById:M,mvfConnectionsById:v,mvfConnectionsByNodeId:x,mvfEntrancesById:w,mvfAnnotationsById:O}},"createDataFromMVF");var se,Ki,Qi,en,tn,rn,nn,on,an,Wa,Ya,Ua,za,Za,qa,$a,Ja,Yd=class Yd{constructor(e,t){P(this,se,{});h(this,"mvf");h(this,"outdoorViewToken");h(this,"spaceIdsByDestinationNodeId");h(this,"objectEntranceNodeIdsByObstructionId");h(this,"obstructionIdByEntranceId");P(this,Ki,void 0);P(this,Qi,void 0);P(this,en,void 0);P(this,tn,void 0);P(this,rn,void 0);P(this,nn,void 0);h(this,"doorsByNodeId");P(this,on,void 0);P(this,an,void 0);P(this,Wa,void 0);P(this,Ya,void 0);P(this,Ua,void 0);P(this,za,void 0);P(this,Za,void 0);P(this,qa,void 0);P(this,$a,void 0);P(this,Ja,void 0);this.mvf=e,this.outdoorViewToken=t;let i=ob(e,this);I(this,Ki,i.nodesById),I(this,Qi,i.spacesById),I(this,en,i.floorsById),I(this,tn,i.connectionsById),I(this,rn,i.objectsById),I(this,nn,i.doorsById),I(this,on,i.poisById),I(this,an,i.annotationsById),I(this,Wa,i.mvfAnnotationsById),I(this,Ya,i.mvfConnectionsById),I(this,Ua,i.mvfConnectionsByNodeId),I(this,za,i.mvfEntrancesById),I(this,Za,i.mvfNodesById),I(this,qa,i.mvfObstructionById),I(this,$a,i.mvfSpacesById),I(this,Ja,i.mvfMapsById),this.doorsByNodeId=i.doorsByNodeId,this.spaceIdsByDestinationNodeId=i.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=i.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=i.obstructionIdByEntranceId}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 ee(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return u(this,se).spaces==null&&(u(this,se).spaces=globalThis.Object.values(u(this,Qi))),u(this,se).spaces}get objects(){return u(this,se).objects==null&&(u(this,se).objects=globalThis.Object.values(u(this,rn))),u(this,se).objects}get connections(){return u(this,se).connections==null&&(u(this,se).connections=globalThis.Object.values(u(this,tn))),u(this,se).connections}get floors(){return u(this,se).floors==null&&(u(this,se).floors=globalThis.Object.values(u(this,en))),u(this,se).floors}get doors(){return u(this,se).doors==null&&(u(this,se).doors=globalThis.Object.values(u(this,nn))),u(this,se).doors}get pointsOfInterest(){return u(this,se).pointsOfInterest==null&&(u(this,se).pointsOfInterest=globalThis.Object.values(u(this,on))),u(this,se).pointsOfInterest}get annotations(){return u(this,se).annotations==null&&(u(this,se).annotations=globalThis.Object.values(u(this,an))),u(this,se).annotations}get nodes(){return u(this,se).nodes==null&&(u(this,se).nodes=globalThis.Object.values(u(this,Ki))),u(this,se).nodes}getById(e,t){switch(e){case"space":return u(this,Qi)[t];case"floor":return u(this,en)[t];case"node":return u(this,Ki)[t];case"door":return u(this,nn)[t];case"connection":return u(this,tn)[t];case"object":return u(this,rn)[t];case"point-of-interest":return u(this,on)[t];case"annotation":return u(this,an)[t];default:throw new Error("Unknown type: ".concat(e))}}getMapDataById(e){var t,i,n,o,a,c,l;return(l=(c=(a=(o=(n=(i=(t=u(this,Qi)[e])!=null?t:u(this,en)[e])!=null?i:u(this,Ki)[e])!=null?n:u(this,nn)[e])!=null?o:u(this,tn)[e])!=null?a:u(this,rn)[e])!=null?c:u(this,on)[e])!=null?l:u(this,an)[e]}getMVFFeatureById(e,t){switch(e){case"space":return u(this,$a)[t];case"node":return u(this,Za)[t];case"obstruction":return u(this,qa)[t];case"map":return u(this,Ja)[t];case"connection":return u(this,Ya)[t];case"entrance":return u(this,za)[t];case"annotation":return u(this,Wa)[t];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,t){switch(e){case"connection":return u(this,Ua)[t];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}destroy(){for(let e of globalThis.Object.keys(u(this,se)))u(this,se)[e]=null}};se=new WeakMap,Ki=new WeakMap,Qi=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakMap,nn=new WeakMap,on=new WeakMap,an=new WeakMap,Wa=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,za=new WeakMap,Za=new WeakMap,qa=new WeakMap,$a=new WeakMap,Ja=new WeakMap,s(Yd,"MapDataInternal");var vo=Yd;m();m();m();m();m();var bo=class bo{constructor(e,t){h(this,"id");h(this,"text");h(this,"__type",bo.__type);this.id=e,this.text=t}static is(e){return e.__type===bo.__type}};s(bo,"Label"),h(bo,"__type","Label");var vi=bo;m();var Co=class Co{constructor(e,t){h(this,"id");h(this,"__type",Co.__type);h(this,"contentEl");this.id=e,this.contentEl=t}static is(e){return e.__type===Co.__type}};s(Co,"Marker"),h(Co,"__type","Marker");var sn=Co;m();var xo=class xo{constructor(e,t){h(this,"id");h(this,"groupId");h(this,"__type",xo.__type);this.id=e,this.groupId=t}static is(e){return e.__type===xo.__type}};s(xo,"Model"),h(xo,"__type","Model");var Ka=xo;m();var Ud=class Ud{constructor(e){h(this,"id");h(this,"__type");this.id=e,this.__type="Path"}};s(Ud,"Path");var Qa=Ud;m();var bi,zd=class zd{constructor(e){P(this,bi,void 0);I(this,bi,e)}get center(){return u(this,bi).center}get bearing(){return u(this,bi).bearing}get pitch(){return u(this,bi).pitch}get zoomLevel(){return u(this,bi).zoomLevel}};bi=new WeakMap,s(zd,"CameraTransform");var es=zd;m();var So=class So{constructor(e){h(this,"id");h(this,"__type",So.__type);this.id=e}static is(e){return e.__type===So.__type}};s(So,"Shape"),h(So,"__type","Shape");var ts=So;m();m();m();var Ix=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // 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>']]),Ex=/<svg([^>]*)>/g;function ab(r,e,t){let i=Ix.get(r);return i?i.replace(Ex,'<svg$1 style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}s(ab,"getStyledIcon");var Dx=s(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill={color}\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),Lx=s(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill={color}\n />\n </svg>\n '),"getDestinationPin"),Zd="#722ED1",qd="#1890FF",$d=s(({type:r="departure",destinationColor:e=Zd,departureColor:t=qd})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?Dx(t):Lx(e),"\n </div>"),"DroppedPin"),_x=s(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),sb=s(({type:r="stairs",color:e="#722ED1",direction:t="up"})=>{let i=_x("default"),n=i/2+2,o=t&&t!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(e,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(ab("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(t==="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 lb=s(async r=>new Promise(e=>setTimeout(e,r)),"ms");var Bc={createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{color:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1},polygons:{departure:"#40A9FF"}},Xr,jr,ln,ze,Ci,Gc,cb,rs,Jd=class Jd{constructor(e){P(this,Gc);P(this,Xr,void 0);P(this,jr,new Map);P(this,ln,void 0);P(this,ze,void 0);P(this,Ci,Bc);h(this,"draw",s(async(e,t={})=>{var c,l,p;if(e.coordinates.length<2){N.warn("Directions must have at least 2 coordinates");return}u(this,Xr)&&this.clear();let i={pathOptions:{...Bc.pathOptions,...t.pathOptions},createMarkers:{...Bc.createMarkers,...t.createMarkers},polygons:{...Bc.polygons,...t.polygons}};I(this,Ci,i),I(this,Xr,e);let n=e.coordinates[0],o=e.coordinates[e.coordinates.length-1],a=u(this,ze).getMapData()[Object.keys(u(this,ze).getMapData())[0]];if(n.floorId&&u(this,ze).setFloor(a.getById("floor",n.floorId)),(c=u(this,Ci).createMarkers)!=null&&c.departure){let f=u(this,ze).Markers.add(n,$d({type:"departure"}),{anchor:"top",rank:"always-visible"});u(this,jr).set(f,void 0)}if(await lb(500),!!u(this,Xr)&&(I(this,ln,await u(this,ze).Paths.add(e.coordinates,u(this,Ci).pathOptions)),!!u(this,Xr))){if((l=u(this,Ci).createMarkers)!=null&&l.destination){let f=u(this,ze).Markers.add(o,$d({type:"destination"}),{anchor:"top",rank:"always-visible"});u(this,jr).set(f,void 0)}(p=u(this,Ci).createMarkers)!=null&&p.connection&&(e.instructions.filter(y=>X(this,Gc,cb).call(this,y.action)).forEach(y=>{let g=u(this,ze).Markers.add(y.coordinate,sb({type:y.action.connectionType,color:y.action.type==="ExitConnection"?qd:Zd,direction:y.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});u(this,jr).set(g,y)}),u(this,ze).on("click",u(this,rs)))}},"draw"));P(this,rs,s(e=>{if(e.markers.length>0){let t=u(this,jr).get(e.markers[0]);t!=null&&t.action.toFloor&&u(this,ze).setFloor(t.action.toFloor)}},"#handleClick"));h(this,"clear",s(()=>{u(this,Xr)&&(u(this,jr).forEach((e,t)=>{u(this,ze).Markers.remove(t)}),u(this,jr).clear(),u(this,ln)&&(u(this,ze).Paths.remove(u(this,ln)),I(this,ln,void 0)),u(this,ze).off("click",u(this,rs)),I(this,Xr,void 0))},"clear"));I(this,ze,e)}};Xr=new WeakMap,jr=new WeakMap,ln=new WeakMap,ze=new WeakMap,Ci=new WeakMap,Gc=new WeakSet,cb=s(function(e){return e!=null&&["TakeConnection","ExitConnection"].includes(e.type)},"#isVortexAction"),rs=new WeakMap,s(Jd,"Navigation");var Fc=Jd;m();m();m();var Ox=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>']]),Ax=/<svg([^>]*)>/g;function ub(r,e,t){let i=Ox.get(r);return i?i.replace(Ax,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}s(ub,"getStyledIcon");var cn,Mo,is,Kd,Hc,pb,Xc,hb,ns,Qd,jc,db,ef=class ef{constructor(e,t){P(this,is);P(this,Hc);P(this,Xc);P(this,ns);P(this,jc);P(this,cn,void 0);P(this,Mo,void 0);h(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});I(this,cn,e),I(this,Mo,t)}auto(){let e=u(this,Mo)[Object.keys(u(this,Mo))[0]];[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(t=>{t.__type==="connection"?t.coordinates.forEach(i=>{u(this,cn).Labels.add(i,t.name,X(this,is,Kd).call(this,t))}):(t.__type==="space"&&t.name!==""&&u(this,cn).updateState(t,{interactive:!0,hoverColor:"#F0F0F0"}),u(this,cn).Labels.add(t,t.name,X(this,is,Kd).call(this,t)))})}};cn=new WeakMap,Mo=new WeakMap,is=new WeakSet,Kd=s(function(e){let t=ub(X(this,Hc,pb).call(this,e),"white",12);return{appearance:{text:{foregroundColor:X(this,ns,Qd).call(this,e)},marker:{foregroundColor:{active:X(this,ns,Qd).call(this,e)},icon:t,iconSize:12}},interactive:!0,rank:X(this,jc,db).call(this,e)}},"#generatLabelAppearance"),Hc=new WeakSet,pb=s(function(e){return e.__type==="connection"?X(this,Xc,hb).call(this,e.type):e.name.includes("Washroom")?"washroom-14x14":e.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),Xc=new WeakSet,hb=s(function(e){let t="";switch(e){case"elevator":t="connection-elevator-12x12";break;case"escalator":t="connection-escalator-12x12";break;case"stairs":t="connection-stairs-12x12";break}return t},"#attemptIconNameForConnection"),ns=new WeakSet,Qd=s(function(e){return e.__type==="connection"?this.colors.connection:e.__type==="point-of-interest"?this.colors.point:"name"in e&&e.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),jc=new WeakSet,db=s(function(e){return e.__type==="connection"?"high":(e.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),s(ef,"Labels");var Vc=ef;var tf=class tf{constructor(e,t){h(this,"Labels");h(this,"auto",s(()=>{this.Labels.auto()},"auto"));this.Labels=new Vc(e,t)}};s(tf,"DefaultTheme");var Wc=tf;m();var de,rf=class rf{constructor(e){P(this,de,void 0);h(this,"setMinPitch",s(e=>{u(this,de).camera.setMinPitch(e)},"setMinPitch"));h(this,"setMaxPitch",s(e=>{u(this,de).camera.setMaxPitch(e)},"setMaxPitch"));h(this,"setMinZoomLevel",s(e=>{u(this,de).camera.setMinZoomLevel(e)},"setMinZoomLevel"));h(this,"setMaxZoomLevel",s(e=>{u(this,de).camera.setMaxZoomLevel(e)},"setMaxZoomLevel"));I(this,de,e)}setScreenOffsets(e){u(this,de).camera.setInsetPadding(e)}focusOn(e,t){var o;let i=[],n=Array.isArray(e)?e:[e];for(let a of n)if(Vr.is(a)){let c;for(c of a.coordinates)i.push([c.longitude,c.latitude])}else if(Nr.is(a)||st.is(a)||lt.is(a)){let c=u(this,de).getBoundingArea(a.id);c&&i.push(...c)}else{let c=hr(a);if(c){let l=0;c.floorId&&(l=((o=u(this,de).getState(c.floorId))==null?void 0:o.altitude)||0),i.push([c.longitude,c.latitude,l])}}return u(this,de).camera.focusOn(i,{pitch:t==null?void 0:t.pitch,bearing:t==null?void 0:t.bearing,padding:t==null?void 0:t.screenOffsets,maxZoomLevel:t==null?void 0:t.maxZoomLevel,minZoomLevel:t==null?void 0:t.minZoomLevel,duration:t==null?void 0:t.duration,easing:t==null?void 0:t.easing})}animateTo(e,t){var p;let{center:i,zoomLevel:n,bearing:o,pitch:a}=e,c=i!=null?i:this.center,l=[c.longitude,c.latitude];return u(this,de).camera.animateTo({center:l,zoomLevel:n!=null?n:this.zoomLevel,bearing:o!=null?o:this.bearing,pitch:a!=null?a:this.pitch,duration:(p=t==null?void 0:t.duration)!=null?p:600,easing:t==null?void 0:t.easing})}set(e){let{center:t=this.center,zoomLevel:i=this.zoomLevel,bearing:n=this.bearing,pitch:o=this.pitch}=e,a=[t.longitude,t.latitude];u(this,de).camera.setCenter(a),u(this,de).camera.setZoomLevel(i),u(this,de).camera.setBearing(n),u(this,de).camera.setPitch(o)}get center(){let e=u(this,de).camera.center;return new ee(e[1],e[0],void 0)}get zoomLevel(){return u(this,de).camera.zoomLevel}get pitch(){return u(this,de).camera.pitch}get minPitch(){return u(this,de).camera.minPitch}get maxPitch(){return u(this,de).camera.maxPitch}get bearing(){let e=u(this,de).camera.bearing;return(e<0?e+360:e)%360}get minZoomLevel(){return u(this,de).camera.minZoomLevel}get maxZoomLevel(){return u(this,de).camera.maxZoomLevel}};de=new WeakMap,s(rf,"Camera");var os=rf;m();m();m();m();m();m();m();m();function nf(r){let e=+this._x.call(null,r),t=+this._y.call(null,r);return fb(this.cover(e,t),e,t,r)}s(nf,"default");function fb(r,e,t,i){if(isNaN(e)||isNaN(t))return r;var n,o=r._root,a={data:i},c=r._x0,l=r._y0,p=r._x1,f=r._y1,y,g,C,S,M,v,x,E;if(!o)return r._root=a,r;for(;o.length;)if((M=e>=(y=(c+p)/2))?c=y:p=y,(v=t>=(g=(l+f)/2))?l=g:f=g,n=o,!(o=o[x=v<<1|M]))return n[x]=a,r;if(C=+r._x.call(null,o.data),S=+r._y.call(null,o.data),e===C&&t===S)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=e>=(y=(c+p)/2))?c=y:p=y,(v=t>=(g=(l+f)/2))?l=g:f=g;while((x=v<<1|M)===(E=(S>=g)<<1|C>=y));return n[E]=o,n[x]=a,r}s(fb,"add");function mb(r){var e,t,i=r.length,n,o,a=new Array(i),c=new Array(i),l=1/0,p=1/0,f=-1/0,y=-1/0;for(t=0;t<i;++t)isNaN(n=+this._x.call(null,e=r[t]))||isNaN(o=+this._y.call(null,e))||(a[t]=n,c[t]=o,n<l&&(l=n),n>f&&(f=n),o<p&&(p=o),o>y&&(y=o));if(l>f||p>y)return this;for(this.cover(l,p).cover(f,y),t=0;t<i;++t)fb(this,a[t],c[t],r[t]);return this}s(mb,"addAll");m();function of(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(t))n=(t=Math.floor(r))+1,o=(i=Math.floor(e))+1;else{for(var a=n-t||1,c=this._root,l,p;t>r||r>=n||i>e||e>=o;)switch(p=(e<i)<<1|r<t,l=new Array(4),l[p]=c,c=l,a*=2,p){case 0:n=t+a,o=i+a;break;case 1:t=n-a,o=i+a;break;case 2:n=t+a,i=o-a;break;case 3:t=n-a,i=o-a;break}this._root&&this._root.length&&(this._root=c)}return this._x0=t,this._y0=i,this._x1=n,this._y1=o,this}s(of,"default");m();function af(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}s(af,"default");m();function sf(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}s(sf,"default");m();m();function Ae(r,e,t,i,n){this.node=r,this.x0=e,this.y0=t,this.x1=i,this.y1=n}s(Ae,"default");function lf(r,e,t){var i,n=this._x0,o=this._y0,a,c,l,p,f=this._x1,y=this._y1,g=[],C=this._root,S,M;for(C&&g.push(new Ae(C,n,o,f,y)),t==null?t=1/0:(n=r-t,o=e-t,f=r+t,y=e+t,t*=t);S=g.pop();)if(!(!(C=S.node)||(a=S.x0)>f||(c=S.y0)>y||(l=S.x1)<n||(p=S.y1)<o))if(C.length){var v=(a+l)/2,x=(c+p)/2;g.push(new Ae(C[3],v,x,l,p),new Ae(C[2],a,x,v,p),new Ae(C[1],v,c,l,x),new Ae(C[0],a,c,v,x)),(M=(e>=x)<<1|r>=v)&&(S=g[g.length-1],g[g.length-1]=g[g.length-1-M],g[g.length-1-M]=S)}else{var E=r-+this._x.call(null,C.data),T=e-+this._y.call(null,C.data),w=E*E+T*T;if(w<t){var D=Math.sqrt(t=w);n=r-D,o=e-D,f=r+D,y=e+D,i=C.data}}return i}s(lf,"default");m();function cf(r){if(isNaN(f=+this._x.call(null,r))||isNaN(y=+this._y.call(null,r)))return this;var e,t=this._root,i,n,o,a=this._x0,c=this._y0,l=this._x1,p=this._y1,f,y,g,C,S,M,v,x;if(!t)return this;if(t.length)for(;;){if((S=f>=(g=(a+l)/2))?a=g:l=g,(M=y>=(C=(c+p)/2))?c=C:p=C,e=t,!(t=t[v=M<<1|S]))return this;if(!t.length)break;(e[v+1&3]||e[v+2&3]||e[v+3&3])&&(i=e,x=v)}for(;t.data!==r;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[v]=o:delete e[v],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[x]=t:this._root=t),this):(this._root=o,this)}s(cf,"default");function yb(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}s(yb,"removeAll");m();function uf(){return this._root}s(uf,"default");m();function pf(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}s(pf,"default");m();function hf(r){var e=[],t,i=this._root,n,o,a,c,l;for(i&&e.push(new Ae(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(i=t.node,o=t.x0,a=t.y0,c=t.x1,l=t.y1)&&i.length){var p=(o+c)/2,f=(a+l)/2;(n=i[3])&&e.push(new Ae(n,p,f,c,l)),(n=i[2])&&e.push(new Ae(n,o,f,p,l)),(n=i[1])&&e.push(new Ae(n,p,a,c,f)),(n=i[0])&&e.push(new Ae(n,o,a,p,f))}return this}s(hf,"default");m();function df(r){var e=[],t=[],i;for(this._root&&e.push(new Ae(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var n=i.node;if(n.length){var o,a=i.x0,c=i.y0,l=i.x1,p=i.y1,f=(a+l)/2,y=(c+p)/2;(o=n[0])&&e.push(new Ae(o,a,c,f,y)),(o=n[1])&&e.push(new Ae(o,f,c,l,y)),(o=n[2])&&e.push(new Ae(o,a,y,f,p)),(o=n[3])&&e.push(new Ae(o,f,y,l,p))}t.push(i)}for(;i=t.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}s(df,"default");m();function gb(r){return r[0]}s(gb,"defaultX");function ff(r){return arguments.length?(this._x=r,this):this._x}s(ff,"default");m();function vb(r){return r[1]}s(vb,"defaultY");function mf(r){return arguments.length?(this._y=r,this):this._y}s(mf,"default");function as(r,e,t){var i=new yf(e==null?gb:e,t==null?vb:t,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}s(as,"quadtree");function yf(r,e,t,i,n,o){this._x=r,this._y=e,this._x0=t,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}s(yf,"Quadtree");function bb(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}s(bb,"leaf_copy");var Ke=as.prototype=yf.prototype;Ke.copy=function(){var r=new yf(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return r;if(!e.length)return r._root=bb(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(4)}):e.target[n]=bb(i));return r};Ke.add=nf;Ke.addAll=mb;Ke.cover=of;Ke.data=af;Ke.extent=sf;Ke.find=lf;Ke.remove=cf;Ke.removeAll=yb;Ke.root=uf;Ke.size=pf;Ke.visit=hf;Ke.visitAfter=df;Ke.x=ff;Ke.y=mf;m();m();var gf=class gf{constructor({origin:e,destination:t,distance:i=0,angle:n=0,pathWeight:o=0}){h(this,"origin");h(this,"destination");h(this,"distance");h(this,"angle");h(this,"weight");this.origin=e,this.destination=t,this.distance=i,this.angle=n;let a=o||0;if(this.weight=a>=0?this.distance+a:0,isNaN(this.angle))throw new Error("nan angle")}};s(gf,"Edge");var un=gf;m();m();m();function vf(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=Mt(r),n=Hy(e),o=n.type,a=e.bbox,c=n.coordinates;if(a&&kx(i,a)===!1)return!1;o==="Polygon"&&(c=[c]);for(var l=!1,p=0;p<c.length&&!l;p++)if(Cb(i,c[p][0],t.ignoreBoundary)){for(var f=!1,y=1;y<c[p].length&&!f;)Cb(i,c[p][y],!t.ignoreBoundary)&&(f=!0),y++;f||(l=!0)}return l}s(vf,"booleanPointInPolygon");function Cb(r,e,t){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var n=0,o=e.length-1;n<e.length;o=n++){var a=e[n][0],c=e[n][1],l=e[o][0],p=e[o][1],f=r[1]*(a-l)+c*(l-r[0])+p*(r[0]-a)===0&&(a-r[0])*(l-r[0])<=0&&(c-r[1])*(p-r[1])<=0;if(f)return!t;var y=c>r[1]!=p>r[1]&&r[0]<(l-a)*(r[1]-c)/(p-c)+a;y&&(i=!i)}return i}s(Cb,"inRing");function kx(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}s(kx,"inBBox");m();m();function Wr([r,e],[t,i]){let n=e-i,o=r-t;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}s(Wr,"getAngle");m();var Rx=63710088e-1;function pn(r,e){let[t,i]=r.map(f=>f*Math.PI/180),[n,o]=e.map(f=>f*Math.PI/180),a=o-i,c=n-t,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return Rx*p}s(pn,"getDistance");m();m();function Yc(r,e,t,i){let[n,o]=r,[a,c]=e,[l,p]=t,[f,y]=i;if(o===c&&n===a||p===y&&l===f)return null;let g=(f-l)*(c-o)-(y-p)*(a-n);if(g===0)return null;let C=((y-p)*(n-l)-(f-l)*(o-p))/g,S=((c-o)*(n-l)-(a-n)*(o-p))/g;if(C<0||C>1||S<0||S>1)return null;let M=o+C*(c-o);return[n+C*(a-n),M]}s(Yc,"getLineIntersection");m();function bf(r,e,t,i){let n=Gi(r,t/1e3,i),o=Gi(e,t/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}s(bf,"getOffsetLine");m();function Cf(r){let e=r*(180/Math.PI);return e=e%360,e>180?e-=360:e<-180&&(e+=360),Object.is(e,-0)?0:e}s(Cf,"radToDegNormalized");function xb(r,e,t=[],i=0){let n=!0,o=r.geometry.coordinates,a=e.geometry.coordinates,c=Cf(Wr(o,a)-Math.PI/2),l=Cf(Wr(o,a)+Math.PI/2);return t.forEach(p=>{if(i>0){let f=bf(o,a,i,c),y=bf(o,a,i,l);if(Yc(f[0],f[1],p[0],p[1])||Yc(y[0],y[1],p[0],p[1])){n=!1;return}}else if(Yc(o,a,p[0],p[1])){n=!1;return}}),n}s(xb,"hasLineOfSight");var hn,ss,xf,zc,Sb,Zc,Mb,qc,Pb,$c,wb,Jc,Tb,Kc,Ib,Qc,Sf=class Sf{constructor({nodes:e,groupBy:t}){P(this,ss);P(this,zc);P(this,Zc);P(this,qc);P(this,$c);P(this,Jc);P(this,Kc);h(this,"edges",{});h(this,"nodesById");h(this,"nodesByGroup",new Map);P(this,hn,void 0);P(this,Qc,s((e,t)=>{let i=0;for(let n of t)(!n[u(this,hn)]||n[u(this,hn)]===e.properties[u(this,hn)])&&vf(e.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i},"#getZonalCost"));I(this,hn,t);let{features:i}=e;this.nodesById=X(this,zc,Sb).call(this,i),X(this,Zc,Mb).call(this),X(this,qc,Pb).call(this,i,t)}getShortestEuclideanDistance(e,t){return t.reduce((i,n)=>{let o=pn(e.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:e,destinationNodeIds:t,excludedNodeIds:i,zones:n}){let o=X(this,ss,xf).call(this,e),a=X(this,ss,xf).call(this,t);if(o.length===0||a.length===0)return[];let{frontier:c,cameFrom:l,costSoFar:p}=X(this,$c,wb).call(this,o,a);for(;c.length>0;){let f=c.shift();if(!f)break;if(X(this,Jc,Tb).call(this,f.origin,a))return X(this,Kc,Ib).call(this,l,f.origin.properties.id);for(let y of this.edges[f.origin.properties.id]){let g=p[f.origin.properties.id]+y.weight+u(this,Qc).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 C=g+this.getShortestEuclideanDistance(y.destination,a);p[y.destination.properties.id]=g,l[y.destination.properties.id]=y,c.push({origin:y.destination,priority:C})}}c.sort((y,g)=>y.priority-g.priority)}return[]}};hn=new WeakMap,ss=new WeakSet,xf=s(function(e){return e.map(t=>this.nodesById[t]).filter(Boolean)},"#filterValidNodes"),zc=new WeakSet,Sb=s(function(e){return e.reduce((t,i)=>(t[i.properties.id]=i,t),{})},"#createNodesById"),Zc=new WeakSet,Mb=s(function(){for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].properties.neighbors=this.nodesById[e].properties.neighbors.filter(({id:t})=>!!this.nodesById[t]))},"#removeInvalidNeighbors"),qc=new WeakSet,Pb=s(function(e,t){e.forEach(i=>{let n=t==="default"?t:i.properties[t];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 c=this.nodesById[o],l=pn(i.geometry.coordinates,c.geometry.coordinates),p=Wr(i.geometry.coordinates,c.geometry.coordinates);return new un({origin:i,destination:c,pathWeight:a,distance:l,angle:p})})})},"#initializeEdgesAndGroups"),$c=new WeakSet,wb=s(function(e,t){let i=[],n={},o={};return e.forEach(a=>{let c=this.getShortestEuclideanDistance(a,t);i.push({origin:a,priority:c}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,c)=>a.priority-c.priority),{frontier:i,cameFrom:n,costSoFar:o}},"#initializeSearch"),Jc=new WeakSet,Tb=s(function(e,t){return t.some(i=>i.properties.id===e.properties.id)},"#isDestinationNode"),Kc=new WeakSet,Ib=s(function(e,t){let i=[],n=e[t];for(;n;)i.push(n),n=e[n.origin.properties.id];return i.reverse()},"#reconstructPath"),Qc=new WeakMap,s(Sf,"NavigationGraph");var Uc=Sf;var Nx=.4,Mf=class Mf{constructor({nodes:e,obstructions:t,groupBy:i="default"}){h(this,"groupBy");h(this,"graph");h(this,"geometryEdgesByMapId",new Map);h(this,"cache",{nodeTreesByGroup:new Map});h(this,"findNearestNode",s(e=>{var n;let t=this.groupBy==="default"?this.groupBy:e.properties[this.groupBy];if(!this.cache.nodeTreesByGroup.has(t)){let o=(n=this.graph.nodesByGroup.get(t))!=null?n:[],a=as();a.x(c=>c.geometry.coordinates[1]),a.y(c=>c.geometry.coordinates[0]),a.addAll(o),this.cache.nodeTreesByGroup.set(t,a)}return this.cache.nodeTreesByGroup.get(t).find(e.geometry.coordinates[1],e.geometry.coordinates[0])||null},"findNearestNode"));h(this,"generatePath",s(e=>{let{destination:t}=e[e.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<e.length;o++){let{origin:a}=e[o],c={id:a.properties.id,angle:e[o].angle,distance:e[o].distance};this.groupBy!=="default"&&(c.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:c})}let n={id:t.properties.id};return this.groupBy!=="default"&&(n.groupBy=t.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},properties:n}),i},"generatePath"));h(this,"getDistance",s((e,t)=>pn(e,t),"getDistance"));h(this,"getAngle",s((e,t)=>Wr(e,t),"getAngle"));this.groupBy=i,this.graph=new Uc({nodes:e,groupBy:this.groupBy}),t&&t.features.forEach(n=>{let o=n.geometry.coordinates.length===1?n.geometry.coordinates[0]:n.geometry.coordinates,a=this.groupBy==="default"?this.groupBy:n.properties[this.groupBy];this.geometryEdgesByMapId.has(a)||this.geometryEdgesByMapId.set(a,[]),o.forEach((c,l)=>{this.geometryEdgesByMapId.get(a).push([c,o[l+1]||o[0]])})})}getDirections({zones:e,originIds:t,destinationNodeIds:i,excludedNodeIds:n,simplify:o}){var p,f;let a=(p=o==null?void 0:o.enabled)!=null?p:!0,c=e!=null?e:[],l=this.graph.aStar({originIds:t,destinationNodeIds:i,zones:c,excludedNodeIds:new Set(n)});return l.length===0?{type:"FeatureCollection",features:[]}:(a&&(l=this.simplifyAllSteps(l,(f=o==null?void 0:o.bufferRadius)!=null?f:Nx)),this.generatePath(l))}simplifyAllSteps(e,t){var l,p;let i=[],n=[e[0]];for(let f=1;f<e.length;f++){if(this.groupBy!=="default"&&e[f].origin.properties[this.groupBy]!==e[f-1].origin.properties[this.groupBy]){let y=e[f-1].origin.properties[this.groupBy],g=(l=this.geometryEdgesByMapId.get(y))!=null?l:[];i.push(...this.simplifySteps(n,g,t)),n=[e[f]]}n.push(e[f])}let o=e[e.length-1],a=this.groupBy==="default"?this.groupBy:o.origin.properties[this.groupBy],c=(p=this.geometryEdgesByMapId.get(a))!=null?p:[];return i.push(...this.simplifySteps(n,c,t)),i}simplifySteps(e,t,i){if(e.length<3)return e;let n=[e[0]],o=1;for(let a=o+2;a<e.length;a++)if(!xb(e[o].origin,e[a].origin,t,i)){let c=a-1;n.push(new un({...e[o],destination:e[c].origin,distance:pn(e[o].origin.geometry.coordinates,e[c].origin.geometry.coordinates),angle:Wr(e[o].origin.geometry.coordinates,e[c].origin.geometry.coordinates)})),o=c}return n.push(new un({...e[o],destination:e[e.length-1].origin,distance:pn(e[o].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates),angle:Wr(e[o].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates)}),e[e.length-1]),n}};s(Mf,"Navigator");var Po=Mf;m();function xi(r){return[r.longitude,r.latitude]}s(xi,"convertCoordinateToPosition");function Bx(r){return new Map(r.map(e=>{let{properties:t}=e,{id:i}=t;return[i,e]}))}s(Bx,"getEntranceMap");var Pf=s((r,e)=>{let t=Bx(e),i={type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}};for(let n of r){let o=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((c,l)=>(t.has(l)&&c.push(t.get(l)),c),[]);a.length&&(o=Ed(n,a).map(c=>c.geometry.coordinates)),i.geometry.coordinates.push(...o)}return i},"cutEntrancesFromLineStrings");function Eb(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.appearance&&(t.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!==void 0&&(t.enabled=r.enabled),r.interactive!==null&&(t.options.interactive=r.interactive),t}s(Eb,"translateLabelStateToGeojsonCore");function Db(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!==void 0&&(t.enabled=r.enabled),r.interactive!==null&&(t.options.interactive=r.interactive),t}s(Db,"translateMarkerStateToGeojsonCore");function Lb(r,e){let t={};return e==null||(r.color&&(r.color==="initial"?t.color=e.initialColor:t.color=r.color),r.hoverColor&&(t.hoverColor=r.hoverColor),r.interactive!==void 0&&(t.interactive=r.interactive),r.visible!==void 0&&(t.visible=r.visible),r.opacity!==void 0&&(t.opacity=r.opacity),r.height!==void 0&&(t.height=r.height)),t}s(Lb,"translateSpaceStateToGeojsonCore");function _b(r,e){return((e-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}s(_b,"differenceBetweenAngles");function Ob(r,e){let t="Left";return r<=-Math.PI/4?t="Right":r<=-e?t="SlightRight":r<=e?t="Straight":r<=Math.PI/4?t="SlightLeft":t="Left",t}s(Ob,"getRelativeBearing");function Ab(r){let e={};for(let t in r){let i=r[t];if(i!=null){if(i.id=t,"polygons"in i)for(let n of i.polygons)e[n]=i;else if("lineStrings"in i)for(let n of i.lineStrings)e[n]=i;else if("points"in i)for(let n of i.points)e[n]=i}}return e}s(Ab,"extractStyleMap");function wf(r,e){return r.reduce((t,i)=>{let n=e[i.properties.id];return n==null||(t.has(n)||t.set(n,[]),t.get(n).push(i)),t},new Map)}s(wf,"groupGeometryByStyle");function ls(r,e={}){var n,o,a,c,l,p;let t={...r},i=(o=(n=e==null?void 0:e.style)==null?void 0:n.shading)!=null?o:e==null?void 0:e.shadingAndOutlines;if(i===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(t.shading={start:i.start,end:i.end,intensity:i.intensity}),t.outline=(c=(a=e==null?void 0:e.style)==null?void 0:a.outlines)!=null?c:e==null?void 0:e.shadingAndOutlines,"lineStrings"in r){let f=(p=(l=e==null?void 0:e.style)==null?void 0:l.wallTopColor)!=null?p:e==null?void 0:e.wallTopColor;f!=null&&(t.topColor=f)}return t}s(ls,"translateToCoreStyle");var kb=Math.PI*.1,Qe,dr,wt,ru,Rb,cs,Tf,iu,Nb,If=class If{constructor(e,t){P(this,ru);P(this,cs);P(this,iu);P(this,Qe,{});P(this,dr,void 0);P(this,wt,void 0);I(this,dr,t),I(this,wt,e.features),I(this,dr,t),I(this,wt,e.features)}get coordinates(){return u(this,Qe).coordinates?u(this,Qe).coordinates:(u(this,Qe).coordinates=u(this,wt).map(e=>new ee(e.geometry.coordinates[1],e.geometry.coordinates[0],e.properties.groupBy)),u(this,Qe).coordinates)}get distance(){return u(this,Qe).distance?u(this,Qe).distance:(u(this,Qe).distance=u(this,wt).reduce((e,t)=>e+(t.properties.distance||0),0),u(this,Qe).distance)}get instructions(){if(u(this,wt).length<2)return[];if(u(this,Qe).instructions)return u(this,Qe).instructions;let e=[],t=0;for(let i=0;i<u(this,wt).length;i++){let n=u(this,wt)[i],o=u(this,wt)[i-1],a=u(this,wt)[i+1],c=new ee(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),l=X(this,ru,Rb).call(this,{prevDirection:o,direction:n,nextDirection:a});t+=(o==null?void 0:o.properties.distance)||0;for(let p of l)p&&(e.push({action:p,distance:t,coordinate:c}),t=0)}return u(this,Qe).instructions=e,u(this,Qe).instructions}};Qe=new WeakMap,dr=new WeakMap,wt=new WeakMap,ru=new WeakSet,Rb=s(function(e){let{prevDirection:t,direction:i,nextDirection:n}=e,o=t&&u(this,dr).getById("floor",t.properties.groupBy),a=u(this,dr).getById("floor",i.properties.groupBy),c=n&&u(this,dr).getById("floor",n.properties.groupBy),l=[];if(t||l.push({type:"Departure"}),c&&a.id!==c.id){let p=u(this,dr).getMVFFeatureByNodeId("connection",i.properties.id);l.push(X(this,cs,Tf).call(this,"TakeConnection",a,c,p==null?void 0:p.type))}else if(o&&o.id!==a.id){let p=u(this,dr).getMVFFeatureByNodeId("connection",i.properties.id);l.push(X(this,cs,Tf).call(this,"ExitConnection",a,o,p==null?void 0:p.type))}else l.push(X(this,iu,Nb).call(this,t,i));return n||l.push({type:"Arrival"}),l},"#getActions"),cs=new WeakSet,Tf=s(function(e,t,i,n){let o=t.elevation-i.elevation,a="none";return o>0?a="down":o<0&&(a="up"),{type:e,fromFloor:t,toFloor:i,direction:a,connectionType:n!=null?n:"stairs"}},"#createConnectionAction"),iu=new WeakSet,Nb=s(function(e,t){let i=e?-_b(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=kb?{type:"Turn",bearing:Ob(i,kb),referencePosition:"At"}:null},"#createTurnAction"),s(If,"Directions");var eu=If,Ef=class Ef{constructor({nodes:e,obstructions:t,connections:i,groupBy:n}){h(this,"navigator");h(this,"connections");h(this,"getDirections",s((e,t,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:c}}=i,l=e.flatMap(C=>this.getNodesFromTarget(C,n)),p=t.flatMap(C=>this.getNodesFromTarget(C,n)),f=this.getExcludedNodeIds(o).filter(C=>!l.includes(C)&&!p.includes(C)),y=this.navigator.getDirections({zones:i.zones.map(C=>{var S;return{geometry:C.geometry,cost:C.cost,map:(S=C.floor)==null?void 0:S.id}}),originIds:l,destinationNodeIds:p,excludedNodeIds:f,simplify:{enabled:a,bufferRadius:c}});this.addCoordinateDirections(y,e,t);let g=new eu(y,n);if(!(g.distance===0&&new Set([...l,...p]).size===l.length+p.length))return g},"getDirections"));h(this,"getExcludedNodeIds",s(e=>e?this.connections.reduce((t,i)=>i.accessible?t:t.concat(i.nodes),[]):[],"getExcludedNodeIds"));h(this,"addCoordinateDirections",s((e,[t],[i])=>{if(e.features.length){if(ee.is(t)){let n=this.createDirectionFeature(t,this.navigator.getAngle([t.longitude,t.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([t.longitude,t.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,n)}if(ee.is(i)){let n=this.createDirectionFeature(i,0,0),o=e.features[e.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]),e.features.push(n)}}},"addCoordinateDirections"));h(this,"getNodesFromTarget",s((e,t)=>{if(ee.is(e)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(e));return i?[i.properties.id]:[]}else if(Br.is(e)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(e.coordinate));return i?[i.properties.id]:[]}else if(Rr.is(e)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(e.center));return i?[i.properties.id]:[]}else if(st.is(e)){let i=t==null?void 0:t.getMVFFeatureById("space",e.id);return i==null?[]:i.properties.destinationNodes}else{if(Vr.is(e))return e.coordinates.reduce((i,n)=>{let o=this.navigator.findNearestNode(this.createCoordinateFeature(n));return o&&i.push(o.properties.id),i},[]);if(lt.is(e)){let i=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return i!=null?i:[]}else return[]}},"getNodesFromTarget"));h(this,"createCoordinateFeature",s(e=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{map:e.floorId}}),"createCoordinateFeature"));h(this,"createDirectionFeature",s((e,t,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:i}}),"createDirectionFeature"));this.navigator=new Po({nodes:e,obstructions:this.createObstructionCollection(t),groupBy:n}),this.connections=i}createObstructionCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[i,n])=>t.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};s(Ef,"DirectionsInternal");var tu=Ef;m();var wo,Df=class Df{constructor({currentMapGetter:e}){P(this,wo,void 0);I(this,wo,e)}get currentMap(){return u(this,wo).call(this)}async getCurrentSceneGLTF(e){let t=u(this,wo).call(this);return t?t==null?void 0:t.Exporter.getCurrentSceneGLTF(e):(N.error("There is no map to export. Please load a map first."),new Blob)}};wo=new WeakMap,s(Df,"Exporter");var us=Df;m();var fr,hs,Lf=class Lf{constructor({currentMapGetter:e}){P(this,fr,new Map);P(this,hs,void 0);I(this,hs,e)}get currentMap(){return u(this,hs).call(this)}getById(e){return u(this,fr).get(e)}add(e,t,i){let n=hr(e);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(xi(n),t,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium"}),c=new vi(a.id.toString(),t);return u(this,fr).set(c.id,{label:c,entityId:c.id}),c}all(){var t;let e=[];return(t=this.currentMap)==null||t.Labels.all({onCreate:(i,n)=>{let o=new vi(i.toString(),n);u(this,fr).set(o.id,{label:o,entityId:o.id}),e.push(o)}}),e}remove(e){var i;let t=u(this,fr).get(e.id);t&&((i=this.currentMap)==null||i.Labels.remove(t.entityId),u(this,fr).delete(e.id.toString()))}removeAll(){let e=[];return u(this,fr).forEach(({label:t})=>{this.remove(t),e.push(t),u(this,fr).delete(t.id.toString())}),e}};fr=new WeakMap,hs=new WeakMap,s(Lf,"Labels");var ps=Lf;m();m();var Bb={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},_f=class _f{constructor(e,t,i,n,o,a){h(this,"id");h(this,"name");h(this,"elevation");h(this,"containerId");h(this,"loaded",!1);h(this,"styleMap",{});h(this,"obstructions");h(this,"entrances");h(this,"spaces");h(this,"renderer");h(this,"options");h(this,"mvf");h(this,"layers",new Map);h(this,"load",s(()=>{var e,t,i,n,o;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;if(this.loaded=!0,this.spaces!=null&&this.spaces.features.length>0){let a=this.spaces.features.filter(f=>{var y;return f.geometry.type==="Polygon"&&((y=f.properties.kind)==null?void 0:y.toLowerCase())!=="void"}),c=wf(a,this.styleMap),l=this.renderer.addGroupContainer("spaces-".concat(this.id),{},this.id),p=0;for(let[f,y]of c){let g=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(p),{features:y},ls(f,this.options),l);p++;let C=g.id.toString();this.layers.set(f.id||C,g.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let a=this.obstructions.features.filter(M=>M.geometry.type==="Polygon"&&M.properties.kind==="object"),c=wf(a,this.styleMap),l=this.renderer.addGroupContainer("objects-".concat(this.id),{},this.id),p=0;for(let[M,v]of c){let x=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(p),{features:v},ls(M,this.options),l);p++;let E=x.id.toString();this.layers.set(M.id||E,E)}let f=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!1),y=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!0),g=this.entrances,C=Bb,S=Bb;if(f!=null&&f.length>0){let M=this.styleMap[(e=f[0].properties)==null?void 0:e.id];M!=null&&(C={...M}),S=C;let v=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[Pf(f,(g==null?void 0:g.features)||[])]},ls(C,this.options),this.id);this.layers.set(so,v.id.toString())}if(y!=null&&y.length>0){let M=this.styleMap[(t=y[0].properties)==null?void 0:t.id];M!=null&&(S={...M,id:fi});let v=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[Pf(y,(g==null?void 0:g.features)||[])]},ls(S,this.options),this.id);this.layers.set(fi,v.id.toString())}}if(((i=this.mvf.mapImages)==null?void 0:i[this.id])!=null){let a=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let c of((n=this.mvf.mapImages[this.id])==null?void 0:n.features)||[])"anchorId"in c.properties||"anchorId"in c.properties&&((o=c.properties)==null?void 0:o.anchorId)==null||this.renderer.addImage(q(),c,{url:c.properties.path,flipImageToFaceCamera:!0},a);this.layers.set(a.id.toString(),a.id.toString())}return this.renderer.render(),this},"load"));this.id=t.id,this.options=n,this.mvf=o;let c=i.addGroupContainer(this.id,{visible:!1,interactive:!0},e);this.containerId=c.id.toString(),this.name=t.externalId,this.elevation=t.elevation,o!=null&&a!=null&&(this.styleMap=a,this.spaces=o.space[this.id],this.entrances=o.entrance[this.id],this.obstructions=o.obstruction[this.id]),this.renderer=i}};s(_f,"FloorObject");var nu=_f;var Rn=Qt(dn());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 Fb(r){return Fl(r)}s(Fb,"getBoundingBoxFromFeature");m();var Gb="#ffffff";var Rf=class Rf{constructor(e={}){h(this,"initialColor",Gb);h(this,"color",Gb);h(this,"topColor");h(this,"topTexture");h(this,"texture");h(this,"hoverColor");h(this,"dirty",!0);h(this,"visible",!0);h(this,"opacity",1);h(this,"width",.1);h(this,"height",.1);h(this,"altitude",0);h(this,"join","round");h(this,"cap","round");h(this,"outline",!0);h(this,"showImage",!0);h(this,"flipImageToFaceCamera",!0);h(this,"url");this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url}};s(Rf,"StyleComponent");var jt=Rf;var Nf=class Nf extends Hn{constructor(){super(...arguments);h(this,"userData",{entities:{}})}};s(Nf,"EntityBatchedMesh");var mr=Nf,ds,fs,fn,Bf=class Bf{constructor(e){h(this,"mesh");h(this,"focusMesh");h(this,"outline");h(this,"imageMesh");h(this,"type","geometry");h(this,"dirty",!0);h(this,"detached",!1);h(this,"instanceIndex",-1);h(this,"geometry");h(this,"material");h(this,"feature");h(this,"currentHeight",.1);h(this,"focusable",!1);h(this,"color",new he);h(this,"topColor",new he);h(this,"position",new W);P(this,ds,0);P(this,fs,1);P(this,fn,void 0);h(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e),this.imageMesh&&(this.imageMesh.visible=e)}setOpacity(e){this.mesh&&(this.material&&(this.material.opacity=e,this.material.transparent=e<1),this.outline&&(this.outline.material.opacity=e),e===0?this.mesh.visible=!1:this.mesh.visible=!0)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return u(this,ds)}set altitude(e){this.mesh&&(this.mesh.position.z=e,I(this,ds,e))}get opacity(){return u(this,fs)}set opacity(e){this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.outline&&(this.outline.material.opacity=e),this.material.needsUpdate=!0),I(this,fs,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get featureBbox(){return u(this,fn)?u(this,fn):(I(this,fn,Fb(this.feature)),u(this,fn))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}};ds=new WeakMap,fs=new WeakMap,fn=new WeakMap,s(Bf,"MeshComponent");var Pe=Bf;m();var Gx="#ffffff",Si,Ff=class Ff{constructor(e={}){h(this,"color",Gx);h(this,"topColor");h(this,"opacity",1);P(this,Si,void 0);h(this,"outline",!0);h(this,"dirty",!0);var t,i;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(i=e==null?void 0:e.opacity)!=null?i:this.opacity,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return u(this,Si)}set shading(e){var t;if(!e){I(this,Si,void 0);return}I(this,Si,(t=u(this,Si))!=null?t:{start:0,end:0,intensity:0}),Object.assign(u(this,Si),e)}};Si=new WeakMap,s(Ff,"GeometryGroupStyleComponent");var mn=Ff;m();m();function Mi(r){var t;let e=(t=r.parent)==null?void 0:t.children.find(i=>i.userData.outlineOfEntityId===r.userData.entityId);return e instanceof Bi?e:void 0}s(Mi,"findOutline");m();m();m();m();var Gf=class Gf{constructor(){h(this,"hover",!1);h(this,"dirty",!1)}};s(Gf,"InteractionComponent");var To=Gf;m();m();var Vf=class Vf extends Rt{};s(Vf,"Geometry2DObject3D");var Io=Vf,Hf=class Hf{constructor(e,t){h(this,"id");h(this,"positionDirty",!0);h(this,"object3d",new Io);h(this,"components");h(this,"disposed",!1);h(this,"worldPosition",new W);this.id=e.id||q(),this.components=[e],this.object3d=new Io,this.object3d.position.copy(t),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parent(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}};s(Hf,"Geometry2D");var Tt=Hf;m();var Xf=class Xf extends Rt{constructor(){super(...arguments);h(this,"userData",{entityId:"",type:"geometry"})}};s(Xf,"Geometry3DObject3D");var It=Xf,jf=class jf{constructor(e,t){h(this,"id",q());h(this,"components");this.components=[e,t]}get object3d(){return this.components[0].mesh}get parent(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}};s(jf,"Geometry3D");var ce=jf;var pu={};ny(pu,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Vx,CLIPPING_RADIUS:()=>ms,CONTROL_OPTIONS:()=>au,EARTH_RADIUS_M:()=>yr,EVENTS:()=>uu,MAPLIBRE_TILE_SIZE:()=>ou,MAX_LAT:()=>Yf,MAX_MERCATOR_ZOOM_LEVEL:()=>cu,MIN_LAT:()=>Wf,MIN_MERCATOR_ZOOM_LEVEL:()=>lu,ROOM_MERCATOR_ZOOM_LEVEL:()=>Hx,TWO_PI:()=>su,WHEEL_ZOOM_MULTIPLIER:()=>Uf,ZRANGE:()=>Eo});m();var ou=512,yr=63710088e-1,Wf=-85.051129,Yf=85.051129,ms=1e4,au={chain:"chain",cancel:"cancel"},su=Math.PI*2,Eo=100,Uf=1e4,lu=0,cu=22,Vx=17,Hx=20,uu=["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"];m();var ys="mappedin";m();function zf(r){let e=r.min,t=r.max,i=new W(e.x,e.y,e.z),n=new W(t.x,e.y,e.z),o=new W(e.x,t.y,e.z),a=new W(t.x,t.y,e.z);return[i,n,o,a]}s(zf,"getCornersOfBoundingBox");m();function Pi(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}s(Pi,"getPixelRatio");m();function gr(r,e,t=!1){let i=null,n=0;return function(...o){n++,n===1&&t===!0&&r(...o);let a=s(()=>{(!t||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,e)}}s(gr,"debounce");m();var Xx=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:i}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),o=t==="iPad"||t.indexOf("Mac")===0&&i>0&&!window.MSStream,a=/android/i.test(e);return r={isIpad:o,isMobile:a||n||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Vb=Xx.getDeviceType,Hb=(()=>{let r,e,t;function i(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return e;try{let a=Vb().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=a?o.getParameter(a.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}s(i,"getInfo");function n(){var a,c;if(!Vb().isWindows)return!1;if(t!==void 0)return t;let o=(c=(a=jx())==null?void 0:a.toLowerCase())!=null?c:"";return t=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),t}return s(n,"shouldDisableOffscreenCanvas"),{getInfo:i,shouldDisableOffscreenCanvas:n,_setCanvas(o){r=o,e=void 0,t=void 0}}})(),jx=Hb.getInfo,Zf=Hb.shouldDisableOffscreenCanvas;m();m();var qf=s(r=>e=>{if(!e.includes("mappedin")){let t={};for(let i in r){let n=r[i];e.includes("mappedin")||(r[i]=n)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function du(r,e,t,i){let n=r*(Math.PI/180),o=i/yr,a=r+o*180/Math.PI,c=t/yr/Math.cos(n),l=e+c*180/Math.PI;return{lat:a,lon:l}}s(du,"cartesianToGeographic");function fu(r,e,t,i){let n=t*(Math.PI/180),o=i*(Math.PI/180),a=r*(Math.PI/180),c=e*(Math.PI/180),l=n-a,p=o-c,f=yr*p*Math.cos(a),y=yr*l;return{x:f,y}}s(fu,"geographicToCartesian");var $f=s((r,e)=>{var t;if(r.children&&r.visible)for(let i of r.children){if(i.visible)if((t=i.userData)!=null&&t.entities3D&&i.type==="geometry-group"){e.add(i.userData.entityId);for(let n of i.userData.entities3D.values())e.add(n)}else(i.type==="group-container"||i.type==="custom-geometry"||i instanceof It)&&e.add(i.userData.entityId);$f(i,e)}return e},"populateGeometry3DIdsInScene"),Jf=s((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let i of r.children)i.visible&&i instanceof Io&&e.add(i.userData.entityId),Jf(i,e);return e},"populateGeometry2DIdsInScene");function Kf(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Kf(r[t],e[t]):r[t]=e[t]}return r}s(Kf,"mergeObjects");function mu(r,e,t,i){let n={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new Er,a=new W(n.scale,-n.scale,n.scale),c=new Er().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(a);return{id:ys,type:"custom",renderingMode:"3d",render:(l,p)=>{if(o.fromArray(p),t.elevation>0){let f=Al.fromLngLat(r.toLngLat(),t.elevation);c.makeTranslation(n.translateX,n.translateY,-f.z).scale(a)}e.projectionMatrix=o.multiply(c),i()}}}s(mu,"createCustomLayer");function Wx(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}s(Wx,"fetchToken");async function Xb(r){let e=await Wx(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}s(Xb,"getRequestHeaders");function jb(r,e=0){let t=3735928559^e,i=1103547991^e;for(let n=0,o;n<r.length;n++)o=r.charCodeAt(n),t=Math.imul(t^o,2654435761),i=Math.imul(i^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}s(jb,"cyrb53");var Yx=s(r=>r,"linearEase");function Wt(r,e,t,i,n,o=Yx){r=Math.max(e,Math.min(r,t));let a=(r-Math.min(e,t))/Math.abs(t-e),c=o(a);return i+c*(n-i)}s(Wt,"interpolate");function Qf(r,e,t){let i=r*(Math.PI/180)/2,n=e/2;return t*Math.tan(i)/n}s(Qf,"getProjectionScaleFactor");function gs(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}s(gs,"getGeometryByGeometryId");function Wb(r){return new wy(new Dp(r[0][0],r[0][1]),new Dp(r[1][0],r[1][1])).getCenter().toArray()}s(Wb,"getBoundingBoxCenter");function hu(r){return r*(Math.PI/180)}s(hu,"toRadians");function Yb(r,e){let t=hu(e[1]-r[1]),i=hu(e[0]-r[0]),n=hu(r[1]),o=hu(e[1]),a=Math.sin(t/2)*Math.sin(t/2)+Math.sin(i/2)*Math.sin(i/2)*Math.cos(n)*Math.cos(o),c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return yr*c}s(Yb,"haversineDistance");function Ub(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof Py||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}s(Ub,"isFiniteBox");m();var zb=["","","low","medium","high","always-visible"];function Zb(r){return Math.min(5,Math.max(2,r))}s(Zb,"clampTierNumber");function Do(r){if(typeof r=="number")return Zb(r);let e=zb.indexOf(r);return e===-1?3:e}s(Do,"convertCollisionRankingTierToNumber");function vs(r){let e=Zb(r);return zb[e]}s(vs,"convertNumberToCollisionRankingTier");function Ct(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return e===!0?(r instanceof Tt&&r.components[1]===void 0?(r.components[1]=new To,r.components[1].dirty=!0):r instanceof ce&&r.components[2]===void 0?(r.components[2]=new To,r.components[2].dirty=!0):r instanceof De&&r.components[1]===void 0&&(r.components[1]=new To,r.components[1].dirty=!0),!0):(r instanceof Tt?r.components[1]=void 0:r instanceof ce?r.components[2]=void 0:r instanceof De&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let i;for(let n of r.userData.entities3D.values())i=t.geometry3DMap.get(n),Ct(i,e,t);return!0}}return!1}s(Ct,"updateInteractivity");function qb(r,e,t){if(!(!(t!=null&&t.color)&&!(t!=null&&t.topColor))){if(t!==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=e.geometry3DMap.get(a),i&&(n=i.components[1],n.color===o.color&&(n.initialColor=t.color||o.color,n.color=t.color||o.color,n.dirty=!0),n.topColor===o.topColor&&(n.topColor=t.topColor||o.topColor,n.dirty=!0));return t.color!==void 0&&(o.color=t.color,o.dirty=!0),t.topColor!==void 0&&(o.topColor=t.topColor,o.dirty=!0),!0}return!1}}s(qb,"updateGroupColor");function $b(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}s($b,"updateGroupShading");function Jb(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}s(Jb,"updateImageProps");function Kb(r,e){var t;if(e!==void 0&&r.type==="geometry"){let i=r.components[1];if(i.height!==e)return i.height=e,i.dirty=!0,((t=r.parent)==null?void 0:t.type)==="geometry-group"&&(r.parent.userData.outlineDirty=!0),!0}return!1}s(Kb,"updateHeight");function Qb(r,e){e!==void 0&&(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&(r.components[1].initialColor=e.initialColor),e.color!==void 0&&(r.components[1].color=e.color),e.topColor!==void 0&&(r.components[1].topColor=e.topColor),r.components[1].dirty=!0)}s(Qb,"updateColor");function em(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(t(e[1],e[0],e[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}s(em,"updatePosition");function tm(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parent!==e&&r.parent instanceof De?((t=r.parent)==null||t.removeEntity(r),e.addEntity(r),!0):!1}s(tm,"updateParent");function e4(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&(r.components[0].enabled=e)}s(e4,"updateEnabled");function t4(r,e){if(e!==void 0&&r.type==="path"){let t=r.components[0];e.completeFraction!==void 0&&(t.completeFraction=e.completeFraction)}}s(t4,"updatePath");function r4(r,e){if(e!==void 0&&r.type==="marker"){let t=r.components[0];if(e.contentHTML!==void 0)return t.containerEl.innerHTML=e.contentHTML,!0}return!1}s(r4,"updateMarker");function i4(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Do(e),!0):!1}s(i4,"updateRank");function n4(r,e){var t,i,n;if(e!==void 0&&r.type==="label"){let o=r.components[0];e.text!==void 0&&(o.text=e.text,o.dirty=!0),((t=e.options)==null?void 0:t.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(Kf(o.appearance,((n=e.options)==null?void 0:n.appearance)||{}),o.dirty=!0)}}s(n4,"updateLabel");function o4(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}s(o4,"updateHoverColor");function rm(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}s(rm,"updateFlipImageToFaceCamera");function yn(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"){r.components[1].visible=e,r.components[1].dirty=!0;let t=r.parent;t instanceof ke&&(t.userData.outlineDirty=!0)}else(r.type==="group-container"||r.type==="geometry-group")&&r.setVisible(e);return!0}return!1}s(yn,"updateVisibility");function a4(r,e,t){if(t!==void 0&&r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=e.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=t,o.components[1].dirty=!0))}r.setOpacity(t),i.opacity=t}}s(a4,"updateOpacity");function s4(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let i=r.components[0];i.detached===!1&&(i.detached=!0,i.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.dirty=!0;let n=r.parent;return(n==null?void 0:n.type)==="geometry-group"&&(n.userData.outlineDirty=!0,n.userData.shadingDirty=!0),!0}}return!1}s(s4,"updateIndividualGeometryOpacity");function im(r,e){e!==void 0&&(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"?(r.components[1].altitude=e,r.components[1].dirty=!0):r.type==="group-container"&&r.setAltitude(e))}s(im,"updateAltitude");function nm(r,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=e,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=e,r.components[1].dirty=!0;let t=r.parent;t instanceof ke&&(t.userData.outlineDirty=!0)}return!0}return!1}s(nm,"updateOutline");m();m();m();m();var am=class am extends gy{constructor(t){let i=t,n=3,o=n*4;super(new Float32Array(t*o),n,t,ay,oy);h(this,"_width");h(this,"_height");h(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(t,i,n){let o=this.image.data,a=t*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(t){let i=this.image.data,n=t*this._width,o=new he(i[n],i[n+1],i[n+2]),a=new he(i[n+4],i[n+5],i[n+6]);return{color:o,topColor:a}}setTexture(t,i,n){let o=this.image.data,a=t*this._width;o[a+8]=i?1:0,o[a+9]=n?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};s(am,"BatchedPropertiesTexture");var gu=am;var l4="#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 c4="#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;\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, vUv).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 Zx=-.05,qx=1,sm=class sm extends nr{constructor(t,i){super(t);h(this,"propertiesTexture");h(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null}});h(this,"showTextures",s(t=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(t,i,n),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new gu(i),this.onBeforeCompile=n=>{let o=this.uniforms.uGradientIntensity,a=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,l=this.uniforms.uTopTexture,p=this.uniforms.uTexture;this.uniforms=n.uniforms,n.vertexShader=l4,n.fragmentShader=c4,Object.assign(this.uniforms,{uGradientIntensity:o,uGradientEnd:a,uGradientStart:c,uMinSideAlpha:{value:Zx},uMaxSideAlpha:{value:qx},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:l,uTexture:p})}}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=er,t.wrapT=er,t.colorSpace=Tr,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=er,t.wrapT=er,t.colorSpace=Tr,this.uniforms.uTopTexture.value=t}setGradientShading(t,i,n){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(t,i,n){this.propertiesTexture.setColor(t,i,n)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}dispose(){super.dispose(),this.propertiesTexture.dispose()}};s(sm,"BatchedStandardMaterial");var Lo=sm;m();function vu(r){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vu(r)}s(vu,"_typeof");var $x=/^\s+/,Jx=/\s+$/;function F(r,e){if(r=r||"",e=e||{},r instanceof F)return r;if(!(this instanceof F))return new F(r,e);var t=Kx(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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=t.ok}s(F,"tinycolor");F.prototype={isDark:s(function(){return this.getBrightness()<128},"isDark"),isLight:s(function(){return!this.isDark()},"isLight"),isValid:s(function(){return this._ok},"isValid"),getOriginalInput:s(function(){return this._originalInput},"getOriginalInput"),getFormat:s(function(){return this._format},"getFormat"),getAlpha:s(function(){return this._a},"getAlpha"),getBrightness:s(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:s(function(){var e=this.toRgb(),t,i,n,o,a,c;return t=e.r/255,i=e.g/255,n=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?c=n/12.92:c=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*c},"getLuminance"),setAlpha:s(function(e){return this._a=y4(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:s(function(){var e=p4(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:s(function(){var e=p4(this._r,this._g,this._b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+i+"%, "+n+"%)":"hsva("+t+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHsvString"),toHsl:s(function(){var e=u4(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:s(function(){var e=u4(this._r,this._g,this._b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+i+"%, "+n+"%)":"hsla("+t+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHslString"),toHex:s(function(e){return h4(this._r,this._g,this._b,e)},"toHex"),toHexString:s(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:s(function(e){return rS(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:s(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:s(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:s(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:s(function(){return{r:Math.round(ye(this._r,255)*100)+"%",g:Math.round(ye(this._g,255)*100)+"%",b:Math.round(ye(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:s(function(){return this._a==1?"rgb("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%)":"rgba("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:s(function(){return this._a===0?"transparent":this._a<1?!1:fS[h4(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:s(function(e){var t="#"+d4(this._r,this._g,this._b,this._a),i=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=F(e);i="#"+d4(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+i+")"},"toFilter"),toString:s(function(e){var t=!!e;e=e||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},"toString"),clone:s(function(){return F(this.toString())},"clone"),_applyModification:s(function(e,t){var i=e.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},"_applyModification"),lighten:s(function(){return this._applyModification(aS,arguments)},"lighten"),brighten:s(function(){return this._applyModification(sS,arguments)},"brighten"),darken:s(function(){return this._applyModification(lS,arguments)},"darken"),desaturate:s(function(){return this._applyModification(iS,arguments)},"desaturate"),saturate:s(function(){return this._applyModification(nS,arguments)},"saturate"),greyscale:s(function(){return this._applyModification(oS,arguments)},"greyscale"),spin:s(function(){return this._applyModification(cS,arguments)},"spin"),_applyCombination:s(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:s(function(){return this._applyCombination(hS,arguments)},"analogous"),complement:s(function(){return this._applyCombination(uS,arguments)},"complement"),monochromatic:s(function(){return this._applyCombination(dS,arguments)},"monochromatic"),splitcomplement:s(function(){return this._applyCombination(pS,arguments)},"splitcomplement"),triad:s(function(){return this._applyCombination(f4,[3])},"triad"),tetrad:s(function(){return this._applyCombination(f4,[4])},"tetrad")};F.fromRatio=function(r,e){if(vu(r)=="object"){var t={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?t[i]=r[i]:t[i]=bs(r[i]));r=t}return F(r,e)};function Kx(r){var e={r:0,g:0,b:0},t=1,i=null,n=null,o=null,a=!1,c=!1;return typeof r=="string"&&(r=vS(r)),vu(r)=="object"&&(Ur(r.r)&&Ur(r.g)&&Ur(r.b)?(e=Qx(r.r,r.g,r.b),a=!0,c=String(r.r).substr(-1)==="%"?"prgb":"rgb"):Ur(r.h)&&Ur(r.s)&&Ur(r.v)?(i=bs(r.s),n=bs(r.v),e=tS(r.h,i,n),a=!0,c="hsv"):Ur(r.h)&&Ur(r.s)&&Ur(r.l)&&(i=bs(r.s),o=bs(r.l),e=eS(r.h,i,o),a=!0,c="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=y4(t),{ok:a,format:r.format||c,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}s(Kx,"inputToRGB");function Qx(r,e,t){return{r:ye(r,255)*255,g:ye(e,255)*255,b:ye(t,255)*255}}s(Qx,"rgbToRgb");function u4(r,e,t){r=ye(r,255),e=ye(e,255),t=ye(t,255);var i=Math.max(r,e,t),n=Math.min(r,e,t),o,a,c=(i+n)/2;if(i==n)o=a=0;else{var l=i-n;switch(a=c>.5?l/(2-i-n):l/(i+n),i){case r:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-r)/l+2;break;case t:o=(r-e)/l+4;break}o/=6}return{h:o,s:a,l:c}}s(u4,"rgbToHsl");function eS(r,e,t){var i,n,o;r=ye(r,360),e=ye(e,100),t=ye(t,100);function a(p,f,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(f-p)*6*y:y<1/2?f:y<2/3?p+(f-p)*(2/3-y)*6:p}if(s(a,"hue2rgb"),e===0)i=n=o=t;else{var c=t<.5?t*(1+e):t+e-t*e,l=2*t-c;i=a(l,c,r+1/3),n=a(l,c,r),o=a(l,c,r-1/3)}return{r:i*255,g:n*255,b:o*255}}s(eS,"hslToRgb");function p4(r,e,t){r=ye(r,255),e=ye(e,255),t=ye(t,255);var i=Math.max(r,e,t),n=Math.min(r,e,t),o,a,c=i,l=i-n;if(a=i===0?0:l/i,i==n)o=0;else{switch(i){case r:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-r)/l+2;break;case t:o=(r-e)/l+4;break}o/=6}return{h:o,s:a,v:c}}s(p4,"rgbToHsv");function tS(r,e,t){r=ye(r,360)*6,e=ye(e,100),t=ye(t,100);var i=Math.floor(r),n=r-i,o=t*(1-e),a=t*(1-n*e),c=t*(1-(1-n)*e),l=i%6,p=[t,a,o,o,c,t][l],f=[c,t,t,a,o,o][l],y=[o,o,c,t,t,a][l];return{r:p*255,g:f*255,b:y*255}}s(tS,"hsvToRgb");function h4(r,e,t,i){var n=[Ut(Math.round(r).toString(16)),Ut(Math.round(e).toString(16)),Ut(Math.round(t).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}s(h4,"rgbToHex");function rS(r,e,t,i,n){var o=[Ut(Math.round(r).toString(16)),Ut(Math.round(e).toString(16)),Ut(Math.round(t).toString(16)),Ut(g4(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}s(rS,"rgbaToHex");function d4(r,e,t,i){var n=[Ut(g4(i)),Ut(Math.round(r).toString(16)),Ut(Math.round(e).toString(16)),Ut(Math.round(t).toString(16))];return n.join("")}s(d4,"rgbaToArgbHex");F.equals=function(r,e){return!r||!e?!1:F(r).toRgbString()==F(e).toRgbString()};F.random=function(){return F.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function iS(r,e){e=e===0?0:e||10;var t=F(r).toHsl();return t.s-=e/100,t.s=bu(t.s),F(t)}s(iS,"_desaturate");function nS(r,e){e=e===0?0:e||10;var t=F(r).toHsl();return t.s+=e/100,t.s=bu(t.s),F(t)}s(nS,"_saturate");function oS(r){return F(r).desaturate(100)}s(oS,"_greyscale");function aS(r,e){e=e===0?0:e||10;var t=F(r).toHsl();return t.l+=e/100,t.l=bu(t.l),F(t)}s(aS,"_lighten");function sS(r,e){e=e===0?0:e||10;var t=F(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),F(t)}s(sS,"_brighten");function lS(r,e){e=e===0?0:e||10;var t=F(r).toHsl();return t.l-=e/100,t.l=bu(t.l),F(t)}s(lS,"_darken");function cS(r,e){var t=F(r).toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,F(t)}s(cS,"_spin");function uS(r){var e=F(r).toHsl();return e.h=(e.h+180)%360,F(e)}s(uS,"_complement");function f4(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=F(r).toHsl(),i=[F(r)],n=360/e,o=1;o<e;o++)i.push(F({h:(t.h+o*n)%360,s:t.s,l:t.l}));return i}s(f4,"polyad");function pS(r){var e=F(r).toHsl(),t=e.h;return[F(r),F({h:(t+72)%360,s:e.s,l:e.l}),F({h:(t+216)%360,s:e.s,l:e.l})]}s(pS,"_splitcomplement");function hS(r,e,t){e=e||6,t=t||30;var i=F(r).toHsl(),n=360/t,o=[F(r)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,o.push(F(i));return o}s(hS,"_analogous");function dS(r,e){e=e||6;for(var t=F(r).toHsv(),i=t.h,n=t.s,o=t.v,a=[],c=1/e;e--;)a.push(F({h:i,s:n,v:o})),o=(o+c)%1;return a}s(dS,"_monochromatic");F.mix=function(r,e,t){t=t===0?0:t||50;var i=F(r).toRgb(),n=F(e).toRgb(),o=t/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 F(a)};F.readability=function(r,e){var t=F(r),i=F(e);return(Math.max(t.getLuminance(),i.getLuminance())+.05)/(Math.min(t.getLuminance(),i.getLuminance())+.05)};F.isReadable=function(r,e,t){var i=F.readability(r,e),n,o;switch(o=!1,n=bS(t),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};F.mostReadable=function(r,e,t){var i=null,n=0,o,a,c,l;t=t||{},a=t.includeFallbackColors,c=t.level,l=t.size;for(var p=0;p<e.length;p++)o=F.readability(r,e[p]),o>n&&(n=o,i=F(e[p]));return F.isReadable(r,i,{level:c,size:l})||!a?i:(t.includeFallbackColors=!1,F.mostReadable(r,["#fff","#000"],t))};var lm=F.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"},fS=F.hexNames=mS(lm);function mS(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}s(mS,"flip");function y4(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}s(y4,"boundAlpha");function ye(r,e){yS(r)&&(r="100%");var t=gS(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}s(ye,"bound01");function bu(r){return Math.min(1,Math.max(0,r))}s(bu,"clamp01");function xt(r){return parseInt(r,16)}s(xt,"parseIntFromHex");function yS(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}s(yS,"isOnePointZero");function gS(r){return typeof r=="string"&&r.indexOf("%")!=-1}s(gS,"isPercentage");function Ut(r){return r.length==1?"0"+r:""+r}s(Ut,"pad2");function bs(r){return r<=1&&(r=r*100+"%"),r}s(bs,"convertToPercentage");function g4(r){return Math.round(parseFloat(r)*255).toString(16)}s(g4,"convertDecimalToHex");function m4(r){return xt(r)/255}s(m4,"convertHexToDecimal");var Yt=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 Ur(r){return!!Yt.CSS_UNIT.exec(r)}s(Ur,"isValidCSSUnit");function vS(r){r=r.replace($x,"").replace(Jx,"").toLowerCase();var e=!1;if(lm[r])r=lm[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Yt.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=Yt.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Yt.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=Yt.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Yt.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=Yt.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Yt.hex8.exec(r))?{r:xt(t[1]),g:xt(t[2]),b:xt(t[3]),a:m4(t[4]),format:e?"name":"hex8"}:(t=Yt.hex6.exec(r))?{r:xt(t[1]),g:xt(t[2]),b:xt(t[3]),format:e?"name":"hex"}:(t=Yt.hex4.exec(r))?{r:xt(t[1]+""+t[1]),g:xt(t[2]+""+t[2]),b:xt(t[3]+""+t[3]),a:m4(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Yt.hex3.exec(r))?{r:xt(t[1]+""+t[1]),g:xt(t[2]+""+t[2]),b:xt(t[3]+""+t[3]),format:e?"name":"hex"}:!1}s(vS,"stringInputToObject");function bS(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}s(bS,"validateWCAG2Parms");var SS=80;function v4(r,e){var c,l;let t=0;for(let p of r)t+=((l=(c=p.components[0])==null?void 0:c.geometry)==null?void 0:l.attributes.position.count)||0;let i=new he(e.color),n=new Lo({color:i,side:wr,opacity:e.opacity||1,transparent:e.opacity!==void 0?e.opacity<1:!1},r.length),o=new mr(r.length,t,0,n),a;for(let p of r)a=p.components[0],!(!(a instanceof Pe)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=p.id,n.setColor(a.instanceIndex,i,e.topColor?new he(e.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}s(v4,"batchGeometries");function cm(r,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let t=new by(r,SS),i=um(e.color.getHexString()),n=new Ll({linewidth:2,color:i,transparent:!0}),o=new Bi(t,n);return o.layers.set(1),o}s(cm,"createOutlines");function um(r){return F(r).darken(30).toRgbString()}s(um,"darkenColorForOutline");m();function b4(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}s(b4,"scrubMaterial");function Ze(r){for(let e=r.children.length-1;e>=0;e--)Ze(r.children[e]);"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(e){b4(e)}):"material"in r&&typeof r.material<"u"&&b4(r.material)}s(Ze,"destroyObject3D");var xs,pm=class pm{constructor(e){h(this,"rendererState");h(this,"dirty",!0);P(this,xs,!0);this.rendererState=e}get geometries3DDirty(){return u(this,xs)}set geometries3DDirty(e){I(this,xs,e)}update(e,t=!1){var o,a;let i=t&&e>=16&&e<=19,n;if(this.geometries3DDirty){for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let l=n.children[0];n.userData.outlineDirty=!1;let p=Mi(n);if(p&&Ze(p),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let f;if(l instanceof mr){let C=[],S,M,v,x;for(let E of n.userData.entities3D)x=this.rendererState.geometry3DMap.get(E),x instanceof ce&&(M=x.components[0],v=x.components[1],M instanceof Pe&&v.visible&&v.outline&&!M.detached&&(S=M==null?void 0:M.geometry,S&&C.push(S)));if(C.length===0||(f=ar(C),!f))continue}else f=l.geometry;let y=cm(f,l.material);y.userData.outlineOfEntityId=n.userData.entityId;let g;for(let C of n.userData.entities3D.values()){let S=this.rendererState.geometry3DMap.get(C);g=S==null?void 0:S.components[0],g instanceof Pe&&((S==null?void 0:S.type)==="geometry"&&!g.detached?(S.components[0].outline=y,(o=n.parent)==null||o.add(y)):(S==null?void 0:S.type)==="geometry"&&g.geometry!=null&&g.material!=null&&g.detached&&(g.outline&&Ze(g.outline),g.outline=cm(g.geometry,g.material),(a=n.parent)==null||a.add(g.outline)))}}this.dirty=!0}this.geometries3DDirty=!1}if((i||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let c=Wt(e,16,19,0,1),l;for(let p of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(p),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let f=Mi(l);if(f&&f.visible){let y=Array.isArray(f.material)?f.material:[f.material];for(let g of y)g.opacity=c}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof Pe&&l.components[0].detached){let f=l.components[0].outline;if(f){let y=Array.isArray(f.material)?f.material:[f.material];for(let g of y)g.opacity=c}}}this.dirty=!1}};xs=new WeakMap,s(pm,"OutlineInterpolationSystem");var Cs=pm;var hm=class hm extends Rt{constructor(t,i=new mn){super();h(this,"visible",!0);h(this,"type","geometry-group");h(this,"components");h(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[i],this.userData.entityId=t}setVisible(t){this.visible=t;let i=Mi(this);i&&(i.visible=t),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t=this.children[0];return t instanceof mr?Object.values(t.userData.entities)[0]:void 0}};s(hm,"GeometryGroupObject3D");var ke=hm;var Ss=class Ss extends Rt{constructor(t){super();h(this,"childrenIds",new Set);h(this,"type","group-container");h(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});h(this,"components",[]);this.userData.entityId=t}addEntity(t){t instanceof Ss?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof Tt?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof ke?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ce&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof Ss?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof Tt?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof ke?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ce&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible=t,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};s(Ss,"GroupContainerObject3D");var De=Ss;m();var S4=!1;function dm(){S4=!0}s(dm,"enableTestMode");var fm=class fm{constructor(e,t=2){h(this,"backgroundAlpha",1);h(this,"backgroundColor",new he);h(this,"width",0);h(this,"height",0);h(this,"options",{});h(this,"renderer");var i,n;try{this.options=e;let o={canvas:e.canvas,alpha:e.alpha||!1,stencil:!1,antialias:typeof e.antialias=="boolean"?e.antialias:!0,outputColorSpace:Tr,powerPreference:"high-performance",preserveDrawingBuffer:!0};S4?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new he,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=t===2?new my(o):new yy(o),this.backgroundColor=new he((i=e.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(n=e.backgroundAlpha)!=null?n:1}catch(o){N.error(o),e.onWebGLRendererError&&e.onWebGLRendererError(o)}}destroy(){var e,t;this.renderer&&((t=(e=this.renderer).dispose)==null||t.call(e))}render(e,t){this.renderer&&(this.renderer.state.reset(),t.layers.enable(0),t.layers.enable(1),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(e,t),this.renderer.state.reset())}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(e,t){b.env.NODE_ENV==="test"||!this.renderer||(this.width=e,this.height=t,this.renderer.setSize(e,t,!1))}setBackgroundColor(e,t){this.backgroundColor=e,this.backgroundAlpha=t}domElement(){var e;return(e=this.renderer)==null?void 0:e.domElement}};s(fm,"Renderer");var Cu=fm;m();m();var M4='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(J(n,typeof e!="symbol"?e+"":e,t),t);function j(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function q(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function z(n,e){let t=e.x,i=e.y,r=e.x+e.w,c=e.y+e.h,h=n.x,f=n.y,y=n.x+n.w,R=n.y+n.h;return t<y&&h<r&&i<R&&f<c}function a(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var k=4,o=class{constructor(e,t,i,r,c){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");let h=typeof window>"u"?2:window.devicePixelRatio;this.userData=typeof c>"u"?null:c,this.x=e-k,this.y=t-k,this.w=i+k*Math.min(h,2),this.h=r+k*Math.min(h,2)}contains(e){return e===this?!1:j(this,e)}intersects(e){return z(this,e)}intersectsPoint(e){return q(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.5)",e.fillRect(this.x,this.y,this.w,this.h)}};var I=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:r}=this.boundary;this.topLeft=new n(new o(e,t,i/2,r/2),this),this.topRight=new n(new o(e+i/2,t,i/2,r/2),this),this.bottomLeft=new n(new o(e,t+r/2,i/2,r/2),this),this.bottomRight=new n(new o(e+i/2,t+r/2,i/2,r/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(a(t,this.topLeft.queryRect(e)),a(t,this.topRight.queryRect(e)),a(t,this.bottomLeft.queryRect(e)),a(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(a(t,this.topLeft.queryPoint(e)),a(t,this.topRight.queryPoint(e)),a(t,this.bottomLeft.queryPoint(e)),a(t,this.bottomRight.queryPoint(e))),t}insert(e){return this.boundary.contains(e)?this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0):!1}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,C=10;function X(n,e,t,i,r,c,h="-1"){let f=1/0,y=1/0,R=-1/0,S=-1/0,K=new o(-C,0,5,t),Q=new o(-C,0,e,5),W=new o(e-5,0,e+C,t),Y=new o(0,t-5,e,t+C),F=Z(e,t,i,r,c),V=[K,Q,W,Y],E=new o(-d,-d,e+d*2,t+d*2);for(let s of n)for(let b=0;b<s.bboxes.length;b++){let{boundingBox:P}=s.bboxes[b],[m,T,u,p]=P,[v,x,_,U]=[s.y-m,s.y+T,s.x-u,s.x+p],B=_,D=v,A=U-_,M=x-v;f=Math.min(f,B)-d,y=Math.min(y,D)-d,R=Math.max(R,B+A)+d,S=Math.max(S,D+M)+d,s.bboxes[b].boundingRect=new o(B,D,A,M)}let g={msgId:h,colliders:new Array(n.length),debug:[]},L=new I(new o(f,y,R-f,S-y)),w;for(let s=0;s<n.length;s++)if(w=n[s],g.colliders[s]=[-1,!1],w.enabled){let[b,P,m]=[1/0,-1,void 0];for(let{index:T,boundingRect:u}of w.bboxes){let p=[];if(p=L.queryRect(u).filter(x=>u.intersects(x)),w.shouldCollideWithScreenEdges&&V.forEach(x=>{u.intersects(x)&&p.push(x)}),u.intersects(F)){g.colliders[s]=[T,!0,u];break}if(p.length<=b&&(m=u,P=T,b=p.length),p.length===0){L.insert(u),g.colliders[s]=[T,!E.contains(u),u];break}}w.rank===5&&m!=null&&(L.insert(m),g.colliders[s]=[P,!E.contains(m),m])}else g.colliders[s]=[-1,!1];return g}function Z(n,e,t,i,r){switch(r){case"top-right":return new o(n-t,0,t,i);case"bottom-left":return new o(0,e-i,t,i);case"bottom-right":return new o(n-t,e-i,t,i);case"top-left":return new o(0,0,t,i)}}function O(n){let e=n[0].map(t=>{let i=t[0].map((r,c)=>({index:c,boundingBox:[r[0],r[1],r[2],r[3]]}));return{enabled:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],bboxes:i}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=O(n.data);self.postMessage(X(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';m();m();m();m();m();function P4(r,e){return e.x+e.w<r.x+r.w&&e.x>r.x&&e.y>r.y&&e.y+e.h<r.y+r.h}s(P4,"contains");m();function w4(r,e){let[t,i]=e;return t>=r.x&&t<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}s(w4,"intersectPoint");m();function T4(r,e){let t=e.x,i=e.y,n=e.x+e.w,o=e.y+e.h,a=r.x,c=r.y,l=r.x+r.w,p=r.y+r.h;return t<l&&a<n&&i<p&&c<o}s(T4,"intersects");m();function zr(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}s(zr,"appendItems");m();var xu=4,mm=class mm{constructor(e,t,i,n,o){h(this,"x");h(this,"y");h(this,"w");h(this,"h");h(this,"userData");let a=typeof window>"u"?2:window.devicePixelRatio;this.userData=typeof o>"u"?null:o,this.x=e-xu,this.y=t-xu,this.w=i+xu*Math.min(a,2),this.h=n+xu*Math.min(a,2)}contains(e){return e===this?!1:P4(this,e)}intersects(e){return T4(this,e)}intersectsPoint(e){return w4(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.5)",e.fillRect(this.x,this.y,this.w,this.h)}};s(mm,"Rectangle");var Re=mm;var gn=class gn{constructor(e,t){h(this,"topLeft");h(this,"topRight");h(this,"bottomLeft");h(this,"bottomRight");h(this,"divided",!1);h(this,"boundary");h(this,"capacity",16);h(this,"objects",[]);h(this,"parent");this.parent=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:n}=this.boundary;this.topLeft=new gn(new Re(e,t,i/2,n/2),this),this.topRight=new gn(new Re(e+i/2,t,i/2,n/2),this),this.bottomLeft=new gn(new Re(e,t+n/2,i/2,n/2),this),this.bottomRight=new gn(new Re(e+i/2,t+n/2,i/2,n/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(zr(t,this.topLeft.queryRect(e)),zr(t,this.topRight.queryRect(e)),zr(t,this.bottomLeft.queryRect(e)),zr(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(zr(t,this.topLeft.queryPoint(e)),zr(t,this.topRight.queryPoint(e)),zr(t,this.bottomLeft.queryPoint(e)),zr(t,this.bottomRight.queryPoint(e))),t}insert(e){return this.boundary.contains(e)?this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0):!1}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};s(gn,"QuadTree");var vr=gn;m();function I4(r,e,t){let i,n,o,a=null,c=0;t||(t={});let l=s(function(){c=t.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)},"later");return function(){let p=Date.now();!c&&t.leading===!1&&(c=p);let f=e-(p-c);return i=globalThis,n=arguments,f<=0||f>e?(a&&(clearTimeout(a),a=null),c=p,o=r.apply(i,n),a||(i=n=null)):!a&&t.trailing!==!1&&(a=setTimeout(l,f)),o}}s(I4,"throttle");function E4(r){return[r.bboxes.map(t=>[t.boundingBox[0],t.boundingBox[1],t.boundingBox[2],t.boundingBox[3]]),r.enabled?1:0,r.rank===5?1:0,r.x,r.y]}s(E4,"packCollider");var vn=!1,MS=150,gm=class gm extends z{constructor(t,i,n=new Worker(URL.createObjectURL(new Blob([M4],{type:"text/javascript"})))){super();h(this,"worker");h(this,"debugContext");h(this,"debugCanvas");h(this,"dirty",!0);h(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);h(this,"visibleCollidersQTree",new vr(new Re(0,0,0,0)));h(this,"interactiveCollidersQTree",new vr(new Re(0,0,0,0)));h(this,"coreState");h(this,"postMessage");h(this,"showCollisionBoxes",s(()=>{vn=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{vn=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));h(this,"currentMsgId","");h(this,"working",!1);h(this,"_postMessage",s(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));h(this,"componentArray",[]);h(this,"update",s((t,i,n="bottom-left")=>{if(this.dirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=new Array(this.coreState.geometry2DIdsInScene.size);let o=0,a;for(let c of this.coreState.geometry2DIdsInScene){let l=this.coreState.geometry2DMap.get(c);l&&(a=l.components[0],this.componentArray[o]=a),o++}this.resize(t,i,n),this.dirty=!1,this.componentArray.sort((c,l)=>l.rank-c.rank)}else this.componentArray.filter(a=>a.collisionDirty===!0).length>0&&this.componentArray.sort((a,c)=>c.rank-a.rank);for(let o=0;o<this.componentArray.length;o++)this.packedMessage&&(this.componentArray[o].collisionDirty||this.packedMessage[0][o]==null?(this.packedMessage[0][o]=E4(this.componentArray[o].toJSON()),this.componentArray[o].collisionDirty=!1):(this.packedMessage[0][o][1]=this.componentArray[o].enabled?1:0,this.packedMessage[0][o][2]=this.componentArray[o].rank===5?1:0,this.packedMessage[0][o][3]=this.componentArray[o].projection.x,this.packedMessage[0][o][4]=this.componentArray[o].projection.y));this.working||this.postMessage()},"update"));h(this,"resolve",s(t=>{if(this.working=!1,this.dirty||!t.data)return;let i=t.data.colliders,n=-1,o=!1,a,c,l;vn&&(this.visibleCollidersQTree=new vr(new Re(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new vr(new Re(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let p=0;p<this.componentArray.length;p++){let f=this.componentArray[p];i[p]==null||!f.enabled||([n,o,a]=i[p],n!==-1&&!o&&a!=null?(l=new Re(a.x,a.y,a.w,a.h,{entityId:f.id}),vn&&this.visibleCollidersQTree.insert(l),c=this.coreState.geometry2DMap.get(f.id),(c==null?void 0:c.components[1])!=null&&this.interactiveCollidersQTree.insert(new Re(a.x,a.y,a.w,a.h,{entityId:f.id})),f.visible===!1&&(f.visible=!0,"visibilityNeedsUpdate"in f&&(f.visibilityNeedsUpdate=!0)),n!==-1&&n!==f.activeStrategyIndex&&(f.activeBoundingBox=l,f.onStrategySelected(n))):(f.visible===!0&&(f.visible=!1,"visibilityNeedsUpdate"in f&&(f.visibilityNeedsUpdate=!0)),n!==-1&&n!==f.activeStrategyIndex&&f.onStrategySelected(n)))}vn&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));h(this,"drawDebug",s(()=>{vn&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));h(this,"destroy",s(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=t,this.debugContext=t.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=I4(this._postMessage,MS,!1),vn?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(t,i,n){this.packedMessage[6]=n,this.packedMessage[5]=i,this.packedMessage[4]=t,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};s(gm,"CollisionSystem");var Su=gm;m();m();m();m();var bm=class bm{constructor(e){h(this,"type");h(this,"event");this.type=0,this.event=e}get timestamp(){return this.event.timeStamp}};s(bm,"Tap");var Mu=bm,Cm=class Cm{constructor(){h(this,"taps",[])}add(e){this.lastPointerDown&&e.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(e)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===1}get isSingleTapWithOneFinger(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===0}get isDoubleTapWithOneFinger(){var e,t;return this.isDoubleTap&&((e=this.taps[0])==null?void 0:e.type)===0&&((t=this.taps[1])==null?void 0:t.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(e){this.taps=this.taps.filter(t=>e-t.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};s(Cm,"TapsController");var Pu=Cm;m();function D4(r){let e=new Set;for(let t of r){let i=t.object;for(;i.parent&&!e.has(i.parent);)i=i.parent,i instanceof De&&i.type==="group-container"&&i.visible&&i.components[1]&&e.add(i)}return Array.from(e)}s(D4,"getUniqueIntersectedGroupContainers");function L4(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}s(L4,"arraysEqual");var _o,xm=class xm extends z{constructor(t,i,n,o){super();h(this,"raycaster",new or);h(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});h(this,"coreState");h(this,"camera");h(this,"cameraPlane");h(this,"_quadtree",new vr(new Re(0,0,0,0)));h(this,"_container");h(this,"lastPointerEvent");h(this,"cursor","grab");h(this,"touchesCount",0);h(this,"hasTouched",!1);P(this,_o,void 0);h(this,"onPointerMoveRaf",s(t=>{this.lastPointerEvent=t,u(this,_o)&&cancelAnimationFrame(u(this,_o)),I(this,_o,requestAnimationFrame(()=>{this.onPointerMove(t)}))},"onPointerMoveRaf"));h(this,"onPointerMove",s(t=>{t.preventDefault(),this.updateInteractionStateIfPanning(t),(t.pointerType!=="touch"||t.pointerType===void 0&&this.hasTouched)&&this.handleHover(t),this.handleCursor()},"onPointerMove"));h(this,"tapsControl",new Pu);h(this,"onPointerDown",s(t=>{t.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:t.timeStamp,clientX:t.clientX,clientY:t.clientY},this.lastPointerEvent=t,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),t.pointerType==="touch"&&(this.tapsControl.add(new Mu(t)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));h(this,"clickTimeout");h(this,"onPointerUp",s(t=>{this.tapsControl.discardOutsideOfWaitWindow(t.timeStamp),this.lastPointerEvent=t,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(t);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)&&(t.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",t),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(t),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",t),this.flush()):this.handleClick(t)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));h(this,"dirty3D",!0);h(this,"cachedHitBoxes",{entities:[],groups:[]});h(this,"ndcPoint",new U);h(this,"debugPanel");h(this,"resize",s(()=>{let{top:t,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[t,i]},"resize"));this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=t,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(t){this._quadtree=t}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let t=this.state.hovered3DEntity.components[2];t&&(t.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(t){let i=t||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i)return;let{entity3D:n,entity2D:o,position:a,groupContainers:c}=this.intersect(i);(this.handle3DEntityHover(n)||this.handle2DEntityHover(o)||this.handle3DContainerHover(c))&&this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:c}),this.handleCursor()}handleCursor(){let t=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=TS(t,n,i);this.cursor!==o&&(this.cursor=o,o==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}handle2DEntityHover(t){let i=this.state.hovered2DEntity!==t;return this.state.hovered2DEntity=t,i}handleClick(t){let i=this.intersect(t);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:t.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let t;for(let i of this.coreState.geometry3DIdsInScene)t=this.coreState.geometry3DMap.get(i),((t==null?void 0:t.type)==="geometry"||(t==null?void 0:t.type)==="model")&&t.components[2]?t.components[0].mesh&&!this.cachedHitBoxes.entities.includes(t.components[0].mesh)&&this.cachedHitBoxes.entities.push(t.components[0].mesh):(t==null?void 0:t.type)==="group-container"&&t.components[1]&&!this.cachedHitBoxes.groups.includes(t)&&this.cachedHitBoxes.groups.push(t);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(t){var S,M;let i=[t.offsetX,t.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(v=>v.intersectsPoint(i)),a=this.state.containerOffset[0],c=this.state.containerOffset[1];this.ndcPoint.x=(t.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((t.clientY-a)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[l]=this.getMouseRayIntersects(),p=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(v=>v.object.visible),[f]=p,y=(S=f==null?void 0:f.instanceId)!=null?S:f==null?void 0:f.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(v=>v.object.visible),C;return g!=null&&g.length>0&&(C=D4(g)),{entity2D:((M=o==null?void 0:o.userData)==null?void 0:M.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:y!=null?this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entities[y]):this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entityId),position:l==null?void 0:l.point,groupContainers:C}}handle3DEntityHover(t){this.state.lastHover!==t&&(this.state.lastHover&&O4(this.state.lastHover,!1),t&&O4(t,!0));let i=this.state.hovered3DEntity!==t;return this.state.hovered3DEntity=t,this.state.lastHover=t,i}handle3DContainerHover(t){let i=!L4(this.state.hovered3DContainers,t);return this.state.hovered3DContainers=t,i}updateInteractionStateIfPanning(t){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(t.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(t.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 t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="white",t.style.padding="10px",document.body.append(t),t.id="interaction-debug-panel",this.debugPanel=t,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(t,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=t,(o=this.debugPanel)==null||o.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};_o=new WeakMap,s(xm,"InteractionSystem");var Ms=xm;function O4(r,e){let t=r.components[2];t&&(t.hover=e,t.dirty=!0)}s(O4,"updateHover");function TS(r,e,t){return e?"grabbing":r?"pointer":t?"grabbing":"grab"}s(TS,"processCursor");m();m();var km=Qt(Am());var Ro={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}}},vP={lightOnDark:{...Ro,text:{...Ro.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Ro.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Ro,text:{...Ro.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Ro.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},bP="LOW_PRIORITY",c5=4,CP=6,xP=20,SP=2.5,MP=2,PP="cover",u5=.5,wP=6.5,p5={heightAbovePolygon:0,appearance:vP.darkOnLight};var xn=class xn{constructor(e,t,i){h(this,"lines",0);h(this,"id");h(this,"rank");h(this,"type","label");h(this,"initialRank");h(this,"contextConfigured",!1);h(this,"fillText");h(this,"newStyle",{});h(this,"opacity",0);h(this,"visibilityNeedsUpdate",!0);h(this,"activeStrategyIndex",-1);h(this,"text");h(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});h(this,"projection",new U);h(this,"_cache",{});h(this,"appearance");h(this,"options");h(this,"visible",!1);h(this,"enabled",!0);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"currentStrategyIndex",-1);h(this,"totalMarkerSize",0);h(this,"dirty",!0);h(this,"collisionDirty",!0);h(this,"lastTextAlign");h(this,"imageHash");h(this,"markerSize",0);h(this,"iconVisible",!1);h(this,"zoomProportion",0);h(this,"dp");h(this,"onStrategySelected",s(e=>{if(this.currentStrategyIndex===e)return;let t=this.strategies[e];t&&t.onStrategySelected(this),this.currentStrategyIndex=e;let i=this.style;this.style=this.newStyle,this.newStyle=i,this.iconVisible||(this.opacity=0,this.visibilityNeedsUpdate=!0)},"onStrategySelected"));var o,a;if(this.id=(o=t.id)!=null?o:q(),this.options=(0,km.default)({},t,p5),this.text=e,this.dp=(c=1)=>c*i.pixelRatio,typeof t.rank=="string")this.rank=Do(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let c=Math.trunc(b.env.NODE_ENV==="test"?xn.testId:xn.testId*10)/10;xn.testId+=.001,this.rank=c,this.initialRank=c}let n=(0,km.default)({},this.options.appearance,p5.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||F(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||F(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||xP,iconPadding:(a=n.marker.iconPadding)!=null?a:MP,iconFit:n.marker.iconFit||PP,iconVisibilityThreshold:n.marker.iconVisibilityThreshold==null?u5:n.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=u5}=this.appearance.marker,t=this.dp();this.zoomProportion<=e&&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(wP)),this.totalMarkerSize=Math.ceil((this.markerSize+SP)/t)}get strategies(){let{width:e,height:t}=this.dimensions,{margin:i}=this.appearance;this.calculateMarkerSize();let n=Math.max(CP,i),o=this.iconVisible?n/2:0,a=[{name:"RIGHT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,t);return[c/2+n,c/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+e+n]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.totalMarkerSize/2+c5,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,t);return[c/2+n,c/2+n,this.totalMarkerSize/2+e+n,this.totalMarkerSize/2+n]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.totalMarkerSize/2-c5,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let c=this.dp();return[t+this.totalMarkerSize/2/c+n,this.totalMarkerSize/2+n,e/2+n,e/2+n]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-this.totalMarkerSize-t/2,this.newStyle.left=-e/2}},{name:bP,getBoundingBox:()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:a}updatePosition(){}disable(){this.visible=!1}toJSON(){return{x:this.projection.x,y:this.projection.y,enabled:this.enabled,id:this.id,rank:this.rank,bboxes:this.strategies.map((e,t)=>({index:t,boundingBox:e.getBoundingBox()})),shouldCollideWithScreenEdges:!1}}destroy(){}};s(xn,"LabelComponent"),h(xn,"testId",0);var Rm=xn,br=Rm;var Nm=class Nm extends z{constructor(){super();h(this,"interpolators",new Map);h(this,"update",s(t=>{for(let[i,n]of this.interpolators)i instanceof Pe?i.setOpacity(n(t)):i instanceof br?i.enabled=n(t):n(t)},"update"))}addEntity3D(t,i){let[n,o,a,c]=i[1];this.interpolators.set(t,l=>Wt(l,n,o,a,c))}addEntity2D(t,i){let[n,o,a]=i[1];this.interpolators.set(t,c=>c<n?o:a)}addAny(t,i){this.interpolators.set(t,i)}destroy(){this.interpolators.clear()}};s(Nm,"ZoomInterpolationSystem");var Au=Nm;m();var Sn=class Sn{constructor(e,t={}){h(this,"id");h(this,"type","marker");h(this,"rank",0);h(this,"initialRank",0);h(this,"options",{});h(this,"projection",new U);h(this,"enabled",!0);h(this,"activeStrategyIndex",-1);h(this,"strategyIndex",-1);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"containerEl");h(this,"contentEl",null);h(this,"contentHtml","");h(this,"style",{top:"0px",left:"0px"});h(this,"dirty",!1);h(this,"collisionDirty",!0);h(this,"visibilityNeedsUpdate",!0);h(this,"visible",!1);h(this,"animation",null);h(this,"currentStrategyIndex",-1);h(this,"onStrategySelected",s((e,t=!1)=>{if(this.currentStrategyIndex===e||t)return;let{width:i,height:n}=this.dimensions,o=-n/2+"px",a=-i/2+"px";switch(this.style.top=o,this.style.left=a,this.options.anchor){case"top":{this.style.top=-n+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-i+"px";break}case"right":{this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));if(this.id=(t==null?void 0:t.id)||q(),this.options=t,typeof t.rank=="string")this.rank=Do(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let n=Math.trunc(b.env.NODE_ENV==="test"?Sn.testId:Sn.testId*10)/10;Sn.testId+=.001,this.rank=n}this.contentHtml=e,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(e,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};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:e,height:t}=this.dimensions;return[{name:"center",getBoundingBox:()=>{let i=t/2,n=t/2,o=e/2,a=e/2;switch(this.options.anchor){case"top":{i=t,n=0;break}case"bottom":{i=0,n=t;break}case"left":{o=e,a=0;break}case"right":{o=0,a=e;break}}return[i,n,o,a]}}]}toJSON(){return{x:this.projection.x,y:this.projection.y,enabled:this.enabled,id:this.id,rank:this.rank,bboxes:this.strategies.map((e,t)=>({index:t,boundingBox:e.getBoundingBox()})),shouldCollideWithScreenEdges:!1}}destroy(){}};s(Sn,"MarkerComponent"),h(Sn,"testId",0);var Et=Sn;m();m();var Mn,Cr,ku,Ru,h5,Ls,Nu,Bu,d5,Fu,f5,_s,Gu,Os,As,Vu,Fm=class Fm{constructor(e){P(this,Ru);P(this,Bu);P(this,Fu);P(this,Mn,null);P(this,Cr,void 0);h(this,"getCurrentSceneGLTF",s(async e=>{let t={onlyVisible:!0,binary:!0,light:!0,scale:1,...e},i=await X(this,Ru,h5).call(this),n=u(this,ku).call(this,t),o=await i.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:t.onlyVisible,binary:t.binary,scale:t.scale}),a;if(o instanceof ArrayBuffer)a=new Blob([o],{type:"application/octet-stream"});else{let c=JSON.stringify(o,null,2);a=new Blob([c],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));P(this,ku,s(e=>{let{scale:t,light:i,onlyVisible:n}=e,o=new El,a=new Ir().setFromObject(u(this,Cr).entityScene);if(u(this,Ls).call(this,u(this,Cr).entityScene,o,n),i){let c=new Ol(16777215,.3*Math.PI);c.position.set(0,Math.max(a.max.x,a.max.y)*t*.5,a.max.y*t*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),o.add(c)}return o},"#getExportedScene"));P(this,Ls,s((e,t,i)=>{e.material&&(e instanceof Hn?X(this,Bu,d5).call(this,e).forEach(n=>t.add(n)):e instanceof Bi&&t.add(X(this,Fu,f5).call(this,e))),e.children.forEach(n=>{(!i||n.visible)&&u(this,Ls).call(this,n,t,i)})},"#processObject3D"));P(this,Nu,s((e,t,i)=>{let n=new xy({color:new he(e),metalness:0});return n.opacity=t,n.transparent=i,n},"#createStandardMaterial"));P(this,_s,s(e=>{let{geometry:t,material:i,position:n,rotation:o,quaternion:a,scale:c}=e;if(!(t!=null&&t.isBufferGeometry))return e;let l=t.attributes.position,p=t.attributes.normal,f=t.attributes.uv;return u(this,Gu).call(this,l,p),u(this,As).call(this,n,c,o,a),f&&u(this,Vu).call(this,f),i!=null&&i.map&&t.type==="PlaneGeometry"&&(e.side=wr),e},"#convertGeometry"));P(this,Gu,s((e,t)=>{let i=new W,n=new W;for(let o=0;o<e.count;o++)i.fromBufferAttribute(e,o),u(this,Os).call(this,i),e.setXYZ(o,i.x,i.y,i.z),t&&(n.fromBufferAttribute(t,o),u(this,Os).call(this,n),t.setXYZ(o,n.x,n.y,n.z))},"#convertAttributes"));P(this,Os,s(e=>{let t=e.y;e.y=e.z,e.z=-t},"#convertVector"));P(this,As,s((e,t,i,n)=>{let o=e.y;e.y=e.z,e.z=-o;let a=t.y;if(t.y=t.z,t.z=a,i instanceof Vn)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let c=n.y;n.set(n.x,n.z,-c,n.w)}},"#convertObjectProperties"));P(this,Vu,s(e=>{for(let t=0;t<e.count;t++){let i=e.getX(t),n=e.getY(t);e.setXY(t,i,n)}},"#convertUVs"));I(this,Cr,e),u(this,Cr).entityScene=e.entityScene,u(this,Cr).geometry3DMap=e.geometry3DMap}destroy(){I(this,Mn,null)}};Mn=new WeakMap,Cr=new WeakMap,ku=new WeakMap,Ru=new WeakSet,h5=s(async function(){if(!u(this,Mn)){let{GLTFExporter:e}=await import("./GLTFExporter-BMU6LTDX.js");I(this,Mn,new e)}return u(this,Mn)},"#getGLTFExporter"),Ls=new WeakMap,Nu=new WeakMap,Bu=new WeakSet,d5=s(function(e){var a,c;let t=[],n=((a=e.userData)!=null&&a.entities?Object.values((c=e.userData)==null?void 0:c.entities):[]).map(l=>u(this,Cr).geometry3DMap.get(l)),o=new Map;return n.forEach(l=>{var C;if(!l||!(l instanceof ce))return;let p=l.components[1],f=l.components[2];if(!p.visible||p.opacity===0)return;let y=f!=null&&f.hover?p.hoverColor||u(this,Cr).hoverColor:p.color,g="".concat(y,"-").concat(p.opacity,"-").concat(Number(p.visible));o.has(g)||o.set(g,[]),(C=o.get(g))==null||C.push(l)}),o.forEach((l,p)=>{let[f,y,g]=p.split("-"),C=l.reduce((x,E)=>{let T=E.components[0];if(T.type==="custom-geometry")return x;let w=T==null?void 0:T.geometry;return w&&x.push(w),x},[]),S=u(this,Nu).call(this,f,Number(y),e.material.transparent),M=ar(C,!0),v=new Me(M,S);v.position.copy(e.position),v.rotation.copy(e.rotation),v.scale.copy(e.scale),v.visible=!!g,u(this,As).call(this,v.position,v.scale,v.rotation,v.quaternion),t.push(u(this,_s).call(this,v))}),t},"#processBatchedMesh"),Fu=new WeakSet,f5=s(function(e){let t=e.geometry.clone(),i=e.material,n=new ti({color:i.color,side:wr});n.opacity=i.opacity,n.transparent=i.transparent;let o=new Bi(t,n);return o.position.copy(e.position),o.rotation.copy(e.rotation),o.scale.copy(e.scale),o.visible=e.visible,u(this,_s).call(this,o)},"#processLineSegments"),_s=new WeakMap,Gu=new WeakMap,Os=new WeakMap,As=new WeakMap,Vu=new WeakMap,s(Fm,"ExporterSystem");var Ds=Fm;m();m();m();m();var Hu={top:0,bottom:0,left:0,right:0};m();m();var TP="gray",IP=.1;function m5(r,e,t){let{color:i=TP,opacity:n=1,altitude:o=0,height:a=IP}=t||{};Array.isArray(n)&&(n=1);let c={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o},center:{x:0,y:0,z:(a+o)/2}},l=new tr,p=r.geometry.coordinates[0].map(C=>{let S=e(C[1],C[0]);return c.min.x=Math.min(c.min.x,S.x),c.min.y=Math.min(c.min.y,S.y),c.max.x=Math.max(c.max.x,S.x),c.max.y=Math.max(c.max.y,S.y),S});l.moveTo(p[0].x,p[0].y),p.slice(1).forEach(C=>l.lineTo(C.x,C.y)),l.lineTo(p[0].x,p[0].y);let f=r.geometry.coordinates.slice(1);l.holes=f.map(C=>{let S=C.map(v=>e(v[1],v[0])),M=new ri;return M.moveTo(S[0].x,S[0].y),S.slice(1).forEach(v=>M.lineTo(v.x,v.y)),M.lineTo(S[0].x,S[0].y),M});let y={bevelEnabled:!1,depth:a},g=new rr(l,y);return g.translate(0,0,o||0),g.userData={style:{color:i,opacity:n}},g}s(m5,"renderPolygonGeometry");m();var EP="gray",DP=.1;function y5(r,e,t){let{color:i=EP,opacity:n=1,altitude:o=0,height:a=DP}=t||{};Array.isArray(n)&&(n=1);let c={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},l={bevelEnabled:!1,depth:a},p=[];r.geometry.coordinates.forEach(y=>{let g=new tr,C=y[0].map(v=>{let x=e(v[1],v[0]);return c.min.x=Math.min(c.min.x,x.x),c.min.y=Math.min(c.min.y,x.y),c.max.x=Math.max(c.max.x,x.x),c.max.y=Math.max(c.max.y,x.y),x});g.moveTo(C[0].x,C[0].y),C.slice(1).forEach(v=>g.lineTo(v.x,v.y)),g.lineTo(C[0].x,C[0].y);let S=y.slice(1);g.holes=S.map(v=>{let x=v.map(T=>e(T[1],T[0])),E=new ri;return E.moveTo(x[0].x,x[0].y),x.slice(1).forEach(T=>E.lineTo(T.x,T.y)),E.lineTo(x[0].x,x[0].y),E});let M=new rr(g,l);p.push(M)});let f=ar(p);return f.translate(0,0,o||0),f.userData={style:{color:i,opacity:n}},f}s(y5,"renderMultiPolygonGeometry");m();m();var Hm=Qt(T5());function I5(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}s(I5,"JSClipperError");I5.prototype=Error.prototype;Hm.default.Error=function(r){throw new I5(r)};var ut=Hm.default;var ST="gray",Xm=new ut.ClipperOffset,tt=100;function E5(r,e,t){let{color:i=ST,opacity:n=1,width:o=1,join:a="round",cap:c="round",height:l=.01,altitude:p=0}=t||{};Array.isArray(n)&&(n=0);let f=[];for(let M=0;M<r.geometry.coordinates.length-1;M++){let v=e(r.geometry.coordinates[M][1],r.geometry.coordinates[M][0]),x=e(r.geometry.coordinates[M+1][1],r.geometry.coordinates[M+1][0]);f.push([v,x])}Xm.AddPaths(f.map(M=>M.map(v=>({X:v.x*tt,Y:v.y*tt}))),a==="round"?ut.JoinType.jsRound:a==="miter"?ut.JoinType.jsMiter:ut.JoinType.jsSquare,c==="round"?ut.EndType.etOpenRound:c==="butt"?ut.EndType.etOpenButt:ut.EndType.etOpenSquare);let y=new ut.PolyTree;Xm.Execute(y,o/2*tt);let g=[],C={bevelEnabled:!1,depth:l};for(let M of y.m_AllPolys){let v=new tr;if(M.IsHole())continue;let x=M.m_polygon;v.moveTo(x[0].X/tt,x[0].Y/tt),x.slice(1).forEach(E=>v.lineTo(E.X/tt,E.Y/tt)),v.lineTo(x[0].X/tt,x[0].Y/tt),v.holes=M.m_Childs.map(E=>{let T=new ri,w=E.m_polygon;return T.moveTo(w[0].X/tt,w[0].Y/tt),w.slice(1).forEach(D=>T.lineTo(D.X/tt,D.Y/tt)),T.lineTo(w[0].X/tt,w[0].Y/tt),T}),g.push(new rr(v,C))}let S=ar(g);return S.translate(0,0,p||0),S.userData={style:{color:i,opacity:n}},Xm.Clear(),S}s(E5,"renderLineStringGeometry");m();var rt=100,MT=.22,PT=.01;function D5(r,e,t={}){let{width:i=MT,height:n=PT,color:o="gray",opacity:a=1,altitude:c=0}=t,l={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+n}},p={bevelEnabled:!1,depth:n},f=new ut.ClipperOffset,y=r.geometry.coordinates.map(M=>M.map(v=>e(v[1],v[0])));f.AddPaths(y.map(M=>M.map(v=>({X:v.x*rt,Y:v.y*rt}))),ut.JoinType.jsMiter,ut.EndType.etOpenRound);let g=new ut.PolyTree;f.Execute(g,i/2*rt);let C=[];for(let M of g.m_AllPolys){let v=new tr;if(M.IsHole())continue;l.min.x=Math.min(l.min.x,M.m_polygon[0].X),l.min.y=Math.min(l.min.y,M.m_polygon[0].Y),l.max.x=Math.max(l.max.x,M.m_polygon[0].X),l.max.y=Math.max(l.max.y,M.m_polygon[0].Y);let x=M.m_polygon;v.moveTo(x[0].X/rt,x[0].Y/rt),x.slice(1).forEach(E=>v.lineTo(E.X/rt,E.Y/rt)),v.lineTo(x[0].X/rt,x[0].Y/rt),v.holes=M.m_Childs.map(E=>{let T=new ri,w=E.m_polygon;return T.moveTo(w[0].X/rt,w[0].Y/rt),w.slice(1).forEach(D=>T.lineTo(D.X/rt,D.Y/rt)),T.lineTo(w[0].X/rt,w[0].Y/rt),T}),C.push(new rr(v,p))}let S=ar(C);return S.translate(0,0,c||0),S.userData={style:{color:o,opacity:a}},f.Clear(),S}s(D5,"renderMultiLineStringGeometry");m();var Ns,Bs,jm=class jm{constructor(e){h(this,"mesh");h(this,"type","model");h(this,"outline");h(this,"geometry");h(this,"material");h(this,"feature");h(this,"instanceIndex",-1);h(this,"visible",!0);h(this,"color",new he);h(this,"position",new W);P(this,Ns,0);P(this,Bs,1);this.feature=e}setOpacity(){}setColor(){}get altitude(){return u(this,Ns)}set altitude(e){this.mesh&&(this.mesh.position.z=e,I(this,Ns,e))}get opacity(){return u(this,Bs)}set opacity(e){var t,i;if(this.mesh){for(let n of this.mesh.children)if(n instanceof Dl){((t=n.userData)==null?void 0:t.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let o=Wt(e,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=o,n.material.transparent=o<1,n.material.needsUpdate=!0}}I(this,Bs,e)}};Ns=new WeakMap,Bs=new WeakMap,s(jm,"ModelComponent");var Ii=jm;function wT(r){let{color:e,opacity:t,topColor:i,texture:n,topTexture:o}=r;return"".concat(e).concat(t).concat(i||"").concat(n||"").concat(o||"")}s(wT,"generateIndex");var TT=1e4,Wm=class Wm extends z{constructor(t,i){super();h(this,"state");h(this,"convertTo3DMapPosition");h(this,"loader");this.state=t,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:t}=await import("./GLTFLoader-5SLMAWGO.js");this.loader=new t}createEntityFromFeature(t,i,n){let o=new Pe(i),a=new ce(o,new jt(n));return a.id=t,a}createModelFromFeature(t,i,n){let o=new Ii(i),a=new ce(o,new jt(n));return a.id=t,a}populateEntityMesh(t,i){let n=t.components[0];n.geometry=i,n.currentHeight=t.components[1].height,n.dirty=!1}async populateModelGroup(t,i,n){let o=new Er,a=new Vn,c=new cy,l=new W,p=new It;return this.loader||await this.getGLTFLoader(),this.loader.load(i,f=>{var C,S,M,v,x,E;f.scene.traverse(T=>{let w=T;if("isMesh"in w&&w.isMesh===!0){let D=new Dl(w.geometry,w.material,t.size);D.userData={entities:{}},p.add(D),n.add(p)}});let y=0,g;for(let T of t.values()){g=this.state.geometry3DMap.get(T);let w=g.components[0],D=g.components[0].feature;w.mesh=p,w.instanceIndex=y;let{x:O,y:B,z:G}=this.convertTo3DMapPosition(D.geometry.coordinates[1],D.geometry.coordinates[0],0);w.position.set(O,B,G),a.set(((C=D.properties.rotation)==null?void 0:C[0])||0,((S=D.properties.rotation)==null?void 0:S[1])||0,((M=D.properties.rotation)==null?void 0:M[2])||0),l.set(((v=D.properties.scale)==null?void 0:v[0])||1,((x=D.properties.scale)==null?void 0:x[1])||1,((E=D.properties.scale)==null?void 0:E[2])||1),c.setFromEuler(a),o.compose(w.position,c,l),p.children.forEach(R=>{let H=R;H.setMatrixAt(y,o),H.userData.entities[y]=g.id}),y++}this.publish("model-loaded")}),p}populateEntityGroup(t){let i,n,o,a;for(let c of t.values())a=this.state.geometry3DMap.get(c),a.components[0]instanceof Pe&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=m5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=y5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=E5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=D5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return t}optimize(t){if(t.visible&&(t instanceof ke||t instanceof De)){for(let o of t.children)this.optimize(o);if(t instanceof De||t.userData.dirty===!1)return;let i={};if(!t.userData.modelURL&&t.userData.dirty)try{this.populateEntityGroup(t.userData.entities3D)}catch(o){N.warn(o)}else t.userData.modelURL&&t.userData.dirty&&(this.populateModelGroup(t.userData.entities3D,t.userData.modelURL,t),t.userData.dirty=!1);let n=0;if(t.userData.dirty){let o=0,a;for(let c of t.userData.entities3D.values()){a=this.state.geometry3DMap.get(c);let l=a.components[0],p=a.components[1];if(l instanceof Pe){o++,o>=TT&&(o=0,n++);let f=wT(p)+n;i[f]===void 0&&(i[f]={style:p,entities:[]}),i[f].entities.push(a)}else l.mesh&&l.mesh.parent!==t&&t.add(l.mesh)}for(let c in i){let l=v4(i[c].entities,i[c].style);t.add(l),t.userData.outlineDirty=!0,t.userData.dirty=!1}}}}update(){this.optimize(this.state.entityScene)}};s(Wm,"MeshCreationAndOptimizationSystem");var Uu=Wm;m();var Ym=class Ym{constructor(e,t){h(this,"state");h(this,"dirty",!0);h(this,"domTree");this.state=e,this.domTree=t}update(){if(this.dirty){let e;for(let t of Array.from(this.domTree.children))if(e=this.state.geometry2DMap.get(t.userData.entityId),e){let i=e.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(t.userData.entityId))&&this.domTree.removeChild(t)}else this.domTree.removeChild(t);for(let t of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(t),e){let i=e.components[0];i instanceof Et&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:e.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};s(Ym,"DOMVisibilitySystem");var zu=Ym;m();var Um=class Um{constructor(e,t){h(this,"state");h(this,"project");this.state=e,this.project=t}update(){let e;for(let t of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(t),e&&this.project(e.components[0].projection,e.position)}};s(Um,"TwoDProjectionSystem");var Zu=Um;m();m();var IT=s(function(){let e,t;return i=>{if((!t||!t)&&(e=document.createElement("canvas"),e.width=500*i,e.height=500*i,e.style.width="500px",e.style.height="500px",t=e.getContext("2d")),!t)throw new Error("Could not get 2D context");return{measureCanvas:e,measureCanvasContext:t}}},"createMeasureCanvasContext")(),L5=s(({text:r,size:e,maxWidth:t,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let c="bold ".concat(e*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=IT(i);l.font=c;let p=[],f=r.split(" "),y=0,g=0,C=0;for(;g<f.length;){let x=f[g];if(y===n&&y>0){p[y-1]+="...";break}if(p[y]==null&&(p[y]=x,g++),f.length===1){p[y]=x;break}if(f[g]==null)break;let{width:E}=l.measureText(p[y]+" "+f[g]);E<=t*i?(p[y]+=" "+f[g],g++):y++}p.forEach(x=>{let{width:E}=l.measureText(x);C=Math.max(E,C)});let S=e*i*o,M=p.length*S;return{maxWidth:C,maxHeight:M,lines:p.length,draw:(x,E,T)=>{p.length===1?(a.strokeText&&x.strokeText(p[0],E,T),x.fillText(p[0],E,T)):(a.strokeText&&(x.strokeText(p[0],E,T-S/2),x.strokeText(p[1],E,T+S/2)),x.fillText(p[0],E,T-S/2),x.fillText(p[1],E,T+S/2))}}},"shaveText");var ET=4.5,DT=2.5,LT=2,_T=5,Fs=2.5;var zm=class zm{constructor(e,t){h(this,"dirty",!1);h(this,"state");h(this,"colliderContext");h(this,"colliderCanvas");h(this,"pinCache",{});h(this,"imagePromiseCache",{});h(this,"imageDimensionsCache",{});h(this,"textCache",{});h(this,"update",s((e,t,i)=>{let n=(e-t)/(i-t),o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let a,c,l,p,f,y;for(let g of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(g),y!=null&&y.components[0]instanceof br&&!y.disposed){if(f=y.components[0],c=f.appearance.marker.foregroundColor,l=f.appearance.marker.backgroundColor,p=f.markerSize,a="".concat(c.active,"-").concat(c.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(p),this.pinCache[a]||this.prepare(f,a,this.colliderContext),f.appearance.marker.icon&&(!f.imageHash||f.dirty)&&this.cacheImage(f),this.textCache[f.id]==null||f.dirty||this.dirty){f.dirty=!1,f.collisionDirty=!0,this.textCache[f.id]={};let{textDrawFn:C,width:S,height:M}=this.processText(f.text,f.appearance.text.size,f.appearance.text.maxWidth,f.appearance.text.numLines,f.appearance.text.lineHeight);["left","center","right"].forEach(x=>{this.textCache[f.id][x]=this.textToCanvas(C,f.appearance.text.size,x,S,M,f.appearance.text.foregroundColor,f.appearance.text.backgroundColor)}),f.dimensions={width:Math.ceil(S/o),height:Math.ceil(M/o)},f.currentStrategyIndex===-1&&(f.currentStrategyIndex=0);let v=f.strategies[f.currentStrategyIndex];if(v){v.onStrategySelected(f);let x=f.style;f.style=f.newStyle,f.newStyle=x}}f.visible&&f.enabled&&(f.zoomProportion=n,this.draw(f,a,this.colliderContext))}this.dirty=!1},"update"));h(this,"processText",s((e,t,i,n,o)=>{let a=this.state.pixelRatio,{draw:c,maxWidth:l,maxHeight:p}=L5({text:e,size:t,pixelRatio:a,maxWidth:i,maxLines:n,lineHeight:o});return{textDrawFn:c,width:l+Fs*a*2,height:p+Fs*a*2}},"processText"));h(this,"textToCanvas",s((e,t,i,n,o,a,c)=>{let l=this.state.pixelRatio,p,f=n,y=o;window.OffscreenCanvas!=null&&!Zf()?p=new OffscreenCanvas(f,y):(p=document.createElement("canvas"),p.width=f,p.height=y,p.style.width=f+"px",p.style.height=y+"px");let g=p.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=i,g.font="bold ".concat(t*l,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=Fs*l,g.fillStyle=a,g.strokeStyle=c;let C=i==="left"?0:i==="center"?f/2:f-Fs*l/2;return e(g,C,(y+Fs*l/2)/2),p},"textToCanvas"));h(this,"cacheImage",s(e=>{if(!e.appearance.marker.icon)return;let t=jb(e.appearance.marker.icon);if(e.imageHash=t,!this.imagePromiseCache[t]){let i=["png","jpg","jpeg"],n=e.appearance.marker.icon.split("?")[0],o=i.some(c=>n.toLowerCase().endsWith(c)),a=new Image;o?a.src=e.appearance.marker.icon:a.src="data:image/svg+xml;base64, ".concat(btoa(e.appearance.marker.icon)),a.onload=()=>{this.imagePromiseCache[t]=a}}},"cacheImage"));h(this,"createPinCanvas",s((e,t,i,n)=>{let o,a=this.state.pixelRatio,c=e.totalMarkerSize*2*a;window.OffscreenCanvas!=null?o=new OffscreenCanvas(c,c):(o=document.createElement("canvas"),o.width=c,o.height=c,o.style.width=c/a+"px",o.style.height=c/a+"px");let l=o.getContext("2d");return l.shadowColor="rgba(0,0,0,0.3)",l.shadowOffsetY=LT*a,l.shadowBlur=_T*a,l.beginPath(),l.arc(c/2,c/2,t/2+DT*a/2,0,2*Math.PI),l.fillStyle=i,l.fill(),l.beginPath(),l.arc(c/2,c/2,t/2,0,2*Math.PI),l.shadowColor="transparent",l.fillStyle=n,l.fill(),o},"createPinCanvas"));h(this,"prepare",s((e,t,i)=>{let n=this.state.pixelRatio;i.lineWidth=4*n;let o=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active),a=this.createPinCanvas(e,e.iconVisible?e.markerSize:ET*n,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[t]=[o,a]},"prepare"));this.state=e,this.colliderCanvas=t,this.colliderContext=t.getContext("2d")}draw(e,t,i){if(!e.visible)return;i.save(),i.globalAlpha=e.opacity;let n=this.state.pixelRatio,o=e.projection.x*n,a=e.projection.y*n,c=e.style.pinVisibility===1?this.pinCache[t][0]:this.pinCache[t][1];if(i.drawImage(c,o-e.totalMarkerSize*n,a-e.totalMarkerSize*n),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imagePromiseCache[e.imageHash]){let l=this.imagePromiseCache[e.imageHash],p=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*n,{iconFit:f}=e.appearance.marker,y=p,g=p,C="".concat(e.imageHash,"_").concat(f);if(this.imageDimensionsCache[C])y=this.imageDimensionsCache[C].width,g=this.imageDimensionsCache[C].height;else{let S=l.width*n,M=l.height*n;if(f==="contain"){let v=Math.sqrt(S**2+M**2),x=p/v;y=S*x,g=M*x}if(f==="cover"){let v=p/S,x=p/M,E=Math.max(v,x);y=S*E,g=M*E}}i.save(),i.beginPath(),i.arc(o,a,p/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(l,o-y/2,a-g/2,y,g),i.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left&&e.style.top&&i.drawImage(this.textCache[e.id][e.style.textAlign],o+e.style.left*n,a+e.style.top*n),i.restore()}};s(zm,"TwoDDrawSystem");var qu=zm;m();m();var Ei=class Ei{constructor(){h(this,"loader");this.loader=new Xn}static getInstance(){return Ei.instance||(Ei.instance=new Ei),Ei.instance}getLoader(){return this.loader}};s(Ei,"TextureLoaderSingleton"),h(Ei,"instance");var Zm=Ei,Fo=Zm.getInstance();function OT(r,e){let t=r.components[2],i=r.components[1];return t!=null&&t.hover?[i.hoverColor||e,i.hoverColor||e]:[i.color,i.topColor||i.color]}s(OT,"processColor");var Gs,qm,$m=class $m extends z{constructor(t){super();P(this,Gs);h(this,"state");h(this,"textureCache",new Map);this.state=t}setShading(t,i){t.material&&t.material.setGradientShading(i.start,i.end,i.intensity)}update(){var a,c,l,p;let t,i,n,o;for(let f of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(f),o instanceof ke&&o.type==="geometry-group"){if(i=o.components[0],o.userData.shadingDirty){let y=o.userData.entities3D.values().next().value,g=this.state.geometry3DMap.get(y);g instanceof ce&&(g.type==="geometry"||g.type==="custom-geometry")&&(t=g.components[0],o.userData.shadingDirty&&i.shading&&this.setShading(t,i.shading));let C,S;for(let M of o.userData.entities3D.values())C=this.state.geometry3DMap.get(M),S=C.components[0],C.type==="geometry"&&S.detached&&o.userData.shadingDirty&&i.shading&&this.setShading(S,i.shading);o.userData.shadingDirty=!1}if(i.dirty){let y=Mi(o);y&&y.material instanceof Ll&&(y.material.color.set(um(i.color)),y.material.needsUpdate=!0),i.dirty=!1}}else if(o instanceof ce&&(o.type==="geometry"||o.type==="custom-geometry")&&((a=o.components[1])!=null&&a.dirty||(c=o.components[2])!=null&&c.dirty)){t=o.components[0],i=o.components[1],n=o.components[2];let y=OT(o,this.state.hoverColor);t.setColor(y[0],y[1]),i.visible!==t.visible&&(t.visible=i.visible),i.altitude!==t.altitude&&(t.altitude=i.altitude),i.opacity!==t.opacity&&(t.opacity=i.opacity),i.dirty=!1,i.texture!==t.texture&&X(this,Gs,qm).call(this,i.texture,t,"texture"),i.topTexture!==t.topTexture&&X(this,Gs,qm).call(this,i.topTexture,t,"topTexture"),(t.texture||t.topTexture)&&(n!=null&&n.hover&&t.texturesVisible?t.hideTextures():t.texturesVisible||t.showTextures()),o.components[2]&&(o.components[2].dirty=!1)}else(o==null?void 0:o.type)==="model"&&((l=o.components[1])!=null&&l.dirty)?(t=o.components[0],i=o.components[1],i.opacity!==t.opacity&&(t.opacity=i.opacity),i.dirty=!1):(o==null?void 0:o.type)==="image"&&((p=o.components[1])!=null&&p.dirty)&&(t=o.components[0],i=o.components[1],i.visible!==t.visible&&(t.visible=i.visible),i.dirty=!1)}destroy(){this.textureCache.forEach(t=>{t.dispose()}),this.textureCache.clear()}};Gs=new WeakSet,qm=s(function(t,i,n){if(!(!t||!i.showTextures)){if(this.textureCache.has(t)){n==="topTexture"?i.topTexture=this.textureCache.get(t):i.texture=this.textureCache.get(t),i.showTextures();return}Fo.getLoader().load(t,o=>{n==="topTexture"?i.topTexture=o:i.texture=o,this.textureCache.set(t,o),i.showTextures(),this.publish("texture-loaded")},void 0,()=>{N.error("Failed to load texture: ".concat(t))})}},"#loadTexture"),s($m,"DrawSystem");var $u=$m;m();var Jm=class Jm extends z{constructor(t){super();h(this,"state");h(this,"animating",new Map);h(this,"isAnimating",!1);h(this,"startTime",-1);h(this,"duration",500);h(this,"update",s(()=>{this.animating.clear();let t,i;for(let n of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(n),t&&(i=t.components[0],i instanceof br&&i.visibilityNeedsUpdate&&(i.visible?this.animating.set(i,i.opacity):(i.opacity=0,i.visibilityNeedsUpdate=!1)));this.startTime=performance.now(),this.publish("animate:2d")},"update"));h(this,"playAnimations");this.state=t,this.playAnimations=this._playAnimations}_playAnimations(){let t=performance.now();for(let[i,n]of this.animating.entries()){let o=(t-this.startTime)/this.duration;i.opacity=Wt(o,0,1,n,1),t-this.startTime>=this.duration&&(i.visible=!0,i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};s(Jm,"TwoDVisibilitySystem");var Ju=Jm;m();var _5=Qt(dn());var Km=class Km extends z{constructor(t,i,n,o,a,c,l){super();h(this,"state");h(this,"renderer");h(this,"mode");h(this,"scene");h(this,"cameraObject");h(this,"viewCamera");h(this,"systems");h(this,"twoDdirty",!0);h(this,"threeDdirty",!0);h(this,"frameId",null);h(this,"twoDFrameId",null);h(this,"animationFrameId",null);h(this,"nextFrame",null);h(this,"update",s((t=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)!=null)if(t)this.commitRenderState(),this.paint();else{if(this.frameId)return;this.frameId=requestAnimationFrame(()=>{var n;((n=this.renderer)==null?void 0:n.renderer)!=null&&this.mode==="standalone"&&(this.commitRenderState(),this.paint())})}},"update"));h(this,"animate2D",s(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));h(this,"drawEntities2D",s(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"drawEntities2D"));h(this,"updateEntities2D",s(()=>{this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));h(this,"commitRenderState",s(()=>{this.frameId=null,_5.default.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),Jf(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.dirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),$f(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.meshOpacitySystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.drawSystem.update(),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position)}),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1},"commitRenderState"));this.renderer=t,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=c,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D)}paint(){var t;(t=this.renderer)!=null&&t.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.dirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};s(Km,"RenderSystem");var Ku=Km;m();var Go,Vs,Qm=class Qm{constructor(e,t){h(this,"type","path");h(this,"mesh",new It);h(this,"material");h(this,"geometry");h(this,"outline");h(this,"feature");h(this,"options");h(this,"nearRadius",.2);h(this,"farRadius",.4);h(this,"color","#ff834c");h(this,"accentColor","blue");P(this,Go,1);h(this,"altitudeAdjustment",1);h(this,"displayArrowsOnPath",!1);h(this,"animateArrowsOnPath",!1);h(this,"dirty",!0);h(this,"position",new W);P(this,Vs,0);var i,n,o,a,c,l;this.feature=e,this.options=t||{},this.color=(i=t==null?void 0:t.color)!=null?i:this.color,this.accentColor=(n=t==null?void 0:t.accentColor)!=null?n:this.accentColor,this.nearRadius=(o=t==null?void 0:t.nearRadius)!=null?o:this.nearRadius,this.farRadius=(a=t==null?void 0:t.farRadius)!=null?a:this.farRadius,this.displayArrowsOnPath=(c=t==null?void 0:t.displayArrowsOnPath)!=null?c:this.displayArrowsOnPath,this.animateArrowsOnPath=(l=t==null?void 0:t.animateArrowsOnPath)!=null?l:this.animateArrowsOnPath}setColor(){}setOpacity(){}set completeFraction(e){I(this,Go,e),this.mesh&&this.mesh.children.forEach(t=>{t.material.uniforms.complete.value=u(this,Go),t.material.needsUpdate=!0})}get completeFraction(){return u(this,Go)}set visible(e){this.mesh&&(this.mesh.visible=e)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return u(this,Vs)}set altitude(e){this.mesh&&(this.mesh.position.z=e,I(this,Vs,e))}set complete(e){this.material&&(this.material.uniforms.complete.value=e,this.material.needsUpdate=!0)}};Go=new WeakMap,Vs=new WeakMap,s(Qm,"PathComponent");var Qu=Qm;m();var e1=class e1{constructor(e){h(this,"rendererState");this.rendererState=e}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(t),e instanceof De&&e.components[0]){let i=e.components[0];if(i.dirty){for(let n of e.children)(n instanceof ke||n instanceof De)&&(n.userData.entityId!==e.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};s(e1,"StackSystem");var ep=e1;m();m();var rp=Qt(dn());m();m();m();var O5=s((r,e)=>(e-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),A5=s((r,e)=>new U(r.clientX-e.offsetLeft,r.clientY-e.offsetTop),"getTouchPos"),t1=s((r,e)=>Math.atan2(e.y-r.y,e.x-r.x),"angle"),Hs=s((r,e)=>Math.sqrt((e.y-r.y)**2+(e.x-r.x)**2),"distance"),r1=s((r,e)=>new U((r.x+e.x)/2,(r.y+e.y)/2),"average"),i1=s(r=>{let e=0,{wheelDelta:t,detail:i}=r;return t!==void 0?e=t:i!==void 0&&(e=-i),e},"getScrollDelta");var n1=class n1{constructor(e,t){h(this,"input1");h(this,"input2");h(this,"lastAngle");h(this,"lastDistance");h(this,"totalDistance");h(this,"first");h(this,"second");this.input1=e,this.input2=t,this.lastAngle=t1(e,t),this.lastDistance=Hs(e,t),this.totalDistance=0,this.first=e,this.second=t}update(e,t){let i=Hs(e,t);this.input1=e,this.input2=t;let n=t1(e,t);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(Hs(this.first,e)+Hs(this.second,t))/2,this.first=r1(this.first,e),this.second=r1(this.second,t)}};s(n1,"InputSet");var tp=n1;m();var o1=class o1{constructor(e,t,i){h(this,"touch");h(this,"camera");h(this,"cameraPlane");h(this,"viewCoordinate");h(this,"snapHolderMatrix");h(this,"snapCamera");h(this,"cameraPosition");h(this,"raycaster");h(this,"worldCoordinate");h(this,"snapshotted",!1);this.touch=e,this.camera=t,this.cameraPlane=i,this.viewCoordinate={x:e.x,y:e.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 e=new U(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new or,this.raycaster.setFromCamera(e,this.snapCamera);let t=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=t&&t.length>0?t[0].point:null,this.snapshotted=!0}updateAnchorState(e,t){this.camera=e,this.snapCamera=e.clone(),this.snapHolderMatrix=e.matrixWorld.clone(),this.updateViewCoordinate(t),this.snapshotCameraState()}updateViewCoordinate(e){this.viewCoordinate={x:e.x,y:e.y}}reUnproject(){var i,n;let e=new U(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(e,this.snapCamera);let t=(n=this.raycaster)==null?void 0:n.intersectObject(this.cameraPlane,!0)[0];return t?t.point:void 0}};s(o1,"TouchAnchor");var Xs=o1;var In,ip,a1=class a1 extends z{constructor(t,i,n,o,a){super();h(this,"dirty",!1);h(this,"zoomDirty",!1);h(this,"zoomSpeed",5);h(this,"rotateSpeed",100);h(this,"enabled",!0);h(this,"enableZoom",!0);h(this,"enablePan",!0);h(this,"enablePedestal",!1);h(this,"maxPedestal",1/0);h(this,"minPedestal",0);h(this,"enableRotate",!0);h(this,"minZoomAltitude",0);h(this,"maxZoomAltitude",1/0);h(this,"ignoreZoomLimits",!1);h(this,"zoomFactor",1);h(this,"panBounds",{min:new W(1/0,1/0),max:new W(-1/0,-1/0),center:new W(0,0,0),radius:1/0});h(this,"minTilt",0);h(this,"maxTilt",1.2);h(this,"MOUSE_BUTTONS",{ORBIT:Il.RIGHT,ZOOM:Il.MIDDLE,PAN:Il.LEFT});h(this,"camera");h(this,"scene");h(this,"renderer");h(this,"elevation");h(this,"orbit");h(this,"cameraPlane");h(this,"raycaster",new or);h(this,"rendererState");h(this,"options");h(this,"state",-1);h(this,"intersection");h(this,"viewState",null);h(this,"tweens",new Set);h(this,"clock",new My(!0));h(this,"coords",{mouse:new U,rotateStart:new U,rotateEnd:new U,rotateDelta:new U,panStart:new W,panCameraStart:new W,panEnd:new W,panDelta:new W,initialShiftPos:new U,initialPedestal:0,floorAnchor:new W});h(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});h(this,"scrollTimer",null);h(this,"lastWheelTime",0);h(this,"resetZoom",!1);h(this,"zoomStart");h(this,"pedestalScaleFactor",1);h(this,"isUserZooming",!1);h(this,"stayInsideBounds",!0);h(this,"userInteracting",!1);h(this,"raycastToFloor",s(t=>{this.raycaster.setFromCamera(t,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new W},"raycastToFloor"));h(this,"isUserInteracting",s(()=>this.userInteracting,"isUserInteracting"));h(this,"getPosition",s(()=>new W(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));h(this,"getPedestal",s(()=>this.orbit.position.z,"getPedestal"));h(this,"pan",s((t,i)=>{isNaN(t)||isNaN(i)||(this.setPosition(this.orbit.position.x+t,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));h(this,"postRender",s(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating()===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));h(this,"isAnimating",s(()=>rp.default.getAll().some(t=>t._mMapAnimation),"isAnimating"));h(this,"isCameraMoving",s(()=>this.state!==-1,"isCameraMoving"));h(this,"setPosition",s((t,i)=>{t===void 0||i===void 0||isNaN(t)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(t,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));h(this,"updateCameraPosition",s((t,i)=>{let n=t-this.panBounds.center.x,o=i-this.panBounds.center.y,a=Math.sqrt(n*n+o*o);if(this.stayInsideBounds&&a>this.panBounds.radius){let c=Math.atan2(o,n),l={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=t,this.orbit.position.y=i},"updateCameraPosition"));h(this,"tilt",s(t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(t+this.getTilt(),this.maxTilt),this.minTilt):t+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));h(this,"zoomIn",s((t,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},t,i,n)},"zoomIn"));h(this,"zoomOut",s((t,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},t,i,n)},"zoomOut"));h(this,"getRotation",s(()=>this.orbit.rotation.z,"getRotation"));h(this,"cancelAnimation",s(()=>{let t=Array.from(this.tweens),i=t[t.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));h(this,"animateCamera",s((t,i,n,o,a,c)=>{let l={mode:au.cancel,...c},p={},f={},y=this.getPosition();if(t.position!=null&&(t.position.x!==void 0&&(p.x=y.x,f.x=t.position.x),t.position.y!==void 0&&(p.y=y.y,f.y=t.position.y),t.position.z!==void 0&&(p.z=y.z,f.z=t.position.z)),t.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?f.zoom=t.zoom:f.zoom=Math.min(Math.max(t.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),t.rotation!==void 0){let T=p.rotation=this.getRotation(),w=t.rotation%(2*Math.PI),D=w-T;if(Math.abs(D)>Math.PI){let O=D<0?1:-1;f.rotation=w+2*Math.PI*O}else f.rotation=w}t.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.tilt=t.tilt:f.tilt=Math.max(Math.min(t.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==f.zoom,C=p.rotation!==f.rotation,S=p.tilt!==f.tilt,M=new rp.default.Tween(p).to(f,b.env.TESTING?0:i).onUpdate(T=>{this.setMulti({x:T.x,y:T.y,z:T.z},T.zoom,T.rotation,T.tilt)}).onComplete(()=>{this.completeTween(M),this.publish("multi-end",{zooming:g,rotating:C,tilting:S}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,M.state=7,this.publish("multi-start",{zooming:g,rotating:C,tilting:S})),this.publish("change")}),v=Array.from(this.tweens),x=v[v.length-1],E=!1;return x!=null&&(l.mode===au.chain?(E=!0,x.chain(M)):(this.completeTween(x),typeof a=="function"&&a(),x=null)),this.tweens.add(M),n?M.easing(n):M.easing(rp.default.Easing.Quadratic.In),!t.doNotAutoStart&&!E&&(M.start(),this.publish("change")),M._mMapAnimation=!0,M},"animateCamera"));h(this,"setMulti",s((t,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;t!=null&&(t.x!==void 0&&!isNaN(t.x)&&t.y!==void 0&&!isNaN(t.y)&&(this.updateCameraPosition(t.x,t.y),c=!0),t.z!==void 0&&!isNaN(t.z)&&(this.setPedestal(t.z,!0),c=!0)),c&&this.publish("position-updated");let l={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;p!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>ms&&(this.camera.near=i-ms,this.camera.far=i+ms):(this.camera.near=i/Eo,this.camera.far=i*Eo),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.orbit.rotation.z&&(l.rotating=!0,this.orbit.rotation.z=n,this.publish("rotation-updated")),o!==void 0&&!isNaN(o)){let p=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;p!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)},"setMulti"));h(this,"getZoomScaledMin",s(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));h(this,"getZoomScaledMax",s(()=>{let t=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,t)},"getZoomScaledMax"));h(this,"setRotation",s((t,i)=>{if(isNaN(t))return;this.state===-1&&!i&&this.publish("rotate-start");let n=t%su;n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setRotation"));h(this,"setZoomAltitude",s(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(t,this.getZoomScaledMin()),this.getZoomScaledMax()):t;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/Eo,this.camera.far=i*Eo,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));h(this,"setZoomLevel",s(t=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(t))},"setZoomLevel"));h(this,"getZoomAltitude",s(()=>this.camera.position.z,"getZoomAltitude"));h(this,"getZoomLevel",s(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));h(this,"rotate",s(t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let i=(this.orbit.rotation.z+t)%su;i!==this.orbit.rotation.z&&(this.orbit.rotation.z=i,this.publish("rotation-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"rotate"));h(this,"setTilt",s((t,i)=>{if(isNaN(t))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(t,this.maxTilt),this.minTilt):t;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));h(this,"getTilt",s(()=>this.elevation.rotation.x,"getTilt"));h(this,"setCameraPlaneElevation",s(t=>{this.cameraPlane.position.z=t},"setCameraPlaneElevation"));h(this,"zoom",s(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-t;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));h(this,"getProjectionScaleFactor",s((t,i,n)=>Qf(t,i,n),"getProjectionScaleFactor"));h(this,"update",s(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));h(this,"setPedestal",s((t,i=!1)=>{typeof t=="number"&&!isNaN(t)&&(this.orbit.position.z=t,i&&(this.publishPedestalChangeEvent(t),this.publish("change")),this.dirty=!0)},"setPedestal"));h(this,"dispose",s(()=>{for(let t of uu)t.endsWith("start")?this.off(t,this.setUserInteracting):t.endsWith("end")&&this.off(t,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));h(this,"createCameraPlane",s(()=>{let t=new Dr(1e10,1e10),i=new ti({color:0,visible:!1}),n=new Me(t,i);return this.scene.add(n),n},"createCameraPlane"));h(this,"addEventListeners",s(()=>{let{domElement:t}=this.renderer;for(let i of uu)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);t.addEventListener("contextmenu",this.onContextMenu,!1),t.addEventListener("mousedown",this.onMouseDown,!1),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));h(this,"addMouseEventListeners",s(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));h(this,"addMouseMoveEventListeners",s(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));h(this,"removeMouseMoveEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));h(this,"removeEventListeners",s(()=>{let{domElement:t}=this.renderer;t.removeEventListener("contextmenu",this.onContextMenu,!1),t.removeEventListener("mousedown",this.onMouseDown,!1),t.removeEventListener("wheel",this.onMouseWheel,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));h(this,"removeMouseUpEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));h(this,"onContextMenu",s(t=>{t.preventDefault()},"onContextMenu"));h(this,"onMouseUp",s(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1}},"onMouseUp"));h(this,"onMouseMove",s(t=>{if(this.enabled!==!1)if(t.preventDefault(),this.mouseToScene(t),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t)}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(t)},"onMouseMove"));h(this,"onTouchStart",s(t=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(t),t.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(t),this.state=9):this.enablePan&&(this.handleTouchStartPan(t),this.state=6);break;case 2:this.touch.inputs=new tp(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));h(this,"onTouchMove",s(t=>{if(this.enabled!==!1)switch(this.touchToScene(t),t.touches.length){case 2:t.preventDefault(),t.stopPropagation();let i={...this.touch.inputs.first},n={...this.touch.inputs.second},o=new U(this.touch.touches[0].x,this.touch.touches[0].y),a=new U(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(t);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=i.y<o.y&&n.y<a.y,l=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(l||c)?(this.handleTouchStartTilt(t),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(t.preventDefault(),t.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(t):this.enablePan&&this.state===6&&this.handleTouchMovePan(t);break;default:this.state=-1}},"onTouchMove"));h(this,"onTouchEnd",s(t=>{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}t.touches.length?this.onTouchStart(t):this.state=-1}},"onTouchEnd"));h(this,"handleTouchMovePan",s(t=>{let i=Object.hasOwn(t,"x")?new U(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panEnd.set(n.x,n.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleTouchMovePan"));h(this,"handleTouchStartDolly",s(()=>{let t=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 U(this.touch.touches[0].x-t/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Xs(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Xs(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("multi-start")},"handleTouchStartDolly"));h(this,"handleMouseMovePan",s(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(t.x,t.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleMouseMovePan"));h(this,"handleTouchStartTilt",s(t=>{this.coords.rotateStart.set(t.touches[1].clientX,t.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));h(this,"handleTouchMovePedestal",s(t=>{this.handleMouseMovePedestal(t.touches[0])},"handleTouchMovePedestal"));h(this,"handleTouchMoveTilt",s(t=>{this.coords.rotateEnd.set(t.touches[1].clientX,t.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));h(this,"handleTouchMoveDolly",s(()=>{let t=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:t.x,y:t.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,t),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));h(this,"handleTouchEnd",s(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")},"handleTouchEnd"));h(this,"handleTouchStartPan",s(t=>{let i=Object.hasOwn(t,"x")?new U(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));h(this,"handleTouchStartPedestal",s(t=>{this.handleMouseDownPedestal(t.touches[0])},"handleTouchStartPedestal"));h(this,"onMouseDown",s(t=>{if(this.enabled!==!1){if(this.mouseToScene(t),t.preventDefault(),this.state===3&&this.publish("zoom-end"),t.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else t.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(t),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));h(this,"onMouseWheel",s(t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(t.preventDefault(),t.stopPropagation(),this.mouseToScene(t),this.canScrollZoom(t)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(t)&&(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(t))},"onMouseWheel"));h(this,"handleMouseWheel",s(t=>{if(this.publish("zoom-start"),!this.canScrollZoom(t)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),n=i-i1(t)*i/Uf*this.zoomSpeed;this.setZoomAltitude(n);let o=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-o),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y),this.publish("change")},"handleMouseWheel"));h(this,"setCameraFromTransformMatrix",s(t=>{this.orbit.updateMatrixWorld();let i=new Vn;i.setFromRotationMatrix(t,"ZYX");let n=(t.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new W(0,0,1);a.applyEuler(i),a.setLength(n);let c=new W;c.setFromMatrixPosition(t),c.sub(a),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(o)},"setCameraFromTransformMatrix"));h(this,"makeTransformFromTouchAnchors",s((t,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=t.worldCoordinate,a=i.worldCoordinate,c=t.reUnproject(),l=i.reUnproject();if(!c||!l||!o||!a)return null;let p=t.viewCoordinate,f=i.viewCoordinate,y=a.x-o.x,g=a.y-o.y,C=Math.atan2(g,y),S=l.x-c.x,M=l.y-c.y,v=Math.atan2(M,S),x=O5(C,v),E=new Er;E.makeRotationZ(-x);let T=E.clone();T.multiply(t.snapHolderMatrix);let w=s((M7,P7,w7)=>M7.elements[(P7-1)*4+w7-1],"m"),D=w(n,1,1)*w(T,1,1)-p.x*w(n,3,4)*w(T,3,1),O=w(n,1,1)*w(T,1,2)-p.x*w(n,3,4)*w(T,3,2),B=w(n,1,1)*w(T,1,3)-p.x*w(n,3,4)*w(T,3,3),G=o.x*D+o.y*O+o.z*B,R=w(n,2,2)*w(T,2,1)-p.y*w(n,3,4)*w(T,3,1),H=w(n,2,2)*w(T,2,2)-p.y*w(n,3,4)*w(T,3,2),j=w(n,2,2)*w(T,2,3)-p.y*w(n,3,4)*w(T,3,3),Q=o.x*R+o.y*H+o.z*j,pe=w(n,1,1)*w(T,1,1)-f.x*w(n,3,4)*w(T,3,1),ge=w(n,1,1)*w(T,1,2)-f.x*w(n,3,4)*w(T,3,2),xe=w(n,1,1)*w(T,1,3)-f.x*w(n,3,4)*w(T,3,3),Ve=a.x*pe+a.y*ge+a.z*xe,kt=w(n,2,2)*w(T,2,1)-f.y*w(n,3,4)*w(T,3,1),ve=w(n,2,2)*w(T,2,2)-f.y*w(n,3,4)*w(T,3,2),Fe=w(n,2,2)*w(T,2,3)-f.y*w(n,3,4)*w(T,3,3),Te=a.x*kt+a.y*ve+a.z*Fe,mt=Math.abs(pe-D),ei=Math.abs(ge-O),yt=Math.abs(xe-B),gt=Math.abs(pe-R),ki=Math.abs(ge-H),Fn=Math.abs(xe-j),ie=Math.abs(kt-D),Ie=Math.abs(ve-O),Se=Math.abs(Fe-B),St=Math.abs(kt-R),Gn=Math.abs(ve-H),ea=Math.abs(Fe-j),Ri=Math.min(mt+ei+yt,gt+ki+Fn),$e=Math.min(ie+Ie+Se,St+Gn+ea);Ri<$e&&(pe=kt,ge=ve,xe=Fe,Ve=Te);let Ni=R*B-D*j,ta=H*B-O*j,wl=Q*B-G*j,ra=pe*j-R*xe,ia=ge*j-H*xe,ey=Ve*j-Q*xe,v7=(ey*ta-wl*ia)/(ra*ta-Ni*ia),b7=(ey*Ni-wl*ra)/(ia*Ni-ta*ra),ty=H*D-O*R,C7=j*D-B*R,x7=Q*D-G*R,ry=ge*R-H*pe,S7=xe*R-j*pe,iy=((Ve*R-Q*pe)*ty-x7*ry)/(S7*ty-C7*ry),Tl=T.clone();return Tl.elements[12]=v7,Tl.elements[13]=b7,Tl.elements[14]=iy,iy>0?Tl:null},"makeTransformFromTouchAnchors"));h(this,"updateTouchOrigin",s(()=>{let t=this.renderer.domElement;this.touch.origin.offsetLeft=t.getBoundingClientRect().left,this.touch.origin.offsetTop=t.getBoundingClientRect().top},"updateTouchOrigin"));h(this,"touchToScene",s(t=>{this.touch.touches=[];for(let i=0,n=t.touches.length;i<n;i++){let o=t.touches[i],a=A5(o,this.touch.origin);this.touch.touches.push(new U(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));h(this,"canScrollZoom",s(t=>{let i=i1(t),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())},"canScrollZoom"));h(this,"mouseToScene",s(t=>{let i=this.getMousePos(t);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));h(this,"getMousePos",s(t=>({x:t.offsetX,y:t.offsetY}),"getMousePos"));h(this,"handleMouseDownRotate",s(t=>{this.coords.rotateStart.set(t.clientX,t.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));h(this,"handleMouseDownPan",s(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(t.x,t.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));h(this,"handleMouseDownPedestal",s(t=>{let i=new U(t.clientX,t.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=Qf(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));h(this,"handleMouseMovePedestal",s(t=>{let i={x:t.clientX,y:t.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)},"handleMouseMovePedestal"));h(this,"handleMouseMoveRotate",s(t=>{this.coords.rotateEnd.set(t.clientX,t.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.rotate(-this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));h(this,"publishUserZoomDebounced",gr(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));h(this,"publishUserZoomEvent",s(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));h(this,"setUserInteracting",s(()=>{this.userInteracting=!0},"setUserInteracting"));h(this,"unsetUserInteracting",s(()=>{this.userInteracting=!1},"unsetUserInteracting"));h(this,"publishPedestalChangeEvent",s(t=>{this.publish("pedestal-change",{pedestal:t,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));h(this,"convertAltitudeToZoomLevel",s(t=>{let[,i]=this.center,o=t*2*Math.tan(ne.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ne.degToRad(i))*2*Math.PI*yr/o;return ne.clamp(Math.log2(a/512),lu,cu)},"convertAltitudeToZoomLevel"));h(this,"convertZoomLevelToAltitude",s(t=>{let[,i]=this.center,n=ne.clamp(t,lu,cu),o=Math.pow(2,n),a=ne.clamp(i,Wf,Yf),c=o*512;return Math.cos(ne.degToRad(a))*Math.PI*2*yr/c*this.options.canvasHeight/2/Math.tan(ne.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));h(this,"completeTween",s(t=>{t.isPlaying?t.stop():t.end(),this.tweens.delete(t)},"completeTween"));P(this,In,{PIXELS:"pixels",PORTIONS:"portions"});P(this,ip,["top","bottom","left","right"]);h(this,"getCameraFrameForPoints",s((t,i,n,o,{canvasWidth:a,canvasHeight:c},l=this.minZoomAltitude,p=this.maxZoomAltitude)=>{Number.isFinite(n)&&(n=1),Number.isFinite(i)&&(i=1),l=Math.max(this.cameraPlane.position.z,l);let f={position:this.getPosition(),zoom:l};if(t==null||t.length===0)return f;o||(o={top:0,bottom:0,left:0,right:0,type:u(this,In).PIXELS});for(let $e of u(this,ip))typeof o[$e]!="number"&&(o[$e]=0);if(o.type||(o.type=u(this,In).PIXELS),o.type===u(this,In).PORTIONS&&(o={top:o.top*c,bottom:o.bottom*c,left:o.left*a,right:o.right*a,type:u(this,In).PIXELS}),o.left+o.right>=a||o.top+o.bottom>=c)return f;this.orbit.updateMatrixWorld();let y=this.camera.matrixWorldInverse,g=this.camera.fov*(Math.PI/180)/2,C=g*n,M=Math.atan(Math.tan(g)*(a/c))*i;if(t.length===1){let $e=t[0].clone();$e.applyMatrix4(y);let Ni=l*Math.tan(M)*2,ta=l*Math.tan(C)*2,wl=(o.left-o.right)/2/a,ra=(o.top-o.bottom)/2/c,ia=new W(-wl*Ni,ra*ta,0);return $e.add(ia),$e.applyMatrix4(this.camera.matrixWorld),f.position.x=$e.x,f.position.y=$e.y,f.position.z=$e.z,f.zoom=Math.max(f.zoom,f.position.z),f}let v=new W(1/0,1/0,1/0),x=new W(-1/0,-1/0,-1/0),E=new Ir().setFromPoints(t),T;for(let $e=0,Ni=t.length;$e<Ni;$e++)T=t[$e].clone(),T.applyMatrix4(y),v.min(T),x.max(T);let w=x.x-v.x,D=x.y-v.y,O=a-o.left-o.right,B=c-o.top-o.bottom,G=(x.x+v.x)/2,R=(x.y+v.y)/2,H=w/O,j=D/B,Q=l,pe=p,ge=Q*Math.tan(M)*2,xe=pe*Math.tan(M)*2,Ve=ge/a,kt=xe/a,ve=Math.max(H,j);ve=ne.clamp(ve,Ve,kt);let Fe=O*ve,Te=B*ve,mt={min:{x:G-Fe/2-o.left*ve,y:R-Te/2-o.bottom*ve},max:{x:G+Fe/2+o.right*ve,y:R+Te/2+o.top*ve}},ei=(mt.min.x+mt.max.x)/2,yt=(mt.min.y+mt.max.y)/2,gt=E.getCenter(new W),ki=Math.abs(ei-mt.min.x),Fn=Math.abs(yt-mt.min.y),ie=ki/Math.tan(M),Ie=Fn/Math.tan(C),Se=new W;Se.set(ei,yt,x.z+Math.max(ie,Ie)),Se.applyMatrix4(this.camera.matrixWorld);let St=new W;St.set(ei,yt,x.z),St.applyMatrix4(this.camera.matrixWorld);let Gn=new W().subVectors(St,Se),ea=(gt.z-Se.z)/Gn.z,Ri=new W().copy(Se).add(Gn.clone().multiplyScalar(ea));return f.position=Ri,St.set(f.position.x,f.position.y,f.position.z),Se.sub(St),f.zoom=Se.length(),f},"getCameraFrameForPoints"));this.camera=t,this.renderer=n,this.rendererState=o,this.scene=i,this.options=a,this.elevation=t.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=t.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(t){this.minZoomAltitude=this.convertZoomLevelToAltitude(t)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(t){this.maxZoomAltitude=this.convertZoomLevelToAltitude(t)}get scrollPercent(){let t=this.minPedestal,i=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,i),n=Math.max(n,t),(n-t)/(i-t)*100}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var o,a,c,l;let t=this.getPosition(),{lat:i,lon:n}=du((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(l=(c=this.rendererState.center)==null?void 0:c[0])!=null?l:0,t.x,t.y);return[n,i]}setCenter(t,i){var a,c,l,p;let{x:n,y:o}=fu((c=(a=this.rendererState.center)==null?void 0:a[1])!=null?c:0,(p=(l=this.rendererState.center)==null?void 0:l[0])!=null?p:0,i,t);this.setPosition(n,o)}focusOn(t,{insetsPadding:i},n={}){let o=n.curve,a=1,c=1,l=n.callback,p=n.cancelledCallback,f=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,y=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,g=this.options.canvasWidth,C=this.options.canvasHeight,S;if(n.duration!==void 0?S=n.duration:b.env.TESTING==="true"?S=0:S=200,i.top!==0||i.bottom!==0||i.left!==0||i.right!==0)if(n.tilt!==void 0&&n.tilt!==this.getTilt()||n.rotation!==void 0&&n.rotation!==this.getRotation())this.animateCamera({position:this.getPosition(),tilt:n.tilt,rotation:n.rotation},S,o,()=>{let M=n.padding||i,v=this.getCameraFrameForPoints(t,a,c,M,{canvasWidth:g,canvasHeight:C},f,y);this.animateCamera({position:v.position,tilt:this.getTilt(),rotation:this.getRotation(),zoom:v.zoom},S,o,l,p)});else{let M=n.padding||i,v=this.getCameraFrameForPoints(t,a,c,M,{canvasWidth:g,canvasHeight:C},f,y);this.animateCamera({position:v.position,tilt:this.getTilt(),rotation:this.getRotation(),zoom:v.zoom},S,o,l,p)}else{let M=n.padding||i,v=this.getCameraFrameForPoints(t,a,c,M,{canvasHeight:C,canvasWidth:g},f,y);this.animateCamera({position:v.position,tilt:n.tilt,rotation:n.rotation,zoom:v.zoom},S,o,l,p)}}resize(t,i){this.options.canvasWidth=t,this.options.canvasHeight=i}};In=new WeakMap,ip=new WeakMap,s(a1,"CameraSystem");var js=a1;m();var AT=300,s1=class s1{constructor(e){h(this,"state");this.state=e}update(e){var o;let t,i,n;for(let a of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(a),t&&(i=t.components[0],n=t.components[1],i instanceof Et&&i.containerEl!=null&&((i.visible===!0||((o=i.animation)==null?void 0:o.pending)===!0)&&(i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.projection.y,"px)")),i.visible===!0?i.containerEl.style.pointerEvents=e||n!=null?"none":"auto":i.containerEl.style.pointerEvents="none",i.visibilityNeedsUpdate&&(i.animation&&i.animation.cancel(),i.animation=i.containerEl.animate([{opacity:i.visible?"1":"0"}],{duration:AT,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)))}};s(s1,"DOMDrawSystem");var np=s1;m();var l1=class l1{constructor(){h(this,"percentExpanded",0);h(this,"activeId","");h(this,"gap",20);h(this,"dirty",!0)}};s(l1,"StackComponent");var op=l1;m();var c1=class c1 extends z{constructor(t,i){super();h(this,"state");h(this,"dirty",!0);h(this,"domTree");h(this,"observers",new Map);h(this,"updateDimensions",s(t=>{t.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 Et&&n.firstElementChild){let{width:c,height:l}=n.firstElementChild.getBoundingClientRect();a.components[0].updateDimensions(c,l)}}}),this.publish("dimensions-update")},"updateDimensions"));this.state=t,this.domTree=i}setupObserver(){var i;if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let t;for(let n of this.domTree.children){let o=n.getAttribute("data-marker-id");if(o!=null&&(t=this.state.geometry2DMap.get(o),(i=t.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 t of this.observers.values())t.disconnect();this.observers.clear()}};s(c1,"DOMResizeSystem");var ap=c1;m();var Ws=Qt(dn());var kT=0,RT=22,NT=0,BT=90;function En(r,e,t,i){return(r<e||r>t)&&N.warn(i),Math.min(t,Math.max(e,r))}s(En,"clampWithWarning");var k5={linear:Ws.default.Easing.Linear.None,"ease-in":Ws.default.Easing.Quadratic.In,"ease-out":Ws.default.Easing.Quadratic.Out,"ease-in-out":Ws.default.Easing.Quadratic.InOut},V,re,Dn,Ys,u1=class u1{constructor(e,t,i,n){P(this,V,void 0);P(this,re,void 0);P(this,Dn,void 0);P(this,Ys,void 0);I(this,V,e),I(this,re,t),I(this,Dn,i),I(this,Ys,n),u(this,re).cameraSystem.on("pedestal-change",({pedestal:o})=>{u(this,V).map&&(u(this,V).map.transform.elevation=o,u(this,V).map.transform.minElevationForCurrentTile=o,u(this,V).map.triggerRepaint()),u(this,re).cameraSystem.setCameraPlaneElevation(o),u(this,Ys).position.z=o})}get center(){return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?u(this,V).map.getCenter().toArray():u(this,re).cameraSystem.center}setCenter(e){var t;if(u(this,V).mode==="outdoors-overlay"&&u(this,V).map){(t=u(this,V).map)==null||t.setCenter(e),u(this,re).interactionSystem.handleHover();return}u(this,re).cameraSystem.setCenter(e[0],e[1]),u(this,re).interactionSystem.handleHover()}get zoomLevel(){var e;return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?(e=u(this,V).map)==null?void 0:e.getZoom():u(this,re).cameraSystem.getZoomLevel()}setZoomLevel(e){var t;u(this,V).mode==="outdoors-overlay"&&u(this,V).map&&((t=u(this,V).map)==null||t.setZoom(e)),u(this,re).cameraSystem.setZoomLevel(En(e,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get maxZoomLevel(){return u(this,re).cameraSystem.maxZoomLevel}get minZoomLevel(){return u(this,re).cameraSystem.minZoomLevel}setMinZoomLevel(e){var i;let t=Math.max(kT,e);u(this,re).cameraSystem.setMinZoomLevel(t),this.zoomLevel<t&&this.setZoomLevel(t),(i=u(this,V).map)==null||i.setMinZoom(t)}setMaxZoomLevel(e){var i;let t=Math.min(RT,e);u(this,re).cameraSystem.setMaxZoomLevel(t),this.zoomLevel>t&&this.setZoomLevel(t),(i=u(this,V).map)==null||i.setMaxZoom(t)}get maxPitch(){var e;return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?(e=u(this,V).map)==null?void 0:e.getMaxPitch():ne.radToDeg(u(this,re).cameraSystem.maxTilt)}get minPitch(){var e;return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?(e=u(this,V).map)==null?void 0:e.getMinPitch():ne.radToDeg(u(this,re).cameraSystem.minTilt)}setMinPitch(e){var i;let t=Math.max(NT,e);(i=u(this,V).map)==null||i.setMinPitch(t),u(this,re).cameraSystem.minTilt=ne.degToRad(t)}setMaxPitch(e){var i;let t=Math.min(BT,e);(i=u(this,V).map)==null||i.setMaxPitch(t),u(this,re).cameraSystem.maxTilt=ne.degToRad(t)}get bearing(){var e;return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?(e=u(this,V).map)==null?void 0:e.getBearing():ne.radToDeg(u(this,re).cameraSystem.getRotation())}setBearing(e){var t;if(u(this,V).mode==="outdoors-overlay"&&u(this,V).map){(t=u(this,V).map)==null||t.setBearing(e);return}u(this,re).cameraSystem.setRotation(ne.degToRad(e))}get pitch(){var e;return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?(e=u(this,V).map)==null?void 0:e.getPitch():ne.radToDeg(u(this,re).cameraSystem.getTilt())}setPitch(e){var t;if(u(this,V).mode==="outdoors-overlay"&&u(this,V).map){(t=u(this,V).map)==null||t.setPitch(e);return}u(this,re).cameraSystem.setTilt(ne.degToRad(En(e,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 u(this,re).cameraSystem.getPedestal()}setElevation(e){u(this,re).cameraSystem.setPedestal(e,!0)}get insetsPadding(){return u(this,Dn).insetsPadding}setInsetPadding(e){u(this,Dn).center&&(u(this,Dn).insetsPadding=e?{...e}:Hu)}animateTo(e){var a;if(u(this,V).mode==="outdoors-overlay"&&u(this,V).map)return(a=u(this,V).map)==null||a.flyTo({center:e.center,zoom:e.zoomLevel,bearing:e.bearing,pitch:e.pitch,duration:e.duration}),Promise.resolve();let t=e.center?u(this,V).convertTo3DMapPosition(e.center[1],e.center[0],0):void 0,i=e.zoomLevel!==void 0?u(this,re).cameraSystem.convertZoomLevelToAltitude(En(e.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=e.bearing!==void 0?ne.degToRad(e.bearing):void 0,o=e.pitch!==void 0?ne.degToRad(En(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;return new Promise(c=>{u(this,re).cameraSystem.animateCamera({position:t,zoom:i,rotation:n,tilt:o},e.duration||0,k5[e.easing||"ease-in-out"],()=>{u(this,re).interactionSystem.handleHover(),c()},c)})}focusOn(e,t){var i,n;return u(this,V).mode==="outdoors-overlay"&&u(this,V).map?(e.length===1?(i=u(this,V).map)==null||i.flyTo({center:e[0],duration:(t==null?void 0:t.duration)||u(this,V).map.getBearing(),animate:!0,bearing:(t==null?void 0:t.bearing)||u(this,V).map.getBearing(),pitch:(t==null?void 0:t.pitch)||u(this,V).map.getPitch(),zoom:(t==null?void 0:t.maxZoomLevel)||u(this,V).map.getMaxZoom()}):(n=u(this,V).map)==null||n.fitBounds(e,{duration:t==null?void 0:t.duration,animate:!0,bearing:(t==null?void 0:t.bearing)||u(this,V).map.getBearing(),pitch:(t==null?void 0:t.pitch)||u(this,V).map.getPitch(),zoom:(t==null?void 0:t.maxZoomLevel)||u(this,V).map.getMaxZoom()}),u(this,re).interactionSystem.handleHover(),Promise.resolve()):new Promise(o=>{u(this,re).cameraSystem.focusOn(e.map(a=>u(this,V).convertTo3DMapPosition(a[1],a[0],a[2]||0)),{insetsPadding:(t==null?void 0:t.padding)||this.insetsPadding},{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:u(this,re).cameraSystem.convertZoomLevelToAltitude(En(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:u(this,re).cameraSystem.convertZoomLevelToAltitude(En(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:(t==null?void 0:t.padding)||{top:0,left:0,bottom:0,right:0},curve:k5[(t==null?void 0:t.easing)||"ease-in-out"],rotation:t!=null&&t.bearing?ne.degToRad(t.bearing):void 0,tilt:(t==null?void 0:t.pitch)!==void 0?ne.degToRad(En(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:()=>{u(this,re).interactionSystem.handleHover(),o()},cancelledCallback:o})})}};V=new WeakMap,re=new WeakMap,Dn=new WeakMap,Ys=new WeakMap,s(u1,"Camera");var sp=u1;m();var R5="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 N5="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 B5=4.291666666666667,F5=15,G5=25,V5=43/60;m();var H5=["horizontal","icon"],VT=new Map([[H5[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>'],[H5[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>']]),HT=/<svg([^>]*)>/g;function X5(r,e,t,i){let n=VT.get(r);return n?n.replace(HT,'<svg$1 width="'.concat(t,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(e,';">')):""}s(X5,"getLogoIcon");var j5=!1,Vo={padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")}},Xe,Ho,Us,Lt,qe,Ln,zt,xr,_t,Zt,p1=class p1 extends z{constructor(t,i,n,o,a){var c,l,p,f,y,g;super();P(this,Xe,void 0);P(this,Ho,void 0);P(this,Us,void 0);P(this,Lt,void 0);P(this,qe,void 0);P(this,Ln,void 0);P(this,zt,0);P(this,xr,0);P(this,_t,0);P(this,Zt,0);h(this,"dirty",!0);h(this,"getPositionAlignedCanvasCoordinates",s((t,i)=>({"top-left":{x:0,y:0},"top-right":{x:t,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:t,y:i},center:{x:t/2,y:i/2},top:{x:t/2,y:0},bottom:{x:t/2,y:i},left:{x:0,y:i/2},right:{x:t,y:i/2}})[u(this,Xe).position],"getPositionAlignedCanvasCoordinates"));h(this,"getPositionAlignedPadding",s(()=>{var n,o,a,c;let t=u(this,Xe).padding;if(typeof t=="number")return{"top-left":{x:t,y:t},"top-right":{x:-t,y:t},"bottom-left":{x:t,y:-t},"bottom-right":{x:-t,y:-t},center:{x:0,y:0},top:{x:0,y:t},bottom:{x:0,y:-t},left:{x:t,y:0},right:{x:-t,y:0}}[u(this,Xe).position];let i={top:(n=t.top)!=null?n:0,right:(o=t.right)!=null?o:0,bottom:(a=t.bottom)!=null?a:0,left:(c=t.left)!=null?c:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));I(this,Xe,{position:(c=a==null?void 0:a.position)!=null?c:Vo.position,padding:(l=a==null?void 0:a.padding)!=null?l:Vo.padding,scale:(p=a==null?void 0:a.scale)!=null?p:Vo.scale,iconOnly:(f=a==null?void 0:a.iconOnly)!=null?f:Vo.iconOnly,color:(y=a==null?void 0:a.color)!=null?y:Vo.color,onClick:(g=a==null?void 0:a.onClick)!=null?g:Vo.onClick}),I(this,Us,t),I(this,Ho,o),I(this,_t,i),I(this,Zt,n)}get color(){return u(this,Xe).color==="light"?"white":"#293136"}get iconName(){return u(this,Xe).iconOnly?"icon":"horizontal"}get minWidth(){return u(this,Xe).iconOnly?F5:75}get defaultWidth(){return u(this,Xe).iconOnly?G5:150}get aspectRatio(){return u(this,Xe).iconOnly?V5:B5}get options(){return{...u(this,Xe)}}set options(t){let{onClick:i,...n}=t;typeof i=="function"&&N.warn("Setting the onClick option is currently unavailable."),Object.assign(u(this,Xe),n)}get icon(){return X5(this.iconName,this.color,u(this,zt)*u(this,Ho).pixelRatio,u(this,xr)*u(this,Ho).pixelRatio)}setSize(t,i){u(this,qe)&&(u(this,qe).uniforms.uSize.value.x=t,u(this,qe).uniforms.uSize.value.y=i)}setXY(t,i){u(this,qe)&&(u(this,qe).uniforms.uSize.value.w=t,u(this,qe).uniforms.uSize.value.z=i)}get width(){return u(this,zt)}get height(){return u(this,xr)}getPositionAlignedOffset(t,i){return{"top-left":{x:0,y:0},"top-right":{x:-t,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-t,y:-i},center:{x:-(t/2),y:-(i/2)},top:{x:-(t/2),y:0},bottom:{x:-(t/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-t,y:-(i/2)}}[u(this,Xe).position]}clampWithWarning(t,i,n,o){return i>=n?(N.warn("Watermark ".concat(o," does not fit within given space.")),i):t<i||t>n?(N.warn("Watermark ".concat(o," must be between ").concat(i," and ").concat(n,".")),ne.clamp(t,i,n)):t}show(){if(!u(this,qe)){N.warn("Watermark material is not initialized.");return}u(this,qe).visible=!0,this.resize(u(this,_t),u(this,Zt))}hide(){if(!u(this,qe)){N.warn("Watermark material is not initialized.");return}u(this,qe).visible=!1,I(this,Ln,void 0)}insertIntoQuadTree(t){u(this,Ln)!=null&&typeof u(this,Xe).onClick=="function"&&t.insert(u(this,Ln))}render(){let t=this.clampWithWarning(this.defaultWidth*u(this,Xe).scale,this.minWidth,u(this,_t),"width");I(this,zt,t),I(this,xr,u(this,zt)/this.aspectRatio),Fo.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),i=>{if(I(this,qe,new oa({uniforms:{uTexture:{value:i},uSize:{value:new ly(0,0,0,0)},uOpacity:{value:.7}},vertexShader:R5,fragmentShader:N5,depthWrite:!1,depthTest:!1,defines:{debug:j5},wireframe:j5,transparent:!0,visible:!0})),u(this,Lt))u(this,Lt).material=u(this,qe),u(this,Lt).material.needsUpdate=!0;else{let n=new Dr(2,2,1,1);I(this,Lt,new Me(n,u(this,qe))),u(this,Lt).position.set(0,0,-1),u(this,Lt).frustumCulled=!1,u(this,Lt).renderOrder=999;let o=new py(1,1,1),a=new Me(o,new ti({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));a.layers.set(1),u(this,Lt).add(a),u(this,Us).add(u(this,Lt))}this.resize(u(this,_t),u(this,Zt)),this.publish("texture-loaded")})}resize(t,i){I(this,_t,t),I(this,Zt,i);let n=this.getPositionAlignedCanvasCoordinates(u(this,_t),u(this,Zt)),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(u(this,zt),u(this,xr)),c=this.clampWithWarning(n.x+o.x+a.x,0,u(this,_t)-u(this,zt),"x"),l=this.clampWithWarning(n.y+o.y+a.y,0,u(this,Zt)-u(this,xr),"y");this.setSize(u(this,zt)/u(this,_t),u(this,xr)/u(this,Zt)),this.setXY(c/u(this,_t),l/u(this,Zt)),I(this,Ln,new Re(c,l,u(this,zt),u(this,xr),{entityId:"watermark"}))}update(){this.dirty&&(this.render(),this.dirty=!1)}};Xe=new WeakMap,Ho=new WeakMap,Us=new WeakMap,Lt=new WeakMap,qe=new WeakMap,Ln=new WeakMap,zt=new WeakMap,xr=new WeakMap,_t=new WeakMap,Zt=new WeakMap,s(p1,"WatermarkSystem");var lp=p1;m();var h1=100,d1=class d1{constructor(e,t){h(this,"currentTotalBoundingBox");h(this,"state");h(this,"cameraSystem");h(this,"dirty",!1);this.state=e,this.cameraSystem=t}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Ir,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new W(0,0,0),new W(h1*2,h1*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(h1))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let e of this.state.geometry2DMap.values())e.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(e.position),e.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new W),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new uy).radius},this.cameraSystem.dirty=!0,this.dirty=!1}}};s(d1,"PanBoundsSystem");var cp=d1;m();var f1="\xA9 Mappedin",WT="https://info.mappedin.com/feedback",m1=["top-left","top-right","bottom-left","bottom-right"],YT=640,UT=s(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),W5={position:"bottom-right"},y1=class y1{constructor(e){h(this,"controlContainerEl");h(this,"controlPositions");h(this,"compact");h(this,"attribContainerEl");h(this,"attribInnerEl");h(this,"attribButtonEl");h(this,"feedbackLinkEl");h(this,"attribHTML",f1);h(this,"toggleAttribution",s(e=>{this.attribContainerEl!=null&&(e.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"),e.appendChild(this.controlContainerEl),this.controlPositions=m1.reduce((t,i)=>{let n=document.createElement("div");return n.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(n),t[i]=n,t},{})}addAttributionControl(e=W5){let t=m1.includes(e.position)?e.position:W5.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(t)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[t].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=UT(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=f1,this.attribContainerEl.appendChild(this.attribInnerEl),this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=WT,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="nofollow noopener noreferrer",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)}updateAttribution(e){if(!e.style||!this.attribInnerEl||!this.attribContainerEl)return;let t=[f1],i=e.style.sourceCaches;for(let o in i){let a=i[o];if(a.used||a.usedForTerrain){let c=a.getSource();c.attribution&&t.indexOf(c.attribution)<0&&t.push(c.attribution)}}t=t.filter(o=>String(o).trim()),t.sort((o,a)=>o.length-a.length),t=t.filter((o,a)=>{for(let c=a+1;c<t.length;c++)if(t[c].indexOf(o)>=0)return!1;return!0});let n=t.join(" ");n!==this.attribHTML&&(this.attribHTML=n,t.length?(this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.classList.remove("outdoor-attrib-empty")):this.attribContainerEl.classList.add("mappedin-attrib-empty"),this.resizeAttribution(e.getCanvasContainer().offsetWidth))}resizeAttribution(e){this.attribContainerEl&&(e<=YT||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(e){this.resizeAttribution(e)}updateData(e){this.updateAttribution(e)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};s(y1,"HTMLControlsSystem");var up=y1;m();var zs,g1=class g1{constructor(e,t){h(this,"mesh");h(this,"type","custom-geometry");h(this,"dirty",!0);h(this,"feature");h(this,"builder");h(this,"outline");h(this,"color",new he);P(this,zs,0);this.mesh=new It,this.feature=e,this.builder=t}get visible(){return this.mesh.visible}set visible(e){this.mesh.visible=e}setOpacity(){}setColor(){}get position(){var e;return(e=this.mesh)==null?void 0:e.position}get altitude(){return u(this,zs)}set altitude(e){this.mesh&&(this.mesh.position.z=e,I(this,zs,e))}};zs=new WeakMap,s(g1,"CustomGeometryComponent");var Xo=g1;m();var v1=class v1{constructor(e){h(this,"state");this.state=e}update(){let e,t;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(e=n.components[0],t=n.components[1],e.dirty&&t.visible!==!1&&(e.builder.setup(e.mesh),e.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),e.dirty=!1),t.visible!==!1&&e.builder.update(e.mesh))}}};s(v1,"CustomGeometrySystem");var pp=v1;m();m();var b1=class b1 extends Me{constructor(){super(...arguments);h(this,"userData",{entityId:""})}};s(b1,"EntityMesh");var hp=b1;function Y5(r){var e,t,i,n,o;return typeof(r==null?void 0:r.properties)=="object"&&typeof((e=r==null?void 0:r.properties)==null?void 0:e.width)=="number"&&typeof((t=r==null?void 0:r.properties)==null?void 0:t.height)=="number"&&((i=r==null?void 0:r.geometry)==null?void 0:i.type)==="Point"&&((o=(n=r==null?void 0:r.geometry)==null?void 0:n.coordinates)==null?void 0:o.length)===2}s(Y5,"validImageFeature");var C1=class C1{constructor(e){h(this,"mesh",new It);h(this,"imageMesh");h(this,"outline");h(this,"type","image");h(this,"instanceIndex",-1);h(this,"geometry");h(this,"material");h(this,"feature");h(this,"position",new W);this.feature=e}get visible(){var e,t;return(t=(e=this.mesh)==null?void 0:e.visible)!=null?t:!1}set visible(e){this.mesh&&(this.mesh.visible=e)}};s(C1,"ImageComponent");var dp=C1;var U5=Math.PI*2,z5=Math.PI/2,Z5=Math.PI*1.5,zT=.01,ZT=!1,x1=class x1 extends z{constructor(t,i){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");this.rendererState=t,this.convertTo3DMapPosition=i}createImageMesh(t,i,n,o=0,a){let c=new nr({transparent:!0,depthWrite:!1,side:wr}),l=new Dr(n.width,n.height),p=new hp(l);if(ZT){let y=new Me(new Dr(n.width,n.height),new nr({color:"gray"}));p.add(y)}p.userData.entityId=t,p.material=c,Fo.getLoader().load(i,y=>{c.map=y,c.map.colorSpace=Tr,c.needsUpdate=!0,this.publish("image-loaded")});let f=this.convertTo3DMapPosition(a);return p.renderOrder=1,p.position.set(f.x,f.y,o+zT),p.rotation.z=ne.degToRad(n.rotation||0),p}flipIfNeeded(t,i){let o=(t.imageMesh.rotation.z-i+U5)%U5;(o>z5&&o<Z5||o<-z5&&o>-Z5)&&(t.imageMesh.rotation.z=t.imageMesh.rotation.z+Math.PI)}update(t){var a,c,l,p,f;let i,n,o;for(let y of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(y),(i==null?void 0:i.type)==="image")n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null&&(n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)),n.imageMesh&&o.flipImageToFaceCamera&&this.flipIfNeeded(n,t);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&&((c=n.feature.properties)==null?void 0:c.image.position)!=null){let g=this.createImageMesh(y,(l=n.feature.properties)==null?void 0:l.image.path,(p=n.feature.properties)==null?void 0:p.image,o.height,(f=n.feature.properties)==null?void 0:f.image.position);n.mesh.parent.add(g),n.imageMesh=g}n.imageMesh&&(o.showImage&&!n.imageMesh.visible?n.imageMesh.visible=!0:!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1),o.flipImageToFaceCamera&&this.flipIfNeeded(n,t))}}};s(x1,"ImageSystem");var fp=x1;m();var qT=!1,Di,S1=class S1 extends z{constructor(t,i){super();h(this,"cameraDirty",!0);h(this,"focusablesDirty",!0);h(this,"state");h(this,"camera");h(this,"debugEl",null);h(this,"raycasters",[]);h(this,"collisions",new Map);h(this,"focusableEntities",new Set);P(this,Di,void 0);h(this,"update",s(()=>{u(this,Di)&&cancelAnimationFrame(u(this,Di)),I(this,Di,requestAnimationFrame(()=>{this.updateRaf()}))},"update"));this.state=t,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let t=new U(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new U(t.x/1.2,t.y/1.2),n=new U(t.x+(t.x-i.x),i.y),o=new U(i.x,t.y+(t.y-i.y)),a=new U(n.x,o.y);this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[t,i,n,o,a].map((c,l)=>{if(qT){let C=document.createElement("div");C.style.position="absolute",C.style.top=c.y+"px",C.style.left=c.x+"px",C.style.width="10px",C.style.height="10px",C.style.backgroundColor="red",this.debugEl.append(C)}let p=c.x/this.state.canvasWidth*2-1,f=-(c.y/this.state.canvasHeight)*2+1,y=new U(p,f),g=new or;return g.setFromCamera(y,this.camera),[g,y,l===0?10:l<5?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let t,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null&&(t=i.components[0],t instanceof Pe&&t.focusable&&t.geometry!=null)){if(t.focusMesh==null){let o=new Me(t.geometry);o.userData={entityId:i.id},t.focusMesh=o}this.focusableEntities.add(t.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",null);return}this.collisions.clear();for(let[o,a]of this.raycasters)o.setFromCamera(a,this.camera);let t=null,i,n=-1/0;for(let[o,a,c]of this.raycasters)o.intersectObjects(Array.from(this.focusableEntities.values())).forEach(p=>{if((p==null?void 0:p.object)!=null&&"isMesh"in p.object&&(p!=null&&p.object.isMesh)){i=p.object.userData.entityId,this.collisions.has(i)||this.collisions.set(i,0);let f=this.collisions.get(i)+c;this.collisions.set(i,f),f>n&&(t=i,n=f)}});this.publish("geometry-in-focus",t),this.cameraDirty=!1}destroy(){u(this,Di)&&cancelAnimationFrame(u(this,Di)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Di=new WeakMap,s(S1,"GeometryInFocusSystem");var mp=S1;m();var M1=class M1{constructor(e){h(this,"dirty",!0);h(this,"map");h(this,"stylesheetId","");h(this,"userHiddenLayers",new Set);h(this,"hiddenLayersInStyle",new Set);h(this,"centerPoint");h(this,"handleRender",s(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let e=[],t=this.map.project(this.centerPoint),i=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});for(var n of i)e.push(["!=",["id"],n.id]);e.length>0&&(this.hiddenLayersInStyle.forEach(o=>{this.map.setFilter(o,["all",...e])}),this.dirty=!1)},"handleRender"));h(this,"handleStyleChange",s(e=>{var t,i;if(this.map&&e&&e.dataType==="style"&&e.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(t=e==null?void 0:e.style)==null?void 0:t.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));e&&(this.map=e,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(e,t){this.centerPoint=e;for(let i of t)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let e of this.userHiddenLayers)this.map.getLayer(e)&&this.hiddenLayersInStyle.add(e)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};s(M1,"OutdoorLayers");var yp=M1;m();m();m();var P1="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 w1='#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 q5="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 QT=new Xn;function $5(r,e){let{nearRadius:t,farRadius:i,color:n,accentColor:o,completeFraction:a}=e,c=!0,l=0,p=1/0,f=e.displayArrowsOnPath,y=!0,g=!0,C=f,M=t/2+.15,v=0;r[0].z+=M;for(let ie=1;ie<r.length;++ie){r[ie].z+=M;let Ie=r[ie].x-r[ie-1].x,Se=r[ie].y-r[ie-1].y,St=r[ie].z-r[ie-1].z;v+=Math.sqrt(Ie*Ie+Se*Se+St*St)}let x=M-.1;r.push(r[r.length-1].clone().setZ(x)),r.unshift(r[0].clone().setZ(x));let E=new sy;C&&(E=QT.load(q5),E.colorSpace=Tr);let T=new he(n),w=new he(o),D={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new U(1,1)},cameraParameters:{type:"v2",value:new U(l,0)},complete:{type:"f",value:c?0:1},color:{type:"c",value:T},pathLength:{type:"f",value:v},nearRadius:{type:"f",value:t},farRadius:{type:"f",value:i},nearZoom:{type:"f",value:l},farZoom:{type:"f",value:p},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:!1},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:E},displayArrowsOnPath:{type:"b",value:f},flattenFactor:{type:"f",value:y?.05:1},showPulse:{type:"b",value:g},opacityMultiplier:{type:"f",value:1}},O=new vy(r);O.curveType="catmullrom",O.tension=0;let B=30,G=8,R=B*r.length,H=new Cy(O,R,t,G,!1),j=new Float32Array(H.attributes.position.count);for(let ie=r.length;ie<j.length;ie++)j[ie]=ie;H.setAttribute("vertexIndex",new na(j,1));let Q=new Float32Array(H.attributes.position.count),pe=new na(Q,1);for(let ie=0;ie<=R;ie++)for(let Ie=0;Ie<=G;++Ie)pe.setX(ie*(G+1)+Ie,ie/R);H.setAttribute("pathDistance",pe);let ge=new Float32Array(H.attributes.normal.count*3),xe=new na(ge,3);for(let ie=0;ie<R;ie++){let Ie=H.tangents[ie];for(let Se=0;Se<=G;++Se)xe.setXYZ(ie*(G+1)+Se,Ie.x,Ie.y,Ie.z)}H.setAttribute("pathTangent",xe);let Ve=new Float32Array(H.attributes.normal.count*3),kt=new na(Ve,3);for(let ie=0;ie<R;ie++){let Ie=H.tangents[ie];var ve,Fe,Te;ve=-Ie.x*Ie.z,Fe=-Ie.y*Ie.z,Te=1-Ie.z*Ie.z;let Se=Math.sqrt(ve*ve+Fe*Fe+Te*Te);Se===0&&(Se=1);let St=ve/Se,Gn=Fe/Se,ea=Te/Se;for(let Ri=0;Ri<=G;++Ri)kt.setXYZ(ie*(G+1)+Ri,St,Gn,ea)}H.setAttribute("pathNormal",kt);let mt=new oa({uniforms:D,vertexShader:P1,fragmentShader:w1});mt.transparent=!0,mt.alphaTest=.5,D.resolution.value.x=1,D.resolution.value.y=1,D.vertexes.value=j.length,D.arrowTexture.value.wrapS=er,D.arrowTexture.value.wrapT=er,D.arrowTexture.value.anisotropy=16,D.complete.value=a;let ei=new Me(H,mt),yt=ei.clone(),gt={...D,opacityMultiplier:{type:"f",value:.25}};gt.complete.value=1,yt.material=new oa({uniforms:gt,vertexShader:P1,fragmentShader:w1}),yt.material.transparent=!0,yt.material.alphaTest=.5,yt.material.depthWrite=!1,yt.material.depthTest=!1,yt.renderOrder=1,gt.resolution.value.x=1,gt.resolution.value.y=1,gt.vertexes.value=j.length,gt.arrowTexture.value.wrapS=er,gt.arrowTexture.value.wrapT=er,gt.arrowTexture.value.anisotropy=16,gt.complete.value=a;let ki=e.mesh;ki.add(ei),ki.add(yt),H.computeBoundingBox();let Fn=new W;return H.boundingBox.getCenter(Fn),{mesh:ki,material:mt,center:Fn}}s($5,"buildPath");var T1=class T1 extends z{constructor(t,i){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");this.rendererState=t,this.convertTo3DMapPosition=i}update(t,i,n){let o,a=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(c),o&&o.type==="path"&&o.components[0].type==="path"){let l=o.components[0];if(l.dirty){l.mesh.parent!=null&&l.mesh.children.forEach(C=>{Ze(C)});let p=l.feature.features.map(C=>C.geometry.coordinates).map(C=>this.convertTo3DMapPosition(C[1],C[0],C[2]||0)),{mesh:f,material:y,center:g}=$5(p,l);l.mesh=f,l.material=y,l.dirty=!1,l.position=g}l.material&&(l.material.uniforms.nearZoom.value=t,l.material.uniforms.farZoom.value=i,l.material.uniforms.cameraParameters.value.x=n,l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,a=!0),l.material.needsUpdate=!0)}a&&this.publish("animate:path")}};s(T1,"PathSystem");var Zs=T1;m();var Be,jo,qt,I1=class I1{constructor(e){h(this,"rendererState");h(this,"dirty",!1);P(this,Be,void 0);P(this,jo,void 0);P(this,qt,void 0);this.rendererState=e}updateOne(e){var t;if(e instanceof ce&&e.components[0]instanceof Pe&&e.components[1]instanceof jt&&e.parent instanceof ke&&(I(this,Be,e.components[0]),I(this,qt,e.components[1]),u(this,Be).detached&&u(this,Be).dirty&&u(this,Be).geometry!=null&&u(this,Be).material!=null)){I(this,jo,e.parent),(t=u(this,Be).mesh)==null||t.setVisibleAt(u(this,Be).instanceIndex,!1);let i=new he(u(this,qt).color),n=new Lo({color:i,side:wr,opacity:u(this,qt).opacity||1,transparent:u(this,qt).opacity!==void 0?u(this,qt).opacity<1:!1},1),o=new mr(1,u(this,Be).geometry.attributes.position.count||0,0,n);o.addGeometry(u(this,Be).geometry),o.userData={entities:{0:e.id}},u(this,Be).instanceIndex=0,u(this,Be).material.setColor(u(this,Be).instanceIndex,i,u(this,qt).topColor?new he(u(this,qt).topColor):i),u(this,Be).mesh=o,u(this,Be).material=n,u(this,jo).add(o),u(this,Be).dirty=!1}}update(){if(!this.dirty)return;let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.dirty=!1,this.cleanup()}cleanup(){I(this,Be,void 0),I(this,jo,void 0),I(this,qt,void 0)}};Be=new WeakMap,jo=new WeakMap,qt=new WeakMap,s(I1,"MeshOpacitySystem");var gp=I1;m();function eI(r,e){let t=r.attributes.uv;for(let i=0;i<t.count;i++){let n=t.getX(i),o=t.getY(i);t.setXY(i,n,o/e)}t.needsUpdate=!0}s(eI,"adjustUVsAfterScaling");var _n,On,E1=class E1{constructor(e){h(this,"rendererState");h(this,"dirty",!1);P(this,_n,void 0);P(this,On,void 0);this.rendererState=e}updateHeight(e,t){var i;if(e.geometry!=null){let n=t||1e-4,o=n/e.currentHeight;e.geometry.scale(1,1,o),eI(e.geometry,1/o),(i=e.mesh)==null||i.setGeometryAt(e.instanceIndex,e.geometry),e.currentHeight=n}}updateOne(e){var t;e instanceof ce&&e.type==="geometry"&&((t=e.components[1])!=null&&t.dirty)&&(I(this,_n,e.components[0]),I(this,On,e.components[1]),e.type==="geometry"&&u(this,On).height!==u(this,_n).currentHeight&&this.updateHeight(u(this,_n),u(this,On).height))}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.cleanup()}cleanup(){I(this,_n,void 0),I(this,On,void 0)}};_n=new WeakMap,On=new WeakMap,s(E1,"MeshModificationSystem");var vp=E1;var J5=new or,O1=18,tI=12,rI=22,A1=0,k1=0;var iI=ne.radToDeg(.698132),pt,Ee,qs,Wo,Li,An,Yo,$s,L1,_,ue,$t,Ce,Sr,At,L,Js,we,me,bp,K5,Cp,Q5,xp,e7,_i,Ks,Qs,Uo,Sp,el,tl,rl,zo,ht,Ot,il,_1,kn,nl,it,nt,R1=class R1 extends z{constructor(t,i={}){var g,C,S,M,v,x,E,T,w,D;super();P(this,$s);P(this,bp);P(this,Cp);P(this,xp);P(this,ht);P(this,il);h(this,"options");h(this,"container");P(this,pt,void 0);P(this,Ee,void 0);P(this,qs,void 0);P(this,Wo,void 0);P(this,Li,void 0);P(this,An,void 0);P(this,Yo,void 0);h(this,"rendererDomElement");P(this,_,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new De("__scene"),hoverColor:"red",insetsPadding:Hu,shouldMeasureCanvas:!0,pixelRatio:Pi(),canvasWidth:0,canvasHeight:0});h(this,"camera");P(this,ue,void 0);P(this,$t,void 0);P(this,Ce,void 0);P(this,Sr,void 0);P(this,At,void 0);P(this,L,{});P(this,Js,window.matchMedia("screen and (min-resolution: 2dppx)"));h(this,"map");P(this,we,s(()=>{u(this,L).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));P(this,me,s(()=>{u(this,L).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));P(this,_i,"standalone");P(this,Ks,s(t=>Math.trunc(t*10)/10,"#round10"));P(this,Qs,s(()=>{u(this,L).twoDDrawSystem.dirty=!0,X(this,$s,L1).call(this,Pi()),u(this,L).watermarkSystem.dirty=!0,this.render()},"#handlePixelRatioChange"));P(this,Uo,s(()=>{u(this,_).canvasWidth=this.rendererDomElement.clientWidth,u(this,_).canvasHeight=this.rendererDomElement.clientHeight,X(this,$s,L1).call(this,Pi()),u(this,zo).call(this),X(this,xp,e7).call(this),u(this,L).cameraSystem.resize(this.canvasWidth,this.canvasHeight),u(this,L).cameraSystem.dirty=!0,u(this,L).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),u(this,L).htmlControlsSystem.resize(this.canvasWidth),u(this,L).geometryInFocusSystem.resize(),u(this,L).interactionSystem.resize(),this.render()},"#handleWindowResize"));P(this,Sp,s(()=>{this.renderSync()},"#renderFull"));P(this,el,new W);P(this,tl,s((t,i)=>{let n=this.mode==="standalone"?u(this,Ee):this.viewCamera;if(u(this,Ee).position.z+this.camera.elevation>i.z){u(this,el).copy(i);let o=u(this,el).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,c=(-o.y+1)/2*this.canvasHeight-0/2,l=u(this,Ks).call(this,a),p=u(this,Ks).call(this,c);t.x=l,t.y=p}else t.x=-1e3,t.y=-1e3},"#project"));P(this,rl,s((t,i)=>{u(this,At).setBufferSize(t,i),u(this,Ee).aspect=t/i,u(this,Ee).updateProjectionMatrix(),u(this,Ee).updateMatrixWorld(!0),u(this,Wo).x=t,u(this,Wo).y=i},"#setBufferSize"));P(this,zo,s(()=>{var a;let t=u(this,_).canvasWidth=this.rendererDomElement.clientWidth,i=u(this,_).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(t*this.resolutionScale),o=Math.floor(i*this.resolutionScale);u(this,rl).call(this,n,o),(a=this.map)==null||a.resize(),u(this,_).shouldMeasureCanvas=!1},"#measureCanvas"));h(this,"showCollisionBoxes",s(()=>{u(this,L).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{u(this,L).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));h(this,"projectScreenXYToCoordinate",s((t,i)=>{var l;let n=t/this.canvasWidth*2-1,o=-(i/this.canvasHeight)*2+1,a=new U(n,o);J5.setFromCamera(a,u(this,Ee).clone());let c=(l=J5.intersectObject(u(this,Li),!1)[0])==null?void 0:l.point;return c!=null?this.convert3DMapPositionToCoordinate(c):void 0},"projectScreenXYToCoordinate"));h(this,"projectCoordinateToScreenXY",s(t=>{let i=this.convertTo3DMapPosition(t[1],t[0],t[2]||0),n=new U;return u(this,tl).call(this,n,i),{x:n.x,y:n.y}},"projectCoordinateToScreenXY"));h(this,"convert3DMapPositionToCoordinate",s(t=>{var o,a,c,l;let{lat:i,lon:n}=du((a=(o=u(this,_).center)==null?void 0:o[1])!=null?a:0,(l=(c=u(this,_).center)==null?void 0:c[0])!=null?l:0,t.x,t.y);return[n,i]},"convert3DMapPositionToCoordinate"));h(this,"setBackgroundColor",s((t,i)=>{u(this,At).setBackgroundColor(t,i)},"setBackgroundColor"));h(this,"getMetresPerPixel",s(()=>{let t=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i),o=this.projectScreenXYToCoordinate(t,i);return n==null||o==null?void 0:Yb(n,o)/t},"getMetresPerPixel"));h(this,"hideOutdoorLayersUnderPoint",s((t,i)=>{!this.map||(i==null?void 0:i.length)===0||(u(this,L).outdoorLayersSystem.hideLayersUnderPoint(t,i),this.render())},"hideOutdoorLayersUnderPoint"));P(this,kn,new fy);P(this,nl,new Er);h(this,"render",s(()=>{u(this,L).renderSystem!=null&&(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay")?this.map.triggerRepaint():u(this,L).renderSystem.update())},"render"));h(this,"renderSync",s(()=>{u(this,L).renderSystem.update(!0)},"renderSync"));P(this,it,gr(()=>{this.publish("user-interaction-start",void 0)},0,!0));P(this,nt,gr(()=>{this.publish("user-interaction-end",void 0)},0,!0));h(this,"on",s((t,i)=>{super.on(t,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(t)&&this.mode==="standalone"&&b.env.NODE_ENV!=="test"&&(N.warn('"'.concat(t,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(t))},"on"));h(this,"off",s((t,i)=>{super.off(t,i)},"off"));h(this,"getCursor",s(()=>u(this,L).interactionSystem.getCursor(),"getCursor"));h(this,"destroy",s(()=>{u(this,L).cameraSystem.off("user-dolly-start",u(this,it)),u(this,L).cameraSystem.off("user-pan-start",u(this,it)),u(this,L).cameraSystem.off("user-rotate-start",u(this,it)),u(this,L).cameraSystem.off("user-zoom-start",u(this,it)),u(this,L).cameraSystem.off("user-tilt-start",u(this,it)),u(this,L).cameraSystem.off("user-pedestal-start",u(this,it)),u(this,L).cameraSystem.off("user-dolly-end",u(this,nt)),u(this,L).cameraSystem.off("user-pan-end",u(this,nt)),u(this,L).cameraSystem.off("user-rotate-end",u(this,nt)),u(this,L).cameraSystem.off("user-zoom-end",u(this,nt)),u(this,L).cameraSystem.off("user-tilt-end",u(this,nt)),u(this,L).cameraSystem.off("user-pedestal-end",u(this,nt)),u(this,L).renderSystem.off("measure-canvas",u(this,zo)),this.remove("__scene"),u(this,we).call(this),u(this,me).call(this),this.renderSync(),u(this,L).renderSystem.destroy(),u(this,L).zoomInterpolationSystem.destroy(),u(this,L).renderSystem.destroy(),u(this,L).cameraSystem.off("change",this.render),u(this,L).pathSystem.off("animate:path",this.render),u(this,L).cameraSystem.dispose(),u(this,L).exporterSystem.destroy(),u(this,L).outdoorLayersSystem.destroy(),u(this,L).drawSystem.destroy(),window.removeEventListener("resize",u(this,Uo),!1),u(this,Js).removeEventListener("change",u(this,Qs)),u(this,An)&&u(this,An).disconnect(),this._subscribers={},u(this,At).destroy(),u(this,pt).traverse(t=>{Ze(t),"dispose"in t&&typeof t.dispose=="function"&&t.dispose()}),I(this,pt,void 0),u(this,L).htmlControlsSystem.destroy(),u(this,L).collisionSystem.destroy(),u(this,L).domMutationSystem.destroy(),u(this,L).geometryInFocusSystem.destroy(),I(this,L,void 0),u(this,_i)!=="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(u(this,Sr)),this.container.removeChild(u(this,ue)),I(this,At,void 0)},"destroy"));this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(I(this,_i,i.mode),this.map=i.map),u(this,_).entityScene.addEventListener("childadded",()=>{u(this,me).call(this),u(this,we).call(this)}),u(this,_).entityScene.addEventListener("childremoved",()=>{u(this,me).call(this),u(this,we).call(this)}),u(this,_).geometry3DMap.set(u(this,_).entityScene.userData.entityId,u(this,_).entityScene),i.center&&(u(this,_).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=t,X(this,bp,K5).call(this),X(this,Cp,Q5).call(this),u(this,L).htmlControlsSystem=new up(this.container),u(this,_i)!=="outdoors-overlay"&&u(this,L).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),b.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),I(this,At,new Cu({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(),u(this,we).call(this),u(this,me).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(C=i.backgroundAlpha)!=null?C:1})),I(this,pt,new El),u(this,pt).add(u(this,_).entityScene);let n=window.__THREE_DEVTOOLS__;b.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:u(this,pt)})),n.dispatchEvent(new CustomEvent("observe",{detail:u(this,At)}))),I(this,Ee,new dy(iI,this.aspect,50,1e5)),I(this,qs,new hy),u(this,Ee).renderOrder=999;let o=new Rt;o.add(u(this,Ee)),I(this,Yo,new Rt),u(this,Yo).add(o),u(this,pt).add(u(this,Yo)),u(this,Ee).updateProjectionMatrix(),u(this,Ee).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=u(this,At).domElement(),I(this,Wo,new U);let a=new Dr(1e6,1e6),c=new ti({color:0,visible:!1});I(this,Li,new Me(a,c)),u(this,pt).add(u(this,Li)),(S=i.gl)!=null&&S.canvas||t.appendChild(this.rendererDomElement),window.addEventListener("resize",u(this,Uo),!1),u(this,Js).addEventListener("change",u(this,Qs)),typeof ResizeObserver=="function"&&((M=b.env)==null?void 0:M.NODE_ENV)!=="test"&&(I(this,An,new ResizeObserver(gr(()=>{u(this,Uo).call(this)},0))),(v=u(this,An))==null||v.observe(t)),t.classList.add("mappedin-map"),this.rendererDomElement.style.width=(x=globalThis.MappedinDebug)!=null&&x.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(E=globalThis.MappedinDebug)!=null&&E.TEST_IOS?"1920px":"100%",b.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),u(this,_).canvasWidth=this.rendererDomElement.clientWidth,u(this,_).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,p=this.canvasHeight;u(this,L).watermarkSystem=new lp(u(this,Ee),l,p,u(this,_),i==null?void 0:i.watermark),u(this,L).watermarkSystem.on("texture-loaded",this.render),u(this,_).shouldMeasureCanvas=!0,u(this,_).pixelRatio=this.resolutionScale,u(this,rl).call(this,Math.floor(l*this.resolutionScale),Math.floor(p*this.resolutionScale));let f=new Ol(16777215,.3*Math.PI);f.position.set(-150,-150,350),u(this,pt).add(f);let y=new Sy(16777215,.741*Math.PI);u(this,pt).add(y),u(this,L).cameraSystem=new js(u(this,Ee),u(this,pt),u(this,At).renderer,u(this,_),{mode:this.mode,canvasHeight:p,canvasWidth:l}),u(this,L).cameraSystem.on("user-dolly-start",u(this,it)),u(this,L).cameraSystem.on("user-pan-start",u(this,it)),u(this,L).cameraSystem.on("user-rotate-start",u(this,it)),u(this,L).cameraSystem.on("user-zoom-start",u(this,it)),u(this,L).cameraSystem.on("user-tilt-start",u(this,it)),u(this,L).cameraSystem.on("user-pedestal-start",u(this,it)),u(this,L).cameraSystem.on("user-dolly-end",u(this,nt)),u(this,L).cameraSystem.on("user-pan-end",u(this,nt)),u(this,L).cameraSystem.on("user-rotate-end",u(this,nt)),u(this,L).cameraSystem.on("user-zoom-end",u(this,nt)),u(this,L).cameraSystem.on("user-tilt-end",u(this,nt)),u(this,L).cameraSystem.on("user-pedestal-end",u(this,nt)),u(this,L).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),u(this,L).geometryInFocusSystem&&(u(this,L).geometryInFocusSystem.cameraDirty=!0),this.render()}),u(this,L).panBoundsSystem=new cp(u(this,_),u(this,L).cameraSystem),u(this,L).pathSystem=new Zs(u(this,_),this.convertTo3DMapPosition),u(this,L).pathSystem.on("animate:path",this.render),this.camera=new sp(this,u(this,L),u(this,_),u(this,Li)),this.camera.setZoomLevel((T=i.zoomLevel)!=null?T:O1),this.camera.setBearing((w=i.bearing)!=null?w:k1),this.camera.setPitch((D=i.pitch)!=null?D:A1),this.camera.setMaxZoomLevel(rI),this.camera.setMinZoomLevel(tI),u(this,L).domVisiblitySystem=new zu(u(this,_),u(this,Sr)),u(this,L).domMutationSystem=new ap(u(this,_),u(this,Sr)),u(this,L).domMutationSystem.on("dimensions-update",()=>{u(this,L).collisionSystem.dirty=!0,this.render()}),u(this,L).domDrawSystem=new np(u(this,_)),u(this,L).collisionSystem=new Su(u(this,$t),u(this,_)),u(this,L).twoDDrawSystem=new qu(u(this,_),u(this,Ce)),u(this,L).interactionSystem=new Ms(this.rendererDomElement,u(this,_),u(this,Ee),u(this,Li)),u(this,L).interactionSystem.on("hover",this.render),u(this,L).interactionSystem.on("click",O=>{var B,G,R,H,j;if(((B=O.entity2D)==null?void 0:B.id)==="watermark"&&typeof u(this,L).watermarkSystem.options.onClick=="function"){u(this,L).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(O.position),geometry:O.entity3D?[(G=O.entity3D)==null?void 0:G.id]:[],markers:((R=O.entity2D)==null?void 0:R.components[0])instanceof Et?[O.entity2D.id]:[],models:((H=O.entity3D)==null?void 0:H.components[0])instanceof Ii?[O.entity3D.id]:[],labels:((j=O.entity2D)==null?void 0:j.components[0])instanceof br?[O.entity2D.id]:[],containers:Array.isArray(O.groupContainers)?O.groupContainers.map(Q=>Q.userData.entityId):[],pointerEvent:O.pointerEvent})}),u(this,L).interactionSystem.on("hover",O=>{var B,G,R,H,j;O.position&&((B=O.entity2D)==null?void 0:B.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(O.position),geometry:O.entity3D?[(G=O.entity3D)==null?void 0:G.id]:[],markers:((R=O.entity2D)==null?void 0:R.components[0])instanceof Et?[O.entity2D.id]:[],models:((H=O.entity3D)==null?void 0:H.components[0])instanceof Ii?[O.entity3D.id]:[],labels:((j=O.entity2D)==null?void 0:j.components[0])instanceof br?[O.entity2D.id]:[],containers:Array.isArray(O.groupContainers)?O.groupContainers.map(Q=>Q.userData.entityId):[]})}),u(this,L).geometryInFocusSystem=new mp(u(this,_),u(this,Ee)),u(this,L).geometryInFocusSystem.on("geometry-in-focus",O=>{this.publish("geometry-in-focus",O)}),u(this,L).twoDVisiblitySystem=new Ju(u(this,_)),u(this,L).drawSystem=new $u(u(this,_)),u(this,L).drawSystem.on("texture-loaded",this.render),u(this,L).stackSystem=new ep(u(this,_)),u(this,L).twoDProjectionSystem=new Zu(u(this,_),u(this,tl)),u(this,L).zoomInterpolationSystem=new Au,u(this,L).exporterSystem=new Ds(u(this,_)),u(this,L).meshOptimizationSystem=new Uu(u(this,_),this.convertTo3DMapPosition),u(this,L).meshOptimizationSystem.on("model-loaded",this.render),u(this,L).meshOpacitySystem=new gp(u(this,_)),u(this,L).meshModificationSystem=new vp(u(this,_)),u(this,L).customGeometrySystem=new pp(u(this,_)),u(this,L).outlineInterpolationSystem=new Cs(u(this,_)),u(this,L).renderSystem=new Ku(u(this,At),u(this,_),this.mode,u(this,pt),u(this,Ee),this.viewCamera,u(this,L)),u(this,L).imageSystem=new fp(u(this,_),this.convertTo3DMapPosition),u(this,L).imageSystem.on("image-loaded",this.render),u(this,L).renderSystem.on("measure-canvas",u(this,zo)),u(this,L).outdoorLayersSystem=new yp(this.map),u(this,Sp).call(this)}get viewCamera(){return u(this,qs)}get canvasWidth(){return u(this,_).canvasWidth}get canvasHeight(){return u(this,_).canvasHeight}get resolutionScale(){var t,i;return(i=(t=this.map)==null?void 0:t.getPixelRatio())!=null?i:Pi()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return u(this,_i)}addGroupContainer(t,i,n){var o;if(!u(this,_).geometry3DMap.has(t)&&!u(this,_).geometry2DMap.has(t)){let a=new De(t);a.addEventListener("childadded",()=>{u(this,me).call(this),u(this,we).call(this)}),a.addEventListener("childremoved",()=>{u(this,me).call(this),u(this,we).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&&Ct(a,i.interactive,u(this,_)),u(this,_).geometry3DMap.set(t,a),(o=X(this,ht,Ot).call(this,n))==null||o.addEntity(a),u(this,me).call(this),this.render()}else N.error("Group container with ID '".concat(t,"' already exists. The group container cannot be added."));return{id:t,type:"group-container"}}addStackContainer(t,i,n){var o;if(u(this,_).geometry3DMap.has(t))N.error("Stack container with ID '".concat(t,"' already exists. The stack container cannot be added."));else{let a=new De(t);a.addEventListener("childadded",()=>{u(this,me).call(this),u(this,we).call(this)}),a.addEventListener("childremoved",()=>{u(this,me).call(this),u(this,we).call(this)}),a.components[0]=new op,(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),u(this,_).geometry3DMap.set(t,a),(o=X(this,ht,Ot).call(this,n))==null||o.addEntity(a)}return{id:t,type:"stack-container"}}addCustomGeometry(t,i,n,o,a){var c;if(u(this,_).geometry3DMap.has(t))N.error("Custom geometry with ID '".concat(t,"' already exists. The custom geometry cannot be added."));else{let l=new Xo(i,n),p=new ce(l,new jt(o));p.id=t,l.mesh.userData={entityId:t,type:"custom-geometry"},u(this,_).geometry3DMap.set(p.id,p),(c=X(this,ht,Ot).call(this,a))==null||c.addEntity(p),this.render()}return{id:t,type:"custom-geometry"}}addGeometryGroup(t,i,n,o){var a,c;if(!u(this,_).geometry3DMap.has(t)&&!u(this,_).geometry2DMap.has(t)){let l=new ke(t,new mn(n));l.addEventListener("childadded",()=>{u(this,me).call(this),u(this,we).call(this)}),l.addEventListener("childremoved",()=>{u(this,me).call(this),u(this,we).call(this)}),l.userData.dirty=!0,u(this,_).geometry3DMap.set(t,l);for(let p of i.features){if(!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(p.geometry.type))continue;let f=p.id||p.properties.id||q(),y=u(this,L).meshOptimizationSystem.createEntityFromFeature(f,p,n);u(this,_).geometry3DMap.set(f,y),l.userData.entities3D.add(f)}l.setVisible((a=n==null?void 0:n.visible)!=null?a:!0),(c=X(this,ht,Ot).call(this,o))==null||c.addEntity(l),u(this,me).call(this),this.render()}else N.error("Geometry group with ID '".concat(t,"' already exists. The geometry group cannot be added."));return u(this,L).outlineInterpolationSystem.dirty=!0,{id:t,type:"geometry-group"}}addImage(t,i,n,o){var a;if(!Y5(i)){N.error("Invalid image geometry. The image cannot be added.");return}if(!u(this,_).geometry3DMap.has(t)&&!u(this,_).geometry2DMap.has(t)){let c=new dp(i),l=new ce(c,new jt(n));l.id=t||q(),c.mesh.userData={entityId:l.id,type:"path"},u(this,_).geometry3DMap.set(l.id,l),(a=X(this,ht,Ot).call(this,o))==null||a.addEntity(l),u(this,me).call(this),this.render()}else N.error("Image with ID '".concat(t,"' already exists. The image cannot be added."));return{id:t,type:"image"}}addModelGroup(t,i,n,o){var a;if(!u(this,_).geometry3DMap.has(t)&&!u(this,_).geometry2DMap.has(t)){let c=new ke(t,new mn(n));c.addEventListener("childadded",()=>{u(this,me).call(this),u(this,we).call(this)}),c.addEventListener("childremoved",()=>{u(this,me).call(this),u(this,we).call(this)}),u(this,_).geometry3DMap.set(t,c),c.userData.dirty=!0,c.userData.modelURL=n.url;for(let l of i.features){let p=l.id||l.properties.id||q(),f=u(this,L).meshOptimizationSystem.createModelFromFeature(p,l,n);l.properties.interactive!==void 0&&Ct(f,l.properties.interactive,u(this,_)),u(this,_).geometry3DMap.set(p,f),c.userData.entities3D.add(p)}(a=X(this,ht,Ot).call(this,o))==null||a.addEntity(c),u(this,me).call(this),this.render()}else N.error("Model group with ID '".concat(t,"' already exists. The model group cannot be added."));return{id:t,type:"geometry-group"}}addMarker2D(t,i,n,o){var c;let a=n==null?void 0:n.id;if(a===void 0||!u(this,_).geometry2DMap.has(a)&&!u(this,_).geometry3DMap.has(a)){let l=X(this,il,_1).call(this,t,new Et(i,n));l.id=a||String(l.id),a=l.id,(n==null?void 0:n.interactive)!=null&&Ct(l,n==null?void 0:n.interactive,u(this,_)),(c=X(this,ht,Ot).call(this,o))==null||c.addEntity(l),this.render()}else N.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addLabel2D(t,i,n,o){var c;let a=n==null?void 0:n.id;if(a===void 0||!u(this,_).geometry2DMap.has(a)&&!u(this,_).geometry3DMap.has(a)){let l=X(this,il,_1).call(this,t,new br(i,n||{},u(this,_)));l.id=a||String(l.id),a=l.id,(n==null?void 0:n.interactive)!=null&&Ct(l,n==null?void 0:n.interactive,u(this,_)),(c=X(this,ht,Ot).call(this,o))==null||c.addEntity(l),u(this,we).call(this),this.render()}else N.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(t,i={},n){var c;let o=new Qu(t,i),a=new ce(o,new jt);return a.id=(i==null?void 0:i.id)||q(),o.mesh.userData={entityId:a.id,type:"path"},u(this,_).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&Ct(a,i==null?void 0:i.interactive,u(this,_)),(c=X(this,ht,Ot).call(this,n))==null||c.addEntity(a),u(this,me).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(t){u(this,L).watermarkSystem.options=t,u(this,L).watermarkSystem.dirty=!0,u(this,L).collisionSystem.dirty=!0,this.render()}updateStackState(t,i){let n;(typeof t=="string"||typeof t=="number")&&(n=u(this,_).geometry3DMap.get(t)),n!=null&&n.components[0]&&(typeof i.activeId<"u"&&(n.components[0].activeId=i.activeId),typeof i.expandedFactor<"u"&&(n.components[0].percentExpanded=i.expandedFactor),n.components[0].dirty=!0,this.render())}remove(t){var n;let i;if(typeof t=="string"||typeof t=="number"?(i=u(this,_).geometry2DMap.get(t),i==null&&(i=u(this,_).geometry3DMap.get(t))):typeof t.id=="string"||typeof t.id=="number"?(i=u(this,_).geometry2DMap.get(t.id),i==null&&(i=u(this,_).geometry3DMap.get(t.id))):i=t,i!=null){if(i.type==="custom-geometry")u(this,_).geometry3DMap.delete(i.id),i.object3d&&Ze(i.object3d);else if(i.type==="group-container"){u(this,_).geometry3DMap.delete(i.userData.entityId);for(let o of i.childrenIds.values())this.remove(o),i.userData.entities2D.delete(o);Ze(i)}else if(i.type==="geometry-group"){u(this,_).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);Ze(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let o=i.components[0];i.object3d&&(((n=i.parent)==null?void 0:n.type)==="geometry-group"&&i.parent.userData.entities3D.delete(i.id),Ze(i.object3d)),o.outline&&Ze(o.outline),"focusMesh"in o&&o.focusMesh!=null&&Ze(o.focusMesh),u(this,_).geometry3DMap.delete(i.id)}else i.type==="marker"||i.type==="label"?(i.object3d&&Ze(i.object3d),i.type==="label"&&delete u(this,L).twoDDrawSystem.textCache[i.id],u(this,_).geometry2DMap.delete(i.id)):i.type==="image"&&(i.object3d&&Ze(i.object3d),u(this,_).geometry3DMap.delete(i.id));u(this,me).call(this),u(this,we).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(t){return u(this,L).exporterSystem.getCurrentSceneGLTF(t)}getBoundingArea(t){this.renderSync();let i=new Ir;if(t==null)i.setFromObject(u(this,_).entityScene);else{let n=gs(u(this,_),t);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof Pe?o.geometry:void 0;o.mesh instanceof Hn&&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(Ub(i))return zf(i).map(this.convert3DMapPositionToCoordinate)}getState(t){var n;if(t==null)return{type:"map-view",hoverColor:u(this,_).hoverColor};let i=gs(u(this,_),t);if((i==null?void 0:i.type)==="custom-geometry"){let o=i.components[0],a=i.components[1];return{id:i.id,type:"custom-geometry",visible:a.visible,altitude:a.altitude,parent:(n=i.parent)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(o.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let o=[];for(let c of i.userData.entities3D.values()){let l=this.getState(c);((l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model")&&o.push(l)}let a=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:a.opacity,color:a.color,topColor:a.topColor,outline:a.outline,shading:a.shading,interactive:Array.from(i.userData.entities3D.values()).map(c=>u(this,_).geometry3DMap.get(c)).every(c=>c&&c.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(c=>this.getState(c)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(o=>this.getState(o)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let o=i.components[0],a=i.object3d.parent,c=a==null?void 0:a.userData.entityId;return{id:i.id,type:"label",text:o.text||"",parent:{id:c,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:o.enabled,initialRank:vs(o.initialRank),options:{rank:vs(o.rank),appearance:o.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let o=i.components[0],a=i.object3d.parent,c=a==null?void 0:a.userData.entityId;return{id:i.id,type:"marker",enabled:o.enabled,parent:{id:c,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),element:o.containerEl,initialRank:vs(o.initialRank),options:{rank:vs(o.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:o,hoverColor:a,initialColor:c,topColor:l}=i.components[1],p=i.components[0],f=i.components[1];return{id:i.id,type:"geometry",opacity:f.opacity,color:o,focusable:p.focusable,topColor:l,initialColor:c,hoverColor:a,height:f.height,visible:f.visible,outline:f.outline,showImage:f.showImage,flipImageToFaceCamera:f.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(p.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let o=i.components[0],a=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(o.position),interactive:a!=null}}else if((i==null?void 0:i.type)==="path"){let o=i.components[0],a=i.components[2],c=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(o.position),visible:c.visible,interactive:a!=null,completeFraction:o.completeFraction}}else if((i==null?void 0:i.type)==="image"){let o=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(o.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else return}}setState(t,i){var o,a,c;if(typeof t=="object"&&"hoverColor"in t&&i==null){u(this,_).hoverColor=(o=t.hoverColor)!=null?o:u(this,_).hoverColor;return}let n=gs(u(this,_),t);if(n!=null){if(n.type==="custom-geometry"){let l=u(this,_).geometry3DMap.get(n.id);if(l instanceof ce&&l.components[0]instanceof Xo){let p=i;yn(n,p.visible),im(n,p.altitude),em(n,p.position,this.convertTo3DMapPosition),tm(n,X(this,ht,Ot).call(this,p.parent,!1))}}else if(n.type==="model"||n.type==="path"){let l=i;Ct(n,l.interactive,u(this,_))&&u(this,me).call(this),n.type==="path"&&(l=l,t4(n,l),yn(n,l.visible))}else if(n.type==="group-container"){let l=i;yn(n,l.visible)&&(u(this,L).outlineInterpolationSystem.dirty=!0),Ct(n,l.interactive,u(this,_))&&u(this,me).call(this),im(n,l.altitude)}else if(n.type==="geometry-group"){let l=i;yn(n,l.visible)&&(u(this,L).outlineInterpolationSystem.dirty=!0),qb(n,u(this,_),l)&&(u(this,L).outlineInterpolationSystem.dirty=!0),nm(n,l.outline)&&(u(this,L).outlineInterpolationSystem.geometries3DDirty=!0),$b(n,l.shading),a4(n,u(this,_),l.opacity),Ct(n,l.interactive,u(this,_))&&(u(this,me).call(this),u(this,we).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Pe){let l=i;yn(n,l.visible)&&(u(this,L).outlineInterpolationSystem.geometries3DDirty=!0),nm(n,l.outline)&&(u(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Jb(n,l),l.focusable!=null&&(n.components[0].focusable=l.focusable,u(this,L).geometryInFocusSystem.focusablesDirty=!0),s4(n,l.opacity)&&(u(this,L).meshOpacitySystem.dirty=!0,u(this,L).outlineInterpolationSystem.geometries3DDirty=!0),rm(n,l.flipImageToFaceCamera),Kb(n,l.height)&&(u(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Qb(n,l),o4(n,l.hoverColor),Ct(n,l.interactive,u(this,_))}u(this,me).call(this)}else if(n.type==="label"||n.type==="marker"){let l=i;n4(n,i),r4(n,i)&&u(this,we).call(this),i4(n,(a=l.options)==null?void 0:a.rank)&&u(this,we).call(this),em(n,l.position,this.convertTo3DMapPosition),tm(n,X(this,ht,Ot).call(this,l.parent,!1))&&(u(this,we).call(this),u(this,L).panBoundsSystem.dirty=!0),e4(n,l.enabled),Ct(n,(c=l.options)==null?void 0:c.interactive,u(this,_))&&u(this,we).call(this)}else if(n.type==="image"){let l=i;yn(n,l.visible),rm(n,l.flipImageToFaceCamera)}this.render()}}convertTo3DMapPosition(t,i,n=0,o){var l,p,f,y;if(Array.isArray(t))return this.convertTo3DMapPosition(t[1],t[0],0,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:c}=fu((p=(l=u(this,_).center)==null?void 0:l[1])!=null?p:0,(y=(f=u(this,_).center)==null?void 0:f[0])!=null?y:0,t,i);return o?(o.set(a,c,n),o):new W(a,c,n)}getCenter(t){let i=Array.isArray(t)?t:this.getBoundingArea(t);return i?Wb(i):void 0}isInView(t){let i=gs(u(this,_),t);if(u(this,nl).identity().multiply(u(this,Ee).projectionMatrix).multiply(u(this,Ee).matrixWorldInverse),u(this,kn).setFromProjectionMatrix(u(this,nl)),i instanceof Tt)return u(this,kn).containsPoint(i.position);if(i instanceof ce){let n=i==null?void 0:i.components[0];if(n instanceof Xo||n instanceof Ii)return u(this,kn).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Pe){let o=new Ir(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return u(this,kn).intersectsBox(o)}}return!1}getSystems(){return u(this,L)}getInternalState(){return u(this,_)}};pt=new WeakMap,Ee=new WeakMap,qs=new WeakMap,Wo=new WeakMap,Li=new WeakMap,An=new WeakMap,Yo=new WeakMap,$s=new WeakSet,L1=s(function(t){var i;u(this,_i)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(t)),u(this,_).pixelRatio=this.resolutionScale},"#setResolutionScale"),_=new WeakMap,ue=new WeakMap,$t=new WeakMap,Ce=new WeakMap,Sr=new WeakMap,At=new WeakMap,L=new WeakMap,Js=new WeakMap,we=new WeakMap,me=new WeakMap,bp=new WeakSet,K5=s(function(){I(this,ue,document.createElement("div")),u(this,ue).classList.add("mappedin__smart-collision-engine__container"),I(this,$t,document.createElement("canvas")),u(this,$t).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(u(this,ue)),I(this,Ce,document.createElement("canvas")),u(this,Ce).classList.add("mappedin__smart-collision-engine__container"),u(this,Ce).width=u(this,ue).clientWidth*this.resolutionScale,u(this,Ce).height=u(this,ue).clientHeight*this.resolutionScale,u(this,Ce).style.width=u(this,ue).clientWidth+"px",u(this,Ce).style.height=u(this,ue).clientHeight+"px",u(this,ue).appendChild(u(this,$t)),u(this,ue).appendChild(u(this,Ce)),u(this,$t).width=u(this,ue).clientWidth,u(this,$t).height=u(this,ue).clientHeight,u(this,Ce).width=u(this,ue).clientWidth*this.resolutionScale,u(this,Ce).height=u(this,ue).clientHeight*this.resolutionScale,u(this,Ce).style.width=u(this,ue).clientWidth+"px",u(this,Ce).style.height=u(this,ue).clientHeight+"px"},"#renderEntity2DContainer"),Cp=new WeakSet,Q5=s(function(){I(this,Sr,document.createElement("div")),u(this,Sr).classList.add("mappedin-2d-entities"),Object.assign(u(this,Sr).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(u(this,Sr))},"#renderEntityDOMContainer"),xp=new WeakSet,e7=s(function(){u(this,Ce).width=u(this,ue).clientWidth*this.resolutionScale,u(this,Ce).height=u(this,ue).clientHeight*this.resolutionScale,u(this,Ce).style.width=u(this,ue).clientWidth+"px",u(this,Ce).style.height=u(this,ue).clientHeight+"px",u(this,$t).width=u(this,ue).clientWidth,u(this,$t).height=u(this,ue).clientHeight,u(this,Ce).width=u(this,ue).clientWidth*this.resolutionScale,u(this,Ce).height=u(this,ue).clientHeight*this.resolutionScale,u(this,Ce).style.width=u(this,ue).clientWidth+"px",u(this,Ce).style.height=u(this,ue).clientHeight+"px",u(this,L).collisionSystem.dirty=!0},"#resizeCollisionCanvas"),_i=new WeakMap,Ks=new WeakMap,Qs=new WeakMap,Uo=new WeakMap,Sp=new WeakMap,el=new WeakMap,tl=new WeakMap,rl=new WeakMap,zo=new WeakMap,ht=new WeakSet,Ot=s(function(t,i=!0){if(!t)return i?u(this,_).entityScene:void 0;if(typeof t=="string"||typeof t=="number"){let n=u(this,_).geometry3DMap.get(t);return n instanceof De?n:(N.warn("Parent is not a valid container, adding to scene"),i?u(this,_).entityScene:void 0)}else if(t.type==="group-container"){let n=u(this,_).geometry3DMap.get(t.id);if(n instanceof De)return n}return i?u(this,_).entityScene:void 0},"#getParentContainer"),il=new WeakSet,_1=s(function(t,i,n){let o=new Tt(i,this.convertTo3DMapPosition(t[1],t[0],t[2]||n||0));return u(this,_).geometry2DMap.set(o.id,o),o},"#createEntity2D"),kn=new WeakMap,nl=new WeakMap,it=new WeakMap,nt=new WeakMap,s(R1,"Core");var D1=R1,ol=D1;m();function nI(r,e){oI(r,e)(r.getScene(),e),aI(r,e),e.addFolder("Export").add({export:async()=>{let n=await r.getCurrentSceneGLTF({binary:!0}),o=new Blob([n],{type:"application/octet-stream"});var a=document.createElement("a");document.body.appendChild(a),a.style.display="none";let c=window.URL.createObjectURL(o);a.href=c,a.download="scene.glb",a.click(),window.URL.revokeObjectURL(c)}},"export")}s(nI,"mountSceneGraphVisualizer");function oI(r,e){let t=e;return s(function i(n,o){let a=o.addFolder("".concat([n.type]," ").concat(n.id.slice(0,16)));if(o.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let c={get height(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{height:l})},set flipImageToFaceCamera(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="image"&&r.setState(n,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image")&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?l.visible:!1},set outline(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{outline:l})},get outline(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get color(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"&&l.color?F(l.color).toHexString():"#ffffff"},set color(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:l})},set interactive(l){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(r.setState(n,{interactive:l}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"?l.interactive:!1},get completeFraction(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{completeFraction:l})},focus:()=>{}};a.add(c,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?r.camera.focusOn([l.position]):(l==null?void 0:l.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(l))}),a.add(c,"visible"),n.type==="image"?a.add(c,"flipImageToFaceCamera"):(a.add(c,"interactive"),n.type==="path"&&a.add(c,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(c,"color"),a.add(c,"outline"))),n.type==="geometry"&&a.add(c,"height")}else if(n.type==="marker"){let c={get interactive(){var p;let l=r.getState(n.id);return(l==null?void 0:l.type)==="marker"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:l}}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},focus:()=>{}};a.add(c,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="marker"&&r.camera.focusOn([l.position])}),a.add(c,"interactive")}else if(n.type==="label"){let c={get interactive(){var p;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:l}}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get text(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l})},get"Text Color"(){var p,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:f.foregroundColor:"#000000"},set"Text Color"(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(n.id,{text:c.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var p,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:f.size:10},set"Text Size"(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var p,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(f=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:f.iconSize:10},set"Icon Size"(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var p,f,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(f=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:y.active:"#000000"},set"Active Foreground Color"(l){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var p,f,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(f=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Foreground Color"(l){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var p,f,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(f=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:y.active:"#000000"},set"Active Background Color"(l){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var p,f,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(f=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Background Color"(l){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,inactive:l}}}}})},focus:()=>{}};a.add(c,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="label"&&r.camera.focusOn([l.position])}),a.add(c,"interactive"),a.add(c,"text"),a.add(c,"Text Size",10,50),a.add(c,"Icon Size",10,50),a.addColor(c,"Text Color"),a.addColor(c,"Active Background Color"),a.addColor(c,"Inactive Background Color"),a.addColor(c,"Active Foreground Color"),a.addColor(c,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let c={get opacity(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{opacity:l})},set visible(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{outline:l})},get outline(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(n,{interactive:l}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var p,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"&&(f=(p=l.shading)==null?void 0:p.start)!=null?f:0},set shadingStart(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:l}})},get shadingEnd(){var p,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"&&(f=(p=l.shading)==null?void 0:p.end)!=null?f:0},set shadingEnd(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:l}})},get shadingIntensity(){var p,f;let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"&&(f=(p=l.shading)==null?void 0:p.intensity)!=null?f:0},set shadingIntensity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{intensity:l}})}};a.add(c,"visible"),a.add(c,"opacity",0,1,.1),a.add(c,"interactive"),a.add(c,"outline"),a.add(c,"shadingStart",0,1,.1),a.add(c,"shadingEnd",0,1,.1),a.add(c,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let c={set visible(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:l}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};a.add(c,"visible"),a.add(c,"interactive")}if(a.close(),n.children)for(let c of n.children.values())i(c,a)},"parseChild")}s(oI,"createParseChild");function aI(r,e){let t=e.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};t.add(i,"padding",0,100,1),t.add(i,"scale",.5,1.5,.1),t.add(i,"color",["dark","light"]),t.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),t.add(i,"iconOnly"),t.onChange(()=>{r.updateWatermark(i)})}s(aI,"createWatermarkChild");var t7="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",sI="https://auth.mappedin.com/oauth2/token";async function r7(r,e){var t,i,n,o,a;if((t=e==null?void 0:e.outdoorView)!=null&&t.enabled&&((i=e==null?void 0:e.outdoorView)!=null&&i.headers)){let{Map:c,MercatorCoordinate:l}=await import("./outdoor-context-v4-LAP7PEM5.js"),p=e.outdoorView.headers;p==null&&(p=await Xb(sI));let f=e.center||[0,0],y=new c({container:r,style:e.outdoorView.style||t7,center:f,attributionControl:!1,zoom:(n=e.zoomLevel)!=null?n:O1,pitch:(o=e.pitch)!=null?o:A1,bearing:(a=e.bearing)!=null?a:k1,transformRequest:qf(p),trackResize:!1,pixelRatio:Pi(),antialias:typeof e.antialias=="boolean"?e.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=y.painter.context.gl,C=new ol(r,{center:f,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:g,map:y,mode:"outdoors-interleaved",watermark:e.watermark,attribution:e.attribution,antialias:e.antialias}),S={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(C.camera.minZoomLevel),y.setMaxZoom(C.camera.maxZoomLevel),C.on("camera-change",w=>{S.center=w.center,S.zoom=w.zoomLevel,S.bearing=-w.bearing,S.pitch=w.pitch,y.jumpTo(S)});let M=l.fromLngLat(f,0),v=mu(M,C.viewCamera,C.camera,()=>{C.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(v),C.renderSync())});let x=!1,E=!1;y.on("idle",()=>{y&&(x||(C.publish("outdoor-view-loaded"),x=!0),E||(C.publish("outdoor-style-loaded"),E=!0))});let T=s(w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&C.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",w=>{y&&w&&w.dataType==="style"&&w.type==="styledata"&&(E=!1),T(w)}),y.on("sourcedata",T),y.on("terrain",T),y.on("error",w=>{var D;if(((D=w.error)==null?void 0:D.url)===t7){N.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}N.warn(w)}),C}else return new ol(r,e)}s(r7,"createRenderer");var al=Qt(dn());var Mp=30,lI=1e3,Zo,sl,N1=class N1 extends z{constructor(t,i){super();this.api=t;this.core=i;P(this,Zo,void 0);P(this,sl,0);h(this,"includedFloors",[]);h(this,"expanded",!1);i.on("camera-change",n=>{var c;let o=Math.floor(n.elevation/Mp),a=(c=this.includedFloors[o])==null?void 0:c.id;this.expanded&&a&&a!==this.api.currentFloorId&&(this.api.currentFloorId=this.includedFloors[o].id,this.api.publish("floor-change",{reason:"elevation-change",floorId:this.api.currentFloorId}))})}get percentExpanded(){return u(this,sl)}set percentExpanded(t){let i=Wt(t,0,1,0,Mp);this.includedFloors.forEach((n,o)=>{this.core.setState(n.containerId,{visible:!0,altitude:i*o})}),I(this,sl,t)}animateToCurrentFloor(){let t=this.includedFloors.indexOf(this.api.currentFloor)*Mp;new al.default.Tween({elevation:this.core.camera.elevation}).to({elevation:t},1e3).easing(al.default.Easing.Quadratic.Out).onUpdate(({elevation:i})=>{this.core.camera.setElevation(i),this.core.render()}).onComplete(()=>{this.api.publish("floor-change",{reason:"",floorId:this.api.currentFloorId})}).start(),this.core.render()}expand(t){return this.includedFloors=this.api.floors.filter(i=>!(t!=null&&t.excludeFloorIds.includes(i.id))),this.includedFloors.length<=1?Promise.resolve():this.animate("expand")}collapse(){return this.expanded===!0?this.animate("collapse"):Promise.resolve()}animate(t){u(this,Zo)&&u(this,Zo).stop();let i=this.includedFloors.indexOf(this.api.currentFloor)*Mp;return new Promise(n=>{I(this,Zo,new al.default.Tween({percentExpanded:this.percentExpanded}).to({percentExpanded:t==="expand"?1:"0"},lI).easing(al.default.Easing.Quadratic.Out).onUpdate(({percentExpanded:o})=>{this.core.camera.setElevation(i*o),this.percentExpanded=o,this.core.render()}).onComplete(()=>{this.expanded=t==="expand",this.includedFloors.forEach(o=>{this.core.setState(o.containerId,{visible:t==="collapse"?o.id===this.api.currentFloorId:!0})}),this.core.getSystems().cameraSystem.enablePedestal=t==="expand",this.core.getSystems().cameraSystem.enablePan=t==="collapse",n(),this.publish(t==="expand"?"expanded":"collapsed")}).onStart(()=>{this.includedFloors.forEach(o=>{this.core.setState(o.containerId,{visible:!0})})}).start()),this.core.render()})}};Zo=new WeakMap,sl=new WeakMap,s(N1,"StackedMaps");var Pp=N1;var cI={linear:Rn.default.Easing.Linear.None,"ease-in":Rn.default.Easing.Quadratic.In,"ease-out":Rn.default.Easing.Quadratic.Out,"ease-in-out":Rn.default.Easing.Quadratic.InOut},B1=class B1 extends z{constructor(t,i,n,o={},a){super();h(this,"floors");h(this,"currentFloorId","");h(this,"id");h(this,"renderer");h(this,"mvf");h(this,"styleMap");h(this,"StackedMaps");h(this,"animations",new Map);h(this,"Models",{add:(t,i,n)=>{let{floorId:o,...a}=n,c=n!=null&&n.floorId?this.floors.find(p=>p.id===n.floorId):this.floors[0],l=this.renderer.addModelGroup(t,{type:"FeatureCollection",features:i.map(p=>{var f;return{type:"Feature",properties:{id:q(),rotation:(f=p.rotation)==null?void 0:f.map(y=>y*(Math.PI/180)),scale:p.scale,interactive:p.interactive},geometry:{type:"Point",coordinates:xi(p.target)}}})},{url:a.url},c.id);return this.renderer.getState(l).children},remove:(t,i)=>{this.renderer.remove(t),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});h(this,"Markers",{add:(t,i,n={})=>{let{floorId:o,...a}=n,c=n!=null&&n.floorId?this.floors.find(l=>l.id===n.floorId):this.floors[0];return this.renderer.addMarker2D(t,i,a,c.id)},remove:t=>{this.renderer.remove(t)},getContentEl:t=>{let i=this.renderer.getState(t);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(t,i,n)=>{let o=this.renderer.getState(t);if(!o){N.error('Failed to retrieve state for Marker with id "'.concat(t,'".'));return}if(o.type!=="marker"){N.error('Geometry with id "'.concat(t,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:n!=null?n:this.currentFloorId})},animateTo:(t,i,n,o)=>{let a=this.renderer.getState(t);if(!a)return N.error('Failed to retrieve state for Marker with id "'.concat(t,'".')),Promise.resolve();if(a.type!=="marker")return N.error('Geometry with id "'.concat(t,'" is not of type "marker".')),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(t);let l;new Rn.default.Tween({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},c.duration).easing(cI[c.easing]).onUpdate(({lon:f,lat:y})=>{this.Markers.setPosition(t,[f,y],n),this.renderer.render()}).onComplete(()=>{l()}).start();let p=new Promise(f=>{l=f});return this.renderer.render(),p}});h(this,"Exporter",{getCurrentSceneGLTF:async t=>this.renderer.getCurrentSceneGLTF(t)});h(this,"Shapes",{add:(t,i,n)=>{let o=n!=null&&n.floorId?this.floors.find(c=>c.id===(n==null?void 0:n.floorId)):this.floors[0],a=q();return this.renderer.addGeometryGroup(a,t,i,o.id),a},remove:t=>(this.renderer.remove(t.id),t.id)});h(this,"Labels",{all:({onCreate:t})=>{let i=0;for(let n of Object.entries(this.mvf.space)){let[o,a]=n;a&&(a.features.forEach(c=>{var y,g;let l=(y=this.styleMap[c.properties.id])==null?void 0:y.showImage,p=(g=c.properties.details)==null?void 0:g.images,f;if(l&&p&&p.length>0&&(f={marker:{icon:p[0].url}}),c.properties.center&&c.properties.externalId!==""){let C=this.renderer.addLabel2D(c.properties.center,c.properties.externalId,{id:c.properties.id+"-label",appearance:f},o);t(C.id,c.properties.externalId)}}),i++)}},add:(t,i,n={})=>{let{floorId:o,...a}=n,c=n!=null&&n.floorId?this.floors.find(p=>p.id===(n==null?void 0:n.floorId)):this.floors[0],l=this.renderer.addLabel2D(t,i,a,c.containerId);if(!l)throw new Error("label creating failed");return l},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});h(this,"Paths",{add:(t,i)=>new Promise(n=>{let o=[],a=t[0].floorId||"root",c=0;for(let p of t){let{floorId:f="root",latitude:y,longitude:g}=p;f!==a&&(c++,a=f),o[c]==null&&o.push({floorId:f,coordinates:[]}),o[c].coordinates.push([g,y])}let l=o.map(({floorId:p,coordinates:f})=>this.renderer.addPath({type:"FeatureCollection",features:f.map(y=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:y}}))},i,p));new Rn.default.Tween({fraction:0}).to({fraction:1},(i==null?void 0:i.drawDuration)||1e3).onUpdate(({fraction:p})=>{l.forEach(f=>{this.renderer.setState(f.id,{completeFraction:p})})}).onComplete(()=>{n(l)}).start()}),remove:t=>{t.forEach(i=>{this.renderer.remove(i)})}});this.renderer=a,this.id=t,this.renderer.addGroupContainer(t,{},"root"),this.StackedMaps=new Pp(this,this.renderer),this.mvf=i,this.styleMap=n,this.floors=this.mvf["map.geojson"].sort((c,l)=>c.elevation-l.elevation).map(c=>{var p,f;if(t!=="outdoors-container"&&((p=i.space[c.id])==null?void 0:p.features.length)===0&&((f=i.obstruction[c.id])==null?void 0:f.features.length)===0)return;let l=new nu(t,c,this.renderer,o,i,n);return l.load(),l}).filter(Boolean),this.setFloor(o.initialFloor?rb(o.initialFloor):this.floors[0].id)}get currentFloor(){return this.floors.find(t=>t.id===this.currentFloorId)}setFloor(t,i){if(this.currentFloorId!==t){if(this.publish("floor-change-start",{floorId:t}),this.currentFloorId=t,this.StackedMaps.expanded)return this.StackedMaps.animateToCurrentFloor();this.floors.forEach(n=>{n.id===t?this.renderer.setState(n.containerId,{visible:!0}):this.renderer.setState(n.containerId,{visible:!1})}),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(t){let i=this.animations.get(t);i&&(i.tween.stop(),i.resolver(),this.animations.delete(t))}};s(B1,"GeojsonApiMapObject");var ll=B1;m();var Jt,ul,F1=class F1{constructor({currentMapGetter:e}){P(this,Jt,new Map);P(this,ul,void 0);I(this,ul,e)}get currentMap(){return u(this,ul).call(this)}getById(e){return u(this,Jt).get(e)}add(e,t,i){let n=hr(e);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let{id:a}=o.Markers.add(xi(n),t,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1}),c=o.Markers.getContentEl(a.toString());if(!c)throw new Error("marker component should exist");let l=new sn(a.toString(),c);return u(this,Jt).set(l.id,{marker:l,entityId:a.toString()}),l}remove(e){var i;let t=u(this,Jt).get(e.id);t&&((i=this.currentMap)==null||i.Markers.remove(t.entityId),u(this,Jt).delete(e.id.toString()))}removeAll(){let e=[];return u(this,Jt).forEach(({marker:t})=>{this.remove(t),e.push(t),u(this,Jt).delete(t.id.toString())}),e}setPosition(e,t){var a;let i=hr(t);if(!i){N.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){N.error("Cannot determine the current map.");return}let o=u(this,Jt).get(e.id);if(!o){N.error('Cannot find the Marker with id "'.concat(e.id,'".'));return}n.Markers.setPosition(o.entityId,xi(i),(a=i.floorId)!=null?a:n.currentFloorId)}animateTo(e,t,i){var c;let n=hr(t);if(!n)return N.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return N.error("Cannot determine the current map."),Promise.resolve();let a=u(this,Jt).get(e.id);return a?o.Markers.animateTo(a.entityId,xi(n),(c=n.floorId)!=null?c:o.currentFloorId,i):(N.error('Cannot find the Marker with id "'.concat(e.id,'".')),Promise.resolve())}};Jt=new WeakMap,ul=new WeakMap,s(F1,"Markers");var cl=F1;m();var Mr,hl,G1=class G1{constructor({currentMapGetter:e}){P(this,Mr,new Map);P(this,hl,void 0);I(this,hl,e)}get currentMap(){return u(this,hl).call(this)}getById(e){return u(this,Mr).get(e)}add(e,t){let i=Array.isArray(e)?e:[e],n=i.reduce((c,l)=>{var f;let p=hr(l.target);return p?(c.has(p.floorId)||c.set(p.floorId,[]),(f=c.get(p.floorId))==null||f.push({...l,target:p}),c):(N.error("Cannot determine coordinate from options."),c)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=[];return n.forEach((c,l)=>{let p=q();o.Models.add(p,c,{...t,floorId:l}).forEach(({id:y})=>{let g=new Ka(y.toString(),p);u(this,Mr).set(g.id,{model:g,entityId:y.toString(),groupId:p}),a.push(g)})}),a}remove(e){var i;let t=u(this,Mr).get(e.id);t&&((i=this.currentMap)==null||i.Models.remove(t.entityId,t.groupId),u(this,Mr).delete(e.id.toString()))}removeAll(){let e=[];return u(this,Mr).forEach(({model:t})=>{var n;let i=u(this,Mr).get(t.id);i&&(e.push(t),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),u(this,Mr).delete(t.id.toString()))}),e}};Mr=new WeakMap,hl=new WeakMap,s(G1,"Models");var pl=G1;m();var Jr,fl,V1=class V1{constructor({currentMapGetter:e}){P(this,Jr,new Map);P(this,fl,void 0);I(this,fl,e)}get currentMap(){return u(this,fl).call(this)}getById(e){return u(this,Jr).get(e)}async add(e,t){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let n=await i.Paths.add(e,t),o=new Qa(q());return u(this,Jr).set(o.id,{path:o,entityIds:n.map(a=>a.id.toString())}),o}remove(e){var i;let t=u(this,Jr).get(e.id);t&&((i=this.currentMap)==null||i.Paths.remove(t.entityIds),u(this,Jr).delete(e.id.toString()))}removeAll(){let e=[];return u(this,Jr).forEach(({path:t})=>{this.remove(t),e.push(t),u(this,Jr).delete(t.id.toString())}),e}};Jr=new WeakMap,fl=new WeakMap,s(V1,"Paths");var dl=V1;m();var wp=Qt(dn());m();m();m();var uI=s(function(){let e=globalThis.fetch;return{fetch(...t){if(!ka(e))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return e==null?void 0:e(...t)},setFetch(t){e=t}}},"createFetchControl")(),i7=uI.fetch;var a7=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk"],pI=a7[0],hI="https://api-gateway.mappedin.com/track-analytics/a/",Nn,Kr,ml,X1,W1=class W1{constructor(){P(this,ml);P(this,Nn,Object.freeze({}));P(this,Kr,void 0);h(this,"sendGetDirectionsEvent",gr((e,t)=>this.sendAnalyticEvent("query-directions",{start:e,end:t,type:"location_to_location"}),2500));I(this,Kr,X(this,ml,X1).call(this,u(this,Nn)))}init(e={}){this.reset(),this.updateStateWithOptions(e)}reset(){this.updateStateWithOptions({})}updateStateWithOptions(e={}){return I(this,Nn,Object.freeze(Object.assign({},u(this,Nn),e))),I(this,Kr,X(this,ml,X1).call(this,e)),u(this,Kr)}updateState(e){let i={...{...e}};i.mapId&&(i.baseUrl=n7({...u(this,Kr),mapId:i.mapId})),i.context&&(i.context=o7(i.context)),Object.assign(u(this,Kr),i)}get authReady(){let{key:e,secret:t,accessToken:i}=this.getState();return!!(e&&t)||!!i}getState(){return u(this,Kr)}getContext(){return this.getState().context||u(this,Nn).context}sendAnalyticEvent(e,t={}){let i=this.getState(),n={...t,g:i.geolocationMode};i.userPosition&&(n={...n,...i.userPosition});let o=mI(i.baseUrl,e,n);if(i.logEvents&&N.log("Analytics.track",o),!i.sendEvents)return Promise.resolve();let a={"mi-context":this.getContext(),"mi-session":i.mi_session,"mi-device":i.mi_uuid,"mappedin-sdk-version":i.version,"mappedin-platform-version":i.platformString};return i.accessToken?a.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(a["x-mappedin-key"]=btoa(i.key),a["x-mappedin-secret"]=btoa(i.secret)),i7(o,{method:"GET",mode:"cors",headers:a})}capture(e,t){if(gI.includes(e))return N.warn("".concat(e," event is sent internally.")),Promise.resolve();let i=yI.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(i,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent("load-mapdata",e)}sendWatchPositionDenied(){return this.sendAnalyticEvent("watch-position-denied")}sendMapViewLoadedEvent({firstRenderDuration:e,dimension:t}){return this.sendAnalyticEvent("load-mapview",{firstRenderDuration:e,url:window.location.href,width:t.width,height:t.height,devicePixelRatio:window.devicePixelRatio})}};Nn=new WeakMap,Kr=new WeakMap,ml=new WeakSet,X1=s(function(e){var t,i,n;return{baseUrl:n7(e),version:((t=b==null?void 0:b.env)==null?void 0:t.npm_package_version)||"v6",mi_uuid:dI(),accessToken:e.accessToken,mapId:e.mapId,mi_session:fI(),platformString:e.platformString||"",context:o7(e.context)||pI,geolocationMode:!1,sendEvents:(i=e.sendEvents)!=null?i:!1,logEvents:(n=e.logEvents)!=null?n:!1,noAuth:e.noAuth||!1,key:e.key,secret:e.secret}},"#getStateWithOption"),s(W1,"CustomerAnalytics");var H1=W1;function n7(r){return"".concat(hI).concat(r.mapId,"/")}s(n7,"getBaseUrl");function dI(){return ii.getInstance().loadLocalData("deviceId")}s(dI,"getDeviceID");function fI(){return ii.getInstance().loadSessionData("id")}s(fI,"getSessionID");function mI(r,e,t){let i=new URLSearchParams;for(let[n,o]of Object.entries(t))o!=null&&i.append(n,o);return r+e+"?"+i.toString()}s(mI,"buildUrl");function o7(r){return a7.find(e=>e===r)}s(o7,"getValidContext");var yI=["$select-location","$select-category","$query-suggest","$query-search"],gI=["load-mapview","load-mapdata","query-directions","watch-position-denied"],dt=new H1,j1={init(...r){return dt.init(...r)},capture(...r){return dt.capture(...r)},updateState(r){return dt.updateState(r)}};m();var Y1="#2266ff",s7="#f5f5f5";var l7={radius:10,color:Y1,bearing:{color:Y1,opacity:.7},accuracyRing:{color:Y1,opacity:.3}};var f7=Qt(Am());m();var c7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var u7=s((r,e,t=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=t/Math.tan(r/2),n=t/Math.sin(r/2),o=n+e,a=10,c=new tr;c.moveTo(n*Math.cos(r/2)-i,n*Math.sin(r/2));for(let l=0;l<a;l++)c.lineTo(o*Math.cos(r/2-r/a*l)-i,o*Math.sin(r/2-r/a*l));for(let l=0;l<a;l++)c.lineTo(t*Math.cos(Math.PI/-2+Math.PI/a*l),t*Math.sin(Math.PI/-2+Math.PI/a*l));return new rr(c,{depth:.1,bevelEnabled:!1,UVGenerator:bI(e)})},"createSectorGeometry"),U1=s((r,e,t)=>{let n=Math.sqrt(Math.pow(r,2)+Math.pow(e,2))/t;return n>1?n=1:n<0&&(n=0),new U(0,n)},"generateRadialUV"),bI=s(r=>({generateTopUV:(e,t,i,n,o)=>{let a=t[i*3],c=t[i*3+1],l=t[n*3],p=t[n*3+1],f=t[o*3],y=t[o*3+1];return[U1(a,c,r),U1(l,p,r),U1(f,y,r)]},generateSideWallUV:()=>[new U(0,1),new U(0,1),new U(0,1),new U(0,1)]}),"radialUVGenerator");function p7(r,e){let t=new nr({color:r,opacity:e,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=u7(Math.PI/6,n,i);new Xn().load(c7,c=>{t.alphaMap=c,t.needsUpdate=!0});let a=new Me(o,t);return a.position.z=-.05,a.renderOrder=0,a}s(p7,"createBearingCone");function h7(r,e){let t=new _l(1,1,.05,32),i=new nr({transparent:!0,color:r,opacity:e,depthTest:!1,depthWrite:!1}),n=new Me(t,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}s(h7,"createAccuracyRing");function d7(r){let e=new _l(.35,.35,.07,32),t=new nr({transparent:!0,color:s7,depthTest:!1,depthWrite:!1}),i=new Me(e,t);i.renderOrder=2;let n=new _l(.35*.8,.35*.8,.01,32),o=new nr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new Me(n,o);return a.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:i,innerMesh:a}}s(d7,"createBlueDot");var Kt,ft,yl,z1=class z1 extends z{constructor(t,i){super();this.core=t;this.geoJSONApi=i;h(this,"watcherId",null);h(this,"geometry");h(this,"currentGeolocation");h(this,"positionAnimation");h(this,"scaleAnimation");h(this,"rotationAnimation");P(this,Kt,l7);P(this,ft,1);P(this,yl,void 0);h(this,"updateGeometryPerFrame",s(t=>{var p;let[i,n,o,a]=t.children,{accuracy:c,heading:l}=((p=this.currentGeolocation)==null?void 0:p.coords)||{};this.updateScale(),n.scale.set(u(this,ft),u(this,ft),u(this,ft)),n.position.z=.07/2*u(this,ft),o.scale.set(u(this,ft),u(this,ft),u(this,ft)),o.position.z=.07*u(this,ft),c!=null&&(this.scaleAnimation&&this.scaleAnimation.stop(),this.scaleAnimation=new wp.default.Tween({scale:i.scale.x}).to({scale:c/2},150).onUpdate(({scale:f})=>{i.scale.set(f,1,f)}).start()),l!=null?(a.visible=!0,this.rotationAnimation&&this.rotationAnimation.stop(),this.rotationAnimation=new wp.default.Tween({rotation:a.rotation.z}).to({rotation:ne.degToRad(l)},150).onUpdate(({rotation:f})=>{a.rotation.z=f}).start(),a.scale.set(u(this,ft),u(this,ft),1)):a.visible=!1},"updateGeometryPerFrame"));h(this,"onPositionUpdate",s(t=>{var i;if(this.currentGeolocation=t,dt.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:t.coords.latitude,longitude:t.coords.longitude,floorLevel:t.coords.floorLevel,accuracy:t.coords.accuracy}}),this.geometry){let n=this.core.getState(this.geometry);n.visible===!1&&this.core.setState(this.geometry,{position:[t.coords.longitude,t.coords.latitude],visible:!0}),this.positionAnimation&&this.positionAnimation.stop(),n=this.core.getState(this.geometry);let o;if(t.coords.floorLevel!==void 0){let a=(i=this.geoJSONApi.currentMap)==null?void 0:i.floors[t.coords.floorLevel];o=a==null?void 0:a.id}this.positionAnimation=new wp.default.Tween(n.position).to([t.coords.longitude,t.coords.latitude],500).onUpdate(a=>{if(this.geometry){let c={position:a};if(o==null&&n.parent!=="outdoors-container")c.parent="outdoors-container";else if(o!=null&&n.parent!==o){let l=o!=null?o:"outdoors-container";c.parent=l,this.publish("floor-change",{reason:"blue-dot-floor-change",floorId:l})}this.core.setState(this.geometry,c)}}).start(),this.core.render()}},"onPositionUpdate"));h(this,"onPositionError",s(t=>{switch(t.code){case t.PERMISSION_DENIED:N.error("Geolocation permission denied by the user.",t),dt.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:N.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:N.error("Geolocation request timed out.",t);break;default:N.error("An unknown geolocation error occurred.",t);break}this.disable()},"onPositionError"));h(this,"updateScale",s(()=>{var i;let t=Math.round(this.core.camera.zoomLevel*1e5);if(t!==u(this,yl)){I(this,yl,t);let n=(i=this.core.getMetresPerPixel())!=null?i:1;I(this,ft,Math.max(u(this,Kt).radius/(.35/n),1))}},"updateScale"))}enable(t){I(this,Kt,(0,f7.default)({},t,u(this,Kt))),this.watcherId&&navigator.geolocation.clearWatch(this.watcherId),this.geometry=this.core.addCustomGeometry("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[-79.3935,43.6532]}},{setup:i=>{let n=h7(u(this,Kt).accuracyRing.color,u(this,Kt).accuracyRing.opacity),{outerMesh:o,innerMesh:a}=d7(u(this,Kt).color),c=p7(u(this,Kt).bearing.color,u(this,Kt).bearing.opacity);i.add(n),i.add(o),i.add(a),i.add(c),this.updateScale()},update:this.updateGeometryPerFrame},{visible:!1},"outdoors-container"),this.watcherId=navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0})}disable(){this.watcherId&&navigator.geolocation.clearWatch(this.watcherId),this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),this.currentGeolocation=void 0}};Kt=new WeakMap,ft=new WeakMap,yl=new WeakMap,s(z1,"BlueDot");var Tp=z1;m();var Qr,vl,Z1=class Z1{constructor({currentMapGetter:e}){P(this,Qr,new Map);P(this,vl,void 0);I(this,vl,e)}get currentMap(){return u(this,vl).call(this)}getById(e){return u(this,Qr).get(e)}add(e,t,i){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Shapes.add(e,t||{},{floorId:i==null?void 0:i.id}),a=new ts(o);return u(this,Qr).set(a.id,a),a}remove(e){var i;u(this,Qr).get(e.id)&&((i=this.currentMap)==null||i.Shapes.remove(e),u(this,Qr).delete(e.id.toString()))}removeAll(){let e=[];return u(this,Qr).forEach(t=>{this.remove(t),e.push(t.id),u(this,Qr).delete(t.id.toString())}),e}};Qr=new WeakMap,vl=new WeakMap,s(Z1,"Shapes");var gl=Z1;m();var Cl,q1=class q1{constructor({currentMapGetter:e}){P(this,Cl,void 0);I(this,Cl,e)}get currentMap(){return u(this,Cl).call(this)}setFromStyleCollection(e){var t,i,n;for(let o in e)for(let a of((t=this.currentMap)==null?void 0:t.floors)||[])if(e[o]!=null){if(a.layers.has(o)&&"color"in e[o]){let c=a.layers.get(o);(i=this.currentMap)==null||i.renderer.setState(c,{color:e[o].color})}if(o===so&&!(fi in e)){let c=a.layers.get(fi);c&&"color"in e[o]&&((n=this.currentMap)==null||n.renderer.setState(c,{color:e[o].color}))}}}};Cl=new WeakMap,s(q1,"Style");var bl=q1;m();var Pr,xl,$1=class $1{constructor(e,t){P(this,Pr,void 0);P(this,xl,void 0);I(this,Pr,e),I(this,xl,t||[])}setStyle(e){var t,i;if(u(this,Pr).map){(t=u(this,Pr).map)==null||t.setStyle(e),(i=u(this,Pr).map)==null||i.moveLayer(ys);for(let[n,o]of u(this,xl)||[])u(this,Pr).hideOutdoorLayersUnderPoint(n,o)}}get map(){return u(this,Pr).map}get enabled(){return!!u(this,Pr).map}};Pr=new WeakMap,xl=new WeakMap,s($1,"Outdoor");var $o=$1;var Ip=.05,J1=class J1{constructor(e,t){h(this,"core");h(this,"outdoors");h(this,"mapObjects",[]);h(this,"id");h(this,"mapDataExternal",{});h(this,"mapsByFloorId",{});h(this,"mapData");h(this,"currentMap");h(this,"directions");h(this,"hiddenOutdoorGeometries",[]);h(this,"mapView");h(this,"Camera");h(this,"Labels");h(this,"Markers");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"Outdoor");h(this,"BlueDot");h(this,"Shapes");h(this,"Style");h(this,"update",s(()=>{this.core.render()},"update"));h(this,"getDirections",s((e,t,i)=>{if(!this.directions)throw new Error("You have to call .addMap() before you can get directions");let n=this.getMapDataInternal();if(!n)throw new Error("getDirections failed due to missing mapData");let{accessible:o=!1,smoothing:a=!0}=i||{},c=Array.isArray(e)?e:[e],l=Array.isArray(t)?t:[t];dt.sendGetDirectionsEvent(c[0].id,l[0].id);let p=typeof a=="object"?a.enabled:a,f=typeof a=="object"?a.radius:void 0,y=(i==null?void 0:i.zones)||[],g={accessible:o,zones:y,smoothing:{enabled:p!=null?p:!0,radius:f!=null?f:.75}};return this.directions.getDirections(c,l,g,n)},"getDirections"));this.core=e,this.mapView=t,this.Camera=new os(this.core),this.id=this.core.addGroupContainer("root").id.toString(),this.outdoors=new ll("outdoors-container",{"map.geojson":[{id:"outdoors",externalId:"outdoors",elevation:0}],"styles.json":{},space:{},entrance:{},obstruction:{}},{},{},this.core),this.mapObjects.push(this.outdoors);let i=new es(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",i)});let n=s(c=>l=>{var v,x,E;let p=[],f=[],y=[];l.labels.forEach(T=>{let w=this.Labels.getById(T.toString());w&&p.push(w.label)}),l.markers.forEach(T=>{let w=this.Markers.getById(T.toString());w&&f.push(w.marker)}),l.models.forEach(T=>{let w=this.Models.getById(T.toString());w&&y.push(w.model)});let g=l.geometry[0],C;g&&(C=(v=this.getMapDataInternal())==null?void 0:v.getById("space",g)),C||(C=(x=this.getMapDataInternal())==null?void 0:x.getById("object",g));let S=l.containers.reduce((T,w)=>{var O;let D=(O=this.getMapDataInternal())==null?void 0:O.getById("floor",w);return D&&Nr.is(D)&&T.push(D),T},[]),M={coordinate:new ee(l.coordinate[1],l.coordinate[0],(E=S==null?void 0:S[0])==null?void 0:E.id),spaces:C&&st.is(C)?[C]:[],objects:C&<.is(C)?[C]:[],markers:f,labels:p,models:y,floors:S};"pointerEvent"in l&&(M.pointerEvent=l.pointerEvent),this.mapView.publish(c,M)},"createHandler");this.core.on("hover",n("hover")),this.core.on("click",n("click")),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.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let o=s(()=>this.currentMap,"currentMapGetter");this.Markers=new cl({currentMapGetter:o}),this.Models=new pl({currentMapGetter:o}),this.Labels=new ps({currentMapGetter:o}),this.Exporter=new us({currentMapGetter:o}),this.Paths=new dl({currentMapGetter:o}),this.Navigation=new Fc(t),this.BlueDot=new Tp(this.core,this),this.BlueDot.on("floor-change",c=>{this.setFloor(c.floorId,"blue-dot-floor-change")}),this.Outdoor=new $o(this.core,this.hiddenOutdoorGeometries),this.Shapes=new gl({currentMapGetter:o}),this.Style=new bl({currentMapGetter:o});let a=new Wc(t,this.mapDataExternal);this.auto=a.auto}updateState(e,t){var n;if(e==="walls"){(n=this.currentMap)==null||n.floors.forEach(o=>{let a=o.layers.get(so),c=o.layers.get(fi);a&&this.core.setState(a,t),c&&this.core.setState(c,t)});return}let i=typeof e=="string"?this.getMapDataObject(e):e;if(i){if(vi.is(i))return this.core.setState(i.id,Eb({...t,type:"label"},this.core.getState(i.id)));if(sn.is(i))return this.core.setState(i.id,Db({...t,type:"marker"},this.core.getState(i.id)));(st.is(i)||lt.is(i))&&this.core.setState(i.id,Lb({...t,type:"geometry"},this.core.getState(i.id)))}}getMapDataObject(e){var t;return(t=this.getMapDataInternal())==null?void 0:t.getMapDataById(e)}getMapDataInternal(){if(this.mapData)return kl.get(this.mapData)}getMapData(){return this.mapData}expand(e){var t;return(t=this.currentMap)==null?void 0:t.StackedMaps.expand({excludeFloorIds:(e==null?void 0:e.excludeFloors.map(i=>i.id))||[]})}collapse(){var e;return(e=this.currentMap)==null?void 0:e.StackedMaps.collapse()}addMap(e,t){return new Promise(i=>{var g,C,S;let n=kl.get(e);if(!n){N.error("error exists"),i(e);return}this.mapDataExternal[e.mapName]=e;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ee(a[1],a[0])});let c=Ab(o["styles.json"]||{}),l=o["manifest.geojson"].features[0].properties.name,p=new ll("mapObject-".concat(l),o,c,t,this.core),f=this.core.getBoundingArea(p.currentFloor.id),y=(C=(g=t==null?void 0:t.outdoorView)==null?void 0:g.layersHiddenByGeometry)!=null?C:[];if(y.length>0){let M=(S=this.core.getCenter(f))!=null?S:a;this.core.hideOutdoorLayersUnderPoint(M,y),this.hiddenOutdoorGeometries.push([M,y])}this.mapObjects.push(p),o["map.geojson"].forEach(M=>{this.mapsByFloorId[M.id]=p}),p.StackedMaps.on("expanded",()=>{this.mapView.publish("expanded")}),p.StackedMaps.on("collapsed",()=>{this.mapView.publish("collapsed")}),p.on("floor-change-start",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),p.on("floor-change",M=>{this.mapView.publish("floor-change",{reason:M.reason,floor:this.currentFloor})}),this.currentMap=p,this.mapData=e,this.directions=new tu({nodes:this.currentMap.mvf["node.geojson"],obstructions:this.currentMap.mvf.obstruction,connections:this.currentMap.mvf["connection.json"],groupBy:"map"}),(t==null?void 0:t.zoomLevel)!=null?(this.core.camera.setZoomLevel(t.zoomLevel),i(e)):this.core.mode!=="outdoors-overlay"?this.core.camera.focusOn(this.core.getBoundingArea(p.currentFloor.id),{duration:ib,padding:{top:Ip*this.core.canvasHeight,left:Ip*this.core.canvasWidth,right:Ip*this.core.canvasWidth,bottom:Ip*this.core.canvasHeight}}).then(()=>{i(e)}):i(e)})}setFloor(e,t){if(!this.currentMap)throw new Error("mappObject should exist atm");this.currentMap.setFloor(typeof e=="string"?e:e.id,t)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloor(){var i,n;let e=(i=this.currentMap)==null?void 0:i.currentFloor.id;if(!e)throw new Error("Missing currentFloor object from GeoJsonApi");let t=(n=this.mapData)==null?void 0:n.getById("floor",e);if(!t)throw new Error("Missing currentFloor");return t}getState(e){var n;let t=typeof e=="string"?e:e.id,i=this.core.getState(t);if(i){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};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let o=typeof i.parent=="object"?i.parent.id:i.parent;return{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,coordinate:new ee(i.position[1],i.position[0],o.toString())}}else if(i.type==="model")return{type:"model"}}}setHoverColor(e){this.core.setState({hoverColor:e})}getHoverColor(){let e=this.core.getState();return(e==null?void 0:e.type)==="map-view"?e.hoverColor:void 0}createCoordinate(e,t,i){return new ee(e,t,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(e,t,i){let n=this.core.projectScreenXYToCoordinate(e,t);return n?new ee(n[1],n[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(e){return this.core.isInView(typeof e=="string"?e:e.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.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};s(J1,"GeoJsonApi");var Sl=J1;var Ml,K,K1=class K1 extends z{constructor(t){super();P(this,Ml,{});P(this,K,void 0);h(this,"Camera");h(this,"Labels");h(this,"Markers");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"BlueDot");h(this,"Style");h(this,"Shapes");h(this,"Outdoor");h(this,"update",s(()=>{u(this,K).core.render()},"update"));h(this,"getDirections",s((t,i,n)=>u(this,K).getDirections(t,i,n),"getDirections"));h(this,"on",s((t,i)=>{super.on(t,i)},"on"));h(this,"off",s((t,i)=>{super.off(t,i)},"off"));let i=new Sl(t,this);I(this,K,i),this.Camera=u(this,K).Camera,I(this,Ml,u(this,K).mapDataExternal),this.Markers=u(this,K).Markers,this.Models=u(this,K).Models,this.Labels=u(this,K).Labels,this.Exporter=u(this,K).Exporter,this.Paths=u(this,K).Paths,this.Navigation=u(this,K).Navigation,this.BlueDot=u(this,K).BlueDot,this.Shapes=u(this,K).Shapes,this.Style=u(this,K).Style,this.auto=u(this,K).auto,this.Outdoor=u(this,K).Outdoor}updateState(t,i){return u(this,K).updateState(t,i)}getMapData(){return u(this,Ml)}getDimensions(){return{width:this.__core.canvasWidth,height:this.__core.canvasHeight}}expand(t){return u(this,K).expand(t)}collapse(){return u(this,K).collapse()}addMap(t,i){return u(this,K).addMap(t,i)}setFloor(t){u(this,K).setFloor(t)}get currentFloor(){return u(this,K).currentFloor}updateWatermark(t){u(this,K).updateWatermark(t)}getState(t){return u(this,K).getState(t)}setHoverColor(t){u(this,K).setHoverColor(t)}getHoverColor(){return u(this,K).getHoverColor()}isInView(t){return u(this,K).isInView(t)}createCoordinate(t,i,n){return u(this,K).createCoordinate(t,i,n)}createCoordinateFromScreenCoordinate(t,i,n){return u(this,K).createCoordinateFromScreenCoordinate(t,i,n)}auto(){this.Labels.all()}get __core(){return u(this,K).core}clear(){u(this,K).clear()}destroy(){u(this,K).destroy()}async enableDebug(){let{Inspector:t}=await import("./inspector-6MGWZVYQ.js");await new t(this,u(this,K)).enable()}};Ml=new WeakMap,K=new WeakMap,s(K1,"MapView");var Jo=K1;m();m();var Q1=class Q1 extends z{constructor(t){super();h(this,"gl");h(this,"el",document.createElement("div"));h(this,"core");h(this,"origin");h(this,"map");h(this,"layer");h(this,"handleStyleChange",s(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));h(this,"handleMove",s(()=>{if(!this.map)return;let[t,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(t,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ne.degToRad(-this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ne.degToRad(this.map.getPitch()))},"handleMove"));h(this,"handleError",s(t=>{N.warn(t)},"handleError"));this.origin=t}onAdd(t){this.origin=this.origin||t.getCenter().toArray(),this.gl=t.painter.context.gl,this.core=new ol(t._container,{center:this.origin,zoomLevel:t.getZoom(),pitch:t.getPitch(),bearing:t.getBearing(),gl:this.gl,map:t,mode:"outdoors-overlay"}),this.map=t,this.core.camera.setMinZoomLevel(t.getMinZoom()),this.core.camera.setMaxZoomLevel(t.getMaxZoom()),this.core.camera.setMinPitch(t.getMinPitch()),this.core.camera.setMaxPitch(t.getMaxPitch()),this.map.on("error",this.handleError);let i=Al.fromLngLat(this.origin,0);return this.layer=mu(i,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};s(Q1,"MapLibreOverlay");var Ep=Q1;var Bn,Ko,Ai,Pl=class Pl extends Ep{constructor(t,i,n){super(t);P(this,Bn,void 0);P(this,Ko,void 0);P(this,Ai,void 0);I(this,Bn,i),I(this,Ko,n)}onAdd(t){var n,o;super.onAdd(t);let i={...Ra,...(n=u(this,Ko))!=null?n:{},outdoorView:{token:u(this,Bn).outdoorViewToken,...(o=u(this,Ko))==null?void 0:o.outdoorView}};return I(this,Ai,new Jo(this.core)),u(this,Ai).addMap(u(this,Bn),i).then(()=>{this.publish("loaded",{mapView:u(this,Ai),mapData:u(this,Bn)})}),this.el}onRemove(){u(this,Ai)&&u(this,Ai).clear(),Pl.instance=null,super.onRemove()}};Bn=new WeakMap,Ko=new WeakMap,Ai=new WeakMap,s(Pl,"MappedinMapLibreOverlay"),h(Pl,"instance");var Qo=Pl;var MI=s(async(r,e)=>{let t;try{e&&(t=(await Nl(e)).accessToken)}catch(o){N.warn("Getting access token failed. Outdoor map disabled.",o)}let i=new vo(r,t);return new Rl(i)},"hydrateMapDataFromMVF");function PI(r,e,t){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e,client_secret:t})})}s(PI,"fetchOutdoorViewToken");var m7=s(async r=>{let e={emitAnalyticsEvents:!0,...r},t;if("accessToken"in e)t=e.accessToken;else if("key"in e&&"secret"in e){let p=await PI("https://auth.mappedin.com/oauth2/token",e.key,e.secret),{access_token:f}=await p.json();t=f}else throw new Error("No outdoor view token provided and key and secret missing.");let i={...e,venue:e.mapId,clientId:e.key,clientSecret:e.secret,version:"1.0.0"},n=await Ny(i),o=await ca(n),a=la(o);typeof r.onMVFParsed=="function"&&r.onMVFParsed(a);let c=new vo(a,t);return new Rl(c)},"getMapDataEnterprise"),y7=!1;function wI(r){y7=r}s(wI,"setUseEnterpriseAPI");var TI=s(async r=>{if(y7)return m7(r);let e={emitAnalyticsEvents:!1,...r},t;"accessToken"in e?t=e.accessToken:t=(await Nl(e)).accessToken,dt.authReady||dt.updateState({accessToken:t});let i=performance.now(),n=await Rp(e,t),o=performance.now(),a=await ca(n),c=la(a),l=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(c);let p=new vo(c,t),f=new Rl(p);return dt.sendGetMapDataEvent({parseDuration:(l-o).toFixed(2),downloadDuration:(o-i).toFixed(2),viewId:e.viewId}),f},"getMapData"),II=s((r,e)=>{Qo.instance!=null&&N.warn("Only a single map venue is supported at this time.");let t=new Qo([r.mapCenter.longitude,r.mapCenter.latitude],r,e);return Qo.instance=t,t},"createMapLibreOverlay"),g7=s(async(r,e,t)=>{var c,l,p,f,y,g,C;let i=performance.now(),n=Bd(t,e);try{t&&Nd(t)}catch(S){if(S instanceof Error&&S.name==="MissingOutdoorViewToken")N.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw S}let o=await r7(r,{center:[e.mapCenter.longitude,e.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(c=n.style)==null?void 0:c.backgroundAlpha,backgroundColor:(l=n.style)==null?void 0:l.backgroundColor,outdoorView:(p=n.outdoorView)!=null&&p.token?{headers:{"x-mappedin-tiles-key":(f=n.outdoorView)==null?void 0:f.token},style:(y=n.outdoorView)==null?void 0:y.style,enabled:!!((g=n.outdoorView)!=null&&g.enabled)}:void 0,watermark:n.watermark,attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((C=n.antialiasing)!=null&&C.enabled)}),a=new Jo(o);return await a.addMap(e,n),dt.sendMapViewLoadedEvent({firstRenderDuration:(performance.now()-i).toFixed(2),dimension:a.getDimensions()}),a},"show3dMapGeojson"),EI=g7;export{N as a,ee as b,nI as c,dt as d,j1 as e,TI as f,EI as g,DI as h};
|