@mappedin/mappedin-js 6.32.0 → 6.33.0
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 +929 -116
- package/lib/esm/{chunk-SAPR7Z5M.js → chunk-DC7JFA2T.js} +104 -84
- package/lib/esm/{chunk-PQ2OLSSS.js → chunk-GTWQKKFE.js} +33 -30
- package/lib/esm/{chunk-J5TYCDYA.js → chunk-IMDMEZEU.js} +1 -1
- package/lib/esm/chunk-N3AVUTI4.js +2 -0
- package/lib/esm/chunk-O74CKEFP.js +1 -0
- package/lib/esm/{chunk-ZJEQSG7Y.js → chunk-TFGILZUF.js} +1 -1
- package/lib/esm/{chunk-7B7J4IXM.js → chunk-XBKEAHSJ.js} +1 -1
- package/lib/esm/index.d.ts +125 -10
- package/lib/esm/index.js +3 -3
- package/lib/esm/{inspector-BXOUWL5H.js → inspector-ZUQ77RHW.js} +2 -2
- package/lib/esm/{internal-WXG4ZPV3.js → internal-UFSDJP46.js} +1 -1
- package/lib/esm/{src-Q2KNMHOD.js → src-LANFAOHL.js} +1 -1
- package/lib/esm/{text3d-PIWYZMWH.js → text3d-5HITM4H2.js} +1 -1
- package/package.json +5 -1
- package/lib/esm/chunk-EXOCWBOF.js +0 -1
- package/lib/esm/chunk-TWRTSPVQ.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as Vt,B as qr,E as xe,a as b,e as jr,g as Xr,o as Xt,p as lt,r as Yr,s as Xe,w as Vr,x as Yt,y as ft}from"./chunk-7B7J4IXM.js";import{b as de,d as ut}from"./chunk-PWEV3AFA.js";var er=de((vu,Et)=>{b();(function(){"use strict";function t(s,a){var c=s.x-a.x,u=s.y-a.y;return c*c+u*u}function e(s,a,c){var u=a.x,f=a.y,l=c.x-u,h=c.y-f;if(l!==0||h!==0){var w=((s.x-u)*l+(s.y-f)*h)/(l*l+h*h);w>1?(u=c.x,f=c.y):w>0&&(u+=l*w,f+=h*w)}return l=s.x-u,h=s.y-f,l*l+h*h}function r(s,a){for(var c=s[0],u=[c],f,l=1,h=s.length;l<h;l++)f=s[l],t(f,c)>a&&(u.push(f),c=f);return c!==f&&u.push(f),u}function n(s,a,c,u,f){for(var l=u,h,w=a+1;w<c;w++){var p=e(s[w],s[a],s[c]);p>l&&(h=w,l=p)}l>u&&(h-a>1&&n(s,a,h,u,f),f.push(s[h]),c-h>1&&n(s,h,c,u,f))}function o(s,a){var c=s.length-1,u=[s[0]];return n(s,0,c,a,u),u.push(s[c]),u}function i(s,a,c){if(s.length<=2)return s;var u=a!==void 0?a*a:1;return s=c?s:r(s,u),s=o(s,u),s}typeof define=="function"&&define.amd?define(function(){return i}):typeof Et<"u"?(Et.exports=i,Et.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});var Bn=de((pr,hr)=>{b();(function(t,e){typeof pr=="object"&&typeof hr<"u"?hr.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.TinyQueue=e())})(pr,function(){"use strict";var t=function(n,o){if(n===void 0&&(n=[]),o===void 0&&(o=e),this.data=n,this.length=this.data.length,this.compare=o,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};t.prototype.push=function(n){this.data.push(n),this.length++,this._up(this.length-1)},t.prototype.pop=function(){if(this.length!==0){var n=this.data[0],o=this.data.pop();return this.length--,this.length>0&&(this.data[0]=o,this._down(0)),n}},t.prototype.peek=function(){return this.data[0]},t.prototype._up=function(n){for(var o=this,i=o.data,s=o.compare,a=i[n];n>0;){var c=n-1>>1,u=i[c];if(s(a,u)>=0)break;i[n]=u,n=c}i[n]=a},t.prototype._down=function(n){for(var o=this,i=o.data,s=o.compare,a=this.length>>1,c=i[n];n<a;){var u=(n<<1)+1,f=i[u],l=u+1;if(l<this.length&&s(i[l],f)<0&&(u=l,f=i[l]),s(f,c)>=0)break;i[n]=f,n=u}i[n]=c};function e(r,n){return r<n?-1:r>n?1:0}return t})});var Dn=de((tf,gr)=>{"use strict";b();var Ct=Bn();Ct.default&&(Ct=Ct.default);gr.exports=Rn;gr.exports.default=Rn;function Rn(t,e,r){e=e||1;for(var n,o,i,s,a=0;a<t[0].length;a++){var c=t[0][a];(!a||c[0]<n)&&(n=c[0]),(!a||c[1]<o)&&(o=c[1]),(!a||c[0]>i)&&(i=c[0]),(!a||c[1]>s)&&(s=c[1])}var u=i-n,f=s-o,l=Math.min(u,f),h=l/2;if(l===0){var w=[n,o];return w.distance=0,w}for(var p=new Ct(void 0,Bi),F=n;F<i;F+=l)for(var g=o;g<s;g+=l)p.push(new Se(F+h,g+h,h,t));var d=Di(t),x=new Se(n+u/2,o+f/2,0,t);x.d>d.d&&(d=x);for(var I=p.length;p.length;){var m=p.pop();m.d>d.d&&(d=m,r&&console.log("found best %d after %d probes",Math.round(1e4*m.d)/1e4,I)),!(m.max-d.d<=e)&&(h=m.h/2,p.push(new Se(m.x-h,m.y-h,h,t)),p.push(new Se(m.x+h,m.y-h,h,t)),p.push(new Se(m.x-h,m.y+h,h,t)),p.push(new Se(m.x+h,m.y+h,h,t)),I+=4)}r&&(console.log("num probes: "+I),console.log("best distance: "+d.d));var y=[d.x,d.y];return y.distance=d.d,y}function Bi(t,e){return e.max-t.max}function Se(t,e,r,n){this.x=t,this.y=e,this.h=r,this.d=Ri(t,e,n),this.max=this.d+this.h*Math.SQRT2}function Ri(t,e,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var s=r[i],a=0,c=s.length,u=c-1;a<c;u=a++){var f=s[a],l=s[u];f[1]>e!=l[1]>e&&t<(l[0]-f[0])*(e-f[1])/(l[1]-f[1])+f[0]&&(n=!n),o=Math.min(o,zi(t,e,f,l))}return o===0?0:(n?1:-1)*Math.sqrt(o)}function Di(t){for(var e=0,r=0,n=0,o=t[0],i=0,s=o.length,a=s-1;i<s;a=i++){var c=o[i],u=o[a],f=c[0]*u[1]-u[0]*c[1];r+=(c[0]+u[0])*f,n+=(c[1]+u[1])*f,e+=f*3}return e===0?new Se(o[0][0],o[0][1],0,t):new Se(r/e,n/e,0,t)}function zi(t,e,r,n){var o=r[0],i=r[1],s=n[0]-o,a=n[1]-i;if(s!==0||a!==0){var c=((t-o)*s+(e-i)*a)/(s*s+a*a);c>1?(o=n[0],i=n[1]):c>0&&(o+=s*c,i+=a*c)}return s=t-o,a=e-i,s*s+a*a}});var io=de((Er,Ir)=>{b();(function(t,e){typeof Er=="object"&&typeof Ir<"u"?Ir.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self).RBush=e()})(Er,function(){"use strict";function t(g,d,x,I,m){(function y(E,S,v,M,A){for(;M>v;){if(M-v>600){var P=M-v+1,T=S-v+1,L=Math.log(P),_=.5*Math.exp(2*L/3),B=.5*Math.sqrt(L*_*(P-_)/P)*(T-P/2<0?-1:1),G=Math.max(v,Math.floor(S-T*_/P+B)),z=Math.min(M,Math.floor(S+(P-T)*_/P+B));y(E,S,G,z,A)}var $=E[S],U=v,V=M;for(e(E,v,S),A(E[M],$)>0&&e(E,v,M);U<V;){for(e(E,U,V),U++,V--;A(E[U],$)<0;)U++;for(;A(E[V],$)>0;)V--}A(E[v],$)===0?e(E,v,V):e(E,++V,M),V<=S&&(v=V+1),S<=V&&(M=V-1)}})(g,d,x||0,I||g.length-1,m||r)}function e(g,d,x){var I=g[d];g[d]=g[x],g[x]=I}function r(g,d){return g<d?-1:g>d?1:0}var n=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(g,d,x){if(!x)return d.indexOf(g);for(var I=0;I<d.length;I++)if(x(g,d[I]))return I;return-1}function i(g,d){s(g,0,g.children.length,d,g)}function s(g,d,x,I,m){m||(m=p(null)),m.minX=1/0,m.minY=1/0,m.maxX=-1/0,m.maxY=-1/0;for(var y=d;y<x;y++){var E=g.children[y];a(m,g.leaf?I(E):E)}return m}function a(g,d){return g.minX=Math.min(g.minX,d.minX),g.minY=Math.min(g.minY,d.minY),g.maxX=Math.max(g.maxX,d.maxX),g.maxY=Math.max(g.maxY,d.maxY),g}function c(g,d){return g.minX-d.minX}function u(g,d){return g.minY-d.minY}function f(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function l(g){return g.maxX-g.minX+(g.maxY-g.minY)}function h(g,d){return g.minX<=d.minX&&g.minY<=d.minY&&d.maxX<=g.maxX&&d.maxY<=g.maxY}function w(g,d){return d.minX<=g.maxX&&d.minY<=g.maxY&&d.maxX>=g.minX&&d.maxY>=g.minY}function p(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function F(g,d,x,I,m){for(var y=[d,x];y.length;)if(!((x=y.pop())-(d=y.pop())<=I)){var E=d+Math.ceil((x-d)/I/2)*I;t(g,E,d,x,m),y.push(d,E,E,x)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(g){var d=this.data,x=[];if(!w(g,d))return x;for(var I=this.toBBox,m=[];d;){for(var y=0;y<d.children.length;y++){var E=d.children[y],S=d.leaf?I(E):E;w(g,S)&&(d.leaf?x.push(E):h(g,S)?this._all(E,x):m.push(E))}d=m.pop()}return x},n.prototype.collides=function(g){var d=this.data;if(!w(g,d))return!1;for(var x=[];d;){for(var I=0;I<d.children.length;I++){var m=d.children[I],y=d.leaf?this.toBBox(m):m;if(w(g,y)){if(d.leaf||h(g,y))return!0;x.push(m)}}d=x.pop()}return!1},n.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var d=0;d<g.length;d++)this.insert(g[d]);return this}var x=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var I=this.data;this.data=x,x=I}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},n.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},n.prototype.clear=function(){return this.data=p([]),this},n.prototype.remove=function(g,d){if(!g)return this;for(var x,I,m,y=this.data,E=this.toBBox(g),S=[],v=[];y||S.length;){if(y||(y=S.pop(),I=S[S.length-1],x=v.pop(),m=!0),y.leaf){var M=o(g,y.children,d);if(M!==-1)return y.children.splice(M,1),S.push(y),this._condense(S),this}m||y.leaf||!h(y,E)?I?(x++,y=I.children[x],m=!1):y=null:(S.push(y),v.push(x),x=0,I=y,y=y.children[0])}return this},n.prototype.toBBox=function(g){return g},n.prototype.compareMinX=function(g,d){return g.minX-d.minX},n.prototype.compareMinY=function(g,d){return g.minY-d.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(g){return this.data=g,this},n.prototype._all=function(g,d){for(var x=[];g;)g.leaf?d.push.apply(d,g.children):x.push.apply(x,g.children),g=x.pop();return d},n.prototype._build=function(g,d,x,I){var m,y=x-d+1,E=this._maxEntries;if(y<=E)return i(m=p(g.slice(d,x+1)),this.toBBox),m;I||(I=Math.ceil(Math.log(y)/Math.log(E)),E=Math.ceil(y/Math.pow(E,I-1))),(m=p([])).leaf=!1,m.height=I;var S=Math.ceil(y/E),v=S*Math.ceil(Math.sqrt(E));F(g,d,x,v,this.compareMinX);for(var M=d;M<=x;M+=v){var A=Math.min(M+v-1,x);F(g,M,A,S,this.compareMinY);for(var P=M;P<=A;P+=S){var T=Math.min(P+S-1,A);m.children.push(this._build(g,P,T,I-1))}}return i(m,this.toBBox),m},n.prototype._chooseSubtree=function(g,d,x,I){for(;I.push(d),!d.leaf&&I.length-1!==x;){for(var m=1/0,y=1/0,E=void 0,S=0;S<d.children.length;S++){var v=d.children[S],M=f(v),A=(P=g,T=v,(Math.max(T.maxX,P.maxX)-Math.min(T.minX,P.minX))*(Math.max(T.maxY,P.maxY)-Math.min(T.minY,P.minY))-M);A<y?(y=A,m=M<m?M:m,E=v):A===y&&M<m&&(m=M,E=v)}d=E||d.children[0]}var P,T;return d},n.prototype._insert=function(g,d,x){var I=x?g:this.toBBox(g),m=[],y=this._chooseSubtree(I,this.data,d,m);for(y.children.push(g),a(y,I);d>=0&&m[d].children.length>this._maxEntries;)this._split(m,d),d--;this._adjustParentBBoxes(I,m,d)},n.prototype._split=function(g,d){var x=g[d],I=x.children.length,m=this._minEntries;this._chooseSplitAxis(x,m,I);var y=this._chooseSplitIndex(x,m,I),E=p(x.children.splice(y,x.children.length-y));E.height=x.height,E.leaf=x.leaf,i(x,this.toBBox),i(E,this.toBBox),d?g[d-1].children.push(E):this._splitRoot(x,E)},n.prototype._splitRoot=function(g,d){this.data=p([g,d]),this.data.height=g.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(g,d,x){for(var I,m,y,E,S,v,M,A=1/0,P=1/0,T=d;T<=x-d;T++){var L=s(g,0,T,this.toBBox),_=s(g,T,x,this.toBBox),B=(m=L,y=_,E=void 0,S=void 0,v=void 0,M=void 0,E=Math.max(m.minX,y.minX),S=Math.max(m.minY,y.minY),v=Math.min(m.maxX,y.maxX),M=Math.min(m.maxY,y.maxY),Math.max(0,v-E)*Math.max(0,M-S)),G=f(L)+f(_);B<A?(A=B,I=T,P=G<P?G:P):B===A&&G<P&&(P=G,I=T)}return I||x-d},n.prototype._chooseSplitAxis=function(g,d,x){var I=g.leaf?this.compareMinX:c,m=g.leaf?this.compareMinY:u;this._allDistMargin(g,d,x,I)<this._allDistMargin(g,d,x,m)&&g.children.sort(I)},n.prototype._allDistMargin=function(g,d,x,I){g.children.sort(I);for(var m=this.toBBox,y=s(g,0,d,m),E=s(g,x-d,x,m),S=l(y)+l(E),v=d;v<x-d;v++){var M=g.children[v];a(y,g.leaf?m(M):M),S+=l(y)}for(var A=x-d-1;A>=d;A--){var P=g.children[A];a(E,g.leaf?m(P):P),S+=l(E)}return S},n.prototype._adjustParentBBoxes=function(g,d,x){for(var I=x;I>=0;I--)a(d[I],g)},n.prototype._condense=function(g){for(var d=g.length-1,x=void 0;d>=0;d--)g[d].children.length===0?d>0?(x=g[d-1].children).splice(x.indexOf(g[d]),1):this.clear():i(g[d],this.toBBox)},n})});var Fr=de(O=>{"use strict";b();Object.defineProperty(O,"__esModule",{value:!0});O.earthRadius=63710088e-1;O.factors={centimeters:O.earthRadius*100,centimetres:O.earthRadius*100,degrees:O.earthRadius/111325,feet:O.earthRadius*3.28084,inches:O.earthRadius*39.37,kilometers:O.earthRadius/1e3,kilometres:O.earthRadius/1e3,meters:O.earthRadius,metres:O.earthRadius,miles:O.earthRadius/1609.344,millimeters:O.earthRadius*1e3,millimetres:O.earthRadius*1e3,nauticalmiles:O.earthRadius/1852,radians:1,yards:O.earthRadius*1.0936};O.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/O.earthRadius,yards:1.0936133};O.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 Ae(t,e,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}O.feature=Ae;function Rs(t,e,r){switch(r===void 0&&(r={}),t){case"Point":return Sr(e).geometry;case"LineString":return Ar(e).geometry;case"Polygon":return Mr(e).geometry;case"MultiPoint":return ao(e).geometry;case"MultiLineString":return so(e).geometry;case"MultiPolygon":return co(e).geometry;default:throw new Error(t+" is invalid")}}O.geometry=Rs;function Sr(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!kt(t[0])||!kt(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Ae(n,e,r)}O.point=Sr;function Ds(t,e,r){return r===void 0&&(r={}),Bt(t.map(function(n){return Sr(n,e)}),r)}O.points=Ds;function Mr(t,e,r){r===void 0&&(r={});for(var n=0,o=t;n<o.length;n++){var i=o[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:t};return Ae(a,e,r)}O.polygon=Mr;function zs(t,e,r){return r===void 0&&(r={}),Bt(t.map(function(n){return Mr(n,e)}),r)}O.polygons=zs;function Ar(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Ae(n,e,r)}O.lineString=Ar;function Gs(t,e,r){return r===void 0&&(r={}),Bt(t.map(function(n){return Ar(n,e)}),r)}O.lineStrings=Gs;function Bt(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}O.featureCollection=Bt;function so(t,e,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:t};return Ae(n,e,r)}O.multiLineString=so;function ao(t,e,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:t};return Ae(n,e,r)}O.multiPoint=ao;function co(t,e,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:t};return Ae(n,e,r)}O.multiPolygon=co;function Us(t,e,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:t};return Ae(n,e,r)}O.geometryCollection=Us;function js(t,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}O.round=js;function uo(t,e){e===void 0&&(e="kilometers");var r=O.factors[e];if(!r)throw new Error(e+" units is invalid");return t*r}O.radiansToLength=uo;function Pr(t,e){e===void 0&&(e="kilometers");var r=O.factors[e];if(!r)throw new Error(e+" units is invalid");return t/r}O.lengthToRadians=Pr;function Xs(t,e){return lo(Pr(t,e))}O.lengthToDegrees=Xs;function Ys(t){var e=t%360;return e<0&&(e+=360),e}O.bearingToAzimuth=Ys;function lo(t){var e=t%(2*Math.PI);return e*180/Math.PI}O.radiansToDegrees=lo;function Vs(t){var e=t%360;return e*Math.PI/180}O.degreesToRadians=Vs;function qs(t,e,r){if(e===void 0&&(e="kilometers"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return uo(Pr(t,e),r)}O.convertLength=qs;function Ws(t,e,r){if(e===void 0&&(e="meters"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=O.areaFactors[e];if(!n)throw new Error("invalid original units");var o=O.areaFactors[r];if(!o)throw new Error("invalid final units");return t/n*o}O.convertArea=Ws;function kt(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}O.isNumber=kt;function Zs(t){return!!t&&t.constructor===Object}O.isObject=Zs;function $s(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!kt(e))throw new Error("bbox must only contain numbers")})}O.validateBBox=$s;function Hs(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}O.validateId=Hs});var mo=de(X=>{"use strict";b();Object.defineProperty(X,"__esModule",{value:!0});var J=Fr();function st(t,e,r){if(t!==null)for(var n,o,i,s,a,c,u,f=0,l=0,h,w=t.type,p=w==="FeatureCollection",F=w==="Feature",g=p?t.features.length:1,d=0;d<g;d++){u=p?t.features[d].geometry:F?t.geometry:t,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var x=0;x<a;x++){var I=0,m=0;if(s=h?u.geometries[x]:u,s!==null){c=s.coordinates;var y=s.type;switch(f=r&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(e(c,l,d,I,m)===!1)return!1;l++,I++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],l,d,I,m)===!1)return!1;l++,y==="MultiPoint"&&I++}y==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(e(c[n][o],l,d,I,m)===!1)return!1;l++}y==="MultiLineString"&&I++,y==="Polygon"&&m++}y==="Polygon"&&I++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(m=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(e(c[n][o][i],l,d,I,m)===!1)return!1;l++}m++}I++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(st(s.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Js(t,e,r,n){var o=r;return st(t,function(i,s,a,c,u){s===0&&r===void 0?o=i:o=e(o,i,s,a,c,u)},n),o}function fo(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&e(t.features[r].properties,r)!==!1;r++);break;case"Feature":e(t.properties,0);break}}function Ks(t,e,r){var n=r;return fo(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function po(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function Qs(t,e,r){var n=r;return po(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function ea(t){var e=[];return st(t,function(r){e.push(r)}),e}function Nr(t,e){var r,n,o,i,s,a,c,u,f,l,h=0,w=t.type==="FeatureCollection",p=t.type==="Feature",F=w?t.features.length:1;for(r=0;r<F;r++){for(a=w?t.features[r].geometry:p?t.geometry:t,u=w?t.features[r].properties:p?t.properties:{},f=w?t.features[r].bbox:p?t.bbox:void 0,l=w?t.features[r].id:p?t.id:void 0,c=a?a.type==="GeometryCollection":!1,s=c?a.geometries.length:1,o=0;o<s;o++){if(i=c?a.geometries[o]:a,i===null){if(e(null,h,u,f,l)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(i,h,u,f,l)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(e(i.geometries[n],h,u,f,l)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function ta(t,e,r){var n=r;return Nr(t,function(o,i,s,a,c){i===0&&r===void 0?n=o:n=e(n,o,i,s,a,c)}),n}function Rt(t,e){Nr(t,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(J.feature(r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var c;switch(a){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var f=r.coordinates[u],l={type:c,coordinates:f};if(e(J.feature(l,o),n,u)===!1)return!1}})}function ra(t,e,r){var n=r;return Rt(t,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=e(n,o,i,s)}),n}function ho(t,e){Rt(t,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,c=0,u=0,f=0;if(st(r,function(l,h,w,p,F){if(a===void 0||n>c||p>u||F>f){a=l,c=n,u=p,f=F,i=0;return}var g=J.lineString([a,l],r.properties);if(e(g,n,o,F,i)===!1)return!1;i++,a=l})===!1)return!1}}})}function na(t,e,r){var n=r,o=!1;return ho(t,function(i,s,a,c,u){o===!1&&r===void 0?n=i:n=e(n,i,s,a,c,u),o=!0}),n}function go(t,e){if(!t)throw new Error("geojson is required");Rt(t,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(e(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(e(J.lineString(s[a],r.properties),n,o,a)===!1)return!1;break}}})}function oa(t,e,r){var n=r;return go(t,function(o,i,s,a){i===0&&r===void 0?n=o:n=e(n,o,i,s,a)}),n}function ia(t,e){if(e=e||{},!J.isObject(e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.segmentIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),J.lineString([c[i],c[i+1]],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),J.lineString([c[o][i],c[o][i+1]],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),J.lineString([c[n][i],c[n][i+1]],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),J.lineString([c[n][o][i],c[n][o][i+1]],s,e)}throw new Error("geojson is invalid")}function sa(t,e){if(e=e||{},!J.isObject(e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.coordIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":return J.point(c,s,e);case"MultiPoint":return n<0&&(n=c.length+n),J.point(c[n],s,e);case"LineString":return i<0&&(i=c.length+i),J.point(c[i],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),J.point(c[o][i],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),J.point(c[n][i],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),J.point(c[n][o][i],s,e)}throw new Error("geojson is invalid")}X.coordAll=ea;X.coordEach=st;X.coordReduce=Js;X.featureEach=po;X.featureReduce=Qs;X.findPoint=sa;X.findSegment=ia;X.flattenEach=Rt;X.flattenReduce=ra;X.geomEach=Nr;X.geomReduce=ta;X.lineEach=go;X.lineReduce=oa;X.propEach=fo;X.propReduce=Ks;X.segmentEach=ho;X.segmentReduce=na});var Eo=de(k=>{"use strict";b();Object.defineProperty(k,"__esModule",{value:!0});var oe=63710088e-1,Or={centimeters:oe*100,centimetres:oe*100,degrees:360/(2*Math.PI),feet:oe*3.28084,inches:oe*39.37,kilometers:oe/1e3,kilometres:oe/1e3,meters:oe,metres:oe,miles:oe/1609.344,millimeters:oe*1e3,millimetres:oe*1e3,nauticalmiles:oe/1852,radians:1,yards:oe*1.0936},Tr={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 Pe(t,e,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function aa(t,e,r={}){switch(t){case"Point":return Lr(e).geometry;case"LineString":return _r(e).geometry;case"Polygon":return Cr(e).geometry;case"MultiPoint":return vo(e).geometry;case"MultiLineString":return yo(e).geometry;case"MultiPolygon":return bo(e).geometry;default:throw new Error(t+" is invalid")}}function Lr(t,e,r={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Dt(t[0])||!Dt(t[1]))throw new Error("coordinates must contain numbers");return Pe({type:"Point",coordinates:t},e,r)}function ca(t,e,r={}){return zt(t.map(n=>Lr(n,e)),r)}function Cr(t,e,r={}){for(let o of t){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let i=0;i<o[o.length-1].length;i++)if(o[o.length-1][i]!==o[0][i])throw new Error("First and last Position are not equivalent.")}return Pe({type:"Polygon",coordinates:t},e,r)}function ua(t,e,r={}){return zt(t.map(n=>Cr(n,e)),r)}function _r(t,e,r={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return Pe({type:"LineString",coordinates:t},e,r)}function la(t,e,r={}){return zt(t.map(n=>_r(n,e)),r)}function zt(t,e={}){let r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function yo(t,e,r={}){return Pe({type:"MultiLineString",coordinates:t},e,r)}function vo(t,e,r={}){return Pe({type:"MultiPoint",coordinates:t},e,r)}function bo(t,e,r={}){return Pe({type:"MultiPolygon",coordinates:t},e,r)}function fa(t,e,r={}){return Pe({type:"GeometryCollection",geometries:t},e,r)}function da(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,e||0);return Math.round(t*r)/r}function xo(t,e="kilometers"){let r=Or[e];if(!r)throw new Error(e+" units is invalid");return t*r}function kr(t,e="kilometers"){let r=Or[e];if(!r)throw new Error(e+" units is invalid");return t/r}function pa(t,e){return wo(kr(t,e))}function ha(t){let e=t%360;return e<0&&(e+=360),e}function ga(t){return t=t%360,t>180?t-360:t<-180?t+360:t}function wo(t){return t%(2*Math.PI)*180/Math.PI}function ma(t){return t%360*Math.PI/180}function ya(t,e="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return xo(kr(t,e),r)}function va(t,e="meters",r="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");let n=Tr[e];if(!n)throw new Error("invalid original units");let o=Tr[r];if(!o)throw new Error("invalid final units");return t/n*o}function Dt(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function ba(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function xa(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(e=>{if(!Dt(e))throw new Error("bbox must only contain numbers")})}function wa(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}k.areaFactors=Tr;k.azimuthToBearing=ga;k.bearingToAzimuth=ha;k.convertArea=va;k.convertLength=ya;k.degreesToRadians=ma;k.earthRadius=oe;k.factors=Or;k.feature=Pe;k.featureCollection=zt;k.geometry=aa;k.geometryCollection=fa;k.isNumber=Dt;k.isObject=ba;k.lengthToDegrees=pa;k.lengthToRadians=kr;k.lineString=_r;k.lineStrings=la;k.multiLineString=yo;k.multiPoint=vo;k.multiPolygon=bo;k.point=Lr;k.points=ca;k.polygon=Cr;k.polygons=ua;k.radiansToDegrees=wo;k.radiansToLength=xo;k.round=da;k.validateBBox=xa;k.validateId=wa});var Po=de(Y=>{"use strict";b();Object.defineProperty(Y,"__esModule",{value:!0});var K=Eo();function at(t,e,r){if(t!==null)for(var n,o,i,s,a,c,u,f=0,l=0,h,w=t.type,p=w==="FeatureCollection",F=w==="Feature",g=p?t.features.length:1,d=0;d<g;d++){u=p?t.features[d].geometry:F?t.geometry:t,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var x=0;x<a;x++){var I=0,m=0;if(s=h?u.geometries[x]:u,s!==null){c=s.coordinates;var y=s.type;switch(f=r&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(e(c,l,d,I,m)===!1)return!1;l++,I++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],l,d,I,m)===!1)return!1;l++,y==="MultiPoint"&&I++}y==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(e(c[n][o],l,d,I,m)===!1)return!1;l++}y==="MultiLineString"&&I++,y==="Polygon"&&m++}y==="Polygon"&&I++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(m=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(e(c[n][o][i],l,d,I,m)===!1)return!1;l++}m++}I++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(at(s.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ea(t,e,r,n){var o=r;return at(t,function(i,s,a,c,u){s===0&&r===void 0?o=i:o=e(o,i,s,a,c,u)},n),o}function Io(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&e(t.features[r].properties,r)!==!1;r++);break;case"Feature":e(t.properties,0);break}}function Ia(t,e,r){var n=r;return Io(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function So(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function Sa(t,e,r){var n=r;return So(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function Ma(t){var e=[];return at(t,function(r){e.push(r)}),e}function Br(t,e){var r,n,o,i,s,a,c,u,f,l,h=0,w=t.type==="FeatureCollection",p=t.type==="Feature",F=w?t.features.length:1;for(r=0;r<F;r++){for(a=w?t.features[r].geometry:p?t.geometry:t,u=w?t.features[r].properties:p?t.properties:{},f=w?t.features[r].bbox:p?t.bbox:void 0,l=w?t.features[r].id:p?t.id:void 0,c=a?a.type==="GeometryCollection":!1,s=c?a.geometries.length:1,o=0;o<s;o++){if(i=c?a.geometries[o]:a,i===null){if(e(null,h,u,f,l)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(i,h,u,f,l)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(e(i.geometries[n],h,u,f,l)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Aa(t,e,r){var n=r;return Br(t,function(o,i,s,a,c){i===0&&r===void 0?n=o:n=e(n,o,i,s,a,c)}),n}function Gt(t,e){Br(t,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(K.feature.call(void 0,r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var c;switch(a){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var f=r.coordinates[u],l={type:c,coordinates:f};if(e(K.feature.call(void 0,l,o),n,u)===!1)return!1}})}function Pa(t,e,r){var n=r;return Gt(t,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=e(n,o,i,s)}),n}function Mo(t,e){Gt(t,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,c=0,u=0,f=0;if(at(r,function(l,h,w,p,F){if(a===void 0||n>c||p>u||F>f){a=l,c=n,u=p,f=F,i=0;return}var g=K.lineString.call(void 0,[a,l],r.properties);if(e(g,n,o,F,i)===!1)return!1;i++,a=l})===!1)return!1}}})}function Fa(t,e,r){var n=r,o=!1;return Mo(t,function(i,s,a,c,u){o===!1&&r===void 0?n=i:n=e(n,i,s,a,c,u),o=!0}),n}function Ao(t,e){if(!t)throw new Error("geojson is required");Gt(t,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(e(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(e(K.lineString.call(void 0,s[a],r.properties),n,o,a)===!1)return!1;break}}})}function Na(t,e,r){var n=r;return Ao(t,function(o,i,s,a){i===0&&r===void 0?n=o:n=e(n,o,i,s,a)}),n}function Ta(t,e){if(e=e||{},!K.isObject.call(void 0,e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.segmentIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),K.lineString.call(void 0,[c[i],c[i+1]],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),K.lineString.call(void 0,[c[o][i],c[o][i+1]],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),K.lineString.call(void 0,[c[n][i],c[n][i+1]],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),K.lineString.call(void 0,[c[n][o][i],c[n][o][i+1]],s,e)}throw new Error("geojson is invalid")}function Oa(t,e){if(e=e||{},!K.isObject.call(void 0,e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.coordIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":return K.point.call(void 0,c,s,e);case"MultiPoint":return n<0&&(n=c.length+n),K.point.call(void 0,c[n],s,e);case"LineString":return i<0&&(i=c.length+i),K.point.call(void 0,c[i],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),K.point.call(void 0,c[o][i],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),K.point.call(void 0,c[n][i],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),K.point.call(void 0,c[n][o][i],s,e)}throw new Error("geojson is invalid")}Y.coordAll=Ma;Y.coordEach=at;Y.coordReduce=Ea;Y.featureEach=So;Y.featureReduce=Sa;Y.findPoint=Oa;Y.findSegment=Ta;Y.flattenEach=Gt;Y.flattenReduce=Pa;Y.geomEach=Br;Y.geomReduce=Aa;Y.lineEach=Ao;Y.lineReduce=Na;Y.propEach=Io;Y.propReduce=Ia;Y.segmentEach=Mo;Y.segmentReduce=Fa});var No=de(Ut=>{"use strict";b();Object.defineProperty(Ut,"__esModule",{value:!0});var La=Po();function Fo(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;let r=[1/0,1/0,-1/0,-1/0];return La.coordEach.call(void 0,t,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}var Ca=Fo;Ut.bbox=Fo;Ut.default=Ca});var _o=de((Lp,Rr)=>{b();var ge=io(),Oo=Fr(),Lo=mo(),ze=No().default,_a=Lo.featureEach,Tp=Lo.coordEach,Op=Oo.polygon,To=Oo.featureCollection;function Co(t){var e=new ge(t);return e.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:ze(r),ge.prototype.insert.call(this,r)},e.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:ze(o),n.push(o)}):_a(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:ze(o),n.push(o)}),ge.prototype.load.call(this,n)},e.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:ze(r),ge.prototype.remove.call(this,r,n)},e.clear=function(){return ge.prototype.clear.call(this)},e.search=function(r){var n=ge.prototype.search.call(this,this.toBBox(r));return To(n)},e.collides=function(r){return ge.prototype.collides.call(this,this.toBBox(r))},e.all=function(){var r=ge.prototype.all.call(this);return To(r)},e.toJSON=function(){return ge.prototype.toJSON.call(this)},e.fromJSON=function(r){return ge.prototype.fromJSON.call(this,r)},e.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=ze(r);else if(r.type==="FeatureCollection")n=ze(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},e}Rr.exports=Co;Rr.exports.default=Co});b();b();var Fe=class extends Error{};Fe.prototype.name="InvalidTokenError";function Do(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function zo(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Do(e)}catch{return atob(e)}}function Wr(t,e){if(typeof t!="string")throw new Fe("Invalid token specified: must be a string");e||(e={});let r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new Fe(`Invalid token specified: missing part #${r+1}`);let o;try{o=zo(n)}catch(i){throw new Fe(`Invalid token specified: invalid base64 for part #${r+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Fe(`Invalid token specified: invalid json for part #${r+1} (${i.message})`)}}b();function Go(t,e,r,n){return(t<e||t>r)&&Xr.warn(n),Math.min(r,Math.max(e,t))}b();function Uo(t,e){if(t==null||e==null)return t===e;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Va(t){let e=Wr(t);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:e.aud??[],capabilities:e.capabilities??{}}}function me(t){return t*(Math.PI/180)}function Zr(t){return t*(180/Math.PI)}function qa(t,e){let r=Math.pow(10,e);return Math.sign(t)*Math.round(Math.abs(t)*r)/r}function $r(t,e){return(t%e+e)%e}function Wa(t,e){let r=$r(t,Math.PI*2),n=$r(e,Math.PI*2),o=n-r,i=n+(o>Math.PI?-Math.PI*2:o<-Math.PI?Math.PI*2:0);return{start:r,end:i}}function Za(){return typeof window<"u"&&window!==null}function Hr(t,e){let[r,n]=t,[o,i]=e,s=me(o-r),a=me(i-n);return Math.sqrt(s*s+a*a)*xe}function re(t,e){let r=me(t[0]),n=me(t[1]),o=me(e[0]),i=me(e[1]),s=i-n,c=(o-r)*Math.cos((n+i)/2),u=s;return Math.sqrt(c*c+u*u)*xe}function qt(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function dt(t){let e=me(t),n=Math.cos(e)*xe;function o(s,a){let c=me(s[0]),u=me(s[1]),f=c*n,l=u*xe;return a?(a.x=f,a.y=l,a):{x:f,y:l}}return{toCartesian:o,toGeographic:(s,a)=>{let c=Zr(s/n),u=Zr(a/xe);return{lon:c,lat:u}}}}var $a=()=>{};b();b();b();b();b();function q([t,e],[r,n]){let o=e-n,i=t-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}b();b();function pt(t,e,r,n){let[o,i]=t,[s,a]=e,[c,u]=r,[f,l]=n;if(i===a&&o===s||u===l&&c===f)return null;let h=(f-c)*(a-i)-(l-u)*(s-o);if(h===0)return null;let w=((l-u)*(o-c)-(f-c)*(i-u))/h,p=((a-i)*(o-c)-(s-o)*(i-u))/h;if(w<0||w>1||p<0||p>1)return null;let F=i+w*(a-i);return[o+w*(s-o),F]}b();b();b();function ht(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ne(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Jr(t){return t.type==="Feature"?t.geometry:t}function sc(t,e){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function gt(t,e,r,n){n===void 0&&(n={});var o=ht(t),i=ft(o[0]),s=ft(o[1]),a=ft(r),c=Vr(e,n.units),u=Math.asin(Math.sin(s)*Math.cos(c)+Math.cos(s)*Math.sin(c)*Math.cos(a)),f=i+Math.atan2(Math.sin(a)*Math.sin(c)*Math.cos(s),Math.cos(c)-Math.sin(s)*Math.sin(u)),l=Yt(f),h=Yt(u);return lt([l,h],n.properties)}function Wt(t,e,r,n){let o=gt(t,r/1e3,n),i=gt(e,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}b();function Le(t){let e=t*(180/Math.PI);return e=e%360,e>180?e-=360:e<-180&&(e+=360),Object.is(e,-0)?0:e}var Kr=111e3;function Qr(t,e,r,n,o){return Math.max(t[0][0],t[1][0])>=e&&Math.min(t[0][0],t[1][0])<=r&&Math.max(t[0][1],t[1][1])>=n&&Math.min(t[0][1],t[1][1])<=o}function pe(t,e,r=[],n=0){let o=t.geometry.coordinates,i=e.geometry.coordinates;if(r.length===0)return!0;let s=n/Kr,a=n/(Kr*Math.cos(o[1]*Math.PI/180)),c=Math.min(o[1],i[1])-s,u=Math.max(o[1],i[1])+s,f=Math.min(o[0],i[0])-a,l=Math.max(o[0],i[0])+a;if(n>0){let h=Le(q(o,i)-Math.PI/2),w=Le(q(o,i)+Math.PI/2),p=Wt(o,i,n,h),F=Wt(o,i,n,w);for(let g of r)if(Qr(g,f,l,c,u)&&(pt(p[0],p[1],g[0],g[1])||pt(F[0],F[1],g[0],g[1])))return!1}else for(let h of r)if(Qr(h,f,l,c,u)&&pt(o,i,h[0],h[1]))return!1;return!0}b();function en(t,e=.5){let[r,n]=t,o=(r.x+n.x)/2,i=(r.y+n.y)/2,s=n.x-r.x,c=-(n.y-r.y),u=s,f=Math.sqrt(c*c+u*u),l=c/f,h=u/f,w={x:o+l*e,y:i+h*e},p={x:o-l*e,y:i-h*e};return[w,p]}b();function D(t){return t.properties.floor??t.properties.map}b();var tn=111e3,jo=63710088e-1/1e3,Xo=256,Ye=0,Zt=4,$t=8,we=12,rn=new WeakMap;function Yo(t){let e=t.length,r=1/0,n=1/0,o=-1/0,i=-1/0;for(let m=0;m<e;m++){let y=t[m][0],E=t[m][1];y[0]<r&&(r=y[0]),E[0]<r&&(r=E[0]),y[0]>o&&(o=y[0]),E[0]>o&&(o=E[0]),y[1]<n&&(n=y[1]),E[1]<n&&(n=E[1]),y[1]>i&&(i=y[1]),E[1]>i&&(i=E[1])}let s=Math.max(1,Math.min(Xo,Math.ceil(Math.sqrt(e)))),a=s,c=s,u=o-r,f=i-n,l=u/a||f/a||1e-9,h=f/c||u/c||1e-9,w=(m,y,E,S)=>{let v=Math.floor((m-y)/E);return v<0?0:v>=S?S-1:v},p=a*c,F=new Int32Array(p+1),g=(m,y)=>{let E=t[m][0],S=t[m][1],v=w(Math.min(E[0],S[0]),r,l,a),M=w(Math.max(E[0],S[0]),r,l,a),A=w(Math.min(E[1],S[1]),n,h,c),P=w(Math.max(E[1],S[1]),n,h,c);for(let T=A;T<=P;T++)for(let L=v;L<=M;L++)y(T*a+L)};for(let m=0;m<e;m++)g(m,y=>F[y+1]++);for(let m=0;m<p;m++)F[m+1]+=F[m];let d=F.slice(),x=F.slice(0,p),I=new Int32Array(d[p]);for(let m=0;m<e;m++)g(m,y=>I[x[y]++]=m);return{edges:t,edgeCount:e,minX:r,minY:n,cellW:l,cellH:h,cols:a,rows:c,cellStart:d,cellEdges:I,cellStamp:new Uint32Array(p),edgeStamp:new Uint32Array(e),stamp:0}}function Vo(t){let e=rn.get(t);return(!e||e.edgeCount!==t.length)&&(e=Yo(t),rn.set(t,e)),e}function qo(t,e,r,n,o,i,s,a){if(e===n&&t===r||i===a&&o===s)return!1;let c=(s-o)*(n-e)-(a-i)*(r-t);if(c===0)return!1;let u=((a-i)*(t-o)-(s-o)*(e-i))/c,f=((n-e)*(t-o)-(r-t)*(e-i))/c;return!(u<0||u>1||f<0||f>1)}function Ht(t,e,r){let n=e[r],o=e[r+1],i=e[r+2],s=e[r+3],a=e[we],c=e[we+1],u=e[we+2],f=e[we+3],{edges:l,cols:h,rows:w,cellW:p,cellH:F,minX:g,minY:d,cellStart:x,cellEdges:I,cellStamp:m,edgeStamp:y}=t,E=t.stamp,S=Math.ceil(Math.max(Math.abs(i-n)/p,Math.abs(s-o)/F)*2)+1;for(let v=0;v<=S;v++){let M=v/S,A=Math.floor((n+(i-n)*M-g)/p),P=Math.floor((o+(s-o)*M-d)/F);A=A<0?0:A>=h?h-1:A,P=P<0?0:P>=w?w-1:P;let T=P>0?P-1:0,L=P<w-1?P+1:P,_=A>0?A-1:0,B=A<h-1?A+1:A;for(let G=T;G<=L;G++)for(let z=_;z<=B;z++){let $=G*h+z;if(m[$]!==E){m[$]=E;for(let U=x[$],V=x[$+1];U<V;U++){let ve=I[U];if(y[ve]===E)continue;y[ve]=E;let te=l[ve][0],Z=l[ve][1];if(!(Math.max(te[0],Z[0])<a||Math.min(te[0],Z[0])>c||Math.max(te[1],Z[1])<u||Math.min(te[1],Z[1])>f)&&qo(n,o,i,s,te[0],te[1],Z[0],Z[1]))return!0}}}}return!1}var Jt=t=>t%360*Math.PI/180,nn=t=>t%(2*Math.PI)*180/Math.PI;function mt(t,e,r,n,o,i){let s=Jt(r),a=Jt(n),c=Jt(i),u=o/jo,f=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(c)),l=s+Math.atan2(Math.sin(c)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(f));t[e]=nn(l),t[e+1]=nn(f)}function on(t=[]){if(t.length===0)return()=>!0;let e=Vo(t),r=new Float64Array(16),n=()=>{++e.stamp===4294967295&&(e.cellStamp.fill(0),e.edgeStamp.fill(0),e.stamp=1)};return(o,i,s)=>{let a=o.geometry.coordinates,c=i.geometry.coordinates,u=s/tn,f=s/(tn*Math.cos(a[1]*Math.PI/180));if(r[we]=Math.min(a[0],c[0])-f,r[we+1]=Math.max(a[0],c[0])+f,r[we+2]=Math.min(a[1],c[1])-u,r[we+3]=Math.max(a[1],c[1])+u,n(),s>0){let l=q(a,c),h=Le(l-Math.PI/2),w=Le(l+Math.PI/2),p=s/1e3;return mt(r,Zt,a[0],a[1],p,h),mt(r,Zt+2,c[0],c[1],p,h),Ht(e,r,Zt)?!1:(mt(r,$t,a[0],a[1],p,w),mt(r,$t+2,c[0],c[1],p,w),n(),!Ht(e,r,$t))}return r[Ye]=a[0],r[Ye+1]=a[1],r[Ye+2]=c[0],r[Ye+3]=c[1],!Ht(e,r,Ye)}}var yt=0,ne=class{origin;destination;distance;angle;pathWeight;weight;constructor({origin:e,destination:r,distance:n=0,angle:o=0,pathWeight:i=yt,multiplicativeDistanceWeightScaling:s=!0}){if(this.origin=e,this.destination=r,this.distance=n,this.angle=o,this.pathWeight=i,this.weight=i||yt,s?D(e)===D(r)&&(this.weight=(this.weight>=0?this.distance*this.weight:yt)+this.distance):D(e)===D(r)&&(this.weight=this.weight>=0?this.distance+this.weight:yt),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};b();b();b();b();var vt=class{#e=[];#r;constructor(e){this.#r=e}get size(){return this.#e.length}isEmpty(){return this.#e.length===0}peek(){return this.#e[0]}push(e){this.#e.push(e),this.#t(this.#e.length-1)}pop(){if(this.#e.length===0)return;let e=this.#e[0],r=this.#e.pop();return this.#e.length>0&&r!==void 0&&(this.#e[0]=r,this.#n(0)),e}#t(e){for(;e>0;){let r=e-1>>1;if(this.#r(this.#e[e],this.#e[r])>=0)break;this.#o(e,r),e=r}}#n(e){let r=this.#e.length;for(;;){let n=e*2+1,o=e*2+2,i=e;if(n<r&&this.#r(this.#e[n],this.#e[i])<0&&(i=n),o<r&&this.#r(this.#e[o],this.#e[i])<0&&(i=o),i===e)break;this.#o(e,i),e=i}}#o(e,r){[this.#e[e],this.#e[r]]=[this.#e[r],this.#e[e]]}};b();var bt=class{#e;#r;#t;#n;#o=0;#i=0;constructor(e=1024){let r=Math.max(16,e);this.#e=new Float64Array(r),this.#r=new Float64Array(r),this.#t=new Float64Array(r),this.#n=new Int32Array(r)}get size(){return this.#o}reset(){this.#o=0,this.#i=0}push(e,r,n){this.#o===this.#n.length&&this.#a();let o=this.#i++,i=this.#o++,s=this.#e,a=this.#t;for(;i>0;){let c=i-1>>1,u=s[c];if(u<r||u===r&&a[c]<o)break;this.#s(c,i),i=c}s[i]=r,a[i]=o,this.#r[i]=n,this.#n[i]=e}popInto(e){let r=this.#n[0];e[0]=this.#r[0];let n=--this.#o;if(n<=0)return r;let o=this.#e,i=this.#t,s=o[n],a=i[n],c=this.#r[n],u=this.#n[n],f=0,l=n>>1;for(;f<l;){let h=2*f+1,w=h+1;w<n&&(o[w]<o[h]||o[w]===o[h]&&i[w]<i[h])&&(h=w);let p=o[h];if(s<p||s===p&&a<i[h])break;this.#s(h,f),f=h}return o[f]=s,i[f]=a,this.#r[f]=c,this.#n[f]=u,r}#s(e,r){this.#e[r]=this.#e[e],this.#t[r]=this.#t[e],this.#r[r]=this.#r[e],this.#n[r]=this.#n[e]}#a(){let e=this.#n.length*2,r=new Float64Array(e);r.set(this.#e);let n=new Float64Array(e);n.set(this.#r);let o=new Float64Array(e);o.set(this.#t);let i=new Int32Array(e);i.set(this.#n),this.#e=r,this.#r=n,this.#t=o,this.#n=i}};b();function sn(t,e,r){return r.zone[t]===e||(r.extraZones.get(t)?.includes(e)??!1)}function Kt(t,e,r){let{stamp:n,generation:o}=r;if(n[e]!==o)return 0;if(n[t]!==o)return r.cost[e];let{zoneCosts:i,zonePerEntry:s}=r,a=r.zone[e],c=s[a]&&sn(t,a,r)?0:i[a],u=r.extraZones.get(e);if(u)for(let f of u)s[f]&&sn(t,f,r)||(c+=i[f]);return c}var an=Symbol("all-groups"),xt=class{#e;#r;#t=new WeakMap;#n;#o=0;constructor(e){this.#e=e,this.#n=new Uint32Array(e.nodeCount)}fill(e,r,n){let{lon:o,lat:i}=this.#e,{cost:s,stamp:a,generation:c,zone:u,extraZones:f,zoneCosts:l,zonePerEntry:h}=n,w=this.#n;f.clear(),l.length=0,h.length=0;for(let p=0;p<e.length;p++){let F=e[p],g=Math.max(0,F.cost);l.push(g),h.push(F.costAccumulation==="per-zone-entry");let d=F.geometry.geometry,x=d.type==="Polygon"?[d.coordinates]:d.coordinates,I=F[r]?F[r]:an,m=d.bbox,y=x.length>1,E=y?this.#i():0;for(let S of x){let v=this.#s(S,I);for(let M=0;M<v.length;M++){let A=v[M];if(y){if(w[A]===E)continue;w[A]=E}if(!(m&&!(m[0]<=o[A]&&m[1]<=i[A]&&m[2]>=o[A]&&m[3]>=i[A]))){if(a[A]!==c)a[A]=c,s[A]=0,u[A]=p;else if(u[A]!==p){let P=f.get(A);P?P.includes(p)||P.push(p):f.set(A,[p])}s[A]+=g}}}}}#i(){return this.#o>=4294967294&&(this.#n.fill(0),this.#o=0),++this.#o}#s(e,r){let n=this.#t.get(e);n||(n=new Map,this.#t.set(e,n));let o=n.get(r);return o||(o=this.#a(e,r),n.set(r,o)),o}#a(e,r){let n=this.#c(r);if(!n||e.length===0||e[0].length===0)return new Int32Array(0);let o=e.map(Wo),i=1/0,s=1/0,a=-1/0,c=-1/0,u=o[0];for(let p=0;p<u.length;p+=2)u[p]<i&&(i=u[p]),u[p]>a&&(a=u[p]),u[p+1]<s&&(s=u[p+1]),u[p+1]>c&&(c=u[p+1]);let{lat:f}=this.#e,{indices:l,lon:h}=n,w=[];for(let p=Zo(h,i);p<l.length&&h[p]<=a;p++){let F=l[p],g=f[F];if(g<s||g>c)continue;let d=h[p];if(!cn(o[0],d,g,!1))continue;let x=!1;for(let I=1;I<o.length&&!x;I++)cn(o[I],d,g,!0)&&(x=!0);x||w.push(F)}return Int32Array.from(w)}#c(e){if(!this.#r){let{nodeCount:r,lon:n,group:o}=this.#e,i=new Map,s=new Array(r);for(let a=0;a<r;a++){s[a]=a;let c=i.get(o[a]);c||i.set(o[a],c=[]),c.push(a)}i.set(an,s),this.#r=new Map;for(let[a,c]of i){c.sort((l,h)=>n[l]-n[h]);let u=Int32Array.from(c),f=new Float64Array(u.length);for(let l=0;l<u.length;l++)f[l]=n[u[l]];this.#r.set(a,{indices:u,lon:f})}}return this.#r.get(e)}};function Wo(t){let e=t.length;e>0&&t[0][0]===t[e-1][0]&&t[0][1]===t[e-1][1]&&e--;let r=new Float64Array(e*2);for(let n=0;n<e;n++)r[n*2]=t[n][0],r[n*2+1]=t[n][1];return r}function cn(t,e,r,n){let o=t.length>>1,i=!1;for(let s=0,a=o-1;s<o;a=s++){let c=t[s*2],u=t[s*2+1],f=t[a*2],l=t[a*2+1];if(r*(c-f)+u*(f-e)+l*(e-c)===0&&(c-e)*(f-e)<=0&&(u-r)*(l-r)<=0)return!n;u>r!=l>r&&e<(f-c)*(r-u)/(l-u)+c&&(i=!i)}return i}function Zo(t,e){let r=0,n=t.length;for(;r<n;){let o=r+n>>1;t[o]<e?r=o+1:n=o}return r}var Ve=.4,$o=10,un=Math.PI/180,ln=1,Qt=2,wt=class{edges=Object.create(null);nodesById;nodesByGroup=new Map;#e;#r;constructor({nodes:e,groupBy:r,multiplicativeDistanceWeightScaling:n}){this.#e=r,this.#r=n??!0;let{features:o}=e;this.nodesById=Object.create(null),this.#t=this.#n(o,r,n)}#t;#n(e,r,n){let o=this.nodesById;for(let m=0;m<e.length;m++)o[e[m].properties.id]=e[m];let i=Object.keys(o),s=i.length,a=new Map,c=new Array(s),u=new Float64Array(s),f=new Float64Array(s);for(let m=0;m<s;m++){let y=o[i[m]];a.set(i[m],m),c[m]=y,u[m]=y.geometry.coordinates[0],f[m]=y.geometry.coordinates[1]}let l=0;for(let m=0;m<s;m++){let y=c[m].properties,E=y.neighbors,S=0;for(let v=0;v<E.length;v++)a.has(E[v].id)&&S++;S!==E.length&&(y.neighbors=E.filter(({id:v})=>a.has(v))),l+=S}for(let m=0;m<e.length;m++){let y=e[m],E=r==="default"?r:y.properties[r],S=this.nodesByGroup.get(E);S||this.nodesByGroup.set(E,S=[]),S.push(y)}let h=new Int32Array(s+1),w=new Int32Array(l),p=new Int32Array(l),F=new Uint8Array(l),g=new Uint8Array(l),d=new Set,x=new Array(l),I=0;for(let m=0;m<s;m++){let y=c[m],E=y.properties.neighbors,S=new Array(E.length);h[m]=I;for(let v=0;v<E.length;v++){let{id:M,weight:A,sameStop:P}=E[v],T=a.get(M),L=c[T],_=new ne({origin:y,destination:L,pathWeight:A,distance:re(y.geometry.coordinates,L.geometry.coordinates),angle:q(y.geometry.coordinates,L.geometry.coordinates),multiplicativeDistanceWeightScaling:n});S[v]=_,w[I]=m,p[I]=T,F[I]=D(y)!==D(L)?1:0,P===!0&&(g[I]=1,d.add(_)),x[I]=_,I++}this.edges[y.properties.id]=S}return h[s]=I,{nodeCount:s,indexById:a,nodes:c,lon:u,lat:f,edgeStart:h,edgeOrigin:w,edgeDestination:p,edgeCrossesFloor:F,edgeSameStop:g,sameStopEdges:d,edgeRefs:x,generation:0,scratch:{costSoFar:new Float64Array(s),cameFrom:new Int32Array(s),stamp:new Uint32Array(s),heuristic:new Float64Array(s),heuristicStamp:new Uint32Array(s),flags:new Uint8Array(s),frontier:new bt(1024),popped:new Float64Array(1),zoneTarget:{cost:new Float64Array(s),stamp:new Uint32Array(s),generation:0,zone:new Int32Array(s),extraZones:new Map,zoneCosts:[],zonePerEntry:[]}},flagSetCache:new WeakMap}}#o(){return this.#t.scratch}#i(e){let r=this.#t,n=r.flagSetCache.get(e);if(!n||n.setSize!==e.size){let o=new Uint8Array(r.nodeCount);for(let i of e){let s=r.indexById.get(i);s!==void 0&&(o[s]=1)}n={array:o,setSize:e.size},r.flagSetCache.set(e,n)}return n.array}getShortestEuclideanDistance(e,r){return r.reduce((n,o)=>{let i=Hr(e.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}hasLineOfSight=(e,r,n=[],o=Ve)=>pe({type:"Feature",properties:{id:"origin",neighbors:[]},geometry:{type:"Point",coordinates:e}},{type:"Feature",properties:{id:"destination",neighbors:[]},geometry:{type:"Point",coordinates:r}},n,o)===!0;dijkstraFindWithinTravelDistance(e,r,n,o,i,s,a,c){let u=this.nodesById[e];if(!u)return[];let f=new Set(n),l=new vt((E,S)=>E.distance-S.distance),h=new Map,w=[],p=c!==void 0&&c.length>0;p&&this.#l(c);let{zoneTarget:F}=this.#o(),g=this.#t.indexById,d=this.#t.sameStopEdges,x=new Set,I=0,m=(E,S)=>{let v=E.properties.id;if(x.has(v))return;let M=d.size>0&&(this.edges[v]??[]).some(A=>d.has(A)&&x.has(A.destination.properties.id));w.push({feature:E,distance:S}),x.add(v),M||I++},y=()=>{if(d.size!==0)for(let E=0;E<w.length;E++){let{feature:S,distance:v}=w[E];for(let M of this.edges[S.properties.id]??[]){let A=M.destination;d.has(M)&&f.has(A.properties.id)&&m(A,v)}}};for(l.push({node:u,distance:0,geometricDistance:0}),h.set(u.properties.id,0);!l.isEmpty()&&!(I>=s);){let E=l.pop();if(!E)break;let S=E.node,v=E.distance,M=E.geometricDistance;if(!(v>(h.get(S.properties.id)??1/0))){S.properties.id!=null&&f.has(S.properties.id?.toString())&&(i?this.hasLineOfSight(u.geometry.coordinates,S.geometry.coordinates,o)&&m(S,v):m(S,v));for(let A of this.edges[S.properties.id]){let P=A.destination,T=D(A.origin)!==D(A.destination),L=a?.get(A)??A.weight,_=T?Math.max(L,$o):a?.has(A)?L:A.distance,B=v+_+(p&&!this.#t.sameStopEdges.has(A)?Kt(g.get(S.properties.id),g.get(P.properties.id),F):0),G=M+_;if(B===1/0||G>r)continue;let z=h.get(P.properties.id);z!==void 0&&B>=z||(h.set(P.properties.id,B),l.push({node:P,distance:B,geometricDistance:G}))}}}return y(),w}aStar({originIds:e,destinationNodeIds:r,disabledConnectionNodeIds:n,zones:o,overrideEdgeWeights:i,disabledNodeIds:s,outdoorNodeIds:a,indoorPathWeight:c,outdoorPathWeight:u,outdoorPathWeightMultiplier:f}){let l=this.#u(e),h=this.#u(r);if(l.length===0||h.length===0)return[];let w=this.#t,p=this.#o(),{edgeStart:F,edgeDestination:g,edgeCrossesFloor:d,edgeSameStop:x,edgeRefs:I}=w,{costSoFar:m,cameFrom:y,stamp:E,heuristic:S,heuristicStamp:v,flags:M,frontier:A}=p,P=this.#s();A.reset();let T=C=>w.indexById.get(C.properties.id),L=h.map(T),_=[];if(n)for(let C of n){let Q=w.indexById.get(C);Q!==void 0&&_.push(Q)}for(let C of L)M[C]|=ln;for(let C of _)M[C]|=Qt;let B=s&&s.size>0?this.#i(s):void 0,G=this.#r&&f!==void 0&&c!==void 0&&a!==void 0&&a.size>0,z=G?this.#i(a):void 0,$=G?(c+1)*f/((u??c)+1):1,U=i&&i.size>0?i:void 0,V=o.length>0;V&&this.#l(o,P);let{zoneTarget:ve}=p,te=h.length,Z=new Float64Array(te),Oe=new Float64Array(te),be=p.popped;for(let C=0;C<te;C++)Z[C]=h[C].geometry.coordinates[0],Oe[C]=h[C].geometry.coordinates[1];try{for(let C of l){let Q=T(C);E[Q]=P,m[Q]=0,y[Q]=-1,this.#a(Q,P,Z,Oe),A.push(Q,S[Q],0)}for(;A.size>0;){let C=A.popInto(be),Q=be[0],Ge=M[C];if(Ge&ln)return this.#c(C);let Ue=m[C];if(Q>Ue||B!==void 0&&B[C]===1)continue;let jt=(Ge&Qt)!==0,ct=F[C+1];for(let fe=F[C];fe<ct;fe++){let ee=g[fe],Dr=d[fe]===1;if(jt&&(Dr||(M[ee]&Qt)!==0))continue;let zr=I[fe],Gr=U!==void 0?U.get(zr):void 0,Ur=Gr??zr.weight;z!==void 0&&Gr===void 0&&!Dr&&z[C]===1&&z[ee]===1&&(Ur*=$);let Ro=V&&x[fe]!==1?Kt(C,ee,ve):0,je=Ue+Ur+Ro;je!==1/0&&(E[ee]!==P||je<m[ee])&&(E[ee]=P,m[ee]=je,y[ee]=fe,v[ee]!==P&&this.#a(ee,P,Z,Oe),A.push(ee,je+S[ee],je))}}return[]}finally{for(let C of L)M[C]=0;for(let C of _)M[C]=0}}#s(){let e=this.#t;if(e.generation>=4294967294){let r=this.#o();r.stamp.fill(0),r.heuristicStamp.fill(0),r.zoneTarget.stamp.fill(0),e.generation=0}return++e.generation}#a(e,r,n,o){let{lon:i,lat:s}=this.#t,{heuristic:a,heuristicStamp:c}=this.#o(),u=i[e],f=s[e],l=Number.MAX_VALUE;for(let h=0;h<n.length;h++){let w=(n[h]-u)*un,p=(o[h]-f)*un,F=Math.sqrt(w*w+p*p)*xe;l=Math.min(l,F)}a[e]=l,c[e]=r}#c(e){let{edgeRefs:r,edgeOrigin:n}=this.#t,{cameFrom:o}=this.#o(),i=[],s=o[e];for(;s!==-1;)i.push(r[s]),s=o[n[s]];return i.reverse()}#u(e){return e.map(r=>this.nodesById[r]).filter(Boolean)}#l(e,r=this.#s()){let n=this.#t;n.zoneIndex||(n.zoneIndex=new xt({nodeCount:n.nodeCount,lon:n.lon,lat:n.lat,group:n.nodes.map(i=>i.properties[this.#e])}));let o=this.#o();return o.zoneTarget.generation=r,n.zoneIndex.fill(e,this.#e,o.zoneTarget),r}};b();function fn(t,e,r,n=Ve){if(t.length<3)return t;let o=1e-4,i=t.length,s=new Uint8Array(i),a=new Int32Array(i+1);a[i]=i;for(let p=i-1;p>=0;p--)s[p]=t[p].origin.properties.preventSmoothing?1:0,a[p]=s[p]?p:a[p+1];let c=t[i-1].destination,u=on(e),f=new Array(i+1).fill(null).map(()=>({cost:1/0,prev:-1}));f[0]={cost:0,prev:-1};for(let p=0;p<i;p++){let F=!0;if(f[p].cost===1/0)continue;let g=t[p].origin,d=a[p+1];for(let x=p+1;x<=d;x++){let I=x===i?c:t[x].origin,m=re(g.geometry.coordinates,I.geometry.coordinates);if(m<.01)continue;let E=(x-p-1)*o,S=f[p].cost+m-E;if(S>=f[x].cost)continue;let v=x===p+1&&x<i&&s[x]===1,M=x===p+1&&s[p]===1;!v&&!M&&!u(g,I,n)||(f[x].cost=S,f[x].prev=p,F=!1)}F&&f[p+1].cost===1/0&&(f[p+1].cost=f[p].cost,f[p+1].prev=p)}let l=[],h=i;for(;h!==-1;)l.unshift(h),h=f[h].prev===-1?h-1:f[h].prev;let w=[];for(let p=0;p<l.length-1;p++){let F=l[p],g=l[p+1],d=t[F].origin,x=g===i?c:t[g].origin;w.push(new ne({origin:d,destination:x,distance:re(d.geometry.coordinates,x.geometry.coordinates),angle:q(d.geometry.coordinates,x.geometry.coordinates),multiplicativeDistanceWeightScaling:r}))}return w}b();var hn=ut(er());b();var dn=jr("Navigator");function qe(t,e,r){if(t==null||t[e]==null)return!1;let n=1<<r;return(t[e]&n)!==0}b();var Ho=.5;function pn(t,e,r,n,o,i){if(!t?.geoJSON?.geometry?.coordinates)return null;let[s,a]=en(n,Ho),c=s,u=a;if(o){let p=Math.sqrt(Math.pow(s.x-o.x,2)+Math.pow(s.y-o.y,2));Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2))<p&&(c=a,u=s)}let f=i(c.x,c.y),l=i(u.x,u.y),h={type:"Feature",geometry:{type:"Point",coordinates:[f.lon,f.lat]},properties:{id:`${e}_buffer_entry`,map:r,neighbors:[],preventSmoothing:!0}},w={type:"Feature",geometry:{type:"Point",coordinates:[l.lon,l.lat]},properties:{id:`${e}_buffer_exit`,map:r,neighbors:[],preventSmoothing:!0}};return{entryNode:h,exitNode:w,entryMeters:c,exitMeters:u}}function gn(t,e,r,n){let o=[t[0].origin];for(let v=0;v<t.length;v++)o.push(t[v].destination);let i=new Map,s=new Map;for(let v=0;v<o.length;v++)i.set(o[v].properties.id,o[v]),s.set(v,o[v]);let a=o[0].geometry.coordinates[1],{toCartesian:c,toGeographic:u}=dt(a),f=o.map((v,M)=>{let A={x:0,y:0,nodeId:v.properties.id,originalIndex:M};return c(v.geometry.coordinates,A),A}),l=new Set,h=new Map,w=new Set;for(let v=0;v<o.length;v++){let M=e(o[v].properties.id);if(M&&(l.add(v),h.set(v,M)),v<o.length-1){let A=D(o[v]),P=D(o[v+1]);A!==P&&(w.add(v),w.add(v+1),v>0&&w.add(v-1))}}if(t.length<3&&l.size===0)return t;let p=t.length>=3?(0,hn.default)(f,.7,!1):f,F=new Set;for(let v=0;v<p.length;v++)F.add(p[v].originalIndex);let g=[];for(let v of l)F.has(v)||g.push(v);let d=p.slice(),x=.25;for(let v of w){if(F.has(v))continue;let M=s.get(v);if(!M)continue;let A=-1;for(let P=0;P<d.length-1;P++)if(d[P].originalIndex<v&&d[P+1].originalIndex>v){A=P+1;break}if(A!==-1){let P={x:0,y:0,nodeId:M.properties.id,originalIndex:v};c(M.geometry.coordinates,P),d.splice(A,0,P)}}for(let v of g){let M=s.get(v);if(!M)continue;let A=-1;for(let P=0;P<d.length-1;P++)if(d[P].originalIndex<v&&d[P+1].originalIndex>v){A=P+1;break}if(A!==-1){let P={x:0,y:0,nodeId:M.properties.id,originalIndex:v};c(M.geometry.coordinates,P);let T=qt(P,d[A-1]),L=qt(P,d[A]);T<x?d[A-1]=P:L<x?d[A]=P:d.splice(A,0,P)}}let I=[],m={x:0,y:0},y={x:0,y:0},E=new Map;for(let v=0;v<d.length;v++)E.set(d[v].originalIndex,v);for(let v of l){let M=s.get(v);if(!M)continue;let A=h.get(v);if(!A)continue;let P=E.get(v)??-1;if(P!==-1){let T;P>0&&(T={x:d[P-1].x,y:d[P-1].y});let L=A.geoJSON.geometry.coordinates;c(L[0],m),c(L[1],y);let _=[m,y],B=M.properties.id,G=D(M)||"test-floor",z=pn(A,B,G,_,T,u);if(z){let $={x:z.entryMeters.x,y:z.entryMeters.y,nodeId:z.entryNode.properties.id,originalIndex:v-.5},U={x:z.exitMeters.x,y:z.exitMeters.y,nodeId:z.exitNode.properties.id,originalIndex:v+.5};i.set(z.entryNode.properties.id,z.entryNode),i.set(z.exitNode.properties.id,z.exitNode),I.push($,U)}}}if(d.push(...I),d.sort((v,M)=>v.originalIndex-M.originalIndex),n&&d.length>=3)for(let v=0;v<d.length-1;v++){let M=d[v];if(M.nodeId.endsWith("_buffer_exit")){let A=d[d.length-1];if(v<d.length-2){let P=!1;for(let T=v+1;T<d.length-1;T++)if(d[T].nodeId.endsWith("_buffer_entry")||d[T].nodeId.endsWith("_buffer_exit")){P=!0;break}if(!P){let T=i.get(M.nodeId),L=i.get(A.nodeId);if(T&&L){if(D(T)!==D(L))continue;if(pe(T,L,n,.1)){let _=d.length-v-2;d.splice(v+1,_)}}}}}}if(n&&d.length>=3){let v=d[0],M=-1;for(let A=1;A<d.length;A++)if(d[A].nodeId.endsWith("_buffer_entry")){M=A;break}if(M>1){let A=!1;for(let P=1;P<M;P++)if(d[P].nodeId.endsWith("_buffer_entry")||d[P].nodeId.endsWith("_buffer_exit")){A=!0;break}if(!A){let P=d[M],T=i.get(v.nodeId),L=i.get(P.nodeId);if(T&&L&&D(T)===D(L)){if(pe(T,L,n,.1)){let _=M-1;d.splice(1,_)}}}}}let S=[];for(let v=0;v<d.length-1;v++){let M=d[v],A=d[v+1],P=i.get(M.nodeId),T=i.get(A.nodeId);P&&T?S.push(new ne({origin:P,destination:T,distance:re(P.geometry.coordinates,T.geometry.coordinates),angle:q(P.geometry.coordinates,T.geometry.coordinates),multiplicativeDistanceWeightScaling:r})):dn.warn(`Origin or destination node not found for point ${M.nodeId} or ${A.nodeId}`)}return S}function H(t,e){return new ne({origin:t,destination:e,distance:re(t.geometry.coordinates,e.geometry.coordinates),angle:q(t.geometry.coordinates,e.geometry.coordinates)})}function mn(t,e,r,n=!0){if(t.length<3)return t;let o=new Set;for(let a=0;a<t.length;a++)if(t[a].origin.properties.preventSmoothing){if(o.add(a),n){for(let c=a-1;c>=0;c--)if(!t[c].origin.properties.preventSmoothing){o.add(c);break}}if(n){for(let c=a+1;c<t.length;c++)if(!t[c].origin.properties.preventSmoothing){o.add(c);break}}}if(t.length>0&&t[t.length-1].destination.properties.preventSmoothing&&(o.add(t.length-1),n)){for(let a=t.length-2;a>=0;a--)if(!t[a].origin.properties.preventSmoothing){o.add(a);break}}let i=[],s=0;for(let a=1;a<t.length;a++){let c=a===t.length-1,u=o.has(a),f=c?.05:.7,l=pe(t[s].origin,t[a].origin,e,f),h=t[a].origin.properties.preventSmoothing,w=a-1;if(u){s!==a&&(l?(i.push(H(t[s].origin,t[a].origin)),s=a):(s!==w&&(i.push(H(t[s].origin,t[w].origin)),s=w),s!==a&&(i.push(H(t[s].origin,t[a].origin)),s=a))),c&&i.push(H(t[a].origin,t[a].destination));continue}if(h)l?(i.push(H(t[s].origin,t[a].origin)),s=a):s!==w&&(i.push(H(t[s].origin,t[w].origin)),s=w),i.push(H(t[s].origin,t[a].origin)),s=a,c&&i.push(H(t[a].origin,t[a].destination));else if(l)c&&(pe(t[s].origin,t[a].destination,e,.7)?i.push(H(t[s].origin,t[a].destination)):(i.push(H(t[s].origin,t[a].origin)),i.push(H(t[a].origin,t[a].destination))),s=a);else{if(s===w){c&&(i.push(H(t[s].origin,t[a].origin)),i.push(H(t[a].origin,t[a].destination)));continue}i.push(H(t[s].origin,t[w].origin)),s=w,c&&(i.push(H(t[s].origin,t[a].origin)),i.push(H(t[a].origin,t[a].destination)))}}if(!1){let a=i[i.length-1];window.__DEBUG_PATH.finalSteps.push({nodeId:a.destination.properties.id,coordinate:a.destination.geometry.coordinates,floorId:D(a.destination)})}return i}b();function ae(t,e,r){return new ne({origin:t,destination:e,distance:re(t.geometry.coordinates,e.geometry.coordinates),angle:q(t.geometry.coordinates,e.geometry.coordinates),multiplicativeDistanceWeightScaling:r})}function yn(t,e,r=.2,n={},o){if(t.length<3)return t;let i=c=>"outdoors"in n&&qe(c?.properties?.flags??[],n.outdoors.index,n.outdoors.bit)||!!c?.properties?.preventSmoothing,s=[t[0]],a=1;for(let c=a+1;c<t.length;c++){let u=c===t.length-1,f=t[a].origin,l=t[c].origin,h=pe(f,l,e,r),w=i(l),p=c-1;if(w)h?(s.push(ae(f,l,o)),a=c):(a!==p&&(s.push(ae(t[a].origin,t[p].origin,o)),a=p),s.push(ae(t[a].origin,l,o)),a=c),u&&s.push(ae(l,t[c].destination,o));else if(h)u&&(!(D(l)!==D(t[c].destination))&&pe(f,t[c].destination,e,r)?s.push(ae(f,t[c].destination,o)):(s.push(ae(f,l,o)),s.push(ae(l,t[c].destination,o))),a=c);else{if(a===p){u&&(s.push(ae(f,l,o)),s.push(ae(l,t[c].destination,o)));continue}s.push(ae(t[a].origin,t[p].origin,o)),a=p,u&&(s.push(ae(t[a].origin,l,o)),s.push(ae(l,t[c].destination,o)))}}return s}b();var vn=ut(er());function bn(t,e){let r=new Set;if(t.length<2)return r;let n=[t[0].origin];for(let p=0;p<t.length;p++)n.push(t[p].destination);let o=n[0].geometry.coordinates[1],{toCartesian:i}=dt(o),s=e;if(!s)return r;let a=n.map((p,F)=>{let g={x:0,y:0,nodeId:p.properties.id,originalIndex:F};return i(p.geometry.coordinates,g),g}),c=new Set,u=new Set;for(let p=0;p<a.length;p++)s(a[p].nodeId)&&(c.add(p),u.add(a[p].nodeId));if(c.size===0)return r;let f=a.length>=3?(0,vn.default)(a,.7,!1):a,l=new Map;for(let p=0;p<f.length;p++)l.set(f[p].originalIndex,p);let h=new Set;for(let p of c){let F=l.get(p);if(F!==void 0){if(F>0){let g=f[F-1].nodeId;h.add(g)}if(F<f.length-1){let g=f[F+1].nodeId;h.add(g)}}else{let g,d;for(let x=0;x<f.length-1;x++){let I=f[x].originalIndex,m=f[x+1].originalIndex;if(I<p&&p<m){g=f[x].nodeId,d=f[x+1].nodeId;break}}g&&h.add(g),d&&h.add(d)}}let w=0;for(let p of t)h.has(p.origin.properties.id)&&(p.origin.properties.preventSmoothing||(p.origin.properties.preventSmoothing=!0,r.add(p.origin.properties.id))),h.has(p.destination.properties.id)&&(p.destination.properties.preventSmoothing||(p.destination.properties.preventSmoothing=!0,r.add(p.destination.properties.id))),w++;return r}b();b();var Ce={accessible:"accessible",outdoors:"outdoors",public:"public"};b();b();function Ze(t,e,r=[]){let n={...t};for(let[o,i]of Object.entries(e))if(i!==void 0)if(o in n){let s=o;if(Array.isArray(i)&&i.length>0){let a=Jo(i[0],r);if(a){let c=n[s];if(!Array.isArray(c))throw new Error(`Expected array at ${o}, got ${typeof c}`);let u=new Map(i.map(h=>[xn(h,a),h])),l=c.map(h=>{let w=u.get(xn(h,a));return w?Ze(h,w,r):h});n[s]=l}else n[s]=i}else{let a=n[s];typeof a=="object"&&a!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?n[s]=i:n[s]=Ze(a,i,r):n[o]=i}}else n[o]=i;return n}function Jo(t,e){function r(n){if(typeof n!="object"||n===null)return null;for(let o of e)if(o in n&&typeof n[o]<"u")return[o];if(Array.isArray(n))return null;for(let[o,i]of Object.entries(n)){let s=r(i);if(s)return[o,...s]}return null}return r(t)}function xn(t,e){return e.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},t)}b();b();var _e=/\.(json|geojson)$/,tr=["floorstack.json","mapstack.json","floor.geojson"],Ko=["styles.json","shapes.json","tileset.json","location.json","category.json","navigationFlags.json","annotation-symbols.json","geometry-effects.json","annotation","textAreas","enterprise","floorImages","shapeInstances","modelInstances","window","area","facade"],It=Ko,Ku=new Set(It);var wn="2.100.0-final.15";b();var Qo=t=>{if(t==="space"||t==="obstruction"||t==="entrance")return{}},St=(t,e,r)=>{let n=t[e];if(typeof n!="object"||Object.keys(n).length===0)return Qo(e);let o={};for(let[i,s]of Object.entries(n)){let a=i.replace(_e,"");o[a]=JSON.parse(r(s))}return o},ei=[...tr,...It].filter(t=>_e.test(t)),ti=[...tr,...It].filter(t=>!_e.test(t)),ri=t=>{let e=new TextDecoder("utf-8"),r=e.decode.bind(e),n={"manifest.geojson":JSON.parse(r(t["manifest.geojson"])),"mapstack.geojson":JSON.parse(r(t["mapstack.geojson"])),"map.geojson":JSON.parse(r(t["map.geojson"])),"node.geojson":JSON.parse(r(t["node.geojson"])),"connection.json":JSON.parse(r(t["connection.json"])),space:St(t,"space",r),obstruction:St(t,"obstruction",r),entrance:St(t,"entrance",r)};for(let o of ei)t[o]&&(n[o]=JSON.parse(r(t[o])));for(let o of ti)t[o]&&(n[o]=St(t,o,r));return n};b();b();b();var $e=["agriculture","airport","casino","city-district","convention-center","entertainment","event-centre","first-responder-building","government-building","grocery-store","healthcare","higher-education","hotel","library","manufacturing","medical-centre","mixed-use","multifamily","museum","office-building","oil-and-energy","other","parking-facility","religious-institution","resort","retail-store","schools-k-12","shopping-mall","stadium-or-arena","storage-facility","theme-park","transit","transportation-hub","warehousing"],ni=[...$e,"unknown"],rr=Object.freeze(Object.fromEntries([...$e,"unknown"].map(t=>[t,t])));b();var He=["reference-point","checkpoint","checkpoint-passport","parent"],oi=[...He,"unknown"],ii=Object.freeze(Object.fromEntries([...He,"unknown"].map(t=>[t,t])));var Je=["closed-temporarily","new","pop-up","coming-soon","relocated"],si=[...Je,"unknown"],ai=Object.freeze(Object.fromEntries([...Je,"unknown"].map(t=>[t,t])));b();var Ke=["left","center","right"],ci=[...Ke,"unknown"],ui=Object.freeze(Object.fromEntries([...Ke,"unknown"].map(t=>[t,t])));b();var Qe=["near","center"],li=[...Qe,"unknown"],fi=Object.freeze(Object.fromEntries([...Qe,"unknown"].map(t=>[t,t])));b();var et=["top","side"],di=[...et,"unknown"],pi=Object.freeze(Object.fromEntries([...et,"unknown"].map(t=>[t,t])));var tt=["inside","outside","both"],hi=[...tt,"unknown"],gi=Object.freeze(Object.fromEntries([...tt,"unknown"].map(t=>[t,t])));b();var Mt=["elevator","escalator","travelator","stairs","door","ramp","ladder"],Tl=[...Mt,"unknown"],nr=Object.freeze(Object.fromEntries([...Mt,"unknown"].map(t=>[t,t])));b();var At=["room","hallway","wall","object","poi","area","window"],Cl=[...At,"unknown"],_l=Object.freeze(Object.fromEntries([...At,"unknown"].map(t=>[t,t])));b();b();var Pt=class{_value;constructor(e){this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}},Ft=class{_tag="Some";_value;constructor(e){this._value=e}get value(){return this._value}isSome(){return!0}isSomeAnd(e){return e(this.value)}isNone(){return!1}equals(e){return e.isSome()&&e.value===this.value}expect(e){return this.value}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectNone(e){return this}map(e){return En(e(this.value))}mapAsync(e){return e(this.value).then(r=>En(r))}mapOr(e,r){return this.map(e).unwrapOr(r)}mapOrAsync(e,r){return this.mapAsync(e).then(n=>n.unwrapOr(r))}mapOrElse(e,r){return this.map(e).unwrapOrElse(r)}mapOrElseAsync(e,r){return this.mapAsync(e).then(n=>n.unwrapOrElse(r))}and(e){return e}andThen(e){return e(this.value)}andThenAsync(e){return e(this.value)}filter(e){return e(this.value)?this:Ee()}or(e){return this}orElse(e){return this}xor(e){return e.isSome()?Ee():this}toString(){return`Some(${this.value})`}okOr(e){return ue(this.value)}okOrElse(e){return ue(this.value)}iter(){return new Pt(this.value)}[Symbol.iterator](){return this.iter()}zip(e){return e.isSome()?ke([this.value,e.value]):Ee()}zipWith(e,r){return e.isSome()?ke(r(this.value,e.value)):Ee()}get[Symbol.toStringTag](){return"Some"}},Nt=class{_tag="None";get value(){return null}isSome(){return!1}isSomeAnd(e){return!1}isNone(){return!0}equals(e){return e.isNone()}expect(e){throw new Error(e)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(e){return this}inspectNone(e){return e(),this}map(e){return this}mapAsync(e){return Promise.resolve(this)}mapOr(e,r){return r}mapOrAsync(e,r){return Promise.resolve(r)}mapOrElse(e,r){return r()}mapOrElseAsync(e,r){return r()}and(e){return this}andThen(e){return this}andThenAsync(e){return Promise.resolve(this)}filter(e){return this}or(e){return e}orElse(e){return e()}xor(e){return e}toString(){return"None"}okOr(e){return Ie(e)}okOrElse(e){return Ie(e())}iter(){return new Pt(null)}[Symbol.iterator](){return this.iter()}zip(e){return this}zipWith(e,r){return this}get[Symbol.toStringTag](){return"None"}},ke=t=>new Ft(t),Ee=()=>new Nt,En=t=>t instanceof Ft||t instanceof Nt?t:t==null?Ee():ke(t);var Tt=class{_value;constructor(e){this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}},or=class{_tag="Ok";_value;constructor(e){this._value=e}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(e){return e(this.value)}isErr(){return!1}isErrAnd(e){return!1}ok(){return ke(this.value)}err(){return Ee()}expect(e){return this.value}expectErr(e){throw new Error(e)}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectErr(){return this}map(e){return ue(e(this.value))}async mapAsync(e){return e(this.value).then(ue)}mapOr(e,r){return e(this.value)}async mapOrAsync(e,r){return e(this.value)}mapOrElse(e,r){return e(this.value)}async mapOrElseAsync(e,r){return e(this.value)}mapErr(e){return this}iter(){return new Tt(this.value)}[Symbol.iterator](){return this.iter()}and(e){return e}andThen(e){return e(this.value)}or(e){return this}orElse(e){return this}async andThenAsync(e){return e(this.value)}toString(){return`Ok(${this.value})`}get[Symbol.toStringTag](){return"Ok"}},ir=class t{_tag="Err";_error;constructor(e){this._error=e}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(e){return!1}isErr(){return!0}isErrAnd(e){return e(this.error)}ok(){return Ee()}err(){return ke(this.error)}expect(e){throw new Error(e)}expectErr(e){return this.error}unwrap(){throw this.error}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(){return this}inspectErr(e){return e(this.error),this}map(e){return this}iter(){return new Tt(null)}[Symbol.iterator](){return this.iter()}async mapAsync(e){return this}mapOr(e,r){return r}async mapOrAsync(e,r){return r}mapOrElse(e,r){return r()}async mapOrElseAsync(e,r){return r()}mapErr(e){return new t(e(this.error))}and(e){return this}andThen(e){return this}async andThenAsync(e){return this}or(e){return e}orElse(e){return e(this.error)}toString(){return`Err(${this.error})`}get[Symbol.toStringTag](){return"Err"}},ue=t=>new or(t),Ie=t=>new ir(t);b();var se=Uint8Array,Be=Uint16Array,mi=Int32Array,In=new se([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Sn=new se([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),yi=new se([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mn=function(t,e){for(var r=new Be(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var o=new mi(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},An=Mn(In,2),Pn=An.b,vi=An.r;Pn[28]=258,vi[258]=28;var Fn=Mn(Sn,0),bi=Fn.b,Xl=Fn.r,ur=new Be(32768);for(R=0;R<32768;++R)ye=(R&43690)>>1|(R&21845)<<1,ye=(ye&52428)>>2|(ye&13107)<<2,ye=(ye&61680)>>4|(ye&3855)<<4,ur[R]=((ye&65280)>>8|(ye&255)<<8)>>1;var ye,R,rt=(function(t,e,r){for(var n=t.length,o=0,i=new Be(e);o<n;++o)t[o]&&++i[t[o]-1];var s=new Be(e);for(o=1;o<e;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new Be(1<<e);var c=15-e;for(o=0;o<n;++o)if(t[o])for(var u=o<<4|t[o],f=e-t[o],l=s[t[o]-1]++<<f,h=l|(1<<f)-1;l<=h;++l)a[ur[l]>>c]=u}else for(a=new Be(n),o=0;o<n;++o)t[o]&&(a[o]=ur[s[t[o]-1]++]>>15-t[o]);return a}),nt=new se(288);for(R=0;R<144;++R)nt[R]=8;var R;for(R=144;R<256;++R)nt[R]=9;var R;for(R=256;R<280;++R)nt[R]=7;var R;for(R=280;R<288;++R)nt[R]=8;var R,Nn=new se(32);for(R=0;R<32;++R)Nn[R]=5;var R;var xi=rt(nt,9,1);var wi=rt(Nn,5,1),sr=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},le=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},ar=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},Ei=function(t){return(t+7)/8|0},fr=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new se(t.subarray(e,r))};var Ii=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ie=function(t,e,r){var n=new Error(e||Ii[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,ie),!r)throw n;return n},Si=function(t,e,r,n){var o=t.length,i=n?n.length:0;if(!o||e.f&&!e.l)return r||new se(0);var s=!r,a=s||e.i!=2,c=e.i;s&&(r=new se(o*3));var u=function(ct){var fe=r.length;if(ct>fe){var ee=new se(Math.max(fe*2,ct));ee.set(r),r=ee}},f=e.f||0,l=e.p||0,h=e.b||0,w=e.l,p=e.d,F=e.m,g=e.n,d=o*8;do{if(!w){f=le(t,l,1);var x=le(t,l+1,3);if(l+=3,x)if(x==1)w=xi,p=wi,F=9,g=5;else if(x==2){var E=le(t,l,31)+257,S=le(t,l+10,15)+4,v=E+le(t,l+5,31)+1;l+=14;for(var M=new se(v),A=new se(19),P=0;P<S;++P)A[yi[P]]=le(t,l+P*3,7);l+=S*3;for(var T=sr(A),L=(1<<T)-1,_=rt(A,T,1),P=0;P<v;){var B=_[le(t,l,L)];l+=B&15;var I=B>>4;if(I<16)M[P++]=I;else{var G=0,z=0;for(I==16?(z=3+le(t,l,3),l+=2,G=M[P-1]):I==17?(z=3+le(t,l,7),l+=3):I==18&&(z=11+le(t,l,127),l+=7);z--;)M[P++]=G}}var $=M.subarray(0,E),U=M.subarray(E);F=sr($),g=sr(U),w=rt($,F,1),p=rt(U,g,1)}else ie(1);else{var I=Ei(l)+4,m=t[I-4]|t[I-3]<<8,y=I+m;if(y>o){c&&ie(0);break}a&&u(h+m),r.set(t.subarray(I,y),h),e.b=h+=m,e.p=l=y*8,e.f=f;continue}if(l>d){c&&ie(0);break}}a&&u(h+131072);for(var V=(1<<F)-1,ve=(1<<g)-1,te=l;;te=l){var G=w[ar(t,l)&V],Z=G>>4;if(l+=G&15,l>d){c&&ie(0);break}if(G||ie(2),Z<256)r[h++]=Z;else if(Z==256){te=l,w=null;break}else{var Oe=Z-254;if(Z>264){var P=Z-257,be=In[P];Oe=le(t,l,(1<<be)-1)+Pn[P],l+=be}var C=p[ar(t,l)&ve],Q=C>>4;C||ie(3),l+=C&15;var U=bi[Q];if(Q>3){var be=Sn[Q];U+=ar(t,l)&(1<<be)-1,l+=be}if(l>d){c&&ie(0);break}a&&u(h+131072);var Ge=h+Oe;if(h<U){var Ue=i-U,jt=Math.min(U,Ge);for(Ue+h<0&&ie(3);h<jt;++h)r[h]=n[Ue+h]}for(;h<Ge;++h)r[h]=r[h-U]}}e.l=w,e.p=te,e.b=h,e.f=f,w&&(f=1,e.m=F,e.d=p,e.n=g)}while(!f);return h!=r.length&&s?fr(r,0,h):r.subarray(0,h)};var Mi=new se(0);var he=function(t,e){return t[e]|t[e+1]<<8},ce=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},cr=function(t,e){return ce(t,e)+ce(t,e+4)*4294967296};function Ai(t,e){return Si(t,{i:2},e&&e.out,e&&e.dictionary)}var lr=typeof TextDecoder<"u"&&new TextDecoder,Pi=0;try{lr.decode(Mi,{stream:!0}),Pi=1}catch{}var Fi=function(t){for(var e="",r=0;;){var n=t[r++],o=(n>127)+(n>223)+(n>239);if(r+o>t.length)return{s:e,r:fr(t,r-1)};o?o==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}};function dr(t,e){if(e){for(var r="",n=0;n<t.length;n+=16384)r+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return r}else{if(lr)return lr.decode(t);var o=Fi(t),i=o.s,r=o.r;return r.length&&ie(8),i}}var Ni=function(t,e){return e+30+he(t,e+26)+he(t,e+28)},Ti=function(t,e,r){var n=he(t,e+28),o=he(t,e+30),i=dr(t.subarray(e+46,e+46+n),!(he(t,e+8)&2048)),s=e+46+n,a=Oi(t,s,o,r,ce(t,e+20),ce(t,e+24),ce(t,e+42)),c=a[0],u=a[1],f=a[2];return[he(t,e+10),c,u,i,s+o+he(t,e+32),f]},Oi=function(t,e,r,n,o,i,s){var a=o==4294967295,c=i==4294967295,u=s==4294967295,f=e+r,l=a+c+u;if(n&&l){for(;e+4<f;e+=4+he(t,e+2))if(he(t,e)==1)return[a?cr(t,e+4+8*c):o,c?cr(t,e+4):i,u?cr(t,e+4+8*(c+a)):s,1];n<2&&ie(13)}return[o,i,s,0]};function Tn(t,e){for(var r={},n=t.length-22;ce(t,n)!=101010256;--n)(!n||t.length-n>65558)&&ie(13);var o=he(t,n+8);if(!o)return{};var i=ce(t,n+16),s=ce(t,n-20)==117853008;if(s){var a=ce(t,n-12);s=ce(t,a)==101075792,s&&(o=ce(t,a+32),i=ce(t,a+48))}for(var c=e&&e.filter,u=0;u<o;++u){var f=Ti(t,i,s),l=f[0],h=f[1],w=f[2],p=f[3],F=f[4],g=f[5],d=Ni(t,g);i=F,(!c||c({name:p,size:h,originalSize:w,compression:l}))&&(l?l==8?r[p]=Ai(t.subarray(d,d+h),{out:new se(w)}):ie(14,"unknown compression type "+l):r[p]=fr(t,d,d+h))}return r}b();b();b();b();var W=t=>Object.entries(t);b();var ot=t=>Object.keys(t);function On(t){return t.replace(/^g_/,"s_")}function Ot(t){return t.replace(/^g_/,"o_")}function Li(t){return t.replace(/^g_/,"w_")}function Ln(t){return t.replace(/^loci_/,"eli_")}function it(t){return t.replace(/^loc_/,"el_")}function Lt(t){return t.replace(/^lcat_/,"ec_")}function Ci(t){return t.replace(/^g_/,"ar_")}function Cn(t){return t.replace(/^n_/,"s_")}function _i(t,e,r){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],o=0,i=t.geometry.type.replace("Multi","");for(let s of t.geometry.coordinates)n.push({...t,geometry:{type:i,coordinates:s},properties:{...t.properties,id:`${e}-${o++}`,kind:r}});return n}default:return[{...t,properties:{...t.properties,id:e,kind:r}}]}}function Re(t,e,r,n){let o=new Map;for(let{feature:i,floorId:s}of t){let a=i.properties.id,c=n.get(a);if(e.has(a)){let u=_i(i,r(a),c),f=u.map(h=>h.properties.id),l=f.map(h=>({geometryId:h,floorId:s}));o.set(a,{ids:f,features:u,anchors:l})}}return o}function _n(t){let e={space:new Map,obstruction:new Map,area:new Map,window:new Map,object:new Map};if(!t.geometry)return e;let r=ki(t),n=W(t.geometry).flatMap(([u,f])=>(f?.features??[]).map(l=>({feature:l,floorId:u}))).flat(),o=new Set(Object.values(t.walkable??{}).filter(u=>u!==void 0).flatMap(ot)),i=new Set(Object.values(t.nonwalkable??{}).filter(u=>u!==void 0).flatMap(ot)),s=new Set(Array.from(r.entries()).filter(([u,f])=>f==="area").map(([u])=>u)),a=new Set(Array.from(r.entries()).filter(([u,f])=>f==="object").map(([u])=>u)),c=new Set(Array.from(r.entries()).filter(([u,f])=>f==="window").map(([u])=>u));return o.size>0&&(e.space=Re(n,o,On,r)),i.size>0&&(e.obstruction=Re(n,i,Ot,r)),s.size>0&&(e.area=Re(n,s,Ci,r)),a.size>0&&(e.object=Re(n,a,Ot,r)),c.size>0&&(e.window=Re(n,c,Li,r)),o.size===0&&i.size===0&&s.size===0&&(e.space=Re(n,new Set(n.map(u=>u.feature.properties.id)),On,r)),e}function ki(t){let e=new Map(Object.values(t.kinds??{}).filter(r=>r!==void 0).flatMap(W));for(let r of t.connections?.filter(n=>n.type!=="door")??[]){for(let n of r.entrances)e.set(n.geometryId,`connection.${r.type}`);for(let n of r.exits)e.set(n.geometryId,`connection.${r.type}`)}return e}function kn(t){if(!t||t.length===0)return[];let e=Math.max(...t.map(r=>r.length));return t.reduce((r,n)=>r.map((o,i)=>o|(n[i]??0)),Array(e).fill(0))}b();var mr=ut(Dn(),1),Gi=t=>{let e=t.geometry.coordinates[0],r=0;for(let n=0;n<e.length-1;n++)r+=e[n][0]*e[n+1][1]-e[n+1][0]*e[n][1];return Math.abs(r/2)},zn=(t,e,r)=>{let n=!1;for(let o=0,i=r.length-1;o<r.length;i=o++){let s=r[o][0],a=r[o][1],c=r[i][0],u=r[i][1];a>e!=u>e&&t<(c-s)*(e-a)/(u-a)+s&&(n=!n)}return n},Ui=(t,e)=>{let[r,n]=t,o=e.geometry.coordinates;if(!zn(r,n,o[0]))return!1;for(let i=1;i<o.length;i++)if(zn(r,n,o[i]))return!1;return!0},ji=t=>{let e=t.geometry.coordinates,r=0,n=0,o=0;for(let w of e)for(let p=0;p<w.length-1;p++)r+=w[p][0],n+=w[p][1],o++;if(o===0)throw new Error("Polygon has no vertices");let i=r/o,s=n/o,a=0,c=0,u=0,f,l;for(let w of e)for(let p of w){let F=p[0]-i,g=p[1]-s;if(f!==void 0&&l!==void 0){let d=f*g-F*l;u+=d,a+=(f+F)*d,c+=(l+g)*d}f=F,l=g}if(u===0)return[i,s];let h=1/(3*u);return[i+h*a,s+h*c]},Gn=t=>{let e=Gi(t);return!Number.isFinite(e)||e<=0?1e-9:Math.sqrt(e)*.01},De=t=>{try{let e=ji(t);if(Ui(e,t))return ue(e);let r=(0,mr.default)(t.geometry.coordinates,Gn(t));return ue([r[0],r[1]])}catch{return Ie(new Error("Unable to calculate center of polygon"))}},Xi=t=>{try{let e=(0,mr.default)(t.geometry.coordinates,Gn(t));return ue([e[0],e[1]])}catch{return Ie(new Error("Unable to calculate center of polygon"))}},Un=(t="center-of-mass")=>{if(typeof t=="function")return t;switch(t){case"visual-center":return Xi;case"center-of-mass":return De}};function jn(t,e){let{nodesByGeometryId:r,incomingEdgesByNodeId:n,nodesById:o}=Yi(t),i=_n(t),s=Vi(t),a=t.navigationFlags??{};return{geometryMaps:i,nodesByGeometryId:r,geometryFeatureById:s,navigationFlags:a,incomingEdgesByNodeId:n,nodesById:o,centerCalculator:Un(e?.centerStrategy)}}function Yi(t){let e=new Map,r=new Map,n=new Map;for(let o of Object.values(t.nodes??{}))for(let i of o?.features??[]){if(n.set(i.properties.id,i),i.properties.geometryIds.length>0)for(let s of i.properties.geometryIds){let a=e.get(s)??[];a.push(i.properties.id),e.set(s,a)}if(i.properties.neighbors.length>0)for(let s of i.properties.neighbors){let a=r.get(s.id);a!=null?a.push(s):r.set(s.id,[s])}}return{nodesByGeometryId:e,incomingEdgesByNodeId:r,nodesById:n}}function Vi(t){let e=new Map;for(let r of Object.values(t.geometry??{}))for(let n of r?.features??[])e.set(n.properties.id,n);return e}b();function Xn(t,e){if(!t.annotations||!t.annotationSymbols||!t.geometry)return{};let r={};for(let[n,o]of W(t.annotations)){if(!o||o.length===0||!t.geometry[n]||t.geometry[n].features.length===0)continue;let i=new Map(t.geometry[n].features.map(a=>[a.properties.id,a])),s={type:"FeatureCollection",features:[]};for(let a of o){let c=i.get(a.geometryId);if(!c||c.geometry.type!=="Point")continue;let u={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:c.geometry,properties:u})}r[n]=s}return{annotation:r}}b();b();function Te(t,e){return e&&(t.flags[e.index]&1<<e.bit)!==0}b();var yr={accessible:"accessible",outdoors:"outdoors",public:"public"};function Yn(t,{nodesByGeometryId:e}){let r={"connection.json":[],entrance:{}},n=t.navigationFlags?.[yr.accessible],o=t.navigationFlags?.[yr.outdoors],i=new Map(Object.values(t.geometry??{}).flatMap(s=>s?.features??[]).map(s=>[s.properties.id,s]));for(let s of t.connections??[]){if(vr(s,i)&&!qi(s)){let l=Wi(s,i,e,o);for(let[h,w]of l)r.entrance[h]||(r.entrance[h]={type:"FeatureCollection",features:[]}),r.entrance[h].features.push(w);continue}let a=n!=null&&s.entrances.some(l=>Te(l,n))&&s.exits.some(l=>Te(l,n)),c=Array.from(new Set([...s.entrances.map(l=>e.get(l.geometryId)),...s.exits.map(l=>e.get(l.geometryId))].flat().filter(l=>l!=null))),u=kn([...s.entrances.map(l=>l.flags),...s.exits.map(l=>l.flags)]),f={id:s.id,externalId:s.details?.externalId??"",type:s.type,accessible:a,nodes:c,flags:u};s.details?.name&&(f.details={name:s.details.name}),s.extra&&(f.extra=s.extra),r["connection.json"].push(f)}return r}function vr(t,e){return t.type==nr.door&&t.entrances.every(r=>e.get(r.geometryId)?.geometry.type==="LineString")}function qi(t){return t.entrances.length===0||t.exits.length===0?!1:new Set([...t.entrances.map(r=>r.floorId),...t.exits.map(r=>r.floorId)]).size>=2}function Wi(t,e,r,n){if(t.type!==nr.door)return[];let o=[];for(let i of t.entrances){let s=e.get(i.geometryId);if(s?.geometry.type==="LineString"){let a={type:"Feature",geometry:s.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",isExterior:Zi(t,n)}},c=t.details;c&&(a.properties.details={name:c.name,description:c.description},c.icon&&(a.properties.details.images=[{url:c.icon,altText:`${c.name} icon`}]));let u=r.get(i.geometryId);u&&u.length>0&&(a.properties.node=u[0]),o.push([i.floorId,a])}}return o}function Zi(t,e){return t.entrances.some(r=>Te(r,e))||t.exits.some(r=>Te(r,e))}b();function qn(t,{geometryMaps:e,nodesByGeometryId:r}){let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"English",code:"en"},languages:[]}},o=t.manifest?.features[0];o&&(n.venue.defaultFloor=o.properties.defaultFloor,n.venue.tzid=o.properties.tzid,n.venue.name=o.properties.name,n.venue.defaultLanguage={name:o.properties.language??"English",code:o.properties.language??"en"});let i=t.cms?.venue;i&&(n.venue={...n.venue,slug:i.slug,name:i.details?.name??n.venue.name??o.properties.name,externalId:i.details?.externalId??"",defaultLanguage:i.defaultLanguage,languages:i.languages??[],countrycode:i.countrycode,coverImage:i.coverImage,logo:i.logo,icon:i.details?.icon,extra:i.extra,mappedinWebUrl:i.mappedinWebUrl,operationHours:i.operationHours,topLocations:i.topLocations,type:i.type&&i.type in rr?i.type:"unknown",propertyImage:i.propertyImage});let s=new Map,a=t.locations??[],c=t.cms?.locations??[],u=t.cms?.categories??[],f=new Map((u??[]).map(I=>[I.categoryId,I]));if(a.length>0){let I=new Map(c.map(m=>[m.locationId,m]));for(let m of a){let y=I.get(m.id)??{};if(m){let E=m.details,S={id:y?.cmsId!==void 0?`el_${y?.cmsId}`:it(m.id),name:E.name,externalId:E.externalId??"",type:y.type??"location",sortOrder:y.sortOrder??0,amenity:y.amenity,description:E.description,extra:m.extra,links:m.links,operationHours:m.openingHours,gallery:y.gallery,logo:m.logo,shortName:E.shortName,picture:y.picture,showFloatingLabelWhenImagePresent:y.showFloatingLabelWhenImagePresent,showLogo:y.showLogo,siblingGroups:y.siblingGroups,states:y.states,tags:y.tags,spaces:[],nodes:[],polygons:[],headerImage:y.headerImage};if(m.phone&&(S.phone={number:m.phone}),y.primaryCategory){let M=f.get(y.primaryCategory);M&&(S.primaryCategory=M.id)}let v=Vn(m.social);m.website&&(v.website=m.website.url),S.social=v;for(let M of m.geometryAnchors){let A=e.space.get(M.geometryId),P=e.obstruction.get(M.geometryId),T=A??P;if(T){let _=new Set(T.features.filter(B=>B.geometry.type==="Polygon").map(B=>B.properties.id));for(let B of T.anchors)A!=null&&T===A&&S.spaces.push({floor:B.floorId,id:B.geometryId}),_.has(B.geometryId)&&S.polygons.push({map:B.floorId,id:B.geometryId})}let L=r.get(M.geometryId);for(let _ of L??[])S.nodes.push({map:M.floorId,id:_})}n.locations.push(S);for(let M of m.categories)s.set(M,[...s.get(M)??[],m.id])}}}let l=t.cms?.locationInstances??[],h=t.locationInstances;if(h){let I=new Map(l.map(y=>[y.locationInstanceId,y])),m=[];for(let y of h){let E=I.get(y.id)??{};if(y){let S={id:Ln(y.id),parent:E.parentId??it(y.parentId),name:y.details?.name,externalId:y.details?.externalId,type:E.type,sortOrder:E.sortOrder,amenity:E.amenity,description:y.details?.description,extra:y.extra,links:y.links,operationHours:y.openingHours,gallery:E.gallery,picture:E.picture,showFloatingLabelWhenImagePresent:E.showFloatingLabelWhenImagePresent,showLogo:E.showLogo,siblingGroups:E.siblingGroups,states:E.states,tags:E.tags,logo:y.logo,shortName:y.details?.shortName,headerImage:E.headerImage};y.phone&&(S.phone={number:y.phone});let v=Vn(y.social??[]);if(y.website&&(v.website=y.website.url),Object.keys(v).length>0&&(S.social=v),y.geometryAnchors?.length){let M=y.geometryAnchors.flatMap(A=>e.space.get(A.geometryId)?.anchors??[]);M.length>0&&(S.spaces=M.map(A=>({floor:A.floorId,id:A.geometryId})))}if(y.geometryAnchors){S.spaces=[],S.polygons=[],S.nodes=[];for(let M of y.geometryAnchors){let A=e.space.get(M.geometryId);if(A){let T=new Set(A.features.filter(L=>L.geometry.type==="Polygon").map(L=>L.properties.id));for(let L of A.anchors)S.spaces.push({floor:L.floorId,id:L.geometryId}),T.has(L.geometryId)&&S.polygons.push({map:L.floorId,id:L.geometryId})}let P=r.get(M.geometryId);for(let T of P??[])S.nodes.push({map:M.floorId,id:T})}}m.push(S)}}m.length>0&&(n.locationInstances=m)}let w=t.locationCategories;if(w){let I=[],m=new Map(w.map(v=>[v.id,v])),y=new Map((u??[]).map(v=>[v.categoryId,v])),E=new Map;for(let v of w){let M=m.get(v.parent);if(M){let A=E.get(M.id)??[];A.push(v.id),E.set(M.id,A)}}for(let v of w){let M=y.get(v.id);if(v){let A=(E.get(v.id)??[]).map(Lt),P={id:Lt(v.id),name:v.details.name,externalId:v.details.externalId??"",sortOrder:M?.sortOrder??0,children:A,locations:(s.get(v.id)??[]).map(it),icon:v.details.icon,picture:M?.picture,color:M?.color,extra:v.extra,iconFromDefaultList:M?.iconFromDefaultList};I.push(P)}}n.categories=I;let S={};for(let v of a)S[it(v.id)]=v.categories.map(Lt).filter(M=>M!==void 0);n.categoryPriorities=S}let p={};for(let[I,m]of Object.entries(t.defaultStyle??{}))if(m.buffer){let y=m.geometryAnchors.flatMap(E=>e.space.get(E.geometryId)?.anchors??[]);p[I]={edgeOffset:m.buffer,geometryAnchors:y}}Object.keys(p).length>0&&(n.enterpriseStyles=p);let F=new Map;for(let I of Object.values(t.cms?.layers??{}))if(I)for(let[m,y]of W(I)){if(typeof y!="string")continue;let E=F.get(y)??{name:y,id:`ely_${y}`,spaces:[]};E.spaces.push(...e.space.get(m)?.anchors.map(S=>({floorId:S.floorId,spaceId:S.geometryId}))??[]),F.set(y,E)}F.size>0&&(n.layers=Array.from(F.values()));let g=[];for(let I of Object.values(t.cms?.textures??{}))for(let m of I){let y=e.space.get(m.geometryId)?.anchors;!y||y.length<1||m.face==="unknown"||m.surface==="unknown"||g.push({repeat:m.repeat,offset:m.offset,rotation:m.rotation,path:m.path,face:m.face,surface:m.surface,bounds:m.bounds,geometryAnchors:y})}g.length>0&&(n.textures=g);let d={};for(let[I,m]of Object.entries(t.cms?.floorText??{})){let y={type:"FeatureCollection",features:[]};for(let E of m.features){if(E.properties.align==="unknown")continue;let S={align:E.properties.align,color:E.properties.color,fontFamily:E.properties.fontFamily,fontSize:E.properties.fontSize,rotation:E.properties.rotation,text:E.properties.text,visible:E.properties.visible};"geometryId"in E.properties?S.geometryId=E.properties.geometryId:S.verticalOffset=E.properties.verticalOffset,y.features.push({type:"Feature",geometry:E.geometry,properties:S})}y.features.length>0&&(d[I]=y)}Object.keys(d).length>0&&(n.floorText=d);let x={enterprise:n};if(t.cms?.textAreas){let I={};for(let[m,y]of W(t.cms.textAreas)){let E={type:"FeatureCollection",features:[]};for(let S of y.features){if(S.properties.align==="unknown")continue;let v={align:S.properties.align,maxWidth:S.properties.maxWidth,maxHeight:S.properties.maxHeight,rotation:S.properties.rotation};"geometryId"in S.properties?v.anchorId=S.properties.geometryId:v.verticalOffset=S.properties.verticalOffset;let M={type:"Feature",geometry:S.geometry,properties:v};E.features.push(M)}I[m]=E}x.textAreas=I}return x}var $i=["facebook","instagram","twitter"];function Vn(t){let e={};for(let{name:r,url:n}of t){let o=r.toLowerCase();$i.includes(o)&&(e[o]=n)}return e}b();var Hi=t=>`fc_${t.slice(3)}`;function Wn(t,{geometryMaps:e}){if(!t.facade)return{};let r={},n={};for(let[o,i]of W(t.facade))if(i)for(let s of Object.values(i)){let{floorStackId:a,geometryIds:c}=s,u=Hi(a);n[a]??={id:u,spaces:[]},n[a].spaces.push(...c.map(f=>({floorId:o,spaceId:e.space.get(f)?.ids[0]??""})))}return Object.keys(n).length>0&&(r.facade=n),r}b();function Zn(t,e={}){let r={type:"FeatureCollection",features:[]},n=[];for(let o of t.floors.features)n.push({id:o.properties.id,externalId:o.properties.details?.externalId??"",elevation:o.properties.elevation,name:o.properties.details?.name??"",shortName:o.properties.details?.shortName??"",subtitle:o.properties.subtitle,maxHeight:o.properties.maxHeight}),r.features.push({type:"Feature",geometry:o.geometry,properties:{id:o.properties.id,externalId:o.properties.details?.externalId??"",elevation:o.properties.elevation,name:o.properties.details?.name??"",shortName:o.properties.details?.shortName??"",subtitle:o.properties.subtitle,maxHeight:o.properties.maxHeight}});return{"floor.geojson":r,"map.geojson":n}}b();function $n(t,{geometryMaps:e}){let r={},n={};for(let[o,i]of W(t.floorImages??{})){let s={features:[],type:"FeatureCollection"};for(let a of i?.features??[])if("verticalOffset"in a.properties)s.features.push(a);else{let{geometryId:c,...u}=a.properties,f=e.space.get(c)?.ids[0]??e.obstruction.get(c)?.ids[0];if(!f)continue;let l={geometry:a.geometry,properties:{...u,anchorId:f},type:a.type};s.features.push(l)}n[o]=s}return Object.keys(n).length>0&&(r.floorImages=n),r}b();function Hn(t,e={}){let r=[];for(let o of t?.floorStacks??[]){let i={id:o.id,floors:o.floors,maps:o.floors,externalId:o.details?.externalId??"",name:o.details?.name??"",shortName:o.details?.shortName??"",type:"Building"};o.defaultFloor&&(i.defaultFloor=o.defaultFloor),r.push(i)}if(t.outdoors&&t.outdoors.floors.length>0){let o={id:"outdoors",floors:t.outdoors.floors,maps:t.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(o)}return{"floorstack.json":r,"mapstack.geojson":r}}b();function br(t){return t?.geometry?.type==="Polygon"}function Kn(t,{geometryMaps:e,nodesByGeometryId:r,nodesById:n,centerCalculator:o=De}){let i=es(t.defaultStyle),s={},a={},c={},u={};for(let l of ot(t.geometry)){let h=t.geometry[l];if(!h)continue;let w=[],p=[],F=[],g=[];for(let d of h.features){let x=d.properties.id,I=i.has(x),m=r.get(x)??[];for(let y of e.space.get(x)?.features??[])w.push(Jn(y,m,o));for(let y of e.obstruction.get(x)?.features??[])if(p.push(Ji(y,I,o)),e.object.has(x)){let E=r.get(x)??[],S=E.map(v=>n.get(v)).filter(v=>v!=null);for(let v of S){let M=Jn({type:"Feature",geometry:v.geometry,properties:{id:Cn(v.properties.id),kind:"desk-entrance",details:{externalId:Ot(x)}}},E,o);w.push(M)}}for(let y of e.area.get(x)?.features??[])F.push(Ki(y,m,o));for(let y of e.window.get(x)?.features??[])g.push(Qi(y))}w.length>0&&(s[l]={type:"FeatureCollection",features:w.filter(d=>d!==null)}),p.length>0&&(a[l]={type:"FeatureCollection",features:p.filter(d=>d!==null)}),F.length>0&&(c[l]={type:"FeatureCollection",features:F.filter(d=>d!==null)}),g.length>0&&(u[l]={type:"FeatureCollection",features:g.filter(d=>d!==null)})}let f={space:s,obstruction:a};return Object.keys(c).length>0&&(f.area=c),Object.keys(u).length>0&&(f.window=u),f}function Jn(t,e,r=De){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let n={type:"Feature",geometry:t.geometry,properties:{destinationNodes:e,id:t.properties.id,externalId:t.properties.details?.externalId??"",kind:t.properties.kind}};return t.properties.details&&(n.properties.details={name:t.properties.details.name,description:t.properties.details.description,images:t.properties.details.icon?[{url:t.properties.details.icon,altText:t.properties.details.name?`${t.properties.details.name} icon`:"icon"}]:void 0}),br(n)&&(n.properties.center=r(n).unwrapOr(void 0)),n}function Ji(t,e,r=De){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let n=t.properties,o={type:"Feature",geometry:t.geometry,properties:{id:n.id,externalId:n.details?.externalId??"",entrances:[],kind:n.kind,footprintComponent:e}};return br(o)&&(o.properties.center=r(o).unwrapOr(void 0)),n.details&&(o.properties.details={name:n.details.name,description:n.details.description,images:n.details.icon?[{url:n.details.icon,altText:n.details.name?`${n.details.name} icon`:"icon"}]:void 0}),o}function Ki(t,e,r=De){if(t.geometry.type!=="Polygon")return null;let n=t.properties,o={type:"Feature",geometry:t.geometry,properties:{id:n.id,externalId:n.details?.externalId??"",destinationNodes:e}};return br(o)&&(o.properties.center=r(o).unwrapOr(void 0)),n.details&&(o.properties.details={name:n.details.name,description:n.details.description,images:n.details.icon?[{url:n.details.icon,altText:n.details.name?`${n.details.name} icon`:"icon"}]:void 0}),o}function Qi(t){return t.geometry.type!=="LineString"?null:{type:"Feature",geometry:t.geometry,properties:{id:t.properties.id}}}function es(t){return new Set((t?.ExteriorWalls?.geometryAnchors??[]).map(r=>r.geometryId))}b();function Qn(t,{geometryMaps:e,geometryFeatureById:r}){if(!t.locationCategories&&!t.locations)return{};let n={};if(t.locationCategories?.length){let o=[];for(let i of t.locationCategories){let s={id:i.id,name:i.details.name,icon:i.details.icon??""};i.parent&&(s.parent=i.parent),o.push(s)}n["category.json"]=o}if(t.locations?.length){let o=ts(t,{geometryFeatureById:r}),i=[];for(let s of t.locations){let a={id:s.id,name:s.details.name,categories:s.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:s.links,openingHoursSpecification:s.openingHours??[],pictures:s.images,social:s.social,description:s.details.description,externalId:s.details.externalId,icon:s.details.icon,logo:s.logo,phone:s.phone,website:s.website,searchTags:s.searchTags};i.push(a);for(let{geometryId:c,floorId:u}of s.geometryAnchors)a.spaces.push(...e.space.get(c)?.ids.map(f=>({id:f,floor:u}))??[]),a.obstructions.push(...e.obstruction.get(c)?.ids.map(f=>({id:f,floor:u}))??[]),a.areas.push(...e.area.get(c)?.ids.map(f=>({id:f,floor:u}))??[]),a.entrances.push(...o.entrancesByGeometryId.get(c)??[]),a.connections.push(...o.connectionsByGeometryId.get(c)??[]),a.annotations.push(...o.annotationsByGeometryId.get(c)??[])}n["location.json"]=i}return n}function ts(t,{geometryFeatureById:e}){let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(t.annotations)for(let[n,o]of W(t.annotations))for(let i of o??[]){let s=i.geometryId,a=i.id,c=r.annotationsByGeometryId.get(s)??[];c.push({floor:n,id:a}),r.annotationsByGeometryId.set(s,c)}if(t.connections)for(let n of t.connections){let o=vr(n,e),i=Array.from(new Map([...n.entrances,...n.exits].map(s=>[`${s.geometryId}_${s.floorId}`,s])).values());for(let s of i){let a=s.geometryId;if(o){let c=r.entrancesByGeometryId.get(a)??[];c.push({floor:s.floorId,id:n.id}),r.entrancesByGeometryId.set(a,c)}else{let c=r.connectionsByGeometryId.get(a)??[];c.push(n.id),r.connectionsByGeometryId.set(a,c)}}}return r}b();var rs={"styles.json":["ext:mvf-default-style"],"shapes.json":null,"tileset.json":["ext:mvf-tileset"],"location.json":["ext:locations"],"category.json":["ext:locations"],"navigationFlags.json":["ext:mvf-navigation-flags"],"annotation-symbols.json":["ext:mvf-annotations"],"geometry-effects.json":null,annotation:["ext:mvf-annotations"],textAreas:["ext:cms"],enterprise:["ext:cms","ext:locations"],floorImages:["ext:floor-images"],shapeInstances:null,modelInstances:null,window:["ext:kinds"],area:["ext:kinds"],facade:["ext:facade"]};function ns(t){let e={};for(let[r,n]of Object.entries(rs))n!=null&&n.every(o=>o in t)&&(e[r.replace(_e,"")]=wn);return e}function eo(t,e){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},o=t.manifest;if(o.features.length>0){let i=o.features[0],s=i.properties,a=s.details!=null?{...s.details.externalId!=null&&{externalId:s.details.externalId}}:void 0,c={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:s.time,name:s.name,naturalBearing:s.naturalBearing,tzid:s.tzid,map:s.mapId,org_id:s.orgId,language:s.language,...a!=null&&Object.keys(a).length>0&&{details:a},...s.extensions!=null&&{extensions:ns(s.extensions)}}};r.features.push(c)}return n}b();function to(t,{geometryMaps:e,navigationFlags:r,incomingEdgesByNodeId:n}){let o={"node.geojson":{type:"FeatureCollection",features:[]}},i=o["node.geojson"].features,s=os(t),a=is(t),c=ss(t,a,s);for(let[u,f]of W(t.nodes??{}))for(let l of f?.features??[]){let h=e.space.get(l.properties.geometryIds[0])?.features[0],w=h?.geometry.type==="Point"&&h?.properties.details?.externalId?h.properties.details.externalId:"",p=n.get(l.properties.id)??[],F=Object.keys(r??{}),g=[];for(let x of p)for(let I of F)Te(x,r[I])&&g.push(r[I]);let d={type:"Feature",geometry:l.geometry,properties:{id:l.properties.id,floor:u,space:l.properties.geometryIds.map(x=>e.space.get(x)?.ids).flat().filter(x=>x!==void 0),neighbors:[...l.properties.neighbors.map(x=>({id:x.id,weight:x.extraCost})),...c.get(l.properties.id)??[]],map:u,externalId:w,flags:g.length>0?as(g):void 0}};i.push(d)}return o}function os(t){let e=new Map;for(let r of t.floors?.features??[])e.set(r.properties.id,r.properties.elevation);return e}function is(t){let e=new Map;for(let r of Object.values(t.nodes??{}))for(let n of r?.features??[])if(n.properties.geometryIds.length!==0)for(let o of n.properties.geometryIds){let i=e.get(o)??[];i.includes(n.properties.id)||(i.push(n.properties.id),e.set(o,i))}return e}function ss(t,e,r){let n=new Map;for(let o of t.connections??[]){let i=o.exits.map(s=>({...s,nodes:e.get(s.geometryId)??[]}));for(let s of o.entrances){let a=e.get(s.geometryId)??[];for(let c of a)for(let u of i){let f=Math.abs((r.get(s.floorId)??0)-(r.get(u.floorId)??0))*o.floorCostMultiplier,l=n.get(c)??[];l.push(...u.nodes.filter(h=>h!==c).map(h=>({id:h,weight:f+o.entryCost}))),n.set(c,l)}}}return n}function as(t){if(t==null||t.length===0)return;let e=new Array(Math.max(...t.map(r=>r.index))+1).fill(0);for(let r of t)e[r.index]|=1<<r.bit;return e}b();function cs(t,e){let r={};for(let n of t){let o=e.get(n);o&&(r[o]??=[],r[o].push(n))}return r}function ro(t,{geometryMaps:e}){if(!t.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let o=[...Array.from(e.space.values()).map(s=>s.features),...Array.from(e.obstruction.values()).map(s=>s.features)],i=new Map(o.flatMap(s=>s.map(a=>[a.properties.id,a.geometry.type])));for(let[s,a]of W(t.defaultStyle)){let c=cs(a.geometryAnchors.flatMap(u=>[...e.space.get(u.geometryId)?.ids??[],...e.obstruction.get(u.geometryId)?.ids??[]]),i);if(c.Point&&c.Point.length>0){let u={points:Array.from(c.Point.values()),showImage:a.extra?.showImage!==void 0?a.extra?.showImage===!0:a.opacity!==0};n[`${s}.Point`]=u}if(c.LineString&&c.LineString.length>0){let u={lineStrings:Array.from(c.LineString.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity,width:a.buffer};a.topColor!==void 0&&(u.topColor=a.topColor),n[`${s}.LineString`]=u}if(c.Polygon&&c.Polygon.length>0){let u={polygons:Array.from(c.Polygon.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity};a.extra?.showImage!==void 0&&(u.showImage=a.extra.showImage===!0),a.topColor!==void 0&&(u.topColor=a.topColor),n[`${s}.Polygon`]=u}}return r}function no(t,e){let r=jn(t,e),n=Zn(t,r),o=Kn(t,r),i=to(t,r),s=Yn(t,r),a=ro(t,r),c=Hn(t,r),u=$n(t,r),f=Wn(t,r),l=Xn(t,r),h=Qn(t,r),w=qn(t,r),p=eo(t,r);return{...t.tileset?{"tileset.json":t.tileset}:{},...t.navigationFlags?{"navigationFlags.json":t.navigationFlags}:{},...t.annotationSymbols?{"annotation-symbols.json":t.annotationSymbols}:{},...n,...o,...i,...s,...a,...c,...u,...f,...l,...h,...w,...p}}var j=t=>JSON.parse(dr(t)),us=/^geometry\/(.+)\.geojson$/,ls=/^nodes\/(.+)\.(geo)?json$/,fs=/^floorImages\/(.+)\.geojson$/,ds=/^facade\/(.+)\.json$/,ps=/^walkable\/(.+)\.json$/,hs=/^nonwalkable\/(.+)\.json$/,gs=/^kinds\/(.+)\.json$/,ms=/^annotations\/(.+)\.json$/,ys=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,vs=[(t,e)=>t==="manifest.geojson"?{manifest:j(e)}:void 0,(t,e)=>t==="floors.geojson"?{floors:j(e)}:void 0,(t,e)=>{let r=t.match(us);return r?{geometry:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="connections.json"?{connections:j(e)}:void 0,(t,e)=>t==="navigationFlags.json"?{navigationFlags:j(e)}:void 0,(t,e)=>{let r=t.match(ls);return r?{nodes:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="default-style.json"?{defaultStyle:j(e)}:void 0,(t,e)=>t==="floor-stacks.json"?{floorStacks:j(e)}:void 0,(t,e)=>t==="outdoors.json"?{outdoors:j(e)}:void 0,(t,e)=>t==="tileset.json"?{tileset:j(e)}:void 0,(t,e)=>{let r=t.match(fs);return r?{floorImages:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(ds);return r?{facade:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(ps);return r?{walkable:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(hs);return r?{nonwalkable:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(gs);return r?{kinds:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="annotation-symbols.json"?{annotationSymbols:j(e)}:void 0,(t,e)=>{let r=t.match(ms);return r?{annotations:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="locations.json"?{locations:j(e)}:void 0,(t,e)=>t==="location-categories.json"?{locationCategories:j(e)}:void 0,(t,e)=>t==="location-instances.json"?{locationInstances:j(e)}:void 0,(t,e)=>{let r=t.match(ys);if(!r)return;let[,n,o]=r;return n==="floorText"||n==="textures"||n==="textAreas"?{cms:{[n]:{[o]:j(e)}}}:{cms:{[o]:j(e)}}}],bs=new Set(Mt),xs=new Set(At),ws=new Set($e),Es=new Set(Je),Is=new Set(He),Ss=new Set(Ke),Ms=new Set(Qe),As=new Set(et),Ps=new Set(tt);function Me(t,e){return typeof t=="string"&&e.has(t)?t:"unknown"}function Fs(t){let e=t.connections;if(Array.isArray(e))for(let a of e)a&&typeof a=="object"&&"type"in a&&(a.type=Me(a.type,bs));let r=t.kinds;if(r&&typeof r=="object"){for(let a of Object.values(r))if(a&&typeof a=="object"){let c=a;for(let u of Object.keys(c))c[u]=Me(c[u],xs)}}let n=t.cms;if(!n||typeof n!="object")return;let o=n,i=o.locations;if(Array.isArray(i))for(let a of i){if(!a||typeof a!="object")continue;let c=a;if("type"in c&&(c.type=Me(c.type,ws)),Array.isArray(c.states))for(let u of c.states)u&&typeof u=="object"&&"type"in u&&(u.type=Me(u.type,Es));if(Array.isArray(c.siblingGroups))for(let u of c.siblingGroups)u&&typeof u=="object"&&"type"in u&&(u.type=Me(u.type,Is))}for(let a of["floorText","textAreas"]){let c=a==="floorText"?Ss:Ms,u=o[a];if(!(!u||typeof u!="object"))for(let f of Object.values(u)){if(!f||typeof f!="object")continue;let l=f.features;if(Array.isArray(l))for(let h of l){if(!h||typeof h!="object")continue;let w=h.properties;w&&typeof w=="object"&&"alignment"in w&&(w.alignment=Me(w.alignment,c))}}}let s=o.textures;if(s&&typeof s=="object"){for(let a of Object.values(s))if(Array.isArray(a))for(let c of a){if(!c||typeof c!="object")continue;let u=c;"face"in u&&(u.face=Me(u.face,As)),"surface"in u&&(u.surface=Me(u.surface,Ps))}}}function Ns(t){let e=Tn(t),r={};for(let n of Object.keys(e))for(let o of vs){let i=o(n,e[n]);if(i){r=Ze(r,i,[]);break}}return Fs(r),r}function _t(t){try{return ue(Ns(t))}catch(e){return Ie(e instanceof Error?e:new Error(String(e)))}}var Ts={decompressUnsafeSync:t=>_t(t),decompressUnsafe:t=>Promise.resolve(_t(t)),decompressSync:t=>_t(t),decompress:t=>Promise.resolve(_t(t))};var xr=class{groupBy;graph;geometryEdgesByMapId=new Map;flagDeclarations={};getDoorByNodeId;nonPublicNodeIds;outdoorNodeIds;indoorPathWeight;outdoorPathWeight;constructor({nodes:e,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o,flagDeclarations:i,getDoorByNodeId:s}){this.groupBy=n,this.graph=new wt({nodes:e,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o});let a=r?.features||[];this.flagDeclarations=i??{},this.getDoorByNodeId=s,this.nonPublicNodeIds=this.getNonPublicNodeIds(),this.outdoorNodeIds=this.getOutdoorNodeIds(),this.indoorPathWeight=this.getDominantPathWeight(!1),this.outdoorPathWeight=this.getDominantPathWeight(!0),a.forEach(c=>{let u=null;if(c.geometry.type==="LineString"?u=c.geometry.coordinates:c.geometry.type==="Polygon"&&(u=c.geometry.coordinates.flat()),u){let f=this.groupBy==="default"?this.groupBy:c.properties[this.groupBy];this.geometryEdgesByMapId.has(f)||this.geometryEdgesByMapId.set(f,[]);let l=this.geometryEdgesByMapId.get(f),h=c.geometry.type==="LineString"&&u.length<=2;u.forEach((w,p)=>{h&&p+1>=u.length||l.push([w,u[p+1]||u[0]])})}})}getNonPublicNodeIds(){let e=new Set;if(Ce.public in this.flagDeclarations)for(let r in this.graph.nodesById)qe(this.graph.nodesById[r].properties.flags,this.flagDeclarations[Ce.public].index,this.flagDeclarations[Ce.public].bit)||e.add(r);return e}getOutdoorNodeIds(){let e=new Set;if(Ce.outdoors in this.flagDeclarations){let r=this.flagDeclarations[Ce.outdoors];for(let n in this.graph.nodesById)qe(this.graph.nodesById[n].properties.flags,r.index,r.bit)&&e.add(n)}return e}getDominantPathWeight(e){let r=new Map;for(let i in this.graph.edges)if(this.outdoorNodeIds.has(i)===e)for(let s of this.graph.edges[i])D(s.origin)===D(s.destination)&&this.outdoorNodeIds.has(s.destination.properties.id)===e&&r.set(s.pathWeight,(r.get(s.pathWeight)??0)+1);let n=0,o=0;for(let[i,s]of r)s>o&&(n=i,o=s);return n}getDirections({zones:e,originIds:r,from:n,to:o,destinationNodeIds:i,disabledConnectionNodeIds:s,simplify:a,multiplicativeDistanceWeightScaling:c,overrideEdgeWeights:u,includeNonPublic:f,outdoorPathWeightMultiplier:l}){let h=a?.enabled??!0,w=e??[],p=this.graph.aStar({originIds:r,destinationNodeIds:i,zones:w,disabledConnectionNodeIds:new Set(s),overrideEdgeWeights:u,disabledNodeIds:f?void 0:this.nonPublicNodeIds,outdoorNodeIds:this.outdoorNodeIds,indoorPathWeight:this.indoorPathWeight,outdoorPathWeight:this.outdoorPathWeight,outdoorPathWeightMultiplier:l});if(p.length===0)return{type:"FeatureCollection",features:[]};if(a?.method!=="greedy-los"&&n&&o&&n.length===1&&o.length===1){let F=new ne({origin:n[0],destination:p[0].origin,distance:re(n[0].geometry.coordinates,p[0].origin.geometry.coordinates),angle:q(n[0].geometry.coordinates,p[0].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:c}),g=p.slice(),d=new ne({origin:p[p.length-1].destination,destination:o[0],distance:re(p[p.length-1].destination.geometry.coordinates,o[0].geometry.coordinates),angle:q(p[p.length-1].destination.geometry.coordinates,o[0].geometry.coordinates),multiplicativeDistanceWeightScaling:c});g.unshift(F),g.push(d),p=g}return h&&(p=this.simplifyAllSteps(p,a,c)),this.generatePath(p)}generatePath=e=>{let{destination:r}=e[e.length-1],n={type:"FeatureCollection",features:[]};for(let i=0;i<e.length;i++){let{origin:s,destination:a}=e[i],c={id:s.properties.id,angle:e[i].angle,distance:e[i].distance,destination:a.properties.id,edges:this.graph.edges[s.properties.id]};this.groupBy!=="default"&&(c.groupBy=s.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:c})}let o={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(o.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:o}),n};simplifyAllSteps(e,r={enabled:!0,method:"greedy-los"},n){let o=[],i=[e[0]],s=r.method??"greedy-los",a=r.radius??Ve,c=s==="dp-optimal"?this.simplifyStepsWithDPMethod.bind(this):s==="rdp"?this.simplifyStepsImprovedWithSimplifyBeforeLoSChecks.bind(this):this.simplifySteps.bind(this);for(let h=1;h<e.length;h++)if(this.groupBy!=="default"&&e[h].origin.properties[this.groupBy]!==e[h-1].origin.properties[this.groupBy]){let w=e[h-1].origin.properties[this.groupBy],p=this.geometryEdgesByMapId.get(w)??[];o.push(...c(i,p,a,n,r)),i=[e[h]]}else i.push(e[h]);let u=e[e.length-1],f=this.groupBy==="default"?this.groupBy:u.origin.properties[this.groupBy],l=this.geometryEdgesByMapId.get(f)??[];return o.push(...c(i,l,a,n,r)),o}findNearestNodesOnGraph=(e,r,n,o,i=!1,s=1/0,a,c)=>this.graph.dijkstraFindWithinTravelDistance(e,r,o,this.geometryEdgesByMapId.get(n)??[],i,s,a,c);hasLineOfSight=(e,r,n,o)=>this.graph.hasLineOfSight(e,r,this.geometryEdgesByMapId.get(n),o);simplifySteps(e,r,n,o,i){return yn(e,r,n,this.flagDeclarations,o)}simplifyStepsImprovedWithSimplifyBeforeLoSChecks(e,r,n,o,i){if(e.length<3)return e;!1,e=gn(e,this.getDoorByNodeId,o,r);let s=i?.method==="rdp"?i.includeDoorBufferNodes??!0:!0;return mn(e,r,o,s)}simplifyStepsWithDPMethod(e,r,n,o,i){if(e.length<3)return e;let s=new Set;(i?.method==="dp-optimal"?i.includeDoorBufferNodes??!1:!1)&&(s=bn(e,this.getDoorByNodeId));for(let f=0;f<e.length-1;f++){let l=D(e[f].origin),h=D(e[f+1].origin);l!==h&&(e[f].origin.properties.preventSmoothing||(e[f].origin.properties.preventSmoothing=!0,s.add(e[f].origin.properties.id)),e[f+1].origin.properties.preventSmoothing||(e[f+1].origin.properties.preventSmoothing=!0,s.add(e[f+1].origin.properties.id)))}let c=e[e.length-1];D(c.origin)!==D(c.destination)&&(c.origin.properties.preventSmoothing||(c.origin.properties.preventSmoothing=!0,s.add(c.origin.properties.id))),!1;let u=fn(e,r,o,n);if(!1){let f=u[u.length-1];window.__DEBUG_PATH.finalSteps.push({nodeId:f.destination.properties.id,coordinate:f.destination.geometry.coordinates,floorId:f.destination.properties.map})}for(let f of e)s.has(f.origin.properties.id)&&delete f.origin.properties.preventSmoothing,s.has(f.destination.properties.id)&&delete f.destination.properties.preventSmoothing;return u}getDistance=(e,r)=>re(e,r);getAngle=(e,r)=>q(e,r)};b();b();b();b();function Os(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=ht(t),o=Jr(e),i=o.type,s=e.bbox,a=o.coordinates;if(s&&Ls(n,s)===!1)return!1;i==="Polygon"&&(a=[a]);for(var c=!1,u=0;u<a.length&&!c;u++)if(oo(n,a[u][0],r.ignoreBoundary)){for(var f=!1,l=1;l<a[u].length&&!f;)oo(n,a[u][l],!r.ignoreBoundary)&&(f=!0),l++;f||(c=!0)}return c}function oo(t,e,r){var n=!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 o=0,i=e.length-1;o<e.length;i=o++){var s=e[o][0],a=e[o][1],c=e[i][0],u=e[i][1],f=t[1]*(s-c)+a*(c-t[0])+u*(t[0]-s)===0&&(s-t[0])*(c-t[0])<=0&&(a-t[1])*(u-t[1])<=0;if(f)return!r;var l=a>t[1]!=u>t[1]&&t[0]<(c-s)*(t[1]-a)/(u-a)+s;l&&(n=!n)}return n}function Ls(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}b();b();function Cs(t){if(!t)throw new Error("geojson is required");var e=[];return qr(t,function(r){_s(r,e)}),Xe(e)}function _s(t,e){var r=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":r=Ne(n);break;case"LineString":r=[Ne(n)]}r.forEach(function(o){var i=ks(o,t.properties);i.forEach(function(s){s.id=e.length,e.push(s)})})}}function ks(t,e){var r=[];return t.reduce(function(n,o){var i=Yr([n,o],e);return i.bbox=Bs(n,o),r.push(i),o}),r}function Bs(t,e){var r=t[0],n=t[1],o=e[0],i=e[1],s=r<o?r:o,a=n<i?n:i,c=r>o?r:o,u=n>i?n:i;return[s,a,c,u]}var wr=Cs;var Bo=ut(_o(),1);function ka(t,e){var r={},n=[];if(t.type==="LineString"&&(t=Xt(t)),e.type==="LineString"&&(e=Xt(e)),t.type==="Feature"&&e.type==="Feature"&&t.geometry!==null&&e.geometry!==null&&t.geometry.type==="LineString"&&e.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var o=ko(t,e);return o&&n.push(o),Xe(n)}var i=(0,Bo.default)();return i.load(wr(e)),Vt(wr(t),function(s){Vt(i.search(s),function(a){var c=ko(s,a);if(c){var u=Ne(c).join(",");r[u]||(r[u]=!0,n.push(c))}})}),Xe(n)}function ko(t,e){var r=Ne(t),n=Ne(e);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],i=r[0][1],s=r[1][0],a=r[1][1],c=n[0][0],u=n[0][1],f=n[1][0],l=n[1][1],h=(l-u)*(s-o)-(f-c)*(a-i),w=(f-c)*(i-u)-(l-u)*(o-c),p=(s-o)*(i-u)-(a-i)*(o-c);if(h===0)return null;var F=w/h,g=p/h;if(F>=0&&F<=1&&g>=0&&g<=1){var d=o+F*(s-o),x=i+F*(a-i);return lt([d,x])}return null}var Dp=ka;export{Ze as a,ri as b,Tn as c,Dn as d,no as e,Ts as f,ht as g,Ne as h,Jr as i,sc as j,gt as k,Dp as l,Go as m,Uo as n,Va as o,me as p,qa as q,Wa as r,Za as s,re as t,qt as u,dt as v,$a as w,Os as x,er as y,xr as z};
|
|
1
|
+
import{A as Vt,B as qr,E as xe,a as b,e as jr,g as Xr,o as Xt,p as lt,r as Yr,s as Xe,w as Vr,x as Yt,y as ft}from"./chunk-XBKEAHSJ.js";import{b as de,d as ut}from"./chunk-PWEV3AFA.js";var er=de((vu,Et)=>{b();(function(){"use strict";function t(s,a){var c=s.x-a.x,u=s.y-a.y;return c*c+u*u}function e(s,a,c){var u=a.x,f=a.y,l=c.x-u,h=c.y-f;if(l!==0||h!==0){var w=((s.x-u)*l+(s.y-f)*h)/(l*l+h*h);w>1?(u=c.x,f=c.y):w>0&&(u+=l*w,f+=h*w)}return l=s.x-u,h=s.y-f,l*l+h*h}function r(s,a){for(var c=s[0],u=[c],f,l=1,h=s.length;l<h;l++)f=s[l],t(f,c)>a&&(u.push(f),c=f);return c!==f&&u.push(f),u}function n(s,a,c,u,f){for(var l=u,h,w=a+1;w<c;w++){var p=e(s[w],s[a],s[c]);p>l&&(h=w,l=p)}l>u&&(h-a>1&&n(s,a,h,u,f),f.push(s[h]),c-h>1&&n(s,h,c,u,f))}function o(s,a){var c=s.length-1,u=[s[0]];return n(s,0,c,a,u),u.push(s[c]),u}function i(s,a,c){if(s.length<=2)return s;var u=a!==void 0?a*a:1;return s=c?s:r(s,u),s=o(s,u),s}typeof define=="function"&&define.amd?define(function(){return i}):typeof Et<"u"?(Et.exports=i,Et.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});var Bn=de((pr,hr)=>{b();(function(t,e){typeof pr=="object"&&typeof hr<"u"?hr.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.TinyQueue=e())})(pr,function(){"use strict";var t=function(n,o){if(n===void 0&&(n=[]),o===void 0&&(o=e),this.data=n,this.length=this.data.length,this.compare=o,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};t.prototype.push=function(n){this.data.push(n),this.length++,this._up(this.length-1)},t.prototype.pop=function(){if(this.length!==0){var n=this.data[0],o=this.data.pop();return this.length--,this.length>0&&(this.data[0]=o,this._down(0)),n}},t.prototype.peek=function(){return this.data[0]},t.prototype._up=function(n){for(var o=this,i=o.data,s=o.compare,a=i[n];n>0;){var c=n-1>>1,u=i[c];if(s(a,u)>=0)break;i[n]=u,n=c}i[n]=a},t.prototype._down=function(n){for(var o=this,i=o.data,s=o.compare,a=this.length>>1,c=i[n];n<a;){var u=(n<<1)+1,f=i[u],l=u+1;if(l<this.length&&s(i[l],f)<0&&(u=l,f=i[l]),s(f,c)>=0)break;i[n]=f,n=u}i[n]=c};function e(r,n){return r<n?-1:r>n?1:0}return t})});var Dn=de((tf,gr)=>{"use strict";b();var Ct=Bn();Ct.default&&(Ct=Ct.default);gr.exports=Rn;gr.exports.default=Rn;function Rn(t,e,r){e=e||1;for(var n,o,i,s,a=0;a<t[0].length;a++){var c=t[0][a];(!a||c[0]<n)&&(n=c[0]),(!a||c[1]<o)&&(o=c[1]),(!a||c[0]>i)&&(i=c[0]),(!a||c[1]>s)&&(s=c[1])}var u=i-n,f=s-o,l=Math.min(u,f),h=l/2;if(l===0){var w=[n,o];return w.distance=0,w}for(var p=new Ct(void 0,Bi),F=n;F<i;F+=l)for(var g=o;g<s;g+=l)p.push(new Se(F+h,g+h,h,t));var d=Di(t),x=new Se(n+u/2,o+f/2,0,t);x.d>d.d&&(d=x);for(var I=p.length;p.length;){var m=p.pop();m.d>d.d&&(d=m,r&&console.log("found best %d after %d probes",Math.round(1e4*m.d)/1e4,I)),!(m.max-d.d<=e)&&(h=m.h/2,p.push(new Se(m.x-h,m.y-h,h,t)),p.push(new Se(m.x+h,m.y-h,h,t)),p.push(new Se(m.x-h,m.y+h,h,t)),p.push(new Se(m.x+h,m.y+h,h,t)),I+=4)}r&&(console.log("num probes: "+I),console.log("best distance: "+d.d));var y=[d.x,d.y];return y.distance=d.d,y}function Bi(t,e){return e.max-t.max}function Se(t,e,r,n){this.x=t,this.y=e,this.h=r,this.d=Ri(t,e,n),this.max=this.d+this.h*Math.SQRT2}function Ri(t,e,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var s=r[i],a=0,c=s.length,u=c-1;a<c;u=a++){var f=s[a],l=s[u];f[1]>e!=l[1]>e&&t<(l[0]-f[0])*(e-f[1])/(l[1]-f[1])+f[0]&&(n=!n),o=Math.min(o,zi(t,e,f,l))}return o===0?0:(n?1:-1)*Math.sqrt(o)}function Di(t){for(var e=0,r=0,n=0,o=t[0],i=0,s=o.length,a=s-1;i<s;a=i++){var c=o[i],u=o[a],f=c[0]*u[1]-u[0]*c[1];r+=(c[0]+u[0])*f,n+=(c[1]+u[1])*f,e+=f*3}return e===0?new Se(o[0][0],o[0][1],0,t):new Se(r/e,n/e,0,t)}function zi(t,e,r,n){var o=r[0],i=r[1],s=n[0]-o,a=n[1]-i;if(s!==0||a!==0){var c=((t-o)*s+(e-i)*a)/(s*s+a*a);c>1?(o=n[0],i=n[1]):c>0&&(o+=s*c,i+=a*c)}return s=t-o,a=e-i,s*s+a*a}});var io=de((Er,Ir)=>{b();(function(t,e){typeof Er=="object"&&typeof Ir<"u"?Ir.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self).RBush=e()})(Er,function(){"use strict";function t(g,d,x,I,m){(function y(E,S,v,M,A){for(;M>v;){if(M-v>600){var P=M-v+1,T=S-v+1,L=Math.log(P),_=.5*Math.exp(2*L/3),B=.5*Math.sqrt(L*_*(P-_)/P)*(T-P/2<0?-1:1),G=Math.max(v,Math.floor(S-T*_/P+B)),z=Math.min(M,Math.floor(S+(P-T)*_/P+B));y(E,S,G,z,A)}var $=E[S],U=v,V=M;for(e(E,v,S),A(E[M],$)>0&&e(E,v,M);U<V;){for(e(E,U,V),U++,V--;A(E[U],$)<0;)U++;for(;A(E[V],$)>0;)V--}A(E[v],$)===0?e(E,v,V):e(E,++V,M),V<=S&&(v=V+1),S<=V&&(M=V-1)}})(g,d,x||0,I||g.length-1,m||r)}function e(g,d,x){var I=g[d];g[d]=g[x],g[x]=I}function r(g,d){return g<d?-1:g>d?1:0}var n=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(g,d,x){if(!x)return d.indexOf(g);for(var I=0;I<d.length;I++)if(x(g,d[I]))return I;return-1}function i(g,d){s(g,0,g.children.length,d,g)}function s(g,d,x,I,m){m||(m=p(null)),m.minX=1/0,m.minY=1/0,m.maxX=-1/0,m.maxY=-1/0;for(var y=d;y<x;y++){var E=g.children[y];a(m,g.leaf?I(E):E)}return m}function a(g,d){return g.minX=Math.min(g.minX,d.minX),g.minY=Math.min(g.minY,d.minY),g.maxX=Math.max(g.maxX,d.maxX),g.maxY=Math.max(g.maxY,d.maxY),g}function c(g,d){return g.minX-d.minX}function u(g,d){return g.minY-d.minY}function f(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function l(g){return g.maxX-g.minX+(g.maxY-g.minY)}function h(g,d){return g.minX<=d.minX&&g.minY<=d.minY&&d.maxX<=g.maxX&&d.maxY<=g.maxY}function w(g,d){return d.minX<=g.maxX&&d.minY<=g.maxY&&d.maxX>=g.minX&&d.maxY>=g.minY}function p(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function F(g,d,x,I,m){for(var y=[d,x];y.length;)if(!((x=y.pop())-(d=y.pop())<=I)){var E=d+Math.ceil((x-d)/I/2)*I;t(g,E,d,x,m),y.push(d,E,E,x)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(g){var d=this.data,x=[];if(!w(g,d))return x;for(var I=this.toBBox,m=[];d;){for(var y=0;y<d.children.length;y++){var E=d.children[y],S=d.leaf?I(E):E;w(g,S)&&(d.leaf?x.push(E):h(g,S)?this._all(E,x):m.push(E))}d=m.pop()}return x},n.prototype.collides=function(g){var d=this.data;if(!w(g,d))return!1;for(var x=[];d;){for(var I=0;I<d.children.length;I++){var m=d.children[I],y=d.leaf?this.toBBox(m):m;if(w(g,y)){if(d.leaf||h(g,y))return!0;x.push(m)}}d=x.pop()}return!1},n.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var d=0;d<g.length;d++)this.insert(g[d]);return this}var x=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var I=this.data;this.data=x,x=I}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},n.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},n.prototype.clear=function(){return this.data=p([]),this},n.prototype.remove=function(g,d){if(!g)return this;for(var x,I,m,y=this.data,E=this.toBBox(g),S=[],v=[];y||S.length;){if(y||(y=S.pop(),I=S[S.length-1],x=v.pop(),m=!0),y.leaf){var M=o(g,y.children,d);if(M!==-1)return y.children.splice(M,1),S.push(y),this._condense(S),this}m||y.leaf||!h(y,E)?I?(x++,y=I.children[x],m=!1):y=null:(S.push(y),v.push(x),x=0,I=y,y=y.children[0])}return this},n.prototype.toBBox=function(g){return g},n.prototype.compareMinX=function(g,d){return g.minX-d.minX},n.prototype.compareMinY=function(g,d){return g.minY-d.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(g){return this.data=g,this},n.prototype._all=function(g,d){for(var x=[];g;)g.leaf?d.push.apply(d,g.children):x.push.apply(x,g.children),g=x.pop();return d},n.prototype._build=function(g,d,x,I){var m,y=x-d+1,E=this._maxEntries;if(y<=E)return i(m=p(g.slice(d,x+1)),this.toBBox),m;I||(I=Math.ceil(Math.log(y)/Math.log(E)),E=Math.ceil(y/Math.pow(E,I-1))),(m=p([])).leaf=!1,m.height=I;var S=Math.ceil(y/E),v=S*Math.ceil(Math.sqrt(E));F(g,d,x,v,this.compareMinX);for(var M=d;M<=x;M+=v){var A=Math.min(M+v-1,x);F(g,M,A,S,this.compareMinY);for(var P=M;P<=A;P+=S){var T=Math.min(P+S-1,A);m.children.push(this._build(g,P,T,I-1))}}return i(m,this.toBBox),m},n.prototype._chooseSubtree=function(g,d,x,I){for(;I.push(d),!d.leaf&&I.length-1!==x;){for(var m=1/0,y=1/0,E=void 0,S=0;S<d.children.length;S++){var v=d.children[S],M=f(v),A=(P=g,T=v,(Math.max(T.maxX,P.maxX)-Math.min(T.minX,P.minX))*(Math.max(T.maxY,P.maxY)-Math.min(T.minY,P.minY))-M);A<y?(y=A,m=M<m?M:m,E=v):A===y&&M<m&&(m=M,E=v)}d=E||d.children[0]}var P,T;return d},n.prototype._insert=function(g,d,x){var I=x?g:this.toBBox(g),m=[],y=this._chooseSubtree(I,this.data,d,m);for(y.children.push(g),a(y,I);d>=0&&m[d].children.length>this._maxEntries;)this._split(m,d),d--;this._adjustParentBBoxes(I,m,d)},n.prototype._split=function(g,d){var x=g[d],I=x.children.length,m=this._minEntries;this._chooseSplitAxis(x,m,I);var y=this._chooseSplitIndex(x,m,I),E=p(x.children.splice(y,x.children.length-y));E.height=x.height,E.leaf=x.leaf,i(x,this.toBBox),i(E,this.toBBox),d?g[d-1].children.push(E):this._splitRoot(x,E)},n.prototype._splitRoot=function(g,d){this.data=p([g,d]),this.data.height=g.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(g,d,x){for(var I,m,y,E,S,v,M,A=1/0,P=1/0,T=d;T<=x-d;T++){var L=s(g,0,T,this.toBBox),_=s(g,T,x,this.toBBox),B=(m=L,y=_,E=void 0,S=void 0,v=void 0,M=void 0,E=Math.max(m.minX,y.minX),S=Math.max(m.minY,y.minY),v=Math.min(m.maxX,y.maxX),M=Math.min(m.maxY,y.maxY),Math.max(0,v-E)*Math.max(0,M-S)),G=f(L)+f(_);B<A?(A=B,I=T,P=G<P?G:P):B===A&&G<P&&(P=G,I=T)}return I||x-d},n.prototype._chooseSplitAxis=function(g,d,x){var I=g.leaf?this.compareMinX:c,m=g.leaf?this.compareMinY:u;this._allDistMargin(g,d,x,I)<this._allDistMargin(g,d,x,m)&&g.children.sort(I)},n.prototype._allDistMargin=function(g,d,x,I){g.children.sort(I);for(var m=this.toBBox,y=s(g,0,d,m),E=s(g,x-d,x,m),S=l(y)+l(E),v=d;v<x-d;v++){var M=g.children[v];a(y,g.leaf?m(M):M),S+=l(y)}for(var A=x-d-1;A>=d;A--){var P=g.children[A];a(E,g.leaf?m(P):P),S+=l(E)}return S},n.prototype._adjustParentBBoxes=function(g,d,x){for(var I=x;I>=0;I--)a(d[I],g)},n.prototype._condense=function(g){for(var d=g.length-1,x=void 0;d>=0;d--)g[d].children.length===0?d>0?(x=g[d-1].children).splice(x.indexOf(g[d]),1):this.clear():i(g[d],this.toBBox)},n})});var Fr=de(O=>{"use strict";b();Object.defineProperty(O,"__esModule",{value:!0});O.earthRadius=63710088e-1;O.factors={centimeters:O.earthRadius*100,centimetres:O.earthRadius*100,degrees:O.earthRadius/111325,feet:O.earthRadius*3.28084,inches:O.earthRadius*39.37,kilometers:O.earthRadius/1e3,kilometres:O.earthRadius/1e3,meters:O.earthRadius,metres:O.earthRadius,miles:O.earthRadius/1609.344,millimeters:O.earthRadius*1e3,millimetres:O.earthRadius*1e3,nauticalmiles:O.earthRadius/1852,radians:1,yards:O.earthRadius*1.0936};O.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/O.earthRadius,yards:1.0936133};O.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 Ae(t,e,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}O.feature=Ae;function Rs(t,e,r){switch(r===void 0&&(r={}),t){case"Point":return Sr(e).geometry;case"LineString":return Ar(e).geometry;case"Polygon":return Mr(e).geometry;case"MultiPoint":return ao(e).geometry;case"MultiLineString":return so(e).geometry;case"MultiPolygon":return co(e).geometry;default:throw new Error(t+" is invalid")}}O.geometry=Rs;function Sr(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!kt(t[0])||!kt(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Ae(n,e,r)}O.point=Sr;function Ds(t,e,r){return r===void 0&&(r={}),Bt(t.map(function(n){return Sr(n,e)}),r)}O.points=Ds;function Mr(t,e,r){r===void 0&&(r={});for(var n=0,o=t;n<o.length;n++){var i=o[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:t};return Ae(a,e,r)}O.polygon=Mr;function zs(t,e,r){return r===void 0&&(r={}),Bt(t.map(function(n){return Mr(n,e)}),r)}O.polygons=zs;function Ar(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Ae(n,e,r)}O.lineString=Ar;function Gs(t,e,r){return r===void 0&&(r={}),Bt(t.map(function(n){return Ar(n,e)}),r)}O.lineStrings=Gs;function Bt(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}O.featureCollection=Bt;function so(t,e,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:t};return Ae(n,e,r)}O.multiLineString=so;function ao(t,e,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:t};return Ae(n,e,r)}O.multiPoint=ao;function co(t,e,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:t};return Ae(n,e,r)}O.multiPolygon=co;function Us(t,e,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:t};return Ae(n,e,r)}O.geometryCollection=Us;function js(t,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}O.round=js;function uo(t,e){e===void 0&&(e="kilometers");var r=O.factors[e];if(!r)throw new Error(e+" units is invalid");return t*r}O.radiansToLength=uo;function Pr(t,e){e===void 0&&(e="kilometers");var r=O.factors[e];if(!r)throw new Error(e+" units is invalid");return t/r}O.lengthToRadians=Pr;function Xs(t,e){return lo(Pr(t,e))}O.lengthToDegrees=Xs;function Ys(t){var e=t%360;return e<0&&(e+=360),e}O.bearingToAzimuth=Ys;function lo(t){var e=t%(2*Math.PI);return e*180/Math.PI}O.radiansToDegrees=lo;function Vs(t){var e=t%360;return e*Math.PI/180}O.degreesToRadians=Vs;function qs(t,e,r){if(e===void 0&&(e="kilometers"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return uo(Pr(t,e),r)}O.convertLength=qs;function Ws(t,e,r){if(e===void 0&&(e="meters"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=O.areaFactors[e];if(!n)throw new Error("invalid original units");var o=O.areaFactors[r];if(!o)throw new Error("invalid final units");return t/n*o}O.convertArea=Ws;function kt(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}O.isNumber=kt;function Zs(t){return!!t&&t.constructor===Object}O.isObject=Zs;function $s(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!kt(e))throw new Error("bbox must only contain numbers")})}O.validateBBox=$s;function Hs(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}O.validateId=Hs});var mo=de(X=>{"use strict";b();Object.defineProperty(X,"__esModule",{value:!0});var J=Fr();function st(t,e,r){if(t!==null)for(var n,o,i,s,a,c,u,f=0,l=0,h,w=t.type,p=w==="FeatureCollection",F=w==="Feature",g=p?t.features.length:1,d=0;d<g;d++){u=p?t.features[d].geometry:F?t.geometry:t,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var x=0;x<a;x++){var I=0,m=0;if(s=h?u.geometries[x]:u,s!==null){c=s.coordinates;var y=s.type;switch(f=r&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(e(c,l,d,I,m)===!1)return!1;l++,I++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],l,d,I,m)===!1)return!1;l++,y==="MultiPoint"&&I++}y==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(e(c[n][o],l,d,I,m)===!1)return!1;l++}y==="MultiLineString"&&I++,y==="Polygon"&&m++}y==="Polygon"&&I++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(m=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(e(c[n][o][i],l,d,I,m)===!1)return!1;l++}m++}I++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(st(s.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Js(t,e,r,n){var o=r;return st(t,function(i,s,a,c,u){s===0&&r===void 0?o=i:o=e(o,i,s,a,c,u)},n),o}function fo(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&e(t.features[r].properties,r)!==!1;r++);break;case"Feature":e(t.properties,0);break}}function Ks(t,e,r){var n=r;return fo(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function po(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function Qs(t,e,r){var n=r;return po(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function ea(t){var e=[];return st(t,function(r){e.push(r)}),e}function Nr(t,e){var r,n,o,i,s,a,c,u,f,l,h=0,w=t.type==="FeatureCollection",p=t.type==="Feature",F=w?t.features.length:1;for(r=0;r<F;r++){for(a=w?t.features[r].geometry:p?t.geometry:t,u=w?t.features[r].properties:p?t.properties:{},f=w?t.features[r].bbox:p?t.bbox:void 0,l=w?t.features[r].id:p?t.id:void 0,c=a?a.type==="GeometryCollection":!1,s=c?a.geometries.length:1,o=0;o<s;o++){if(i=c?a.geometries[o]:a,i===null){if(e(null,h,u,f,l)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(i,h,u,f,l)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(e(i.geometries[n],h,u,f,l)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function ta(t,e,r){var n=r;return Nr(t,function(o,i,s,a,c){i===0&&r===void 0?n=o:n=e(n,o,i,s,a,c)}),n}function Rt(t,e){Nr(t,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(J.feature(r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var c;switch(a){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var f=r.coordinates[u],l={type:c,coordinates:f};if(e(J.feature(l,o),n,u)===!1)return!1}})}function ra(t,e,r){var n=r;return Rt(t,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=e(n,o,i,s)}),n}function ho(t,e){Rt(t,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,c=0,u=0,f=0;if(st(r,function(l,h,w,p,F){if(a===void 0||n>c||p>u||F>f){a=l,c=n,u=p,f=F,i=0;return}var g=J.lineString([a,l],r.properties);if(e(g,n,o,F,i)===!1)return!1;i++,a=l})===!1)return!1}}})}function na(t,e,r){var n=r,o=!1;return ho(t,function(i,s,a,c,u){o===!1&&r===void 0?n=i:n=e(n,i,s,a,c,u),o=!0}),n}function go(t,e){if(!t)throw new Error("geojson is required");Rt(t,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(e(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(e(J.lineString(s[a],r.properties),n,o,a)===!1)return!1;break}}})}function oa(t,e,r){var n=r;return go(t,function(o,i,s,a){i===0&&r===void 0?n=o:n=e(n,o,i,s,a)}),n}function ia(t,e){if(e=e||{},!J.isObject(e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.segmentIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),J.lineString([c[i],c[i+1]],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),J.lineString([c[o][i],c[o][i+1]],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),J.lineString([c[n][i],c[n][i+1]],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),J.lineString([c[n][o][i],c[n][o][i+1]],s,e)}throw new Error("geojson is invalid")}function sa(t,e){if(e=e||{},!J.isObject(e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.coordIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":return J.point(c,s,e);case"MultiPoint":return n<0&&(n=c.length+n),J.point(c[n],s,e);case"LineString":return i<0&&(i=c.length+i),J.point(c[i],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),J.point(c[o][i],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),J.point(c[n][i],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),J.point(c[n][o][i],s,e)}throw new Error("geojson is invalid")}X.coordAll=ea;X.coordEach=st;X.coordReduce=Js;X.featureEach=po;X.featureReduce=Qs;X.findPoint=sa;X.findSegment=ia;X.flattenEach=Rt;X.flattenReduce=ra;X.geomEach=Nr;X.geomReduce=ta;X.lineEach=go;X.lineReduce=oa;X.propEach=fo;X.propReduce=Ks;X.segmentEach=ho;X.segmentReduce=na});var Eo=de(k=>{"use strict";b();Object.defineProperty(k,"__esModule",{value:!0});var oe=63710088e-1,Or={centimeters:oe*100,centimetres:oe*100,degrees:360/(2*Math.PI),feet:oe*3.28084,inches:oe*39.37,kilometers:oe/1e3,kilometres:oe/1e3,meters:oe,metres:oe,miles:oe/1609.344,millimeters:oe*1e3,millimetres:oe*1e3,nauticalmiles:oe/1852,radians:1,yards:oe*1.0936},Tr={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 Pe(t,e,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function aa(t,e,r={}){switch(t){case"Point":return Lr(e).geometry;case"LineString":return _r(e).geometry;case"Polygon":return Cr(e).geometry;case"MultiPoint":return vo(e).geometry;case"MultiLineString":return yo(e).geometry;case"MultiPolygon":return bo(e).geometry;default:throw new Error(t+" is invalid")}}function Lr(t,e,r={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Dt(t[0])||!Dt(t[1]))throw new Error("coordinates must contain numbers");return Pe({type:"Point",coordinates:t},e,r)}function ca(t,e,r={}){return zt(t.map(n=>Lr(n,e)),r)}function Cr(t,e,r={}){for(let o of t){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let i=0;i<o[o.length-1].length;i++)if(o[o.length-1][i]!==o[0][i])throw new Error("First and last Position are not equivalent.")}return Pe({type:"Polygon",coordinates:t},e,r)}function ua(t,e,r={}){return zt(t.map(n=>Cr(n,e)),r)}function _r(t,e,r={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return Pe({type:"LineString",coordinates:t},e,r)}function la(t,e,r={}){return zt(t.map(n=>_r(n,e)),r)}function zt(t,e={}){let r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function yo(t,e,r={}){return Pe({type:"MultiLineString",coordinates:t},e,r)}function vo(t,e,r={}){return Pe({type:"MultiPoint",coordinates:t},e,r)}function bo(t,e,r={}){return Pe({type:"MultiPolygon",coordinates:t},e,r)}function fa(t,e,r={}){return Pe({type:"GeometryCollection",geometries:t},e,r)}function da(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,e||0);return Math.round(t*r)/r}function xo(t,e="kilometers"){let r=Or[e];if(!r)throw new Error(e+" units is invalid");return t*r}function kr(t,e="kilometers"){let r=Or[e];if(!r)throw new Error(e+" units is invalid");return t/r}function pa(t,e){return wo(kr(t,e))}function ha(t){let e=t%360;return e<0&&(e+=360),e}function ga(t){return t=t%360,t>180?t-360:t<-180?t+360:t}function wo(t){return t%(2*Math.PI)*180/Math.PI}function ma(t){return t%360*Math.PI/180}function ya(t,e="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return xo(kr(t,e),r)}function va(t,e="meters",r="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");let n=Tr[e];if(!n)throw new Error("invalid original units");let o=Tr[r];if(!o)throw new Error("invalid final units");return t/n*o}function Dt(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function ba(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function xa(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(e=>{if(!Dt(e))throw new Error("bbox must only contain numbers")})}function wa(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}k.areaFactors=Tr;k.azimuthToBearing=ga;k.bearingToAzimuth=ha;k.convertArea=va;k.convertLength=ya;k.degreesToRadians=ma;k.earthRadius=oe;k.factors=Or;k.feature=Pe;k.featureCollection=zt;k.geometry=aa;k.geometryCollection=fa;k.isNumber=Dt;k.isObject=ba;k.lengthToDegrees=pa;k.lengthToRadians=kr;k.lineString=_r;k.lineStrings=la;k.multiLineString=yo;k.multiPoint=vo;k.multiPolygon=bo;k.point=Lr;k.points=ca;k.polygon=Cr;k.polygons=ua;k.radiansToDegrees=wo;k.radiansToLength=xo;k.round=da;k.validateBBox=xa;k.validateId=wa});var Po=de(Y=>{"use strict";b();Object.defineProperty(Y,"__esModule",{value:!0});var K=Eo();function at(t,e,r){if(t!==null)for(var n,o,i,s,a,c,u,f=0,l=0,h,w=t.type,p=w==="FeatureCollection",F=w==="Feature",g=p?t.features.length:1,d=0;d<g;d++){u=p?t.features[d].geometry:F?t.geometry:t,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var x=0;x<a;x++){var I=0,m=0;if(s=h?u.geometries[x]:u,s!==null){c=s.coordinates;var y=s.type;switch(f=r&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(e(c,l,d,I,m)===!1)return!1;l++,I++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],l,d,I,m)===!1)return!1;l++,y==="MultiPoint"&&I++}y==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(e(c[n][o],l,d,I,m)===!1)return!1;l++}y==="MultiLineString"&&I++,y==="Polygon"&&m++}y==="Polygon"&&I++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(m=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(e(c[n][o][i],l,d,I,m)===!1)return!1;l++}m++}I++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(at(s.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ea(t,e,r,n){var o=r;return at(t,function(i,s,a,c,u){s===0&&r===void 0?o=i:o=e(o,i,s,a,c,u)},n),o}function Io(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&e(t.features[r].properties,r)!==!1;r++);break;case"Feature":e(t.properties,0);break}}function Ia(t,e,r){var n=r;return Io(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function So(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function Sa(t,e,r){var n=r;return So(t,function(o,i){i===0&&r===void 0?n=o:n=e(n,o,i)}),n}function Ma(t){var e=[];return at(t,function(r){e.push(r)}),e}function Br(t,e){var r,n,o,i,s,a,c,u,f,l,h=0,w=t.type==="FeatureCollection",p=t.type==="Feature",F=w?t.features.length:1;for(r=0;r<F;r++){for(a=w?t.features[r].geometry:p?t.geometry:t,u=w?t.features[r].properties:p?t.properties:{},f=w?t.features[r].bbox:p?t.bbox:void 0,l=w?t.features[r].id:p?t.id:void 0,c=a?a.type==="GeometryCollection":!1,s=c?a.geometries.length:1,o=0;o<s;o++){if(i=c?a.geometries[o]:a,i===null){if(e(null,h,u,f,l)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(i,h,u,f,l)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(e(i.geometries[n],h,u,f,l)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Aa(t,e,r){var n=r;return Br(t,function(o,i,s,a,c){i===0&&r===void 0?n=o:n=e(n,o,i,s,a,c)}),n}function Gt(t,e){Br(t,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(K.feature.call(void 0,r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var c;switch(a){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var f=r.coordinates[u],l={type:c,coordinates:f};if(e(K.feature.call(void 0,l,o),n,u)===!1)return!1}})}function Pa(t,e,r){var n=r;return Gt(t,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=e(n,o,i,s)}),n}function Mo(t,e){Gt(t,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,c=0,u=0,f=0;if(at(r,function(l,h,w,p,F){if(a===void 0||n>c||p>u||F>f){a=l,c=n,u=p,f=F,i=0;return}var g=K.lineString.call(void 0,[a,l],r.properties);if(e(g,n,o,F,i)===!1)return!1;i++,a=l})===!1)return!1}}})}function Fa(t,e,r){var n=r,o=!1;return Mo(t,function(i,s,a,c,u){o===!1&&r===void 0?n=i:n=e(n,i,s,a,c,u),o=!0}),n}function Ao(t,e){if(!t)throw new Error("geojson is required");Gt(t,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(e(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(e(K.lineString.call(void 0,s[a],r.properties),n,o,a)===!1)return!1;break}}})}function Na(t,e,r){var n=r;return Ao(t,function(o,i,s,a){i===0&&r===void 0?n=o:n=e(n,o,i,s,a)}),n}function Ta(t,e){if(e=e||{},!K.isObject.call(void 0,e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.segmentIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),K.lineString.call(void 0,[c[i],c[i+1]],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),K.lineString.call(void 0,[c[o][i],c[o][i+1]],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),K.lineString.call(void 0,[c[n][i],c[n][i+1]],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),K.lineString.call(void 0,[c[n][o][i],c[n][o][i+1]],s,e)}throw new Error("geojson is invalid")}function Oa(t,e){if(e=e||{},!K.isObject.call(void 0,e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,o=e.geometryIndex||0,i=e.coordIndex||0,s=e.properties,a;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),s=s||t.features[r].properties,a=t.features[r].geometry;break;case"Feature":s=s||t.properties,a=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=t;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var c=a.coordinates;switch(a.type){case"Point":return K.point.call(void 0,c,s,e);case"MultiPoint":return n<0&&(n=c.length+n),K.point.call(void 0,c[n],s,e);case"LineString":return i<0&&(i=c.length+i),K.point.call(void 0,c[i],s,e);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),K.point.call(void 0,c[o][i],s,e);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),K.point.call(void 0,c[n][i],s,e);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),K.point.call(void 0,c[n][o][i],s,e)}throw new Error("geojson is invalid")}Y.coordAll=Ma;Y.coordEach=at;Y.coordReduce=Ea;Y.featureEach=So;Y.featureReduce=Sa;Y.findPoint=Oa;Y.findSegment=Ta;Y.flattenEach=Gt;Y.flattenReduce=Pa;Y.geomEach=Br;Y.geomReduce=Aa;Y.lineEach=Ao;Y.lineReduce=Na;Y.propEach=Io;Y.propReduce=Ia;Y.segmentEach=Mo;Y.segmentReduce=Fa});var No=de(Ut=>{"use strict";b();Object.defineProperty(Ut,"__esModule",{value:!0});var La=Po();function Fo(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;let r=[1/0,1/0,-1/0,-1/0];return La.coordEach.call(void 0,t,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}var Ca=Fo;Ut.bbox=Fo;Ut.default=Ca});var _o=de((Lp,Rr)=>{b();var ge=io(),Oo=Fr(),Lo=mo(),ze=No().default,_a=Lo.featureEach,Tp=Lo.coordEach,Op=Oo.polygon,To=Oo.featureCollection;function Co(t){var e=new ge(t);return e.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:ze(r),ge.prototype.insert.call(this,r)},e.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:ze(o),n.push(o)}):_a(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:ze(o),n.push(o)}),ge.prototype.load.call(this,n)},e.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:ze(r),ge.prototype.remove.call(this,r,n)},e.clear=function(){return ge.prototype.clear.call(this)},e.search=function(r){var n=ge.prototype.search.call(this,this.toBBox(r));return To(n)},e.collides=function(r){return ge.prototype.collides.call(this,this.toBBox(r))},e.all=function(){var r=ge.prototype.all.call(this);return To(r)},e.toJSON=function(){return ge.prototype.toJSON.call(this)},e.fromJSON=function(r){return ge.prototype.fromJSON.call(this,r)},e.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=ze(r);else if(r.type==="FeatureCollection")n=ze(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},e}Rr.exports=Co;Rr.exports.default=Co});b();b();var Fe=class extends Error{};Fe.prototype.name="InvalidTokenError";function Do(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function zo(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Do(e)}catch{return atob(e)}}function Wr(t,e){if(typeof t!="string")throw new Fe("Invalid token specified: must be a string");e||(e={});let r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new Fe(`Invalid token specified: missing part #${r+1}`);let o;try{o=zo(n)}catch(i){throw new Fe(`Invalid token specified: invalid base64 for part #${r+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Fe(`Invalid token specified: invalid json for part #${r+1} (${i.message})`)}}b();function Go(t,e,r,n){return(t<e||t>r)&&Xr.warn(n),Math.min(r,Math.max(e,t))}b();function Uo(t,e){if(t==null||e==null)return t===e;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Va(t){let e=Wr(t);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:e.aud??[],capabilities:e.capabilities??{}}}function me(t){return t*(Math.PI/180)}function Zr(t){return t*(180/Math.PI)}function qa(t,e){let r=Math.pow(10,e);return Math.sign(t)*Math.round(Math.abs(t)*r)/r}function $r(t,e){return(t%e+e)%e}function Wa(t,e){let r=$r(t,Math.PI*2),n=$r(e,Math.PI*2),o=n-r,i=n+(o>Math.PI?-Math.PI*2:o<-Math.PI?Math.PI*2:0);return{start:r,end:i}}function Za(){return typeof window<"u"&&window!==null}function Hr(t,e){let[r,n]=t,[o,i]=e,s=me(o-r),a=me(i-n);return Math.sqrt(s*s+a*a)*xe}function re(t,e){let r=me(t[0]),n=me(t[1]),o=me(e[0]),i=me(e[1]),s=i-n,c=(o-r)*Math.cos((n+i)/2),u=s;return Math.sqrt(c*c+u*u)*xe}function qt(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function dt(t){let e=me(t),n=Math.cos(e)*xe;function o(s,a){let c=me(s[0]),u=me(s[1]),f=c*n,l=u*xe;return a?(a.x=f,a.y=l,a):{x:f,y:l}}return{toCartesian:o,toGeographic:(s,a)=>{let c=Zr(s/n),u=Zr(a/xe);return{lon:c,lat:u}}}}var $a=()=>{};b();b();b();b();b();function q([t,e],[r,n]){let o=e-n,i=t-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}b();b();function pt(t,e,r,n){let[o,i]=t,[s,a]=e,[c,u]=r,[f,l]=n;if(i===a&&o===s||u===l&&c===f)return null;let h=(f-c)*(a-i)-(l-u)*(s-o);if(h===0)return null;let w=((l-u)*(o-c)-(f-c)*(i-u))/h,p=((a-i)*(o-c)-(s-o)*(i-u))/h;if(w<0||w>1||p<0||p>1)return null;let F=i+w*(a-i);return[o+w*(s-o),F]}b();b();b();function ht(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ne(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Jr(t){return t.type==="Feature"?t.geometry:t}function sc(t,e){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function gt(t,e,r,n){n===void 0&&(n={});var o=ht(t),i=ft(o[0]),s=ft(o[1]),a=ft(r),c=Vr(e,n.units),u=Math.asin(Math.sin(s)*Math.cos(c)+Math.cos(s)*Math.sin(c)*Math.cos(a)),f=i+Math.atan2(Math.sin(a)*Math.sin(c)*Math.cos(s),Math.cos(c)-Math.sin(s)*Math.sin(u)),l=Yt(f),h=Yt(u);return lt([l,h],n.properties)}function Wt(t,e,r,n){let o=gt(t,r/1e3,n),i=gt(e,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}b();function Le(t){let e=t*(180/Math.PI);return e=e%360,e>180?e-=360:e<-180&&(e+=360),Object.is(e,-0)?0:e}var Kr=111e3;function Qr(t,e,r,n,o){return Math.max(t[0][0],t[1][0])>=e&&Math.min(t[0][0],t[1][0])<=r&&Math.max(t[0][1],t[1][1])>=n&&Math.min(t[0][1],t[1][1])<=o}function pe(t,e,r=[],n=0){let o=t.geometry.coordinates,i=e.geometry.coordinates;if(r.length===0)return!0;let s=n/Kr,a=n/(Kr*Math.cos(o[1]*Math.PI/180)),c=Math.min(o[1],i[1])-s,u=Math.max(o[1],i[1])+s,f=Math.min(o[0],i[0])-a,l=Math.max(o[0],i[0])+a;if(n>0){let h=Le(q(o,i)-Math.PI/2),w=Le(q(o,i)+Math.PI/2),p=Wt(o,i,n,h),F=Wt(o,i,n,w);for(let g of r)if(Qr(g,f,l,c,u)&&(pt(p[0],p[1],g[0],g[1])||pt(F[0],F[1],g[0],g[1])))return!1}else for(let h of r)if(Qr(h,f,l,c,u)&&pt(o,i,h[0],h[1]))return!1;return!0}b();function en(t,e=.5){let[r,n]=t,o=(r.x+n.x)/2,i=(r.y+n.y)/2,s=n.x-r.x,c=-(n.y-r.y),u=s,f=Math.sqrt(c*c+u*u),l=c/f,h=u/f,w={x:o+l*e,y:i+h*e},p={x:o-l*e,y:i-h*e};return[w,p]}b();function D(t){return t.properties.floor??t.properties.map}b();var tn=111e3,jo=63710088e-1/1e3,Xo=256,Ye=0,Zt=4,$t=8,we=12,rn=new WeakMap;function Yo(t){let e=t.length,r=1/0,n=1/0,o=-1/0,i=-1/0;for(let m=0;m<e;m++){let y=t[m][0],E=t[m][1];y[0]<r&&(r=y[0]),E[0]<r&&(r=E[0]),y[0]>o&&(o=y[0]),E[0]>o&&(o=E[0]),y[1]<n&&(n=y[1]),E[1]<n&&(n=E[1]),y[1]>i&&(i=y[1]),E[1]>i&&(i=E[1])}let s=Math.max(1,Math.min(Xo,Math.ceil(Math.sqrt(e)))),a=s,c=s,u=o-r,f=i-n,l=u/a||f/a||1e-9,h=f/c||u/c||1e-9,w=(m,y,E,S)=>{let v=Math.floor((m-y)/E);return v<0?0:v>=S?S-1:v},p=a*c,F=new Int32Array(p+1),g=(m,y)=>{let E=t[m][0],S=t[m][1],v=w(Math.min(E[0],S[0]),r,l,a),M=w(Math.max(E[0],S[0]),r,l,a),A=w(Math.min(E[1],S[1]),n,h,c),P=w(Math.max(E[1],S[1]),n,h,c);for(let T=A;T<=P;T++)for(let L=v;L<=M;L++)y(T*a+L)};for(let m=0;m<e;m++)g(m,y=>F[y+1]++);for(let m=0;m<p;m++)F[m+1]+=F[m];let d=F.slice(),x=F.slice(0,p),I=new Int32Array(d[p]);for(let m=0;m<e;m++)g(m,y=>I[x[y]++]=m);return{edges:t,edgeCount:e,minX:r,minY:n,cellW:l,cellH:h,cols:a,rows:c,cellStart:d,cellEdges:I,cellStamp:new Uint32Array(p),edgeStamp:new Uint32Array(e),stamp:0}}function Vo(t){let e=rn.get(t);return(!e||e.edgeCount!==t.length)&&(e=Yo(t),rn.set(t,e)),e}function qo(t,e,r,n,o,i,s,a){if(e===n&&t===r||i===a&&o===s)return!1;let c=(s-o)*(n-e)-(a-i)*(r-t);if(c===0)return!1;let u=((a-i)*(t-o)-(s-o)*(e-i))/c,f=((n-e)*(t-o)-(r-t)*(e-i))/c;return!(u<0||u>1||f<0||f>1)}function Ht(t,e,r){let n=e[r],o=e[r+1],i=e[r+2],s=e[r+3],a=e[we],c=e[we+1],u=e[we+2],f=e[we+3],{edges:l,cols:h,rows:w,cellW:p,cellH:F,minX:g,minY:d,cellStart:x,cellEdges:I,cellStamp:m,edgeStamp:y}=t,E=t.stamp,S=Math.ceil(Math.max(Math.abs(i-n)/p,Math.abs(s-o)/F)*2)+1;for(let v=0;v<=S;v++){let M=v/S,A=Math.floor((n+(i-n)*M-g)/p),P=Math.floor((o+(s-o)*M-d)/F);A=A<0?0:A>=h?h-1:A,P=P<0?0:P>=w?w-1:P;let T=P>0?P-1:0,L=P<w-1?P+1:P,_=A>0?A-1:0,B=A<h-1?A+1:A;for(let G=T;G<=L;G++)for(let z=_;z<=B;z++){let $=G*h+z;if(m[$]!==E){m[$]=E;for(let U=x[$],V=x[$+1];U<V;U++){let ve=I[U];if(y[ve]===E)continue;y[ve]=E;let te=l[ve][0],Z=l[ve][1];if(!(Math.max(te[0],Z[0])<a||Math.min(te[0],Z[0])>c||Math.max(te[1],Z[1])<u||Math.min(te[1],Z[1])>f)&&qo(n,o,i,s,te[0],te[1],Z[0],Z[1]))return!0}}}}return!1}var Jt=t=>t%360*Math.PI/180,nn=t=>t%(2*Math.PI)*180/Math.PI;function mt(t,e,r,n,o,i){let s=Jt(r),a=Jt(n),c=Jt(i),u=o/jo,f=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(c)),l=s+Math.atan2(Math.sin(c)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(f));t[e]=nn(l),t[e+1]=nn(f)}function on(t=[]){if(t.length===0)return()=>!0;let e=Vo(t),r=new Float64Array(16),n=()=>{++e.stamp===4294967295&&(e.cellStamp.fill(0),e.edgeStamp.fill(0),e.stamp=1)};return(o,i,s)=>{let a=o.geometry.coordinates,c=i.geometry.coordinates,u=s/tn,f=s/(tn*Math.cos(a[1]*Math.PI/180));if(r[we]=Math.min(a[0],c[0])-f,r[we+1]=Math.max(a[0],c[0])+f,r[we+2]=Math.min(a[1],c[1])-u,r[we+3]=Math.max(a[1],c[1])+u,n(),s>0){let l=q(a,c),h=Le(l-Math.PI/2),w=Le(l+Math.PI/2),p=s/1e3;return mt(r,Zt,a[0],a[1],p,h),mt(r,Zt+2,c[0],c[1],p,h),Ht(e,r,Zt)?!1:(mt(r,$t,a[0],a[1],p,w),mt(r,$t+2,c[0],c[1],p,w),n(),!Ht(e,r,$t))}return r[Ye]=a[0],r[Ye+1]=a[1],r[Ye+2]=c[0],r[Ye+3]=c[1],!Ht(e,r,Ye)}}var yt=0,ne=class{origin;destination;distance;angle;pathWeight;weight;constructor({origin:e,destination:r,distance:n=0,angle:o=0,pathWeight:i=yt,multiplicativeDistanceWeightScaling:s=!0}){if(this.origin=e,this.destination=r,this.distance=n,this.angle=o,this.pathWeight=i,this.weight=i||yt,s?D(e)===D(r)&&(this.weight=(this.weight>=0?this.distance*this.weight:yt)+this.distance):D(e)===D(r)&&(this.weight=this.weight>=0?this.distance+this.weight:yt),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};b();b();b();b();var vt=class{#e=[];#r;constructor(e){this.#r=e}get size(){return this.#e.length}isEmpty(){return this.#e.length===0}peek(){return this.#e[0]}push(e){this.#e.push(e),this.#t(this.#e.length-1)}pop(){if(this.#e.length===0)return;let e=this.#e[0],r=this.#e.pop();return this.#e.length>0&&r!==void 0&&(this.#e[0]=r,this.#n(0)),e}#t(e){for(;e>0;){let r=e-1>>1;if(this.#r(this.#e[e],this.#e[r])>=0)break;this.#o(e,r),e=r}}#n(e){let r=this.#e.length;for(;;){let n=e*2+1,o=e*2+2,i=e;if(n<r&&this.#r(this.#e[n],this.#e[i])<0&&(i=n),o<r&&this.#r(this.#e[o],this.#e[i])<0&&(i=o),i===e)break;this.#o(e,i),e=i}}#o(e,r){[this.#e[e],this.#e[r]]=[this.#e[r],this.#e[e]]}};b();var bt=class{#e;#r;#t;#n;#o=0;#i=0;constructor(e=1024){let r=Math.max(16,e);this.#e=new Float64Array(r),this.#r=new Float64Array(r),this.#t=new Float64Array(r),this.#n=new Int32Array(r)}get size(){return this.#o}reset(){this.#o=0,this.#i=0}push(e,r,n){this.#o===this.#n.length&&this.#a();let o=this.#i++,i=this.#o++,s=this.#e,a=this.#t;for(;i>0;){let c=i-1>>1,u=s[c];if(u<r||u===r&&a[c]<o)break;this.#s(c,i),i=c}s[i]=r,a[i]=o,this.#r[i]=n,this.#n[i]=e}popInto(e){let r=this.#n[0];e[0]=this.#r[0];let n=--this.#o;if(n<=0)return r;let o=this.#e,i=this.#t,s=o[n],a=i[n],c=this.#r[n],u=this.#n[n],f=0,l=n>>1;for(;f<l;){let h=2*f+1,w=h+1;w<n&&(o[w]<o[h]||o[w]===o[h]&&i[w]<i[h])&&(h=w);let p=o[h];if(s<p||s===p&&a<i[h])break;this.#s(h,f),f=h}return o[f]=s,i[f]=a,this.#r[f]=c,this.#n[f]=u,r}#s(e,r){this.#e[r]=this.#e[e],this.#t[r]=this.#t[e],this.#r[r]=this.#r[e],this.#n[r]=this.#n[e]}#a(){let e=this.#n.length*2,r=new Float64Array(e);r.set(this.#e);let n=new Float64Array(e);n.set(this.#r);let o=new Float64Array(e);o.set(this.#t);let i=new Int32Array(e);i.set(this.#n),this.#e=r,this.#r=n,this.#t=o,this.#n=i}};b();function sn(t,e,r){return r.zone[t]===e||(r.extraZones.get(t)?.includes(e)??!1)}function Kt(t,e,r){let{stamp:n,generation:o}=r;if(n[e]!==o)return 0;if(n[t]!==o)return r.cost[e];let{zoneCosts:i,zonePerEntry:s}=r,a=r.zone[e],c=s[a]&&sn(t,a,r)?0:i[a],u=r.extraZones.get(e);if(u)for(let f of u)s[f]&&sn(t,f,r)||(c+=i[f]);return c}var an=Symbol("all-groups"),xt=class{#e;#r;#t=new WeakMap;#n;#o=0;constructor(e){this.#e=e,this.#n=new Uint32Array(e.nodeCount)}fill(e,r,n){let{lon:o,lat:i}=this.#e,{cost:s,stamp:a,generation:c,zone:u,extraZones:f,zoneCosts:l,zonePerEntry:h}=n,w=this.#n;f.clear(),l.length=0,h.length=0;for(let p=0;p<e.length;p++){let F=e[p],g=Math.max(0,F.cost);l.push(g),h.push(F.costAccumulation==="per-zone-entry");let d=F.geometry.geometry,x=d.type==="Polygon"?[d.coordinates]:d.coordinates,I=F[r]?F[r]:an,m=d.bbox,y=x.length>1,E=y?this.#i():0;for(let S of x){let v=this.#s(S,I);for(let M=0;M<v.length;M++){let A=v[M];if(y){if(w[A]===E)continue;w[A]=E}if(!(m&&!(m[0]<=o[A]&&m[1]<=i[A]&&m[2]>=o[A]&&m[3]>=i[A]))){if(a[A]!==c)a[A]=c,s[A]=0,u[A]=p;else if(u[A]!==p){let P=f.get(A);P?P.includes(p)||P.push(p):f.set(A,[p])}s[A]+=g}}}}}#i(){return this.#o>=4294967294&&(this.#n.fill(0),this.#o=0),++this.#o}#s(e,r){let n=this.#t.get(e);n||(n=new Map,this.#t.set(e,n));let o=n.get(r);return o||(o=this.#a(e,r),n.set(r,o)),o}#a(e,r){let n=this.#c(r);if(!n||e.length===0||e[0].length===0)return new Int32Array(0);let o=e.map(Wo),i=1/0,s=1/0,a=-1/0,c=-1/0,u=o[0];for(let p=0;p<u.length;p+=2)u[p]<i&&(i=u[p]),u[p]>a&&(a=u[p]),u[p+1]<s&&(s=u[p+1]),u[p+1]>c&&(c=u[p+1]);let{lat:f}=this.#e,{indices:l,lon:h}=n,w=[];for(let p=Zo(h,i);p<l.length&&h[p]<=a;p++){let F=l[p],g=f[F];if(g<s||g>c)continue;let d=h[p];if(!cn(o[0],d,g,!1))continue;let x=!1;for(let I=1;I<o.length&&!x;I++)cn(o[I],d,g,!0)&&(x=!0);x||w.push(F)}return Int32Array.from(w)}#c(e){if(!this.#r){let{nodeCount:r,lon:n,group:o}=this.#e,i=new Map,s=new Array(r);for(let a=0;a<r;a++){s[a]=a;let c=i.get(o[a]);c||i.set(o[a],c=[]),c.push(a)}i.set(an,s),this.#r=new Map;for(let[a,c]of i){c.sort((l,h)=>n[l]-n[h]);let u=Int32Array.from(c),f=new Float64Array(u.length);for(let l=0;l<u.length;l++)f[l]=n[u[l]];this.#r.set(a,{indices:u,lon:f})}}return this.#r.get(e)}};function Wo(t){let e=t.length;e>0&&t[0][0]===t[e-1][0]&&t[0][1]===t[e-1][1]&&e--;let r=new Float64Array(e*2);for(let n=0;n<e;n++)r[n*2]=t[n][0],r[n*2+1]=t[n][1];return r}function cn(t,e,r,n){let o=t.length>>1,i=!1;for(let s=0,a=o-1;s<o;a=s++){let c=t[s*2],u=t[s*2+1],f=t[a*2],l=t[a*2+1];if(r*(c-f)+u*(f-e)+l*(e-c)===0&&(c-e)*(f-e)<=0&&(u-r)*(l-r)<=0)return!n;u>r!=l>r&&e<(f-c)*(r-u)/(l-u)+c&&(i=!i)}return i}function Zo(t,e){let r=0,n=t.length;for(;r<n;){let o=r+n>>1;t[o]<e?r=o+1:n=o}return r}var Ve=.4,$o=10,un=Math.PI/180,ln=1,Qt=2,wt=class{edges=Object.create(null);nodesById;nodesByGroup=new Map;#e;#r;constructor({nodes:e,groupBy:r,multiplicativeDistanceWeightScaling:n}){this.#e=r,this.#r=n??!0;let{features:o}=e;this.nodesById=Object.create(null),this.#t=this.#n(o,r,n)}#t;#n(e,r,n){let o=this.nodesById;for(let m=0;m<e.length;m++)o[e[m].properties.id]=e[m];let i=Object.keys(o),s=i.length,a=new Map,c=new Array(s),u=new Float64Array(s),f=new Float64Array(s);for(let m=0;m<s;m++){let y=o[i[m]];a.set(i[m],m),c[m]=y,u[m]=y.geometry.coordinates[0],f[m]=y.geometry.coordinates[1]}let l=0;for(let m=0;m<s;m++){let y=c[m].properties,E=y.neighbors,S=0;for(let v=0;v<E.length;v++)a.has(E[v].id)&&S++;S!==E.length&&(y.neighbors=E.filter(({id:v})=>a.has(v))),l+=S}for(let m=0;m<e.length;m++){let y=e[m],E=r==="default"?r:y.properties[r],S=this.nodesByGroup.get(E);S||this.nodesByGroup.set(E,S=[]),S.push(y)}let h=new Int32Array(s+1),w=new Int32Array(l),p=new Int32Array(l),F=new Uint8Array(l),g=new Uint8Array(l),d=new Set,x=new Array(l),I=0;for(let m=0;m<s;m++){let y=c[m],E=y.properties.neighbors,S=new Array(E.length);h[m]=I;for(let v=0;v<E.length;v++){let{id:M,weight:A,sameStop:P}=E[v],T=a.get(M),L=c[T],_=new ne({origin:y,destination:L,pathWeight:A,distance:re(y.geometry.coordinates,L.geometry.coordinates),angle:q(y.geometry.coordinates,L.geometry.coordinates),multiplicativeDistanceWeightScaling:n});S[v]=_,w[I]=m,p[I]=T,F[I]=D(y)!==D(L)?1:0,P===!0&&(g[I]=1,d.add(_)),x[I]=_,I++}this.edges[y.properties.id]=S}return h[s]=I,{nodeCount:s,indexById:a,nodes:c,lon:u,lat:f,edgeStart:h,edgeOrigin:w,edgeDestination:p,edgeCrossesFloor:F,edgeSameStop:g,sameStopEdges:d,edgeRefs:x,generation:0,scratch:{costSoFar:new Float64Array(s),cameFrom:new Int32Array(s),stamp:new Uint32Array(s),heuristic:new Float64Array(s),heuristicStamp:new Uint32Array(s),flags:new Uint8Array(s),frontier:new bt(1024),popped:new Float64Array(1),zoneTarget:{cost:new Float64Array(s),stamp:new Uint32Array(s),generation:0,zone:new Int32Array(s),extraZones:new Map,zoneCosts:[],zonePerEntry:[]}},flagSetCache:new WeakMap}}#o(){return this.#t.scratch}#i(e){let r=this.#t,n=r.flagSetCache.get(e);if(!n||n.setSize!==e.size){let o=new Uint8Array(r.nodeCount);for(let i of e){let s=r.indexById.get(i);s!==void 0&&(o[s]=1)}n={array:o,setSize:e.size},r.flagSetCache.set(e,n)}return n.array}getShortestEuclideanDistance(e,r){return r.reduce((n,o)=>{let i=Hr(e.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}hasLineOfSight=(e,r,n=[],o=Ve)=>pe({type:"Feature",properties:{id:"origin",neighbors:[]},geometry:{type:"Point",coordinates:e}},{type:"Feature",properties:{id:"destination",neighbors:[]},geometry:{type:"Point",coordinates:r}},n,o)===!0;dijkstraFindWithinTravelDistance(e,r,n,o,i,s,a,c){let u=this.nodesById[e];if(!u)return[];let f=new Set(n),l=new vt((E,S)=>E.distance-S.distance),h=new Map,w=[],p=c!==void 0&&c.length>0;p&&this.#l(c);let{zoneTarget:F}=this.#o(),g=this.#t.indexById,d=this.#t.sameStopEdges,x=new Set,I=0,m=(E,S)=>{let v=E.properties.id;if(x.has(v))return;let M=d.size>0&&(this.edges[v]??[]).some(A=>d.has(A)&&x.has(A.destination.properties.id));w.push({feature:E,distance:S}),x.add(v),M||I++},y=()=>{if(d.size!==0)for(let E=0;E<w.length;E++){let{feature:S,distance:v}=w[E];for(let M of this.edges[S.properties.id]??[]){let A=M.destination;d.has(M)&&f.has(A.properties.id)&&m(A,v)}}};for(l.push({node:u,distance:0,geometricDistance:0}),h.set(u.properties.id,0);!l.isEmpty()&&!(I>=s);){let E=l.pop();if(!E)break;let S=E.node,v=E.distance,M=E.geometricDistance;if(!(v>(h.get(S.properties.id)??1/0))){S.properties.id!=null&&f.has(S.properties.id?.toString())&&(i?this.hasLineOfSight(u.geometry.coordinates,S.geometry.coordinates,o)&&m(S,v):m(S,v));for(let A of this.edges[S.properties.id]){let P=A.destination,T=D(A.origin)!==D(A.destination),L=a?.get(A)??A.weight,_=T?Math.max(L,$o):a?.has(A)?L:A.distance,B=v+_+(p&&!this.#t.sameStopEdges.has(A)?Kt(g.get(S.properties.id),g.get(P.properties.id),F):0),G=M+_;if(B===1/0||G>r)continue;let z=h.get(P.properties.id);z!==void 0&&B>=z||(h.set(P.properties.id,B),l.push({node:P,distance:B,geometricDistance:G}))}}}return y(),w}aStar({originIds:e,destinationNodeIds:r,disabledConnectionNodeIds:n,zones:o,overrideEdgeWeights:i,disabledNodeIds:s,outdoorNodeIds:a,indoorPathWeight:c,outdoorPathWeight:u,outdoorPathWeightMultiplier:f}){let l=this.#u(e),h=this.#u(r);if(l.length===0||h.length===0)return[];let w=this.#t,p=this.#o(),{edgeStart:F,edgeDestination:g,edgeCrossesFloor:d,edgeSameStop:x,edgeRefs:I}=w,{costSoFar:m,cameFrom:y,stamp:E,heuristic:S,heuristicStamp:v,flags:M,frontier:A}=p,P=this.#s();A.reset();let T=C=>w.indexById.get(C.properties.id),L=h.map(T),_=[];if(n)for(let C of n){let Q=w.indexById.get(C);Q!==void 0&&_.push(Q)}for(let C of L)M[C]|=ln;for(let C of _)M[C]|=Qt;let B=s&&s.size>0?this.#i(s):void 0,G=this.#r&&f!==void 0&&c!==void 0&&a!==void 0&&a.size>0,z=G?this.#i(a):void 0,$=G?(c+1)*f/((u??c)+1):1,U=i&&i.size>0?i:void 0,V=o.length>0;V&&this.#l(o,P);let{zoneTarget:ve}=p,te=h.length,Z=new Float64Array(te),Oe=new Float64Array(te),be=p.popped;for(let C=0;C<te;C++)Z[C]=h[C].geometry.coordinates[0],Oe[C]=h[C].geometry.coordinates[1];try{for(let C of l){let Q=T(C);E[Q]=P,m[Q]=0,y[Q]=-1,this.#a(Q,P,Z,Oe),A.push(Q,S[Q],0)}for(;A.size>0;){let C=A.popInto(be),Q=be[0],Ge=M[C];if(Ge&ln)return this.#c(C);let Ue=m[C];if(Q>Ue||B!==void 0&&B[C]===1)continue;let jt=(Ge&Qt)!==0,ct=F[C+1];for(let fe=F[C];fe<ct;fe++){let ee=g[fe],Dr=d[fe]===1;if(jt&&(Dr||(M[ee]&Qt)!==0))continue;let zr=I[fe],Gr=U!==void 0?U.get(zr):void 0,Ur=Gr??zr.weight;z!==void 0&&Gr===void 0&&!Dr&&z[C]===1&&z[ee]===1&&(Ur*=$);let Ro=V&&x[fe]!==1?Kt(C,ee,ve):0,je=Ue+Ur+Ro;je!==1/0&&(E[ee]!==P||je<m[ee])&&(E[ee]=P,m[ee]=je,y[ee]=fe,v[ee]!==P&&this.#a(ee,P,Z,Oe),A.push(ee,je+S[ee],je))}}return[]}finally{for(let C of L)M[C]=0;for(let C of _)M[C]=0}}#s(){let e=this.#t;if(e.generation>=4294967294){let r=this.#o();r.stamp.fill(0),r.heuristicStamp.fill(0),r.zoneTarget.stamp.fill(0),e.generation=0}return++e.generation}#a(e,r,n,o){let{lon:i,lat:s}=this.#t,{heuristic:a,heuristicStamp:c}=this.#o(),u=i[e],f=s[e],l=Number.MAX_VALUE;for(let h=0;h<n.length;h++){let w=(n[h]-u)*un,p=(o[h]-f)*un,F=Math.sqrt(w*w+p*p)*xe;l=Math.min(l,F)}a[e]=l,c[e]=r}#c(e){let{edgeRefs:r,edgeOrigin:n}=this.#t,{cameFrom:o}=this.#o(),i=[],s=o[e];for(;s!==-1;)i.push(r[s]),s=o[n[s]];return i.reverse()}#u(e){return e.map(r=>this.nodesById[r]).filter(Boolean)}#l(e,r=this.#s()){let n=this.#t;n.zoneIndex||(n.zoneIndex=new xt({nodeCount:n.nodeCount,lon:n.lon,lat:n.lat,group:n.nodes.map(i=>i.properties[this.#e])}));let o=this.#o();return o.zoneTarget.generation=r,n.zoneIndex.fill(e,this.#e,o.zoneTarget),r}};b();function fn(t,e,r,n=Ve){if(t.length<3)return t;let o=1e-4,i=t.length,s=new Uint8Array(i),a=new Int32Array(i+1);a[i]=i;for(let p=i-1;p>=0;p--)s[p]=t[p].origin.properties.preventSmoothing?1:0,a[p]=s[p]?p:a[p+1];let c=t[i-1].destination,u=on(e),f=new Array(i+1).fill(null).map(()=>({cost:1/0,prev:-1}));f[0]={cost:0,prev:-1};for(let p=0;p<i;p++){let F=!0;if(f[p].cost===1/0)continue;let g=t[p].origin,d=a[p+1];for(let x=p+1;x<=d;x++){let I=x===i?c:t[x].origin,m=re(g.geometry.coordinates,I.geometry.coordinates);if(m<.01)continue;let E=(x-p-1)*o,S=f[p].cost+m-E;if(S>=f[x].cost)continue;let v=x===p+1&&x<i&&s[x]===1,M=x===p+1&&s[p]===1;!v&&!M&&!u(g,I,n)||(f[x].cost=S,f[x].prev=p,F=!1)}F&&f[p+1].cost===1/0&&(f[p+1].cost=f[p].cost,f[p+1].prev=p)}let l=[],h=i;for(;h!==-1;)l.unshift(h),h=f[h].prev===-1?h-1:f[h].prev;let w=[];for(let p=0;p<l.length-1;p++){let F=l[p],g=l[p+1],d=t[F].origin,x=g===i?c:t[g].origin;w.push(new ne({origin:d,destination:x,distance:re(d.geometry.coordinates,x.geometry.coordinates),angle:q(d.geometry.coordinates,x.geometry.coordinates),multiplicativeDistanceWeightScaling:r}))}return w}b();var hn=ut(er());b();var dn=jr("Navigator");function qe(t,e,r){if(t==null||t[e]==null)return!1;let n=1<<r;return(t[e]&n)!==0}b();var Ho=.5;function pn(t,e,r,n,o,i){if(!t?.geoJSON?.geometry?.coordinates)return null;let[s,a]=en(n,Ho),c=s,u=a;if(o){let p=Math.sqrt(Math.pow(s.x-o.x,2)+Math.pow(s.y-o.y,2));Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2))<p&&(c=a,u=s)}let f=i(c.x,c.y),l=i(u.x,u.y),h={type:"Feature",geometry:{type:"Point",coordinates:[f.lon,f.lat]},properties:{id:`${e}_buffer_entry`,map:r,neighbors:[],preventSmoothing:!0}},w={type:"Feature",geometry:{type:"Point",coordinates:[l.lon,l.lat]},properties:{id:`${e}_buffer_exit`,map:r,neighbors:[],preventSmoothing:!0}};return{entryNode:h,exitNode:w,entryMeters:c,exitMeters:u}}function gn(t,e,r,n){let o=[t[0].origin];for(let v=0;v<t.length;v++)o.push(t[v].destination);let i=new Map,s=new Map;for(let v=0;v<o.length;v++)i.set(o[v].properties.id,o[v]),s.set(v,o[v]);let a=o[0].geometry.coordinates[1],{toCartesian:c,toGeographic:u}=dt(a),f=o.map((v,M)=>{let A={x:0,y:0,nodeId:v.properties.id,originalIndex:M};return c(v.geometry.coordinates,A),A}),l=new Set,h=new Map,w=new Set;for(let v=0;v<o.length;v++){let M=e(o[v].properties.id);if(M&&(l.add(v),h.set(v,M)),v<o.length-1){let A=D(o[v]),P=D(o[v+1]);A!==P&&(w.add(v),w.add(v+1),v>0&&w.add(v-1))}}if(t.length<3&&l.size===0)return t;let p=t.length>=3?(0,hn.default)(f,.7,!1):f,F=new Set;for(let v=0;v<p.length;v++)F.add(p[v].originalIndex);let g=[];for(let v of l)F.has(v)||g.push(v);let d=p.slice(),x=.25;for(let v of w){if(F.has(v))continue;let M=s.get(v);if(!M)continue;let A=-1;for(let P=0;P<d.length-1;P++)if(d[P].originalIndex<v&&d[P+1].originalIndex>v){A=P+1;break}if(A!==-1){let P={x:0,y:0,nodeId:M.properties.id,originalIndex:v};c(M.geometry.coordinates,P),d.splice(A,0,P)}}for(let v of g){let M=s.get(v);if(!M)continue;let A=-1;for(let P=0;P<d.length-1;P++)if(d[P].originalIndex<v&&d[P+1].originalIndex>v){A=P+1;break}if(A!==-1){let P={x:0,y:0,nodeId:M.properties.id,originalIndex:v};c(M.geometry.coordinates,P);let T=qt(P,d[A-1]),L=qt(P,d[A]);T<x?d[A-1]=P:L<x?d[A]=P:d.splice(A,0,P)}}let I=[],m={x:0,y:0},y={x:0,y:0},E=new Map;for(let v=0;v<d.length;v++)E.set(d[v].originalIndex,v);for(let v of l){let M=s.get(v);if(!M)continue;let A=h.get(v);if(!A)continue;let P=E.get(v)??-1;if(P!==-1){let T;P>0&&(T={x:d[P-1].x,y:d[P-1].y});let L=A.geoJSON.geometry.coordinates;c(L[0],m),c(L[1],y);let _=[m,y],B=M.properties.id,G=D(M)||"test-floor",z=pn(A,B,G,_,T,u);if(z){let $={x:z.entryMeters.x,y:z.entryMeters.y,nodeId:z.entryNode.properties.id,originalIndex:v-.5},U={x:z.exitMeters.x,y:z.exitMeters.y,nodeId:z.exitNode.properties.id,originalIndex:v+.5};i.set(z.entryNode.properties.id,z.entryNode),i.set(z.exitNode.properties.id,z.exitNode),I.push($,U)}}}if(d.push(...I),d.sort((v,M)=>v.originalIndex-M.originalIndex),n&&d.length>=3)for(let v=0;v<d.length-1;v++){let M=d[v];if(M.nodeId.endsWith("_buffer_exit")){let A=d[d.length-1];if(v<d.length-2){let P=!1;for(let T=v+1;T<d.length-1;T++)if(d[T].nodeId.endsWith("_buffer_entry")||d[T].nodeId.endsWith("_buffer_exit")){P=!0;break}if(!P){let T=i.get(M.nodeId),L=i.get(A.nodeId);if(T&&L){if(D(T)!==D(L))continue;if(pe(T,L,n,.1)){let _=d.length-v-2;d.splice(v+1,_)}}}}}}if(n&&d.length>=3){let v=d[0],M=-1;for(let A=1;A<d.length;A++)if(d[A].nodeId.endsWith("_buffer_entry")){M=A;break}if(M>1){let A=!1;for(let P=1;P<M;P++)if(d[P].nodeId.endsWith("_buffer_entry")||d[P].nodeId.endsWith("_buffer_exit")){A=!0;break}if(!A){let P=d[M],T=i.get(v.nodeId),L=i.get(P.nodeId);if(T&&L&&D(T)===D(L)){if(pe(T,L,n,.1)){let _=M-1;d.splice(1,_)}}}}}let S=[];for(let v=0;v<d.length-1;v++){let M=d[v],A=d[v+1],P=i.get(M.nodeId),T=i.get(A.nodeId);P&&T?S.push(new ne({origin:P,destination:T,distance:re(P.geometry.coordinates,T.geometry.coordinates),angle:q(P.geometry.coordinates,T.geometry.coordinates),multiplicativeDistanceWeightScaling:r})):dn.warn(`Origin or destination node not found for point ${M.nodeId} or ${A.nodeId}`)}return S}function H(t,e){return new ne({origin:t,destination:e,distance:re(t.geometry.coordinates,e.geometry.coordinates),angle:q(t.geometry.coordinates,e.geometry.coordinates)})}function mn(t,e,r,n=!0){if(t.length<3)return t;let o=new Set;for(let a=0;a<t.length;a++)if(t[a].origin.properties.preventSmoothing){if(o.add(a),n){for(let c=a-1;c>=0;c--)if(!t[c].origin.properties.preventSmoothing){o.add(c);break}}if(n){for(let c=a+1;c<t.length;c++)if(!t[c].origin.properties.preventSmoothing){o.add(c);break}}}if(t.length>0&&t[t.length-1].destination.properties.preventSmoothing&&(o.add(t.length-1),n)){for(let a=t.length-2;a>=0;a--)if(!t[a].origin.properties.preventSmoothing){o.add(a);break}}let i=[],s=0;for(let a=1;a<t.length;a++){let c=a===t.length-1,u=o.has(a),f=c?.05:.7,l=pe(t[s].origin,t[a].origin,e,f),h=t[a].origin.properties.preventSmoothing,w=a-1;if(u){s!==a&&(l?(i.push(H(t[s].origin,t[a].origin)),s=a):(s!==w&&(i.push(H(t[s].origin,t[w].origin)),s=w),s!==a&&(i.push(H(t[s].origin,t[a].origin)),s=a))),c&&i.push(H(t[a].origin,t[a].destination));continue}if(h)l?(i.push(H(t[s].origin,t[a].origin)),s=a):s!==w&&(i.push(H(t[s].origin,t[w].origin)),s=w),i.push(H(t[s].origin,t[a].origin)),s=a,c&&i.push(H(t[a].origin,t[a].destination));else if(l)c&&(pe(t[s].origin,t[a].destination,e,.7)?i.push(H(t[s].origin,t[a].destination)):(i.push(H(t[s].origin,t[a].origin)),i.push(H(t[a].origin,t[a].destination))),s=a);else{if(s===w){c&&(i.push(H(t[s].origin,t[a].origin)),i.push(H(t[a].origin,t[a].destination)));continue}i.push(H(t[s].origin,t[w].origin)),s=w,c&&(i.push(H(t[s].origin,t[a].origin)),i.push(H(t[a].origin,t[a].destination)))}}if(!1){let a=i[i.length-1];window.__DEBUG_PATH.finalSteps.push({nodeId:a.destination.properties.id,coordinate:a.destination.geometry.coordinates,floorId:D(a.destination)})}return i}b();function ae(t,e,r){return new ne({origin:t,destination:e,distance:re(t.geometry.coordinates,e.geometry.coordinates),angle:q(t.geometry.coordinates,e.geometry.coordinates),multiplicativeDistanceWeightScaling:r})}function yn(t,e,r=.2,n={},o){if(t.length<3)return t;let i=c=>"outdoors"in n&&qe(c?.properties?.flags??[],n.outdoors.index,n.outdoors.bit)||!!c?.properties?.preventSmoothing,s=[t[0]],a=1;for(let c=a+1;c<t.length;c++){let u=c===t.length-1,f=t[a].origin,l=t[c].origin,h=pe(f,l,e,r),w=i(l),p=c-1;if(w)h?(s.push(ae(f,l,o)),a=c):(a!==p&&(s.push(ae(t[a].origin,t[p].origin,o)),a=p),s.push(ae(t[a].origin,l,o)),a=c),u&&s.push(ae(l,t[c].destination,o));else if(h)u&&(!(D(l)!==D(t[c].destination))&&pe(f,t[c].destination,e,r)?s.push(ae(f,t[c].destination,o)):(s.push(ae(f,l,o)),s.push(ae(l,t[c].destination,o))),a=c);else{if(a===p){u&&(s.push(ae(f,l,o)),s.push(ae(l,t[c].destination,o)));continue}s.push(ae(t[a].origin,t[p].origin,o)),a=p,u&&(s.push(ae(t[a].origin,l,o)),s.push(ae(l,t[c].destination,o)))}}return s}b();var vn=ut(er());function bn(t,e){let r=new Set;if(t.length<2)return r;let n=[t[0].origin];for(let p=0;p<t.length;p++)n.push(t[p].destination);let o=n[0].geometry.coordinates[1],{toCartesian:i}=dt(o),s=e;if(!s)return r;let a=n.map((p,F)=>{let g={x:0,y:0,nodeId:p.properties.id,originalIndex:F};return i(p.geometry.coordinates,g),g}),c=new Set,u=new Set;for(let p=0;p<a.length;p++)s(a[p].nodeId)&&(c.add(p),u.add(a[p].nodeId));if(c.size===0)return r;let f=a.length>=3?(0,vn.default)(a,.7,!1):a,l=new Map;for(let p=0;p<f.length;p++)l.set(f[p].originalIndex,p);let h=new Set;for(let p of c){let F=l.get(p);if(F!==void 0){if(F>0){let g=f[F-1].nodeId;h.add(g)}if(F<f.length-1){let g=f[F+1].nodeId;h.add(g)}}else{let g,d;for(let x=0;x<f.length-1;x++){let I=f[x].originalIndex,m=f[x+1].originalIndex;if(I<p&&p<m){g=f[x].nodeId,d=f[x+1].nodeId;break}}g&&h.add(g),d&&h.add(d)}}let w=0;for(let p of t)h.has(p.origin.properties.id)&&(p.origin.properties.preventSmoothing||(p.origin.properties.preventSmoothing=!0,r.add(p.origin.properties.id))),h.has(p.destination.properties.id)&&(p.destination.properties.preventSmoothing||(p.destination.properties.preventSmoothing=!0,r.add(p.destination.properties.id))),w++;return r}b();b();var Ce={accessible:"accessible",outdoors:"outdoors",public:"public"};b();b();function Ze(t,e,r=[]){let n={...t};for(let[o,i]of Object.entries(e))if(i!==void 0)if(o in n){let s=o;if(Array.isArray(i)&&i.length>0){let a=Jo(i[0],r);if(a){let c=n[s];if(!Array.isArray(c))throw new Error(`Expected array at ${o}, got ${typeof c}`);let u=new Map(i.map(h=>[xn(h,a),h])),l=c.map(h=>{let w=u.get(xn(h,a));return w?Ze(h,w,r):h});n[s]=l}else n[s]=i}else{let a=n[s];typeof a=="object"&&a!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?n[s]=i:n[s]=Ze(a,i,r):n[o]=i}}else n[o]=i;return n}function Jo(t,e){function r(n){if(typeof n!="object"||n===null)return null;for(let o of e)if(o in n&&typeof n[o]<"u")return[o];if(Array.isArray(n))return null;for(let[o,i]of Object.entries(n)){let s=r(i);if(s)return[o,...s]}return null}return r(t)}function xn(t,e){return e.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},t)}b();b();var _e=/\.(json|geojson)$/,tr=["floorstack.json","mapstack.json","floor.geojson"],Ko=["styles.json","shapes.json","tileset.json","location.json","category.json","navigationFlags.json","annotation-symbols.json","geometry-effects.json","annotation","textAreas","enterprise","floorImages","shapeInstances","modelInstances","window","area","facade"],It=Ko,Ku=new Set(It);var wn="2.100.0-final.15";b();var Qo=t=>{if(t==="space"||t==="obstruction"||t==="entrance")return{}},St=(t,e,r)=>{let n=t[e];if(typeof n!="object"||Object.keys(n).length===0)return Qo(e);let o={};for(let[i,s]of Object.entries(n)){let a=i.replace(_e,"");o[a]=JSON.parse(r(s))}return o},ei=[...tr,...It].filter(t=>_e.test(t)),ti=[...tr,...It].filter(t=>!_e.test(t)),ri=t=>{let e=new TextDecoder("utf-8"),r=e.decode.bind(e),n={"manifest.geojson":JSON.parse(r(t["manifest.geojson"])),"mapstack.geojson":JSON.parse(r(t["mapstack.geojson"])),"map.geojson":JSON.parse(r(t["map.geojson"])),"node.geojson":JSON.parse(r(t["node.geojson"])),"connection.json":JSON.parse(r(t["connection.json"])),space:St(t,"space",r),obstruction:St(t,"obstruction",r),entrance:St(t,"entrance",r)};for(let o of ei)t[o]&&(n[o]=JSON.parse(r(t[o])));for(let o of ti)t[o]&&(n[o]=St(t,o,r));return n};b();b();b();var $e=["agriculture","airport","casino","city-district","convention-center","entertainment","event-centre","first-responder-building","government-building","grocery-store","healthcare","higher-education","hotel","library","manufacturing","medical-centre","mixed-use","multifamily","museum","office-building","oil-and-energy","other","parking-facility","religious-institution","resort","retail-store","schools-k-12","shopping-mall","stadium-or-arena","storage-facility","theme-park","transit","transportation-hub","warehousing"],ni=[...$e,"unknown"],rr=Object.freeze(Object.fromEntries([...$e,"unknown"].map(t=>[t,t])));b();var He=["reference-point","checkpoint","checkpoint-passport","parent"],oi=[...He,"unknown"],ii=Object.freeze(Object.fromEntries([...He,"unknown"].map(t=>[t,t])));var Je=["closed-temporarily","new","pop-up","coming-soon","relocated"],si=[...Je,"unknown"],ai=Object.freeze(Object.fromEntries([...Je,"unknown"].map(t=>[t,t])));b();var Ke=["left","center","right"],ci=[...Ke,"unknown"],ui=Object.freeze(Object.fromEntries([...Ke,"unknown"].map(t=>[t,t])));b();var Qe=["near","center"],li=[...Qe,"unknown"],fi=Object.freeze(Object.fromEntries([...Qe,"unknown"].map(t=>[t,t])));b();var et=["top","side"],di=[...et,"unknown"],pi=Object.freeze(Object.fromEntries([...et,"unknown"].map(t=>[t,t])));var tt=["inside","outside","both"],hi=[...tt,"unknown"],gi=Object.freeze(Object.fromEntries([...tt,"unknown"].map(t=>[t,t])));b();var Mt=["elevator","escalator","travelator","stairs","door","ramp","ladder"],Tl=[...Mt,"unknown"],nr=Object.freeze(Object.fromEntries([...Mt,"unknown"].map(t=>[t,t])));b();var At=["room","hallway","wall","object","poi","area","window"],Cl=[...At,"unknown"],_l=Object.freeze(Object.fromEntries([...At,"unknown"].map(t=>[t,t])));b();b();var Pt=class{_value;constructor(e){this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}},Ft=class{_tag="Some";_value;constructor(e){this._value=e}get value(){return this._value}isSome(){return!0}isSomeAnd(e){return e(this.value)}isNone(){return!1}equals(e){return e.isSome()&&e.value===this.value}expect(e){return this.value}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectNone(e){return this}map(e){return En(e(this.value))}mapAsync(e){return e(this.value).then(r=>En(r))}mapOr(e,r){return this.map(e).unwrapOr(r)}mapOrAsync(e,r){return this.mapAsync(e).then(n=>n.unwrapOr(r))}mapOrElse(e,r){return this.map(e).unwrapOrElse(r)}mapOrElseAsync(e,r){return this.mapAsync(e).then(n=>n.unwrapOrElse(r))}and(e){return e}andThen(e){return e(this.value)}andThenAsync(e){return e(this.value)}filter(e){return e(this.value)?this:Ee()}or(e){return this}orElse(e){return this}xor(e){return e.isSome()?Ee():this}toString(){return`Some(${this.value})`}okOr(e){return ue(this.value)}okOrElse(e){return ue(this.value)}iter(){return new Pt(this.value)}[Symbol.iterator](){return this.iter()}zip(e){return e.isSome()?ke([this.value,e.value]):Ee()}zipWith(e,r){return e.isSome()?ke(r(this.value,e.value)):Ee()}get[Symbol.toStringTag](){return"Some"}},Nt=class{_tag="None";get value(){return null}isSome(){return!1}isSomeAnd(e){return!1}isNone(){return!0}equals(e){return e.isNone()}expect(e){throw new Error(e)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(e){return this}inspectNone(e){return e(),this}map(e){return this}mapAsync(e){return Promise.resolve(this)}mapOr(e,r){return r}mapOrAsync(e,r){return Promise.resolve(r)}mapOrElse(e,r){return r()}mapOrElseAsync(e,r){return r()}and(e){return this}andThen(e){return this}andThenAsync(e){return Promise.resolve(this)}filter(e){return this}or(e){return e}orElse(e){return e()}xor(e){return e}toString(){return"None"}okOr(e){return Ie(e)}okOrElse(e){return Ie(e())}iter(){return new Pt(null)}[Symbol.iterator](){return this.iter()}zip(e){return this}zipWith(e,r){return this}get[Symbol.toStringTag](){return"None"}},ke=t=>new Ft(t),Ee=()=>new Nt,En=t=>t instanceof Ft||t instanceof Nt?t:t==null?Ee():ke(t);var Tt=class{_value;constructor(e){this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}},or=class{_tag="Ok";_value;constructor(e){this._value=e}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(e){return e(this.value)}isErr(){return!1}isErrAnd(e){return!1}ok(){return ke(this.value)}err(){return Ee()}expect(e){return this.value}expectErr(e){throw new Error(e)}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectErr(){return this}map(e){return ue(e(this.value))}async mapAsync(e){return e(this.value).then(ue)}mapOr(e,r){return e(this.value)}async mapOrAsync(e,r){return e(this.value)}mapOrElse(e,r){return e(this.value)}async mapOrElseAsync(e,r){return e(this.value)}mapErr(e){return this}iter(){return new Tt(this.value)}[Symbol.iterator](){return this.iter()}and(e){return e}andThen(e){return e(this.value)}or(e){return this}orElse(e){return this}async andThenAsync(e){return e(this.value)}toString(){return`Ok(${this.value})`}get[Symbol.toStringTag](){return"Ok"}},ir=class t{_tag="Err";_error;constructor(e){this._error=e}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(e){return!1}isErr(){return!0}isErrAnd(e){return e(this.error)}ok(){return Ee()}err(){return ke(this.error)}expect(e){throw new Error(e)}expectErr(e){return this.error}unwrap(){throw this.error}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(){return this}inspectErr(e){return e(this.error),this}map(e){return this}iter(){return new Tt(null)}[Symbol.iterator](){return this.iter()}async mapAsync(e){return this}mapOr(e,r){return r}async mapOrAsync(e,r){return r}mapOrElse(e,r){return r()}async mapOrElseAsync(e,r){return r()}mapErr(e){return new t(e(this.error))}and(e){return this}andThen(e){return this}async andThenAsync(e){return this}or(e){return e}orElse(e){return e(this.error)}toString(){return`Err(${this.error})`}get[Symbol.toStringTag](){return"Err"}},ue=t=>new or(t),Ie=t=>new ir(t);b();var se=Uint8Array,Be=Uint16Array,mi=Int32Array,In=new se([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Sn=new se([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),yi=new se([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mn=function(t,e){for(var r=new Be(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var o=new mi(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},An=Mn(In,2),Pn=An.b,vi=An.r;Pn[28]=258,vi[258]=28;var Fn=Mn(Sn,0),bi=Fn.b,Xl=Fn.r,ur=new Be(32768);for(R=0;R<32768;++R)ye=(R&43690)>>1|(R&21845)<<1,ye=(ye&52428)>>2|(ye&13107)<<2,ye=(ye&61680)>>4|(ye&3855)<<4,ur[R]=((ye&65280)>>8|(ye&255)<<8)>>1;var ye,R,rt=(function(t,e,r){for(var n=t.length,o=0,i=new Be(e);o<n;++o)t[o]&&++i[t[o]-1];var s=new Be(e);for(o=1;o<e;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new Be(1<<e);var c=15-e;for(o=0;o<n;++o)if(t[o])for(var u=o<<4|t[o],f=e-t[o],l=s[t[o]-1]++<<f,h=l|(1<<f)-1;l<=h;++l)a[ur[l]>>c]=u}else for(a=new Be(n),o=0;o<n;++o)t[o]&&(a[o]=ur[s[t[o]-1]++]>>15-t[o]);return a}),nt=new se(288);for(R=0;R<144;++R)nt[R]=8;var R;for(R=144;R<256;++R)nt[R]=9;var R;for(R=256;R<280;++R)nt[R]=7;var R;for(R=280;R<288;++R)nt[R]=8;var R,Nn=new se(32);for(R=0;R<32;++R)Nn[R]=5;var R;var xi=rt(nt,9,1);var wi=rt(Nn,5,1),sr=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},le=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},ar=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},Ei=function(t){return(t+7)/8|0},fr=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new se(t.subarray(e,r))};var Ii=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ie=function(t,e,r){var n=new Error(e||Ii[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,ie),!r)throw n;return n},Si=function(t,e,r,n){var o=t.length,i=n?n.length:0;if(!o||e.f&&!e.l)return r||new se(0);var s=!r,a=s||e.i!=2,c=e.i;s&&(r=new se(o*3));var u=function(ct){var fe=r.length;if(ct>fe){var ee=new se(Math.max(fe*2,ct));ee.set(r),r=ee}},f=e.f||0,l=e.p||0,h=e.b||0,w=e.l,p=e.d,F=e.m,g=e.n,d=o*8;do{if(!w){f=le(t,l,1);var x=le(t,l+1,3);if(l+=3,x)if(x==1)w=xi,p=wi,F=9,g=5;else if(x==2){var E=le(t,l,31)+257,S=le(t,l+10,15)+4,v=E+le(t,l+5,31)+1;l+=14;for(var M=new se(v),A=new se(19),P=0;P<S;++P)A[yi[P]]=le(t,l+P*3,7);l+=S*3;for(var T=sr(A),L=(1<<T)-1,_=rt(A,T,1),P=0;P<v;){var B=_[le(t,l,L)];l+=B&15;var I=B>>4;if(I<16)M[P++]=I;else{var G=0,z=0;for(I==16?(z=3+le(t,l,3),l+=2,G=M[P-1]):I==17?(z=3+le(t,l,7),l+=3):I==18&&(z=11+le(t,l,127),l+=7);z--;)M[P++]=G}}var $=M.subarray(0,E),U=M.subarray(E);F=sr($),g=sr(U),w=rt($,F,1),p=rt(U,g,1)}else ie(1);else{var I=Ei(l)+4,m=t[I-4]|t[I-3]<<8,y=I+m;if(y>o){c&&ie(0);break}a&&u(h+m),r.set(t.subarray(I,y),h),e.b=h+=m,e.p=l=y*8,e.f=f;continue}if(l>d){c&&ie(0);break}}a&&u(h+131072);for(var V=(1<<F)-1,ve=(1<<g)-1,te=l;;te=l){var G=w[ar(t,l)&V],Z=G>>4;if(l+=G&15,l>d){c&&ie(0);break}if(G||ie(2),Z<256)r[h++]=Z;else if(Z==256){te=l,w=null;break}else{var Oe=Z-254;if(Z>264){var P=Z-257,be=In[P];Oe=le(t,l,(1<<be)-1)+Pn[P],l+=be}var C=p[ar(t,l)&ve],Q=C>>4;C||ie(3),l+=C&15;var U=bi[Q];if(Q>3){var be=Sn[Q];U+=ar(t,l)&(1<<be)-1,l+=be}if(l>d){c&&ie(0);break}a&&u(h+131072);var Ge=h+Oe;if(h<U){var Ue=i-U,jt=Math.min(U,Ge);for(Ue+h<0&&ie(3);h<jt;++h)r[h]=n[Ue+h]}for(;h<Ge;++h)r[h]=r[h-U]}}e.l=w,e.p=te,e.b=h,e.f=f,w&&(f=1,e.m=F,e.d=p,e.n=g)}while(!f);return h!=r.length&&s?fr(r,0,h):r.subarray(0,h)};var Mi=new se(0);var he=function(t,e){return t[e]|t[e+1]<<8},ce=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},cr=function(t,e){return ce(t,e)+ce(t,e+4)*4294967296};function Ai(t,e){return Si(t,{i:2},e&&e.out,e&&e.dictionary)}var lr=typeof TextDecoder<"u"&&new TextDecoder,Pi=0;try{lr.decode(Mi,{stream:!0}),Pi=1}catch{}var Fi=function(t){for(var e="",r=0;;){var n=t[r++],o=(n>127)+(n>223)+(n>239);if(r+o>t.length)return{s:e,r:fr(t,r-1)};o?o==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}};function dr(t,e){if(e){for(var r="",n=0;n<t.length;n+=16384)r+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return r}else{if(lr)return lr.decode(t);var o=Fi(t),i=o.s,r=o.r;return r.length&&ie(8),i}}var Ni=function(t,e){return e+30+he(t,e+26)+he(t,e+28)},Ti=function(t,e,r){var n=he(t,e+28),o=he(t,e+30),i=dr(t.subarray(e+46,e+46+n),!(he(t,e+8)&2048)),s=e+46+n,a=Oi(t,s,o,r,ce(t,e+20),ce(t,e+24),ce(t,e+42)),c=a[0],u=a[1],f=a[2];return[he(t,e+10),c,u,i,s+o+he(t,e+32),f]},Oi=function(t,e,r,n,o,i,s){var a=o==4294967295,c=i==4294967295,u=s==4294967295,f=e+r,l=a+c+u;if(n&&l){for(;e+4<f;e+=4+he(t,e+2))if(he(t,e)==1)return[a?cr(t,e+4+8*c):o,c?cr(t,e+4):i,u?cr(t,e+4+8*(c+a)):s,1];n<2&&ie(13)}return[o,i,s,0]};function Tn(t,e){for(var r={},n=t.length-22;ce(t,n)!=101010256;--n)(!n||t.length-n>65558)&&ie(13);var o=he(t,n+8);if(!o)return{};var i=ce(t,n+16),s=ce(t,n-20)==117853008;if(s){var a=ce(t,n-12);s=ce(t,a)==101075792,s&&(o=ce(t,a+32),i=ce(t,a+48))}for(var c=e&&e.filter,u=0;u<o;++u){var f=Ti(t,i,s),l=f[0],h=f[1],w=f[2],p=f[3],F=f[4],g=f[5],d=Ni(t,g);i=F,(!c||c({name:p,size:h,originalSize:w,compression:l}))&&(l?l==8?r[p]=Ai(t.subarray(d,d+h),{out:new se(w)}):ie(14,"unknown compression type "+l):r[p]=fr(t,d,d+h))}return r}b();b();b();b();var W=t=>Object.entries(t);b();var ot=t=>Object.keys(t);function On(t){return t.replace(/^g_/,"s_")}function Ot(t){return t.replace(/^g_/,"o_")}function Li(t){return t.replace(/^g_/,"w_")}function Ln(t){return t.replace(/^loci_/,"eli_")}function it(t){return t.replace(/^loc_/,"el_")}function Lt(t){return t.replace(/^lcat_/,"ec_")}function Ci(t){return t.replace(/^g_/,"ar_")}function Cn(t){return t.replace(/^n_/,"s_")}function _i(t,e,r){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],o=0,i=t.geometry.type.replace("Multi","");for(let s of t.geometry.coordinates)n.push({...t,geometry:{type:i,coordinates:s},properties:{...t.properties,id:`${e}-${o++}`,kind:r}});return n}default:return[{...t,properties:{...t.properties,id:e,kind:r}}]}}function Re(t,e,r,n){let o=new Map;for(let{feature:i,floorId:s}of t){let a=i.properties.id,c=n.get(a);if(e.has(a)){let u=_i(i,r(a),c),f=u.map(h=>h.properties.id),l=f.map(h=>({geometryId:h,floorId:s}));o.set(a,{ids:f,features:u,anchors:l})}}return o}function _n(t){let e={space:new Map,obstruction:new Map,area:new Map,window:new Map,object:new Map};if(!t.geometry)return e;let r=ki(t),n=W(t.geometry).flatMap(([u,f])=>(f?.features??[]).map(l=>({feature:l,floorId:u}))).flat(),o=new Set(Object.values(t.walkable??{}).filter(u=>u!==void 0).flatMap(ot)),i=new Set(Object.values(t.nonwalkable??{}).filter(u=>u!==void 0).flatMap(ot)),s=new Set(Array.from(r.entries()).filter(([u,f])=>f==="area").map(([u])=>u)),a=new Set(Array.from(r.entries()).filter(([u,f])=>f==="object").map(([u])=>u)),c=new Set(Array.from(r.entries()).filter(([u,f])=>f==="window").map(([u])=>u));return o.size>0&&(e.space=Re(n,o,On,r)),i.size>0&&(e.obstruction=Re(n,i,Ot,r)),s.size>0&&(e.area=Re(n,s,Ci,r)),a.size>0&&(e.object=Re(n,a,Ot,r)),c.size>0&&(e.window=Re(n,c,Li,r)),o.size===0&&i.size===0&&s.size===0&&(e.space=Re(n,new Set(n.map(u=>u.feature.properties.id)),On,r)),e}function ki(t){let e=new Map(Object.values(t.kinds??{}).filter(r=>r!==void 0).flatMap(W));for(let r of t.connections?.filter(n=>n.type!=="door")??[]){for(let n of r.entrances)e.set(n.geometryId,`connection.${r.type}`);for(let n of r.exits)e.set(n.geometryId,`connection.${r.type}`)}return e}function kn(t){if(!t||t.length===0)return[];let e=Math.max(...t.map(r=>r.length));return t.reduce((r,n)=>r.map((o,i)=>o|(n[i]??0)),Array(e).fill(0))}b();var mr=ut(Dn(),1),Gi=t=>{let e=t.geometry.coordinates[0],r=0;for(let n=0;n<e.length-1;n++)r+=e[n][0]*e[n+1][1]-e[n+1][0]*e[n][1];return Math.abs(r/2)},zn=(t,e,r)=>{let n=!1;for(let o=0,i=r.length-1;o<r.length;i=o++){let s=r[o][0],a=r[o][1],c=r[i][0],u=r[i][1];a>e!=u>e&&t<(c-s)*(e-a)/(u-a)+s&&(n=!n)}return n},Ui=(t,e)=>{let[r,n]=t,o=e.geometry.coordinates;if(!zn(r,n,o[0]))return!1;for(let i=1;i<o.length;i++)if(zn(r,n,o[i]))return!1;return!0},ji=t=>{let e=t.geometry.coordinates,r=0,n=0,o=0;for(let w of e)for(let p=0;p<w.length-1;p++)r+=w[p][0],n+=w[p][1],o++;if(o===0)throw new Error("Polygon has no vertices");let i=r/o,s=n/o,a=0,c=0,u=0,f,l;for(let w of e)for(let p of w){let F=p[0]-i,g=p[1]-s;if(f!==void 0&&l!==void 0){let d=f*g-F*l;u+=d,a+=(f+F)*d,c+=(l+g)*d}f=F,l=g}if(u===0)return[i,s];let h=1/(3*u);return[i+h*a,s+h*c]},Gn=t=>{let e=Gi(t);return!Number.isFinite(e)||e<=0?1e-9:Math.sqrt(e)*.01},De=t=>{try{let e=ji(t);if(Ui(e,t))return ue(e);let r=(0,mr.default)(t.geometry.coordinates,Gn(t));return ue([r[0],r[1]])}catch{return Ie(new Error("Unable to calculate center of polygon"))}},Xi=t=>{try{let e=(0,mr.default)(t.geometry.coordinates,Gn(t));return ue([e[0],e[1]])}catch{return Ie(new Error("Unable to calculate center of polygon"))}},Un=(t="center-of-mass")=>{if(typeof t=="function")return t;switch(t){case"visual-center":return Xi;case"center-of-mass":return De}};function jn(t,e){let{nodesByGeometryId:r,incomingEdgesByNodeId:n,nodesById:o}=Yi(t),i=_n(t),s=Vi(t),a=t.navigationFlags??{};return{geometryMaps:i,nodesByGeometryId:r,geometryFeatureById:s,navigationFlags:a,incomingEdgesByNodeId:n,nodesById:o,centerCalculator:Un(e?.centerStrategy)}}function Yi(t){let e=new Map,r=new Map,n=new Map;for(let o of Object.values(t.nodes??{}))for(let i of o?.features??[]){if(n.set(i.properties.id,i),i.properties.geometryIds.length>0)for(let s of i.properties.geometryIds){let a=e.get(s)??[];a.push(i.properties.id),e.set(s,a)}if(i.properties.neighbors.length>0)for(let s of i.properties.neighbors){let a=r.get(s.id);a!=null?a.push(s):r.set(s.id,[s])}}return{nodesByGeometryId:e,incomingEdgesByNodeId:r,nodesById:n}}function Vi(t){let e=new Map;for(let r of Object.values(t.geometry??{}))for(let n of r?.features??[])e.set(n.properties.id,n);return e}b();function Xn(t,e){if(!t.annotations||!t.annotationSymbols||!t.geometry)return{};let r={};for(let[n,o]of W(t.annotations)){if(!o||o.length===0||!t.geometry[n]||t.geometry[n].features.length===0)continue;let i=new Map(t.geometry[n].features.map(a=>[a.properties.id,a])),s={type:"FeatureCollection",features:[]};for(let a of o){let c=i.get(a.geometryId);if(!c||c.geometry.type!=="Point")continue;let u={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:c.geometry,properties:u})}r[n]=s}return{annotation:r}}b();b();function Te(t,e){return e&&(t.flags[e.index]&1<<e.bit)!==0}b();var yr={accessible:"accessible",outdoors:"outdoors",public:"public"};function Yn(t,{nodesByGeometryId:e}){let r={"connection.json":[],entrance:{}},n=t.navigationFlags?.[yr.accessible],o=t.navigationFlags?.[yr.outdoors],i=new Map(Object.values(t.geometry??{}).flatMap(s=>s?.features??[]).map(s=>[s.properties.id,s]));for(let s of t.connections??[]){if(vr(s,i)&&!qi(s)){let l=Wi(s,i,e,o);for(let[h,w]of l)r.entrance[h]||(r.entrance[h]={type:"FeatureCollection",features:[]}),r.entrance[h].features.push(w);continue}let a=n!=null&&s.entrances.some(l=>Te(l,n))&&s.exits.some(l=>Te(l,n)),c=Array.from(new Set([...s.entrances.map(l=>e.get(l.geometryId)),...s.exits.map(l=>e.get(l.geometryId))].flat().filter(l=>l!=null))),u=kn([...s.entrances.map(l=>l.flags),...s.exits.map(l=>l.flags)]),f={id:s.id,externalId:s.details?.externalId??"",type:s.type,accessible:a,nodes:c,flags:u};s.details?.name&&(f.details={name:s.details.name}),s.extra&&(f.extra=s.extra),r["connection.json"].push(f)}return r}function vr(t,e){return t.type==nr.door&&t.entrances.every(r=>e.get(r.geometryId)?.geometry.type==="LineString")}function qi(t){return t.entrances.length===0||t.exits.length===0?!1:new Set([...t.entrances.map(r=>r.floorId),...t.exits.map(r=>r.floorId)]).size>=2}function Wi(t,e,r,n){if(t.type!==nr.door)return[];let o=[];for(let i of t.entrances){let s=e.get(i.geometryId);if(s?.geometry.type==="LineString"){let a={type:"Feature",geometry:s.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",isExterior:Zi(t,n)}},c=t.details;c&&(a.properties.details={name:c.name,description:c.description},c.icon&&(a.properties.details.images=[{url:c.icon,altText:`${c.name} icon`}]));let u=r.get(i.geometryId);u&&u.length>0&&(a.properties.node=u[0]),o.push([i.floorId,a])}}return o}function Zi(t,e){return t.entrances.some(r=>Te(r,e))||t.exits.some(r=>Te(r,e))}b();function qn(t,{geometryMaps:e,nodesByGeometryId:r}){let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"English",code:"en"},languages:[]}},o=t.manifest?.features[0];o&&(n.venue.defaultFloor=o.properties.defaultFloor,n.venue.tzid=o.properties.tzid,n.venue.name=o.properties.name,n.venue.defaultLanguage={name:o.properties.language??"English",code:o.properties.language??"en"});let i=t.cms?.venue;i&&(n.venue={...n.venue,slug:i.slug,name:i.details?.name??n.venue.name??o.properties.name,externalId:i.details?.externalId??"",defaultLanguage:i.defaultLanguage,languages:i.languages??[],countrycode:i.countrycode,coverImage:i.coverImage,logo:i.logo,icon:i.details?.icon,extra:i.extra,mappedinWebUrl:i.mappedinWebUrl,operationHours:i.operationHours,topLocations:i.topLocations,type:i.type&&i.type in rr?i.type:"unknown",propertyImage:i.propertyImage});let s=new Map,a=t.locations??[],c=t.cms?.locations??[],u=t.cms?.categories??[],f=new Map((u??[]).map(I=>[I.categoryId,I]));if(a.length>0){let I=new Map(c.map(m=>[m.locationId,m]));for(let m of a){let y=I.get(m.id)??{};if(m){let E=m.details,S={id:y?.cmsId!==void 0?`el_${y?.cmsId}`:it(m.id),name:E.name,externalId:E.externalId??"",type:y.type??"location",sortOrder:y.sortOrder??0,amenity:y.amenity,description:E.description,extra:m.extra,links:m.links,operationHours:m.openingHours,gallery:y.gallery,logo:m.logo,shortName:E.shortName,picture:y.picture,showFloatingLabelWhenImagePresent:y.showFloatingLabelWhenImagePresent,showLogo:y.showLogo,siblingGroups:y.siblingGroups,states:y.states,tags:y.tags,spaces:[],nodes:[],polygons:[],headerImage:y.headerImage};if(m.phone&&(S.phone={number:m.phone}),y.primaryCategory){let M=f.get(y.primaryCategory);M&&(S.primaryCategory=M.id)}let v=Vn(m.social);m.website&&(v.website=m.website.url),S.social=v;for(let M of m.geometryAnchors){let A=e.space.get(M.geometryId),P=e.obstruction.get(M.geometryId),T=A??P;if(T){let _=new Set(T.features.filter(B=>B.geometry.type==="Polygon").map(B=>B.properties.id));for(let B of T.anchors)A!=null&&T===A&&S.spaces.push({floor:B.floorId,id:B.geometryId}),_.has(B.geometryId)&&S.polygons.push({map:B.floorId,id:B.geometryId})}let L=r.get(M.geometryId);for(let _ of L??[])S.nodes.push({map:M.floorId,id:_})}n.locations.push(S);for(let M of m.categories)s.set(M,[...s.get(M)??[],m.id])}}}let l=t.cms?.locationInstances??[],h=t.locationInstances;if(h){let I=new Map(l.map(y=>[y.locationInstanceId,y])),m=[];for(let y of h){let E=I.get(y.id)??{};if(y){let S={id:Ln(y.id),parent:E.parentId??it(y.parentId),name:y.details?.name,externalId:y.details?.externalId,type:E.type,sortOrder:E.sortOrder,amenity:E.amenity,description:y.details?.description,extra:y.extra,links:y.links,operationHours:y.openingHours,gallery:E.gallery,picture:E.picture,showFloatingLabelWhenImagePresent:E.showFloatingLabelWhenImagePresent,showLogo:E.showLogo,siblingGroups:E.siblingGroups,states:E.states,tags:E.tags,logo:y.logo,shortName:y.details?.shortName,headerImage:E.headerImage};y.phone&&(S.phone={number:y.phone});let v=Vn(y.social??[]);if(y.website&&(v.website=y.website.url),Object.keys(v).length>0&&(S.social=v),y.geometryAnchors?.length){let M=y.geometryAnchors.flatMap(A=>e.space.get(A.geometryId)?.anchors??[]);M.length>0&&(S.spaces=M.map(A=>({floor:A.floorId,id:A.geometryId})))}if(y.geometryAnchors){S.spaces=[],S.polygons=[],S.nodes=[];for(let M of y.geometryAnchors){let A=e.space.get(M.geometryId);if(A){let T=new Set(A.features.filter(L=>L.geometry.type==="Polygon").map(L=>L.properties.id));for(let L of A.anchors)S.spaces.push({floor:L.floorId,id:L.geometryId}),T.has(L.geometryId)&&S.polygons.push({map:L.floorId,id:L.geometryId})}let P=r.get(M.geometryId);for(let T of P??[])S.nodes.push({map:M.floorId,id:T})}}m.push(S)}}m.length>0&&(n.locationInstances=m)}let w=t.locationCategories;if(w){let I=[],m=new Map(w.map(v=>[v.id,v])),y=new Map((u??[]).map(v=>[v.categoryId,v])),E=new Map;for(let v of w){let M=m.get(v.parent);if(M){let A=E.get(M.id)??[];A.push(v.id),E.set(M.id,A)}}for(let v of w){let M=y.get(v.id);if(v){let A=(E.get(v.id)??[]).map(Lt),P={id:Lt(v.id),name:v.details.name,externalId:v.details.externalId??"",sortOrder:M?.sortOrder??0,children:A,locations:(s.get(v.id)??[]).map(it),icon:v.details.icon,picture:M?.picture,color:M?.color,extra:v.extra,iconFromDefaultList:M?.iconFromDefaultList};I.push(P)}}n.categories=I;let S={};for(let v of a)S[it(v.id)]=v.categories.map(Lt).filter(M=>M!==void 0);n.categoryPriorities=S}let p={};for(let[I,m]of Object.entries(t.defaultStyle??{}))if(m.buffer){let y=m.geometryAnchors.flatMap(E=>e.space.get(E.geometryId)?.anchors??[]);p[I]={edgeOffset:m.buffer,geometryAnchors:y}}Object.keys(p).length>0&&(n.enterpriseStyles=p);let F=new Map;for(let I of Object.values(t.cms?.layers??{}))if(I)for(let[m,y]of W(I)){if(typeof y!="string")continue;let E=F.get(y)??{name:y,id:`ely_${y}`,spaces:[]};E.spaces.push(...e.space.get(m)?.anchors.map(S=>({floorId:S.floorId,spaceId:S.geometryId}))??[]),F.set(y,E)}F.size>0&&(n.layers=Array.from(F.values()));let g=[];for(let I of Object.values(t.cms?.textures??{}))for(let m of I){let y=e.space.get(m.geometryId)?.anchors;!y||y.length<1||m.face==="unknown"||m.surface==="unknown"||g.push({repeat:m.repeat,offset:m.offset,rotation:m.rotation,path:m.path,face:m.face,surface:m.surface,bounds:m.bounds,geometryAnchors:y})}g.length>0&&(n.textures=g);let d={};for(let[I,m]of Object.entries(t.cms?.floorText??{})){let y={type:"FeatureCollection",features:[]};for(let E of m.features){if(E.properties.align==="unknown")continue;let S={align:E.properties.align,color:E.properties.color,fontFamily:E.properties.fontFamily,fontSize:E.properties.fontSize,rotation:E.properties.rotation,text:E.properties.text,visible:E.properties.visible};"geometryId"in E.properties?S.geometryId=E.properties.geometryId:S.verticalOffset=E.properties.verticalOffset,y.features.push({type:"Feature",geometry:E.geometry,properties:S})}y.features.length>0&&(d[I]=y)}Object.keys(d).length>0&&(n.floorText=d);let x={enterprise:n};if(t.cms?.textAreas){let I={};for(let[m,y]of W(t.cms.textAreas)){let E={type:"FeatureCollection",features:[]};for(let S of y.features){if(S.properties.align==="unknown")continue;let v={align:S.properties.align,maxWidth:S.properties.maxWidth,maxHeight:S.properties.maxHeight,rotation:S.properties.rotation};"geometryId"in S.properties?v.anchorId=S.properties.geometryId:v.verticalOffset=S.properties.verticalOffset;let M={type:"Feature",geometry:S.geometry,properties:v};E.features.push(M)}I[m]=E}x.textAreas=I}return x}var $i=["facebook","instagram","twitter"];function Vn(t){let e={};for(let{name:r,url:n}of t){let o=r.toLowerCase();$i.includes(o)&&(e[o]=n)}return e}b();var Hi=t=>`fc_${t.slice(3)}`;function Wn(t,{geometryMaps:e}){if(!t.facade)return{};let r={},n={};for(let[o,i]of W(t.facade))if(i)for(let s of Object.values(i)){let{floorStackId:a,geometryIds:c}=s,u=Hi(a);n[a]??={id:u,spaces:[]},n[a].spaces.push(...c.map(f=>({floorId:o,spaceId:e.space.get(f)?.ids[0]??""})))}return Object.keys(n).length>0&&(r.facade=n),r}b();function Zn(t,e={}){let r={type:"FeatureCollection",features:[]},n=[];for(let o of t.floors.features)n.push({id:o.properties.id,externalId:o.properties.details?.externalId??"",elevation:o.properties.elevation,name:o.properties.details?.name??"",shortName:o.properties.details?.shortName??"",subtitle:o.properties.subtitle,maxHeight:o.properties.maxHeight}),r.features.push({type:"Feature",geometry:o.geometry,properties:{id:o.properties.id,externalId:o.properties.details?.externalId??"",elevation:o.properties.elevation,name:o.properties.details?.name??"",shortName:o.properties.details?.shortName??"",subtitle:o.properties.subtitle,maxHeight:o.properties.maxHeight}});return{"floor.geojson":r,"map.geojson":n}}b();function $n(t,{geometryMaps:e}){let r={},n={};for(let[o,i]of W(t.floorImages??{})){let s={features:[],type:"FeatureCollection"};for(let a of i?.features??[])if("verticalOffset"in a.properties)s.features.push(a);else{let{geometryId:c,...u}=a.properties,f=e.space.get(c)?.ids[0]??e.obstruction.get(c)?.ids[0];if(!f)continue;let l={geometry:a.geometry,properties:{...u,anchorId:f},type:a.type};s.features.push(l)}n[o]=s}return Object.keys(n).length>0&&(r.floorImages=n),r}b();function Hn(t,e={}){let r=[];for(let o of t?.floorStacks??[]){let i={id:o.id,floors:o.floors,maps:o.floors,externalId:o.details?.externalId??"",name:o.details?.name??"",shortName:o.details?.shortName??"",type:"Building"};o.defaultFloor&&(i.defaultFloor=o.defaultFloor),r.push(i)}if(t.outdoors&&t.outdoors.floors.length>0){let o={id:"outdoors",floors:t.outdoors.floors,maps:t.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(o)}return{"floorstack.json":r,"mapstack.geojson":r}}b();function br(t){return t?.geometry?.type==="Polygon"}function Kn(t,{geometryMaps:e,nodesByGeometryId:r,nodesById:n,centerCalculator:o=De}){let i=es(t.defaultStyle),s={},a={},c={},u={};for(let l of ot(t.geometry)){let h=t.geometry[l];if(!h)continue;let w=[],p=[],F=[],g=[];for(let d of h.features){let x=d.properties.id,I=i.has(x),m=r.get(x)??[];for(let y of e.space.get(x)?.features??[])w.push(Jn(y,m,o));for(let y of e.obstruction.get(x)?.features??[])if(p.push(Ji(y,I,o)),e.object.has(x)){let E=r.get(x)??[],S=E.map(v=>n.get(v)).filter(v=>v!=null);for(let v of S){let M=Jn({type:"Feature",geometry:v.geometry,properties:{id:Cn(v.properties.id),kind:"desk-entrance",details:{externalId:Ot(x)}}},E,o);w.push(M)}}for(let y of e.area.get(x)?.features??[])F.push(Ki(y,m,o));for(let y of e.window.get(x)?.features??[])g.push(Qi(y))}w.length>0&&(s[l]={type:"FeatureCollection",features:w.filter(d=>d!==null)}),p.length>0&&(a[l]={type:"FeatureCollection",features:p.filter(d=>d!==null)}),F.length>0&&(c[l]={type:"FeatureCollection",features:F.filter(d=>d!==null)}),g.length>0&&(u[l]={type:"FeatureCollection",features:g.filter(d=>d!==null)})}let f={space:s,obstruction:a};return Object.keys(c).length>0&&(f.area=c),Object.keys(u).length>0&&(f.window=u),f}function Jn(t,e,r=De){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let n={type:"Feature",geometry:t.geometry,properties:{destinationNodes:e,id:t.properties.id,externalId:t.properties.details?.externalId??"",kind:t.properties.kind}};return t.properties.details&&(n.properties.details={name:t.properties.details.name,description:t.properties.details.description,images:t.properties.details.icon?[{url:t.properties.details.icon,altText:t.properties.details.name?`${t.properties.details.name} icon`:"icon"}]:void 0}),br(n)&&(n.properties.center=r(n).unwrapOr(void 0)),n}function Ji(t,e,r=De){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let n=t.properties,o={type:"Feature",geometry:t.geometry,properties:{id:n.id,externalId:n.details?.externalId??"",entrances:[],kind:n.kind,footprintComponent:e}};return br(o)&&(o.properties.center=r(o).unwrapOr(void 0)),n.details&&(o.properties.details={name:n.details.name,description:n.details.description,images:n.details.icon?[{url:n.details.icon,altText:n.details.name?`${n.details.name} icon`:"icon"}]:void 0}),o}function Ki(t,e,r=De){if(t.geometry.type!=="Polygon")return null;let n=t.properties,o={type:"Feature",geometry:t.geometry,properties:{id:n.id,externalId:n.details?.externalId??"",destinationNodes:e}};return br(o)&&(o.properties.center=r(o).unwrapOr(void 0)),n.details&&(o.properties.details={name:n.details.name,description:n.details.description,images:n.details.icon?[{url:n.details.icon,altText:n.details.name?`${n.details.name} icon`:"icon"}]:void 0}),o}function Qi(t){return t.geometry.type!=="LineString"?null:{type:"Feature",geometry:t.geometry,properties:{id:t.properties.id}}}function es(t){return new Set((t?.ExteriorWalls?.geometryAnchors??[]).map(r=>r.geometryId))}b();function Qn(t,{geometryMaps:e,geometryFeatureById:r}){if(!t.locationCategories&&!t.locations)return{};let n={};if(t.locationCategories?.length){let o=[];for(let i of t.locationCategories){let s={id:i.id,name:i.details.name,icon:i.details.icon??""};i.parent&&(s.parent=i.parent),o.push(s)}n["category.json"]=o}if(t.locations?.length){let o=ts(t,{geometryFeatureById:r}),i=[];for(let s of t.locations){let a={id:s.id,name:s.details.name,categories:s.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:s.links,openingHoursSpecification:s.openingHours??[],pictures:s.images,social:s.social,description:s.details.description,externalId:s.details.externalId,icon:s.details.icon,logo:s.logo,phone:s.phone,website:s.website,searchTags:s.searchTags};i.push(a);for(let{geometryId:c,floorId:u}of s.geometryAnchors)a.spaces.push(...e.space.get(c)?.ids.map(f=>({id:f,floor:u}))??[]),a.obstructions.push(...e.obstruction.get(c)?.ids.map(f=>({id:f,floor:u}))??[]),a.areas.push(...e.area.get(c)?.ids.map(f=>({id:f,floor:u}))??[]),a.entrances.push(...o.entrancesByGeometryId.get(c)??[]),a.connections.push(...o.connectionsByGeometryId.get(c)??[]),a.annotations.push(...o.annotationsByGeometryId.get(c)??[])}n["location.json"]=i}return n}function ts(t,{geometryFeatureById:e}){let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(t.annotations)for(let[n,o]of W(t.annotations))for(let i of o??[]){let s=i.geometryId,a=i.id,c=r.annotationsByGeometryId.get(s)??[];c.push({floor:n,id:a}),r.annotationsByGeometryId.set(s,c)}if(t.connections)for(let n of t.connections){let o=vr(n,e),i=Array.from(new Map([...n.entrances,...n.exits].map(s=>[`${s.geometryId}_${s.floorId}`,s])).values());for(let s of i){let a=s.geometryId;if(o){let c=r.entrancesByGeometryId.get(a)??[];c.push({floor:s.floorId,id:n.id}),r.entrancesByGeometryId.set(a,c)}else{let c=r.connectionsByGeometryId.get(a)??[];c.push(n.id),r.connectionsByGeometryId.set(a,c)}}}return r}b();var rs={"styles.json":["ext:mvf-default-style"],"shapes.json":null,"tileset.json":["ext:mvf-tileset"],"location.json":["ext:locations"],"category.json":["ext:locations"],"navigationFlags.json":["ext:mvf-navigation-flags"],"annotation-symbols.json":["ext:mvf-annotations"],"geometry-effects.json":null,annotation:["ext:mvf-annotations"],textAreas:["ext:cms"],enterprise:["ext:cms","ext:locations"],floorImages:["ext:floor-images"],shapeInstances:null,modelInstances:null,window:["ext:kinds"],area:["ext:kinds"],facade:["ext:facade"]};function ns(t){let e={};for(let[r,n]of Object.entries(rs))n!=null&&n.every(o=>o in t)&&(e[r.replace(_e,"")]=wn);return e}function eo(t,e){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},o=t.manifest;if(o.features.length>0){let i=o.features[0],s=i.properties,a=s.details!=null?{...s.details.externalId!=null&&{externalId:s.details.externalId}}:void 0,c={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:s.time,name:s.name,naturalBearing:s.naturalBearing,tzid:s.tzid,map:s.mapId,org_id:s.orgId,language:s.language,...a!=null&&Object.keys(a).length>0&&{details:a},...s.extensions!=null&&{extensions:ns(s.extensions)}}};r.features.push(c)}return n}b();function to(t,{geometryMaps:e,navigationFlags:r,incomingEdgesByNodeId:n}){let o={"node.geojson":{type:"FeatureCollection",features:[]}},i=o["node.geojson"].features,s=os(t),a=is(t),c=ss(t,a,s);for(let[u,f]of W(t.nodes??{}))for(let l of f?.features??[]){let h=e.space.get(l.properties.geometryIds[0])?.features[0],w=h?.geometry.type==="Point"&&h?.properties.details?.externalId?h.properties.details.externalId:"",p=n.get(l.properties.id)??[],F=Object.keys(r??{}),g=[];for(let x of p)for(let I of F)Te(x,r[I])&&g.push(r[I]);let d={type:"Feature",geometry:l.geometry,properties:{id:l.properties.id,floor:u,space:l.properties.geometryIds.map(x=>e.space.get(x)?.ids).flat().filter(x=>x!==void 0),neighbors:[...l.properties.neighbors.map(x=>({id:x.id,weight:x.extraCost})),...c.get(l.properties.id)??[]],map:u,externalId:w,flags:g.length>0?as(g):void 0}};i.push(d)}return o}function os(t){let e=new Map;for(let r of t.floors?.features??[])e.set(r.properties.id,r.properties.elevation);return e}function is(t){let e=new Map;for(let r of Object.values(t.nodes??{}))for(let n of r?.features??[])if(n.properties.geometryIds.length!==0)for(let o of n.properties.geometryIds){let i=e.get(o)??[];i.includes(n.properties.id)||(i.push(n.properties.id),e.set(o,i))}return e}function ss(t,e,r){let n=new Map;for(let o of t.connections??[]){let i=o.exits.map(s=>({...s,nodes:e.get(s.geometryId)??[]}));for(let s of o.entrances){let a=e.get(s.geometryId)??[];for(let c of a)for(let u of i){let f=Math.abs((r.get(s.floorId)??0)-(r.get(u.floorId)??0))*o.floorCostMultiplier,l=n.get(c)??[];l.push(...u.nodes.filter(h=>h!==c).map(h=>({id:h,weight:f+o.entryCost}))),n.set(c,l)}}}return n}function as(t){if(t==null||t.length===0)return;let e=new Array(Math.max(...t.map(r=>r.index))+1).fill(0);for(let r of t)e[r.index]|=1<<r.bit;return e}b();function cs(t,e){let r={};for(let n of t){let o=e.get(n);o&&(r[o]??=[],r[o].push(n))}return r}function ro(t,{geometryMaps:e}){if(!t.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let o=[...Array.from(e.space.values()).map(s=>s.features),...Array.from(e.obstruction.values()).map(s=>s.features)],i=new Map(o.flatMap(s=>s.map(a=>[a.properties.id,a.geometry.type])));for(let[s,a]of W(t.defaultStyle)){let c=cs(a.geometryAnchors.flatMap(u=>[...e.space.get(u.geometryId)?.ids??[],...e.obstruction.get(u.geometryId)?.ids??[]]),i);if(c.Point&&c.Point.length>0){let u={points:Array.from(c.Point.values()),showImage:a.extra?.showImage!==void 0?a.extra?.showImage===!0:a.opacity!==0};n[`${s}.Point`]=u}if(c.LineString&&c.LineString.length>0){let u={lineStrings:Array.from(c.LineString.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity,width:a.buffer};a.topColor!==void 0&&(u.topColor=a.topColor),n[`${s}.LineString`]=u}if(c.Polygon&&c.Polygon.length>0){let u={polygons:Array.from(c.Polygon.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity};a.extra?.showImage!==void 0&&(u.showImage=a.extra.showImage===!0),a.topColor!==void 0&&(u.topColor=a.topColor),n[`${s}.Polygon`]=u}}return r}function no(t,e){let r=jn(t,e),n=Zn(t,r),o=Kn(t,r),i=to(t,r),s=Yn(t,r),a=ro(t,r),c=Hn(t,r),u=$n(t,r),f=Wn(t,r),l=Xn(t,r),h=Qn(t,r),w=qn(t,r),p=eo(t,r);return{...t.tileset?{"tileset.json":t.tileset}:{},...t.navigationFlags?{"navigationFlags.json":t.navigationFlags}:{},...t.annotationSymbols?{"annotation-symbols.json":t.annotationSymbols}:{},...n,...o,...i,...s,...a,...c,...u,...f,...l,...h,...w,...p}}var j=t=>JSON.parse(dr(t)),us=/^geometry\/(.+)\.geojson$/,ls=/^nodes\/(.+)\.(geo)?json$/,fs=/^floorImages\/(.+)\.geojson$/,ds=/^facade\/(.+)\.json$/,ps=/^walkable\/(.+)\.json$/,hs=/^nonwalkable\/(.+)\.json$/,gs=/^kinds\/(.+)\.json$/,ms=/^annotations\/(.+)\.json$/,ys=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,vs=[(t,e)=>t==="manifest.geojson"?{manifest:j(e)}:void 0,(t,e)=>t==="floors.geojson"?{floors:j(e)}:void 0,(t,e)=>{let r=t.match(us);return r?{geometry:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="connections.json"?{connections:j(e)}:void 0,(t,e)=>t==="navigationFlags.json"?{navigationFlags:j(e)}:void 0,(t,e)=>{let r=t.match(ls);return r?{nodes:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="default-style.json"?{defaultStyle:j(e)}:void 0,(t,e)=>t==="floor-stacks.json"?{floorStacks:j(e)}:void 0,(t,e)=>t==="outdoors.json"?{outdoors:j(e)}:void 0,(t,e)=>t==="tileset.json"?{tileset:j(e)}:void 0,(t,e)=>{let r=t.match(fs);return r?{floorImages:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(ds);return r?{facade:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(ps);return r?{walkable:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(hs);return r?{nonwalkable:{[r[1]]:j(e)}}:void 0},(t,e)=>{let r=t.match(gs);return r?{kinds:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="annotation-symbols.json"?{annotationSymbols:j(e)}:void 0,(t,e)=>{let r=t.match(ms);return r?{annotations:{[r[1]]:j(e)}}:void 0},(t,e)=>t==="locations.json"?{locations:j(e)}:void 0,(t,e)=>t==="location-categories.json"?{locationCategories:j(e)}:void 0,(t,e)=>t==="location-instances.json"?{locationInstances:j(e)}:void 0,(t,e)=>{let r=t.match(ys);if(!r)return;let[,n,o]=r;return n==="floorText"||n==="textures"||n==="textAreas"?{cms:{[n]:{[o]:j(e)}}}:{cms:{[o]:j(e)}}}],bs=new Set(Mt),xs=new Set(At),ws=new Set($e),Es=new Set(Je),Is=new Set(He),Ss=new Set(Ke),Ms=new Set(Qe),As=new Set(et),Ps=new Set(tt);function Me(t,e){return typeof t=="string"&&e.has(t)?t:"unknown"}function Fs(t){let e=t.connections;if(Array.isArray(e))for(let a of e)a&&typeof a=="object"&&"type"in a&&(a.type=Me(a.type,bs));let r=t.kinds;if(r&&typeof r=="object"){for(let a of Object.values(r))if(a&&typeof a=="object"){let c=a;for(let u of Object.keys(c))c[u]=Me(c[u],xs)}}let n=t.cms;if(!n||typeof n!="object")return;let o=n,i=o.locations;if(Array.isArray(i))for(let a of i){if(!a||typeof a!="object")continue;let c=a;if("type"in c&&(c.type=Me(c.type,ws)),Array.isArray(c.states))for(let u of c.states)u&&typeof u=="object"&&"type"in u&&(u.type=Me(u.type,Es));if(Array.isArray(c.siblingGroups))for(let u of c.siblingGroups)u&&typeof u=="object"&&"type"in u&&(u.type=Me(u.type,Is))}for(let a of["floorText","textAreas"]){let c=a==="floorText"?Ss:Ms,u=o[a];if(!(!u||typeof u!="object"))for(let f of Object.values(u)){if(!f||typeof f!="object")continue;let l=f.features;if(Array.isArray(l))for(let h of l){if(!h||typeof h!="object")continue;let w=h.properties;w&&typeof w=="object"&&"alignment"in w&&(w.alignment=Me(w.alignment,c))}}}let s=o.textures;if(s&&typeof s=="object"){for(let a of Object.values(s))if(Array.isArray(a))for(let c of a){if(!c||typeof c!="object")continue;let u=c;"face"in u&&(u.face=Me(u.face,As)),"surface"in u&&(u.surface=Me(u.surface,Ps))}}}function Ns(t){let e=Tn(t),r={};for(let n of Object.keys(e))for(let o of vs){let i=o(n,e[n]);if(i){r=Ze(r,i,[]);break}}return Fs(r),r}function _t(t){try{return ue(Ns(t))}catch(e){return Ie(e instanceof Error?e:new Error(String(e)))}}var Ts={decompressUnsafeSync:t=>_t(t),decompressUnsafe:t=>Promise.resolve(_t(t)),decompressSync:t=>_t(t),decompress:t=>Promise.resolve(_t(t))};var xr=class{groupBy;graph;geometryEdgesByMapId=new Map;flagDeclarations={};getDoorByNodeId;nonPublicNodeIds;outdoorNodeIds;indoorPathWeight;outdoorPathWeight;constructor({nodes:e,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o,flagDeclarations:i,getDoorByNodeId:s}){this.groupBy=n,this.graph=new wt({nodes:e,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o});let a=r?.features||[];this.flagDeclarations=i??{},this.getDoorByNodeId=s,this.nonPublicNodeIds=this.getNonPublicNodeIds(),this.outdoorNodeIds=this.getOutdoorNodeIds(),this.indoorPathWeight=this.getDominantPathWeight(!1),this.outdoorPathWeight=this.getDominantPathWeight(!0),a.forEach(c=>{let u=null;if(c.geometry.type==="LineString"?u=c.geometry.coordinates:c.geometry.type==="Polygon"&&(u=c.geometry.coordinates.flat()),u){let f=this.groupBy==="default"?this.groupBy:c.properties[this.groupBy];this.geometryEdgesByMapId.has(f)||this.geometryEdgesByMapId.set(f,[]);let l=this.geometryEdgesByMapId.get(f),h=c.geometry.type==="LineString"&&u.length<=2;u.forEach((w,p)=>{h&&p+1>=u.length||l.push([w,u[p+1]||u[0]])})}})}getNonPublicNodeIds(){let e=new Set;if(Ce.public in this.flagDeclarations)for(let r in this.graph.nodesById)qe(this.graph.nodesById[r].properties.flags,this.flagDeclarations[Ce.public].index,this.flagDeclarations[Ce.public].bit)||e.add(r);return e}getOutdoorNodeIds(){let e=new Set;if(Ce.outdoors in this.flagDeclarations){let r=this.flagDeclarations[Ce.outdoors];for(let n in this.graph.nodesById)qe(this.graph.nodesById[n].properties.flags,r.index,r.bit)&&e.add(n)}return e}getDominantPathWeight(e){let r=new Map;for(let i in this.graph.edges)if(this.outdoorNodeIds.has(i)===e)for(let s of this.graph.edges[i])D(s.origin)===D(s.destination)&&this.outdoorNodeIds.has(s.destination.properties.id)===e&&r.set(s.pathWeight,(r.get(s.pathWeight)??0)+1);let n=0,o=0;for(let[i,s]of r)s>o&&(n=i,o=s);return n}getDirections({zones:e,originIds:r,from:n,to:o,destinationNodeIds:i,disabledConnectionNodeIds:s,simplify:a,multiplicativeDistanceWeightScaling:c,overrideEdgeWeights:u,includeNonPublic:f,outdoorPathWeightMultiplier:l}){let h=a?.enabled??!0,w=e??[],p=this.graph.aStar({originIds:r,destinationNodeIds:i,zones:w,disabledConnectionNodeIds:new Set(s),overrideEdgeWeights:u,disabledNodeIds:f?void 0:this.nonPublicNodeIds,outdoorNodeIds:this.outdoorNodeIds,indoorPathWeight:this.indoorPathWeight,outdoorPathWeight:this.outdoorPathWeight,outdoorPathWeightMultiplier:l});if(p.length===0)return{type:"FeatureCollection",features:[]};if(a?.method!=="greedy-los"&&n&&o&&n.length===1&&o.length===1){let F=new ne({origin:n[0],destination:p[0].origin,distance:re(n[0].geometry.coordinates,p[0].origin.geometry.coordinates),angle:q(n[0].geometry.coordinates,p[0].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:c}),g=p.slice(),d=new ne({origin:p[p.length-1].destination,destination:o[0],distance:re(p[p.length-1].destination.geometry.coordinates,o[0].geometry.coordinates),angle:q(p[p.length-1].destination.geometry.coordinates,o[0].geometry.coordinates),multiplicativeDistanceWeightScaling:c});g.unshift(F),g.push(d),p=g}return h&&(p=this.simplifyAllSteps(p,a,c)),this.generatePath(p)}generatePath=e=>{let{destination:r}=e[e.length-1],n={type:"FeatureCollection",features:[]};for(let i=0;i<e.length;i++){let{origin:s,destination:a}=e[i],c={id:s.properties.id,angle:e[i].angle,distance:e[i].distance,destination:a.properties.id,edges:this.graph.edges[s.properties.id]};this.groupBy!=="default"&&(c.groupBy=s.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:c})}let o={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(o.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:o}),n};simplifyAllSteps(e,r={enabled:!0,method:"greedy-los"},n){let o=[],i=[e[0]],s=r.method??"greedy-los",a=r.radius??Ve,c=s==="dp-optimal"?this.simplifyStepsWithDPMethod.bind(this):s==="rdp"?this.simplifyStepsImprovedWithSimplifyBeforeLoSChecks.bind(this):this.simplifySteps.bind(this);for(let h=1;h<e.length;h++)if(this.groupBy!=="default"&&e[h].origin.properties[this.groupBy]!==e[h-1].origin.properties[this.groupBy]){let w=e[h-1].origin.properties[this.groupBy],p=this.geometryEdgesByMapId.get(w)??[];o.push(...c(i,p,a,n,r)),i=[e[h]]}else i.push(e[h]);let u=e[e.length-1],f=this.groupBy==="default"?this.groupBy:u.origin.properties[this.groupBy],l=this.geometryEdgesByMapId.get(f)??[];return o.push(...c(i,l,a,n,r)),o}findNearestNodesOnGraph=(e,r,n,o,i=!1,s=1/0,a,c)=>this.graph.dijkstraFindWithinTravelDistance(e,r,o,this.geometryEdgesByMapId.get(n)??[],i,s,a,c);hasLineOfSight=(e,r,n,o)=>this.graph.hasLineOfSight(e,r,this.geometryEdgesByMapId.get(n),o);simplifySteps(e,r,n,o,i){return yn(e,r,n,this.flagDeclarations,o)}simplifyStepsImprovedWithSimplifyBeforeLoSChecks(e,r,n,o,i){if(e.length<3)return e;!1,e=gn(e,this.getDoorByNodeId,o,r);let s=i?.method==="rdp"?i.includeDoorBufferNodes??!0:!0;return mn(e,r,o,s)}simplifyStepsWithDPMethod(e,r,n,o,i){if(e.length<3)return e;let s=new Set;(i?.method==="dp-optimal"?i.includeDoorBufferNodes??!1:!1)&&(s=bn(e,this.getDoorByNodeId));for(let f=0;f<e.length-1;f++){let l=D(e[f].origin),h=D(e[f+1].origin);l!==h&&(e[f].origin.properties.preventSmoothing||(e[f].origin.properties.preventSmoothing=!0,s.add(e[f].origin.properties.id)),e[f+1].origin.properties.preventSmoothing||(e[f+1].origin.properties.preventSmoothing=!0,s.add(e[f+1].origin.properties.id)))}let c=e[e.length-1];D(c.origin)!==D(c.destination)&&(c.origin.properties.preventSmoothing||(c.origin.properties.preventSmoothing=!0,s.add(c.origin.properties.id))),!1;let u=fn(e,r,o,n);if(!1){let f=u[u.length-1];window.__DEBUG_PATH.finalSteps.push({nodeId:f.destination.properties.id,coordinate:f.destination.geometry.coordinates,floorId:f.destination.properties.map})}for(let f of e)s.has(f.origin.properties.id)&&delete f.origin.properties.preventSmoothing,s.has(f.destination.properties.id)&&delete f.destination.properties.preventSmoothing;return u}getDistance=(e,r)=>re(e,r);getAngle=(e,r)=>q(e,r)};b();b();b();b();function Os(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=ht(t),o=Jr(e),i=o.type,s=e.bbox,a=o.coordinates;if(s&&Ls(n,s)===!1)return!1;i==="Polygon"&&(a=[a]);for(var c=!1,u=0;u<a.length&&!c;u++)if(oo(n,a[u][0],r.ignoreBoundary)){for(var f=!1,l=1;l<a[u].length&&!f;)oo(n,a[u][l],!r.ignoreBoundary)&&(f=!0),l++;f||(c=!0)}return c}function oo(t,e,r){var n=!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 o=0,i=e.length-1;o<e.length;i=o++){var s=e[o][0],a=e[o][1],c=e[i][0],u=e[i][1],f=t[1]*(s-c)+a*(c-t[0])+u*(t[0]-s)===0&&(s-t[0])*(c-t[0])<=0&&(a-t[1])*(u-t[1])<=0;if(f)return!r;var l=a>t[1]!=u>t[1]&&t[0]<(c-s)*(t[1]-a)/(u-a)+s;l&&(n=!n)}return n}function Ls(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}b();b();function Cs(t){if(!t)throw new Error("geojson is required");var e=[];return qr(t,function(r){_s(r,e)}),Xe(e)}function _s(t,e){var r=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":r=Ne(n);break;case"LineString":r=[Ne(n)]}r.forEach(function(o){var i=ks(o,t.properties);i.forEach(function(s){s.id=e.length,e.push(s)})})}}function ks(t,e){var r=[];return t.reduce(function(n,o){var i=Yr([n,o],e);return i.bbox=Bs(n,o),r.push(i),o}),r}function Bs(t,e){var r=t[0],n=t[1],o=e[0],i=e[1],s=r<o?r:o,a=n<i?n:i,c=r>o?r:o,u=n>i?n:i;return[s,a,c,u]}var wr=Cs;var Bo=ut(_o(),1);function ka(t,e){var r={},n=[];if(t.type==="LineString"&&(t=Xt(t)),e.type==="LineString"&&(e=Xt(e)),t.type==="Feature"&&e.type==="Feature"&&t.geometry!==null&&e.geometry!==null&&t.geometry.type==="LineString"&&e.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var o=ko(t,e);return o&&n.push(o),Xe(n)}var i=(0,Bo.default)();return i.load(wr(e)),Vt(wr(t),function(s){Vt(i.search(s),function(a){var c=ko(s,a);if(c){var u=Ne(c).join(",");r[u]||(r[u]=!0,n.push(c))}})}),Xe(n)}function ko(t,e){var r=Ne(t),n=Ne(e);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],i=r[0][1],s=r[1][0],a=r[1][1],c=n[0][0],u=n[0][1],f=n[1][0],l=n[1][1],h=(l-u)*(s-o)-(f-c)*(a-i),w=(f-c)*(i-u)-(l-u)*(o-c),p=(s-o)*(i-u)-(a-i)*(o-c);if(h===0)return null;var F=w/h,g=p/h;if(F>=0&&F<=1&&g>=0&&g<=1){var d=o+F*(s-o),x=i+F*(a-i);return lt([d,x])}return null}var Dp=ka;export{Ze as a,ri as b,Tn as c,Dn as d,no as e,Ts as f,ht as g,Ne as h,Jr as i,sc as j,gt as k,Dp as l,Go as m,Uo as n,Va as o,me as p,qa as q,Wa as r,Za as s,re as t,qt as u,dt as v,$a as w,Os as x,er as y,xr as z};
|