@mappedin/mappedin-js 6.31.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.
@@ -0,0 +1,2 @@
1
+ import{a as $n,b as ko,c as Co,d as Ws,e as Jn,f as jo,g as Le,h as tt,i as Lo,j as qn,k as Vo,l as Zn,o as er,s as tr,t as Ve,v as or,x as It,z as nr}from"./chunk-IMDMEZEU.js";import{B as Qn,C as Kn,D as ot,a as y,b as T,g as A,h as $,i as Ut,j as Un,l as Wn,m as Q,p as et,q as zn,r as ht,u as Xn,v as Hn,x as Yn,y as Ne}from"./chunk-XBKEAHSJ.js";import{b as Us,d as Gn}from"./chunk-PWEV3AFA.js";var Sr=Us((rn,sn)=>{y();(function(o,e){typeof rn=="object"&&typeof sn<"u"?sn.exports=e():typeof define=="function"&&define.amd?define(e):(o=typeof globalThis<"u"?globalThis:o||self,o.polygonClipping=e())})(rn,(function(){"use strict";function o(M,d){var p={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},g,h,m,S;return S={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function v(B){return function(D){return _([B,D])}}function _(B){if(g)throw new TypeError("Generator is already executing.");for(;p;)try{if(g=1,h&&(m=B[0]&2?h.return:B[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,B[1])).done)return m;switch(h=0,m&&(B=[B[0]&2,m.value]),B[0]){case 0:case 1:m=B;break;case 4:return p.label++,{value:B[1],done:!1};case 5:p.label++,h=B[1],B=[0];continue;case 7:B=p.ops.pop(),p.trys.pop();continue;default:if(m=p.trys,!(m=m.length>0&&m[m.length-1])&&(B[0]===6||B[0]===2)){p=0;continue}if(B[0]===3&&(!m||B[1]>m[0]&&B[1]<m[3])){p.label=B[1];break}if(B[0]===6&&p.label<m[1]){p.label=m[1],m=B;break}if(m&&p.label<m[2]){p.label=m[2],p.ops.push(B);break}m[2]&&p.ops.pop(),p.trys.pop();continue}B=d.call(M,p)}catch(D){B=[6,D],h=0}finally{g=m=0}if(B[0]&5)throw B[1];return{value:B[0]?B[1]:void 0,done:!0}}}var e=(function(){function M(d,p){this.next=null,this.key=d,this.data=p,this.left=null,this.right=null}return M})();function t(M,d){return M>d?1:M<d?-1:0}function n(M,d,p){for(var g=new e(null,null),h=g,m=g;;){var S=p(M,d.key);if(S<0){if(d.left===null)break;if(p(M,d.left.key)<0){var v=d.left;if(d.left=v.right,v.right=d,d=v,d.left===null)break}m.left=d,m=d,d=d.left}else if(S>0){if(d.right===null)break;if(p(M,d.right.key)>0){var v=d.right;if(d.right=v.left,v.left=d,d=v,d.right===null)break}h.right=d,h=d,d=d.right}else break}return h.right=d.left,m.left=d.right,d.left=g.right,d.right=g.left,d}function r(M,d,p,g){var h=new e(M,d);if(p===null)return h.left=h.right=null,h;p=n(M,p,g);var m=g(M,p.key);return m<0?(h.left=p.left,h.right=p,p.left=null):m>=0&&(h.right=p.right,h.left=p,p.right=null),h}function i(M,d,p){var g=null,h=null;if(d){d=n(M,d,p);var m=p(d.key,M);m===0?(g=d.left,h=d.right):m<0?(h=d.right,d.right=null,g=d):(g=d.left,d.left=null,h=d)}return{left:g,right:h}}function s(M,d,p){return d===null?M:(M===null||(d=n(M.key,d,p),d.left=M),d)}function a(M,d,p,g,h){if(M){g(""+d+(p?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+h(M)+`
2
+ `);var m=d+(p?" ":"\u2502 ");M.left&&a(M.left,m,!1,g,h),M.right&&a(M.right,m,!0,g,h)}}var c=(function(){function M(d){d===void 0&&(d=t),this._root=null,this._size=0,this._comparator=d}return M.prototype.insert=function(d,p){return this._size++,this._root=r(d,p,this._root,this._comparator)},M.prototype.add=function(d,p){var g=new e(d,p);this._root===null&&(g.left=g.right=null,this._size++,this._root=g);var h=this._comparator,m=n(d,this._root,h),S=h(d,m.key);return S===0?this._root=m:(S<0?(g.left=m.left,g.right=m,m.left=null):S>0&&(g.right=m.right,g.left=m,m.right=null),this._size++,this._root=g),this._root},M.prototype.remove=function(d){this._root=this._remove(d,this._root,this._comparator)},M.prototype._remove=function(d,p,g){var h;if(p===null)return null;p=n(d,p,g);var m=g(d,p.key);return m===0?(p.left===null?h=p.right:(h=n(d,p.left,g),h.right=p.right),this._size--,h):p},M.prototype.pop=function(){var d=this._root;if(d){for(;d.left;)d=d.left;return this._root=n(d.key,this._root,this._comparator),this._root=this._remove(d.key,this._root,this._comparator),{key:d.key,data:d.data}}return null},M.prototype.findStatic=function(d){for(var p=this._root,g=this._comparator;p;){var h=g(d,p.key);if(h===0)return p;h<0?p=p.left:p=p.right}return null},M.prototype.find=function(d){return this._root&&(this._root=n(d,this._root,this._comparator),this._comparator(d,this._root.key)!==0)?null:this._root},M.prototype.contains=function(d){for(var p=this._root,g=this._comparator;p;){var h=g(d,p.key);if(h===0)return!0;h<0?p=p.left:p=p.right}return!1},M.prototype.forEach=function(d,p){for(var g=this._root,h=[],m=!1;!m;)g!==null?(h.push(g),g=g.left):h.length!==0?(g=h.pop(),d.call(p,g),g=g.right):m=!0;return this},M.prototype.range=function(d,p,g,h){for(var m=[],S=this._comparator,v=this._root,_;m.length!==0||v;)if(v)m.push(v),v=v.left;else{if(v=m.pop(),_=S(v.key,p),_>0)break;if(S(v.key,d)>=0&&g.call(h,v))return this;v=v.right}return this},M.prototype.keys=function(){var d=[];return this.forEach(function(p){var g=p.key;return d.push(g)}),d},M.prototype.values=function(){var d=[];return this.forEach(function(p){var g=p.data;return d.push(g)}),d},M.prototype.min=function(){return this._root?this.minNode(this._root).key:null},M.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},M.prototype.minNode=function(d){if(d===void 0&&(d=this._root),d)for(;d.left;)d=d.left;return d},M.prototype.maxNode=function(d){if(d===void 0&&(d=this._root),d)for(;d.right;)d=d.right;return d},M.prototype.at=function(d){for(var p=this._root,g=!1,h=0,m=[];!g;)if(p)m.push(p),p=p.left;else if(m.length>0){if(p=m.pop(),h===d)return p;h++,p=p.right}else g=!0;return null},M.prototype.next=function(d){var p=this._root,g=null;if(d.right){for(g=d.right;g.left;)g=g.left;return g}for(var h=this._comparator;p;){var m=h(d.key,p.key);if(m===0)break;m<0?(g=p,p=p.left):p=p.right}return g},M.prototype.prev=function(d){var p=this._root,g=null;if(d.left!==null){for(g=d.left;g.right;)g=g.right;return g}for(var h=this._comparator;p;){var m=h(d.key,p.key);if(m===0)break;m<0?p=p.left:(g=p,p=p.right)}return g},M.prototype.clear=function(){return this._root=null,this._size=0,this},M.prototype.toList=function(){return f(this._root)},M.prototype.load=function(d,p,g){p===void 0&&(p=[]),g===void 0&&(g=!1);var h=d.length,m=this._comparator;if(g&&R(d,p,0,h-1,m),this._root===null)this._root=l(d,p,0,h),this._size=h;else{var S=b(this.toList(),u(d,p),m);h=this._size+h,this._root=I({head:S},0,h)}return this},M.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(M.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),M.prototype.toString=function(d){d===void 0&&(d=function(g){return String(g.key)});var p=[];return a(this._root,"",!0,function(g){return p.push(g)},d),p.join("")},M.prototype.update=function(d,p,g){var h=this._comparator,m=i(d,this._root,h),S=m.left,v=m.right;h(d,p)<0?v=r(p,g,v,h):S=r(p,g,S,h),this._root=s(S,v,h)},M.prototype.split=function(d){return i(d,this._root,this._comparator)},M.prototype[Symbol.iterator]=function(){var d,p,g;return o(this,function(h){switch(h.label){case 0:d=this._root,p=[],g=!1,h.label=1;case 1:return g?[3,6]:d===null?[3,2]:(p.push(d),d=d.left,[3,5]);case 2:return p.length===0?[3,4]:(d=p.pop(),[4,d]);case 3:return h.sent(),d=d.right,[3,5];case 4:g=!0,h.label=5;case 5:return[3,1];case 6:return[2]}})},M})();function l(M,d,p,g){var h=g-p;if(h>0){var m=p+Math.floor(h/2),S=M[m],v=d[m],_=new e(S,v);return _.left=l(M,d,p,m),_.right=l(M,d,m+1,g),_}return null}function u(M,d){for(var p=new e(null,null),g=p,h=0;h<M.length;h++)g=g.next=new e(M[h],d[h]);return g.next=null,p.next}function f(M){for(var d=M,p=[],g=!1,h=new e(null,null),m=h;!g;)d?(p.push(d),d=d.left):p.length>0?(d=m=m.next=p.pop(),d=d.right):g=!0;return m.next=null,h.next}function I(M,d,p){var g=p-d;if(g>0){var h=d+Math.floor(g/2),m=I(M,d,h),S=M.head;return S.left=m,M.head=M.head.next,S.right=I(M,h+1,p),S}return null}function b(M,d,p){for(var g=new e(null,null),h=g,m=M,S=d;m!==null&&S!==null;)p(m.key,S.key)<0?(h.next=m,m=m.next):(h.next=S,S=S.next),h=h.next;return m!==null?h.next=m:S!==null&&(h.next=S),g.next}function R(M,d,p,g,h){if(!(p>=g)){for(var m=M[p+g>>1],S=p-1,v=g+1;;){do S++;while(h(M[S],m)<0);do v--;while(h(M[v],m)>0);if(S>=v)break;var _=M[S];M[S]=M[v],M[v]=_,_=d[S],d[S]=d[v],d[v]=_}R(M,d,p,v,h),R(M,d,v+1,g,h)}}let E=(M,d)=>M.ll.x<=d.x&&d.x<=M.ur.x&&M.ll.y<=d.y&&d.y<=M.ur.y,x=(M,d)=>{if(d.ur.x<M.ll.x||M.ur.x<d.ll.x||d.ur.y<M.ll.y||M.ur.y<d.ll.y)return null;let p=M.ll.x<d.ll.x?d.ll.x:M.ll.x,g=M.ur.x<d.ur.x?M.ur.x:d.ur.x,h=M.ll.y<d.ll.y?d.ll.y:M.ll.y,m=M.ur.y<d.ur.y?M.ur.y:d.ur.y;return{ll:{x:p,y:h},ur:{x:g,y:m}}},O=Number.EPSILON;O===void 0&&(O=Math.pow(2,-52));let k=O*O,w=(M,d)=>{if(-O<M&&M<O&&-O<d&&d<O)return 0;let p=M-d;return p*p<k*M*d?0:M<d?-1:1};class U{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(d,p){return{x:this.xRounder.round(d),y:this.yRounder.round(p)}}}class V{constructor(){this.tree=new c,this.round(0)}round(d){let p=this.tree.add(d),g=this.tree.prev(p);if(g!==null&&w(p.key,g.key)===0)return this.tree.remove(d),g.key;let h=this.tree.next(p);return h!==null&&w(p.key,h.key)===0?(this.tree.remove(d),h.key):d}}let z=new U,fe=11102230246251565e-32,q=134217729,gt=(3+8*fe)*fe;function yt(M,d,p,g,h){let m,S,v,_,B=d[0],D=g[0],F=0,N=0;D>B==D>-B?(m=B,B=d[++F]):(m=D,D=g[++N]);let P=0;if(F<M&&N<p)for(D>B==D>-B?(S=B+m,v=m-(S-B),B=d[++F]):(S=D+m,v=m-(S-D),D=g[++N]),m=S,v!==0&&(h[P++]=v);F<M&&N<p;)D>B==D>-B?(S=m+B,_=S-m,v=m-(S-_)+(B-_),B=d[++F]):(S=m+D,_=S-m,v=m-(S-_)+(D-_),D=g[++N]),m=S,v!==0&&(h[P++]=v);for(;F<M;)S=m+B,_=S-m,v=m-(S-_)+(B-_),B=d[++F],m=S,v!==0&&(h[P++]=v);for(;N<p;)S=m+D,_=S-m,v=m-(S-_)+(D-_),D=g[++N],m=S,v!==0&&(h[P++]=v);return(m!==0||P===0)&&(h[P++]=m),P}function Mo(M,d){let p=d[0];for(let g=1;g<M;g++)p+=d[g];return p}function He(M){return new Float64Array(M)}let Fo=(3+16*fe)*fe,vo=(2+12*fe)*fe,To=(9+64*fe)*fe*fe,Ce=He(4),Ot=He(8),Pt=He(12),Dt=He(16),ne=He(4);function Ro(M,d,p,g,h,m,S){let v,_,B,D,F,N,P,j,C,G,L,J,re,H,ie,se,be,ae,Me=M-h,Fe=p-h,ve=d-m,Te=g-m;H=Me*Te,N=q*Me,P=N-(N-Me),j=Me-P,N=q*Te,C=N-(N-Te),G=Te-C,ie=j*G-(H-P*C-j*C-P*G),se=ve*Fe,N=q*ve,P=N-(N-ve),j=ve-P,N=q*Fe,C=N-(N-Fe),G=Fe-C,be=j*G-(se-P*C-j*C-P*G),L=ie-be,F=ie-L,Ce[0]=ie-(L+F)+(F-be),J=H+L,F=J-H,re=H-(J-F)+(L-F),L=re-se,F=re-L,Ce[1]=re-(L+F)+(F-se),ae=J+L,F=ae-J,Ce[2]=J-(ae-F)+(L-F),Ce[3]=ae;let we=Mo(4,Ce),mt=vo*S;if(we>=mt||-we>=mt||(F=M-Me,v=M-(Me+F)+(F-h),F=p-Fe,B=p-(Fe+F)+(F-h),F=d-ve,_=d-(ve+F)+(F-m),F=g-Te,D=g-(Te+F)+(F-m),v===0&&_===0&&B===0&&D===0)||(mt=To*S+gt*Math.abs(we),we+=Me*D+Te*v-(ve*B+Fe*_),we>=mt||-we>=mt))return we;H=v*Te,N=q*v,P=N-(N-v),j=v-P,N=q*Te,C=N-(N-Te),G=Te-C,ie=j*G-(H-P*C-j*C-P*G),se=_*Fe,N=q*_,P=N-(N-_),j=_-P,N=q*Fe,C=N-(N-Fe),G=Fe-C,be=j*G-(se-P*C-j*C-P*G),L=ie-be,F=ie-L,ne[0]=ie-(L+F)+(F-be),J=H+L,F=J-H,re=H-(J-F)+(L-F),L=re-se,F=re-L,ne[1]=re-(L+F)+(F-se),ae=J+L,F=ae-J,ne[2]=J-(ae-F)+(L-F),ne[3]=ae;let Ls=yt(4,Ce,4,ne,Ot);H=Me*D,N=q*Me,P=N-(N-Me),j=Me-P,N=q*D,C=N-(N-D),G=D-C,ie=j*G-(H-P*C-j*C-P*G),se=ve*B,N=q*ve,P=N-(N-ve),j=ve-P,N=q*B,C=N-(N-B),G=B-C,be=j*G-(se-P*C-j*C-P*G),L=ie-be,F=ie-L,ne[0]=ie-(L+F)+(F-be),J=H+L,F=J-H,re=H-(J-F)+(L-F),L=re-se,F=re-L,ne[1]=re-(L+F)+(F-se),ae=J+L,F=ae-J,ne[2]=J-(ae-F)+(L-F),ne[3]=ae;let Vs=yt(Ls,Ot,4,ne,Pt);H=v*D,N=q*v,P=N-(N-v),j=v-P,N=q*D,C=N-(N-D),G=D-C,ie=j*G-(H-P*C-j*C-P*G),se=_*B,N=q*_,P=N-(N-_),j=_-P,N=q*B,C=N-(N-B),G=B-C,be=j*G-(se-P*C-j*C-P*G),L=ie-be,F=ie-L,ne[0]=ie-(L+F)+(F-be),J=H+L,F=J-H,re=H-(J-F)+(L-F),L=re-se,F=re-L,ne[1]=re-(L+F)+(F-se),ae=J+L,F=ae-J,ne[2]=J-(ae-F)+(L-F),ne[3]=ae;let Gs=yt(Vs,Pt,4,ne,Dt);return Dt[Gs-1]}function So(M,d,p,g,h,m){let S=(d-m)*(p-h),v=(M-h)*(g-m),_=S-v,B=Math.abs(S+v);return Math.abs(_)>=Fo*B?_:-Ro(M,d,p,g,h,m,B)}let Qe=(M,d)=>M.x*d.y-M.y*d.x,wt=(M,d)=>M.x*d.x+M.y*d.y,At=(M,d,p)=>{let g=So(M.x,M.y,d.x,d.y,p.x,p.y);return g>0?-1:g<0?1:0},Ke=M=>Math.sqrt(wt(M,M)),Bo=(M,d,p)=>{let g={x:d.x-M.x,y:d.y-M.y},h={x:p.x-M.x,y:p.y-M.y};return Qe(h,g)/Ke(h)/Ke(g)},Eo=(M,d,p)=>{let g={x:d.x-M.x,y:d.y-M.y},h={x:p.x-M.x,y:p.y-M.y};return wt(h,g)/Ke(h)/Ke(g)},kt=(M,d,p)=>d.y===0?null:{x:M.x+d.x/d.y*(p-M.y),y:p},Ct=(M,d,p)=>d.x===0?null:{x:p,y:M.y+d.y/d.x*(p-M.x)},jt=(M,d,p,g)=>{if(d.x===0)return Ct(p,g,M.x);if(g.x===0)return Ct(M,d,p.x);if(d.y===0)return kt(p,g,M.y);if(g.y===0)return kt(M,d,p.y);let h=Qe(d,g);if(h==0)return null;let m={x:p.x-M.x,y:p.y-M.y},S=Qe(m,d)/h,v=Qe(m,g)/h,_=M.x+v*d.x,B=p.x+S*g.x,D=M.y+v*d.y,F=p.y+S*g.y,N=(_+B)/2,P=(D+F)/2;return{x:N,y:P}};class ge{static compare(d,p){let g=ge.comparePoints(d.point,p.point);return g!==0?g:(d.point!==p.point&&d.link(p),d.isLeft!==p.isLeft?d.isLeft?1:-1:_e.compare(d.segment,p.segment))}static comparePoints(d,p){return d.x<p.x?-1:d.x>p.x?1:d.y<p.y?-1:d.y>p.y?1:0}constructor(d,p){d.events===void 0?d.events=[this]:d.events.push(this),this.point=d,this.isLeft=p}link(d){if(d.point===this.point)throw new Error("Tried to link already linked events");let p=d.point.events;for(let g=0,h=p.length;g<h;g++){let m=p[g];this.point.events.push(m),m.point=this.point}this.checkForConsuming()}checkForConsuming(){let d=this.point.events.length;for(let p=0;p<d;p++){let g=this.point.events[p];if(g.segment.consumedBy===void 0)for(let h=p+1;h<d;h++){let m=this.point.events[h];m.consumedBy===void 0&&g.otherSE.point.events===m.otherSE.point.events&&g.segment.consume(m.segment)}}}getAvailableLinkedEvents(){let d=[];for(let p=0,g=this.point.events.length;p<g;p++){let h=this.point.events[p];h!==this&&!h.segment.ringOut&&h.segment.isInResult()&&d.push(h)}return d}getLeftmostComparator(d){let p=new Map,g=h=>{let m=h.otherSE;p.set(h,{sine:Bo(this.point,d.point,m.point),cosine:Eo(this.point,d.point,m.point)})};return(h,m)=>{p.has(h)||g(h),p.has(m)||g(m);let{sine:S,cosine:v}=p.get(h),{sine:_,cosine:B}=p.get(m);return S>=0&&_>=0?v<B?1:v>B?-1:0:S<0&&_<0?v<B?-1:v>B?1:0:_<S?-1:_>S?1:0}}}let _o=0;class _e{static compare(d,p){let g=d.leftSE.point.x,h=p.leftSE.point.x,m=d.rightSE.point.x,S=p.rightSE.point.x;if(S<g)return 1;if(m<h)return-1;let v=d.leftSE.point.y,_=p.leftSE.point.y,B=d.rightSE.point.y,D=p.rightSE.point.y;if(g<h){if(_<v&&_<B)return 1;if(_>v&&_>B)return-1;let F=d.comparePoint(p.leftSE.point);if(F<0)return 1;if(F>0)return-1;let N=p.comparePoint(d.rightSE.point);return N!==0?N:-1}if(g>h){if(v<_&&v<D)return-1;if(v>_&&v>D)return 1;let F=p.comparePoint(d.leftSE.point);if(F!==0)return F;let N=d.comparePoint(p.rightSE.point);return N<0?1:N>0?-1:1}if(v<_)return-1;if(v>_)return 1;if(m<S){let F=p.comparePoint(d.rightSE.point);if(F!==0)return F}if(m>S){let F=d.comparePoint(p.rightSE.point);if(F<0)return 1;if(F>0)return-1}if(m!==S){let F=B-v,N=m-g,P=D-_,j=S-h;if(F>N&&P<j)return 1;if(F<N&&P>j)return-1}return m>S?1:m<S||B<D?-1:B>D?1:d.id<p.id?-1:d.id>p.id?1:0}constructor(d,p,g,h){this.id=++_o,this.leftSE=d,d.segment=this,d.otherSE=p,this.rightSE=p,p.segment=this,p.otherSE=d,this.rings=g,this.windings=h}static fromRing(d,p,g){let h,m,S,v=ge.comparePoints(d,p);if(v<0)h=d,m=p,S=1;else if(v>0)h=p,m=d,S=-1;else throw new Error(`Tried to create degenerate segment at [${d.x}, ${d.y}]`);let _=new ge(h,!0),B=new ge(m,!1);return new _e(_,B,[g],[S])}replaceRightSE(d){this.rightSE=d,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let d=this.leftSE.point.y,p=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:d<p?d:p},ur:{x:this.rightSE.point.x,y:d>p?d:p}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(d){return d.x===this.leftSE.point.x&&d.y===this.leftSE.point.y||d.x===this.rightSE.point.x&&d.y===this.rightSE.point.y}comparePoint(d){if(this.isAnEndpoint(d))return 0;let p=this.leftSE.point,g=this.rightSE.point,h=this.vector();if(p.x===g.x)return d.x===p.x?0:d.x<p.x?1:-1;let m=(d.y-p.y)/h.y,S=p.x+m*h.x;if(d.x===S)return 0;let v=(d.x-p.x)/h.x,_=p.y+v*h.y;return d.y===_?0:d.y<_?-1:1}getIntersection(d){let p=this.bbox(),g=d.bbox(),h=x(p,g);if(h===null)return null;let m=this.leftSE.point,S=this.rightSE.point,v=d.leftSE.point,_=d.rightSE.point,B=E(p,v)&&this.comparePoint(v)===0,D=E(g,m)&&d.comparePoint(m)===0,F=E(p,_)&&this.comparePoint(_)===0,N=E(g,S)&&d.comparePoint(S)===0;if(D&&B)return N&&!F?S:!N&&F?_:null;if(D)return F&&m.x===_.x&&m.y===_.y?null:m;if(B)return N&&S.x===v.x&&S.y===v.y?null:v;if(N&&F)return null;if(N)return S;if(F)return _;let P=jt(m,this.vector(),v,d.vector());return P===null||!E(h,P)?null:z.round(P.x,P.y)}split(d){let p=[],g=d.events!==void 0,h=new ge(d,!0),m=new ge(d,!1),S=this.rightSE;this.replaceRightSE(m),p.push(m),p.push(h);let v=new _e(h,S,this.rings.slice(),this.windings.slice());return ge.comparePoints(v.leftSE.point,v.rightSE.point)>0&&v.swapEvents(),ge.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),g&&(h.checkForConsuming(),m.checkForConsuming()),p}swapEvents(){let d=this.rightSE;this.rightSE=this.leftSE,this.leftSE=d,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let p=0,g=this.windings.length;p<g;p++)this.windings[p]*=-1}consume(d){let p=this,g=d;for(;p.consumedBy;)p=p.consumedBy;for(;g.consumedBy;)g=g.consumedBy;let h=_e.compare(p,g);if(h!==0){if(h>0){let m=p;p=g,g=m}if(p.prev===g){let m=p;p=g,g=m}for(let m=0,S=g.rings.length;m<S;m++){let v=g.rings[m],_=g.windings[m],B=p.rings.indexOf(v);B===-1?(p.rings.push(v),p.windings.push(_)):p.windings[B]+=_}g.rings=null,g.windings=null,g.consumedBy=p,g.leftSE.consumedBy=p.leftSE,g.rightSE.consumedBy=p.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let d=this.prev.consumedBy||this.prev;this._beforeState=d.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let d=this.beforeState();this._afterState={rings:d.rings.slice(0),windings:d.windings.slice(0),multiPolys:[]};let p=this._afterState.rings,g=this._afterState.windings,h=this._afterState.multiPolys;for(let v=0,_=this.rings.length;v<_;v++){let B=this.rings[v],D=this.windings[v],F=p.indexOf(B);F===-1?(p.push(B),g.push(D)):g[F]+=D}let m=[],S=[];for(let v=0,_=p.length;v<_;v++){if(g[v]===0)continue;let B=p[v],D=B.poly;if(S.indexOf(D)===-1)if(B.isExterior)m.push(D);else{S.indexOf(D)===-1&&S.push(D);let F=m.indexOf(B.poly);F!==-1&&m.splice(F,1)}}for(let v=0,_=m.length;v<_;v++){let B=m[v].multiPoly;h.indexOf(B)===-1&&h.push(B)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let d=this.beforeState().multiPolys,p=this.afterState().multiPolys;switch(Ie.type){case"union":{let g=d.length===0,h=p.length===0;this._isInResult=g!==h;break}case"intersection":{let g,h;d.length<p.length?(g=d.length,h=p.length):(g=p.length,h=d.length),this._isInResult=h===Ie.numMultiPolys&&g<h;break}case"xor":{let g=Math.abs(d.length-p.length);this._isInResult=g%2===1;break}case"difference":{let g=h=>h.length===1&&h[0].isSubject;this._isInResult=g(d)!==g(p);break}default:throw new Error(`Unrecognized operation type found ${Ie.type}`)}return this._isInResult}}class je{constructor(d,p,g){if(!Array.isArray(d)||d.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=p,this.isExterior=g,this.segments=[],typeof d[0][0]!="number"||typeof d[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let h=z.round(d[0][0],d[0][1]);this.bbox={ll:{x:h.x,y:h.y},ur:{x:h.x,y:h.y}};let m=h;for(let S=1,v=d.length;S<v;S++){if(typeof d[S][0]!="number"||typeof d[S][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let _=z.round(d[S][0],d[S][1]);_.x===m.x&&_.y===m.y||(this.segments.push(_e.fromRing(m,_,this)),_.x<this.bbox.ll.x&&(this.bbox.ll.x=_.x),_.y<this.bbox.ll.y&&(this.bbox.ll.y=_.y),_.x>this.bbox.ur.x&&(this.bbox.ur.x=_.x),_.y>this.bbox.ur.y&&(this.bbox.ur.y=_.y),m=_)}(h.x!==m.x||h.y!==m.y)&&this.segments.push(_e.fromRing(m,h,this))}getSweepEvents(){let d=[];for(let p=0,g=this.segments.length;p<g;p++){let h=this.segments[p];d.push(h.leftSE),d.push(h.rightSE)}return d}}class No{constructor(d,p){if(!Array.isArray(d))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new je(d[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let g=1,h=d.length;g<h;g++){let m=new je(d[g],this,!1);m.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=m.bbox.ll.x),m.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=m.bbox.ll.y),m.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=m.bbox.ur.x),m.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=m.bbox.ur.y),this.interiorRings.push(m)}this.multiPoly=p}getSweepEvents(){let d=this.exteriorRing.getSweepEvents();for(let p=0,g=this.interiorRings.length;p<g;p++){let h=this.interiorRings[p].getSweepEvents();for(let m=0,S=h.length;m<S;m++)d.push(h[m])}return d}}class Lt{constructor(d,p){if(!Array.isArray(d))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof d[0][0][0]=="number"&&(d=[d])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let g=0,h=d.length;g<h;g++){let m=new No(d[g],this);m.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=m.bbox.ll.x),m.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=m.bbox.ll.y),m.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=m.bbox.ur.x),m.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=m.bbox.ur.y),this.polys.push(m)}this.isSubject=p}getSweepEvents(){let d=[];for(let p=0,g=this.polys.length;p<g;p++){let h=this.polys[p].getSweepEvents();for(let m=0,S=h.length;m<S;m++)d.push(h[m])}return d}}class Ze{static factory(d){let p=[];for(let g=0,h=d.length;g<h;g++){let m=d[g];if(!m.isInResult()||m.ringOut)continue;let S=null,v=m.leftSE,_=m.rightSE,B=[v],D=v.point,F=[];for(;S=v,v=_,B.push(v),v.point!==D;)for(;;){let N=v.getAvailableLinkedEvents();if(N.length===0){let C=B[0].point,G=B[B.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${G.x}, ${G.y}].`)}if(N.length===1){_=N[0].otherSE;break}let P=null;for(let C=0,G=F.length;C<G;C++)if(F[C].point===v.point){P=C;break}if(P!==null){let C=F.splice(P)[0],G=B.splice(C.index);G.unshift(G[0].otherSE),p.push(new Ze(G.reverse()));continue}F.push({index:B.length,point:v.point});let j=v.getLeftmostComparator(S);_=N.sort(j)[0].otherSE;break}p.push(new Ze(B))}return p}constructor(d){this.events=d;for(let p=0,g=d.length;p<g;p++)d[p].segment.ringOut=this;this.poly=null}getGeom(){let d=this.events[0].point,p=[d];for(let B=1,D=this.events.length-1;B<D;B++){let F=this.events[B].point,N=this.events[B+1].point;At(F,d,N)!==0&&(p.push(F),d=F)}if(p.length===1)return null;let g=p[0],h=p[1];At(g,d,h)===0&&p.shift(),p.push(p[0]);let m=this.isExteriorRing()?1:-1,S=this.isExteriorRing()?0:p.length-1,v=this.isExteriorRing()?p.length:-1,_=[];for(let B=S;B!=v;B+=m)_.push([p[B].x,p[B].y]);return _}isExteriorRing(){if(this._isExteriorRing===void 0){let d=this.enclosingRing();this._isExteriorRing=d?!d.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let d=this.events[0];for(let h=1,m=this.events.length;h<m;h++){let S=this.events[h];ge.compare(d,S)>0&&(d=S)}let p=d.segment.prevInResult(),g=p?p.prevInResult():null;for(;;){if(!p)return null;if(!g)return p.ringOut;if(g.ringOut!==p.ringOut)return g.ringOut.enclosingRing()!==p.ringOut?p.ringOut:p.ringOut.enclosingRing();p=g.prevInResult(),g=p?p.prevInResult():null}}}class Vt{constructor(d){this.exteriorRing=d,d.poly=this,this.interiorRings=[]}addInterior(d){this.interiorRings.push(d),d.poly=this}getGeom(){let d=[this.exteriorRing.getGeom()];if(d[0]===null)return null;for(let p=0,g=this.interiorRings.length;p<g;p++){let h=this.interiorRings[p].getGeom();h!==null&&d.push(h)}return d}}class Oo{constructor(d){this.rings=d,this.polys=this._composePolys(d)}getGeom(){let d=[];for(let p=0,g=this.polys.length;p<g;p++){let h=this.polys[p].getGeom();h!==null&&d.push(h)}return d}_composePolys(d){let p=[];for(let g=0,h=d.length;g<h;g++){let m=d[g];if(!m.poly)if(m.isExteriorRing())p.push(new Vt(m));else{let S=m.enclosingRing();S.poly||p.push(new Vt(S)),S.poly.addInterior(m)}}return p}}class Po{constructor(d){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_e.compare;this.queue=d,this.tree=new c(p),this.segments=[]}process(d){let p=d.segment,g=[];if(d.consumedBy)return d.isLeft?this.queue.remove(d.otherSE):this.tree.remove(p),g;let h=d.isLeft?this.tree.add(p):this.tree.find(p);if(!h)throw new Error(`Unable to find segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] in SweepLine tree.`);let m=h,S=h,v,_;for(;v===void 0;)m=this.tree.prev(m),m===null?v=null:m.key.consumedBy===void 0&&(v=m.key);for(;_===void 0;)S=this.tree.next(S),S===null?_=null:S.key.consumedBy===void 0&&(_=S.key);if(d.isLeft){let B=null;if(v){let F=v.getIntersection(p);if(F!==null&&(p.isAnEndpoint(F)||(B=F),!v.isAnEndpoint(F))){let N=this._splitSafely(v,F);for(let P=0,j=N.length;P<j;P++)g.push(N[P])}}let D=null;if(_){let F=_.getIntersection(p);if(F!==null&&(p.isAnEndpoint(F)||(D=F),!_.isAnEndpoint(F))){let N=this._splitSafely(_,F);for(let P=0,j=N.length;P<j;P++)g.push(N[P])}}if(B!==null||D!==null){let F=null;B===null?F=D:D===null?F=B:F=ge.comparePoints(B,D)<=0?B:D,this.queue.remove(p.rightSE),g.push(p.rightSE);let N=p.split(F);for(let P=0,j=N.length;P<j;P++)g.push(N[P])}g.length>0?(this.tree.remove(p),g.push(d)):(this.segments.push(p),p.prev=v)}else{if(v&&_){let B=v.getIntersection(_);if(B!==null){if(!v.isAnEndpoint(B)){let D=this._splitSafely(v,B);for(let F=0,N=D.length;F<N;F++)g.push(D[F])}if(!_.isAnEndpoint(B)){let D=this._splitSafely(_,B);for(let F=0,N=D.length;F<N;F++)g.push(D[F])}}}this.tree.remove(p)}return g}_splitSafely(d,p){this.tree.remove(d);let g=d.rightSE;this.queue.remove(g);let h=d.split(p);return h.push(g),d.consumedBy===void 0&&this.tree.add(d),h}}let Gt=typeof T<"u"&&T.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Do=typeof T<"u"&&T.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class wo{run(d,p,g){Ie.type=d,z.reset();let h=[new Lt(p,!0)];for(let F=0,N=g.length;F<N;F++)h.push(new Lt(g[F],!1));if(Ie.numMultiPolys=h.length,Ie.type==="difference"){let F=h[0],N=1;for(;N<h.length;)x(h[N].bbox,F.bbox)!==null?N++:h.splice(N,1)}if(Ie.type==="intersection")for(let F=0,N=h.length;F<N;F++){let P=h[F];for(let j=F+1,C=h.length;j<C;j++)if(x(P.bbox,h[j].bbox)===null)return[]}let m=new c(ge.compare);for(let F=0,N=h.length;F<N;F++){let P=h[F].getSweepEvents();for(let j=0,C=P.length;j<C;j++)if(m.insert(P[j]),m.size>Gt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let S=new Po(m),v=m.size,_=m.pop();for(;_;){let F=_.key;if(m.size===v){let P=F.segment;throw new Error(`Unable to pop() ${F.isLeft?"left":"right"} SweepEvent [${F.point.x}, ${F.point.y}] from segment #${P.id} [${P.leftSE.point.x}, ${P.leftSE.point.y}] -> [${P.rightSE.point.x}, ${P.rightSE.point.y}] from queue.`)}if(m.size>Gt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>Do)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let N=S.process(F);for(let P=0,j=N.length;P<j;P++){let C=N[P];C.consumedBy===void 0&&m.insert(C)}v=m.size,_=m.pop()}z.reset();let B=Ze.factory(S.segments);return new Oo(B).getGeom()}}let Ie=new wo;var Ao={union:function(M){for(var d=arguments.length,p=new Array(d>1?d-1:0),g=1;g<d;g++)p[g-1]=arguments[g];return Ie.run("union",M,p)},intersection:function(M){for(var d=arguments.length,p=new Array(d>1?d-1:0),g=1;g<d;g++)p[g-1]=arguments[g];return Ie.run("intersection",M,p)},xor:function(M){for(var d=arguments.length,p=new Array(d>1?d-1:0),g=1;g<d;g++)p[g-1]=arguments[g];return Ie.run("xor",M,p)},difference:function(M){for(var d=arguments.length,p=new Array(d>1?d-1:0),g=1;g<d;g++)p[g-1]=arguments[g];return Ie.run("difference",M,p)}};return Ao}))});y();y();function nt(o){return o.endsWith("/")?o:`${o}/`}y();var rr="mi-session-data",ir="mi-local-data",Wt="id",$t="deviceId",Re=class o{static#e;#t;#o;constructor(){try{let e=sessionStorage.getItem(rr);e?this.#t=JSON.parse(e):this.#t={[Wt]:$()}}catch{this.#t={[Wt]:$()}}try{let e=localStorage.getItem(ir);e?this.#o=JSON.parse(e):this.#o={[$t]:$()}}catch{this.#o={[$t]:$()}}this.#t[Wt]||(this.#t[Wt]=$()),this.#o[$t]||(this.#o[$t]=$())}static getInstance(){return this.#e||(this.#e=new o),this.#e}static ___clearInstance(){this.#e=void 0}saveSessionData(e,t){this.#t[e]=t;try{return sessionStorage.setItem(rr,JSON.stringify(this.#t)),!0}catch{return!1}}loadSessionData(e){let t=this.#t[e];if(t!=null)return t}saveLocalData(e,t){this.#o[e]=t;try{return localStorage.setItem(ir,JSON.stringify(this.#o)),!0}catch{return!1}}loadLocalData(e){let t=this.#o[e];if(t!=null)return t}};y();var rt="https://app.mappedin.com/",sr="https://auth.mappedin.com/",ar=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),$s=Object.freeze({...ar,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Js=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),zs=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Xs=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Hs={eu:Js,us:ar,"us-enterprise":$s,"us-staging-enterprise":zs,"us-staging-self-serve":Xs};function cr(o){return Hs[o]}y();y();y();var Ys=o=>{let e=Date.now();return o-e},Jt=(o,e)=>Ys(o)<=e*60*1e3;var lr=10,ud=lr*60*1e3,dr="miSasTokens";async function fd(o,e){let t=`${e}__${o.mapId}`,n=Re.getInstance(),r=n?.loadSessionData(dr)||{};if(r[t]&&!Jt(r[t].expires,lr))return r[t];let i=await qs(o,e),s={...r,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return n?.saveSessionData(dr,s),i}async function qs(o,e){let t=`${o.baseUri?nt(o.baseUri):rt}api/v1/venue/${o.mapId}/sas-token`,n=await Se()(t,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let r=await n.json();return{token:r.token,expires:new Date(r.expires).getTime()}}var pr=globalThis.fetch,Qs=T?.env?.npm_package_version;function Se(){if(pr==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return pr}function fr(o){return o==="3.0.0-native"?"3.0.0":o}async function Ks(o){return typeof o=="function"?o():o}var Go={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Zs(o){let e={...Go,...o};return e.headers={...e.headers,"mappedin-sdk-version":Qs},e.things=[],"platformString"in o&&(e.headers={...e.headers,"mappedin-platform-version":o.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e.language=e.language?.toLowerCase(),e}function ea(o,e,t=!1){let n={language:o.language,clientId:o.clientId,clientSecret:o.clientSecret};t&&delete n.language;let{headers:r}=o;r["Content-Type"]=r["Content-Type"]||"text/json",o.accessToken?r.Authorization=`Bearer ${o.accessToken}`:o.noAuth||o.clientId&&o.clientSecret&&(r["x-mappedin-key"]=btoa(o.clientId),r["x-mappedin-secret"]=btoa(o.clientSecret));let i={method:"GET",headers:r};return o.secure&&(e+="&withcdntoken"),{req:i,url:e}}async function ta(o,e,t=!1){let n=ea(o,e,t),r=await Se()(n.url,n.req);if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}var oa=o=>{let e=o!=null&&typeof o=="object"&&"perspectives"in o&&o.perspectives!=null&&typeof o.perspectives=="object"?o.perspectives:null;if(e==null||Object.keys(e).length===0)return A.warn("No perspectives available in response!"),null;let t={};for(let[n,r]of Object.entries(e)){let i="url"in r&&typeof r.url=="string"?r.url:null,s="locale_packs"in r&&typeof r.locale_packs=="object"?r.locale_packs:null;if(i==null||s==null){A.warn(`Perspective ${n} is missing url or locale_packs!`);continue}t[n]={url:i,locale_packs:s}}return t};async function na(o,e="exports/mvf/1/bundle"){let t=Zs({baseUri:"https://api-gateway.mappedin.com/",...Go,...o}),n=`${t.baseUri+e}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let r=await ta(t,n),i=r.url,s=r.locale_packs,a=t.perspective??Go.perspective,c=oa(r);if(a!=null&&a!==""&&c!=null){let l=c[a];l==null?A.warn(`Perspective ${a} not found in response! Loading default perspective instead.`):(A.log(`Loading perspective "${a}"`),i=l.url,s=l.locale_packs)}return{url:i,localePacks:s,updated_at:r.updated_at}}var it=(function(){let o;return()=>(o||(o=new TextDecoder),o)})();async function Uo(o,{signal:e}){let t=await(await Se()(o,{signal:e})).arrayBuffer();return new Uint8Array(t)}async function Wo(o){let e=Co(o),t={};if(e["enterprise/"]!=null){t.enterprise={};let n=e["enterprise/locations.json"];n&&(t.enterprise.locations=JSON.parse(it().decode(n)));let r=e["enterprise/locationInstances.json"];r&&(t.enterprise.locationInstances=JSON.parse(it().decode(r)));let i=e["enterprise/categories.json"];i&&(t.enterprise.categories=JSON.parse(it().decode(i)))}return e["floorstack.json"]&&(t["floorstack.json"]=JSON.parse(it().decode(e["floorstack.json"]))),e["floor.geojson"]&&(t["floor.geojson"]=JSON.parse(it().decode(e["floor.geojson"]))),e["manifest.json"]&&(t["manifest.geojson"]=JSON.parse(it().decode(e["manifest.json"]))),t}async function gr(o,{signal:e}){try{let t=await(await Se()(o,{signal:e})).arrayBuffer();if(e.aborted)return;let n=new Uint8Array(t);return await Wo(n)}catch(t){let n=new Error("downloadLanguagePack failed");throw n.cause=t,n}}function ra(o){let{mvfVersion:e,useDraftData:t}=o;if(e!=null&&fr(e)==="3.0.0")return t?"exports/mvf3-draft/1/bundle":"exports/mvf3/1/bundle";if(e==null||e==="2.0.0")return t?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle";if(e==="2.0.0-c")return t?"exports/mvf2c-draft/1/bundle":"exports/mvf2c/1/bundle";throw new Error(`Unsupported MVF version: ${e}`)}function Fd(o){return{...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"}}async function vd(o){return new Promise(async(e,t)=>{try{let n=ra(o),{url:r,localePacks:i,updated_at:s}=await na(o,n),a=await Se()(r).then(l=>l.arrayBuffer()),c=new Uint8Array(a);e({compressed:c,localePacks:i,updated_at:s})}catch(n){t(n)}})}async function Td(o,e){return new Promise(async(t,n)=>{try{let{url:r,updated_at:i}=await ia(o,e),s=await Se()(r).then(c=>c.arrayBuffer()),a=new Uint8Array(s);t({compressed:a,updated_at:i})}catch(r){n(r)}})}async function ia(o,e){if(o.bundleUri!=null)return{url:await Ks(o.bundleUri),updated_at:""};if(e==null||e==="")throw new Error("Missing access token.");let t=new URL(`${o.baseUri?nt(o.baseUri):rt}api/v1/venue/${o.mapId}/mvf`);o.viewId&&t.searchParams.set("configId",o.viewId),o.mvfVersion&&t.searchParams.set("version",fr(o.mvfVersion));let n=await Se()(t.toString(),{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}function Rd(o){return ko(o)}function sa(o){if(o==null||typeof o!="object")return!1;let e=["connection.json","manifest.geojson","floor.geojson"in o?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in o?"floorstack.json":"mapstack.json"in o?"mapstack.json":"mapstack.geojson"];"styles.json"in o&&e.push("styles.json"),"shapes.json"in o&&e.push("shapes.json"),"navigationFlags.json"in o&&e.push("navigationFlags.json"),"annotation-symbols.json"in o&&e.push("annotation-symbols.json");for(let t of e)if(o[t]==null||o[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function aa(o){return new Promise(async(e,t)=>{try{if(o==null||typeof o!="object")throw new Error("Error parsing data! Unzipping failed.");if(o[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let n=Co(o);if(!sa(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let r={},i=Object.keys(n);for(let s of i){if(n[s].length===0)continue;let a=s.split("/");if(a.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(a.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(a.length===1){r[a[0]]=n[s];continue}if(a[0]==="image"){A.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else r[a[0]]==null&&(r[a[0]]={}),r[a[0]][a[1]]=n[s]}e(r)}catch(n){t(n)}})}function yr(){let o="us",e={};function t(){return ca(cr(o),e)}return{updateByUserOption(n){n.environment&&(o=n.environment),n.baseUri&&(e.baseUri=n.baseUri),n.baseAuthUri&&(e.baseAuthUri=n.baseAuthUri),n.analytics?.baseUri&&(e.analyticsBaseUri=n.analytics?.baseUri)},updateTileServerBaseUrl(n){e.tileServerUri=n},updateEnvironment(n){o=n},setEnterprise(n){(o==="us"||o==="us-enterprise")&&(o=n?"us-enterprise":"us")},getBaseUri(){return t().baseUri},getBaseAuthUri(){return t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){o="us",e={}},__getState:t}}function ca(o,e){return{...o,...e}}var Sd=o=>{let e=Object.values(o["floorstack.json"]??o["mapstack.json"]??{});return e.length===1?[]:e.filter(t=>t.type!=="Outdoor").map(t=>t.id.replace("fs_","").replace("ms_",""))},Bd=o=>o?.cms!=null,Ed=o=>{let e=Object.values(o.floorStacks??{}),t=(o.outdoors?.floors?.length??0)>0;return e.length+(t?1:0)<=1?[]:e.map(n=>n.id.replace("fs_",""))};var da=o=>{let e=performance.now(),t=jo.decompressUnsafeSync(o),n=t.isOk()?t.unwrap():void 0,r=n?.manifest?.features?.[0]?.properties?.version;if(n==null||!String(r).startsWith("3."))throw new Q(`mvfVersion '3.0.0-native' needs an MVFv3 bundle, but this bundle is ${r!=null?`MVF ${r}`:"not a valid MVF"}.`);return A.log(`Parsed MVFv3 (native) in ${performance.now()-e}ms`),n},ur=async o=>{let e=performance.now(),t,n=jo.decompressUnsafeSync(o);n.isOk()?t=n.unwrap():A.error("MVFv3 decompression failed!");let r;if(t)try{r=Jn(t)}catch(i){A.error("MVFv3 to MVFv2 conversion failed!",i)}if(A.log(`Parsed MVFv3 in ${performance.now()-e}ms`),!r)throw new Error("Failed to parse MVFv2 from MVFv3!");return{kind:"v2",mvf2:r,mvf3:t}};async function _d(o,e="2.0.0"){switch(e){case"2.0.0":case"2.0.0-c":try{let t=performance.now(),n=await aa(o),r=ko(n);return A.log(`Parsed MVFv2 in ${performance.now()-t}ms`),{kind:"v2",mvf2:r}}catch{return A.error("MVFv2 parsing failed! Trying MVFv3."),ur(o)}case"3.0.0":return ur(o);case"3.0.0-native":return{kind:"v3-native",mvf3:da(o)};default:throw new Error(`Unsupported MVF version: ${e}`)}}var hr=10,Ld=hr*60*1e3,mr="accessTokens",la="mik_";function Vd(o){return typeof o=="string"&&o.startsWith(la)}async function Gd(o,e=!1,t=!1){let n=`${o.key}`,r=Re.getInstance(),i=r?.loadSessionData(mr)||{},s=Math.floor(Date.now()/1e3);if(!t&&i[n]&&!Jt(i[n].expiresTimestamp*1e3,hr))return i[n];let a=e?await pa(o,s):await ua(o,s),c={...i,[n]:a};return r?.saveSessionData(mr,c),a}async function pa(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri??sr}oauth2/token`;let n;try{n=await Se()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:o.key,client_secret:o.secret})})}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`Failed to fetch enterprise access token from ${t}: ${s}`)}if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let r=await n.json();return{accessToken:r.access_token,expiresTimestamp:e+r.expires_in}}async function ua(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri?nt(o.baseAuthUri):rt}api/v1/api-key/token`;let n;try{n=await Se()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:o.key,secret:o.secret})})}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`Failed to fetch access token from ${t}: ${s}`)}if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let r=await n.json();return{accessToken:r.access_token,expiresTimestamp:e+r.expires_in}}y();var $o=class o{static __type="coordinate";__type=o.__type;id=$();latitude;longitude;floorId;verticalOffset;#e={};static is(e){return e.__type===o.__type}constructor(e,t,n){if(typeof e=="object")this.latitude=e.latitude,this.longitude=e.longitude,this.floorId=e.floorId,this.verticalOffset=e.verticalOffset??0;else{if(t==null)throw new Error("Coordinate longitude is required.");this.latitude=e,this.longitude=t,this.floorId=n,this.verticalOffset=0}}get anchorTarget(){return this}get focusTarget(){return this}get navigationTarget(){return this}isEqual(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.floorId===e.floorId}toJSON(){return{__type:o.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}get geoJSON(){if(this.#e.geoJSON!=null)return this.#e.geoJSON;let e=[this.longitude,this.latitude];return this.verticalOffset!==0&&e.push(this.verticalOffset),this.#e.geoJSON={type:"Feature",properties:null,geometry:{type:"Point",coordinates:e}},this.#e.geoJSON}toGeoJSON(){return this.geoJSON.geometry}destroy(){for(let e of globalThis.Object.keys(this.#e))delete this.#e[e]}},W=$o;y();y();var Y=class{id;constructor(e){this.id=e}};y();y();function fa(o,e){e===void 0&&(e={});var t=ot(o),n=(t[0]+t[2])/2,r=(t[1]+t[3])/2;return et([n,r],e.properties,e)}var st=fa;function Jo(o){let e=o.enterprise?.locations?.reduce((r,i)=>(r[i.id]=i,r),{})||{};for(let r of o.enterprise?.locationInstances||[])e[r.id]=r;let t={};for(let r of o["floorstack.json"]||[])t[r.id]=r;let n={};for(let r of o["floor.geojson"]?.features||[])r.properties&&r.properties.id&&(n[r.properties.id]=r.properties);return{type:"downloaded",data:o,optimized:{"enterprise-location":e,"enterprise-category":o.enterprise?.categories?.reduce((r,i)=>(r[i.id]=i,r),{})||{},"floor-stack":t,floor:n}}}var ga=/^https?:\/\/cdn(-staging)?\.mappedin\.com(\/|$)/;function Ir(o){return ga.test(o)}function br(o){return!!o.split("?")[1]?.includes("sv=")}function K(o,e,t,n){let r=n||"unknown";if(o==null)return A.error(`Cannot get the center coordinate for "${r}" because it has no geometry.`),new W({latitude:0,longitude:0,floorId:e});try{if(o.type==="LineString"){let[[i,s],[a,c]]=o.coordinates,l=(i+a)/2,u=(s+c)/2;return new W({latitude:u,longitude:l,floorId:e})}else if(o.type==="Point"){let[i,s]=o.coordinates;return new W({latitude:s,longitude:i,floorId:e})}else if(o.type==="Polygon"&&t!=null){let[i,s]=t;return new W({latitude:s,longitude:i,floorId:e})}}catch{}try{let[i,s]=st(o).geometry.coordinates;return new W({latitude:s,longitude:i,floorId:e})}catch(i){return A.error(`Failed to get center coordinate for "${r}" ${i instanceof Error?i.stack:""}`),new W({latitude:0,longitude:0,floorId:e})}}function Ye(o,e){return e&&(o.flags[e.index]&1<<e.bit)!==0}function zt(o,e){if(o==null)return[];let t=[];for(let[n,r]of Object.entries(e))Ye({flags:o},r)&&t.push(n);return t}function Xt(o,e){let t=o.instanceLocationsByPolygonId?.[e];if(t)return[t];let n=[],r=o.locationIdsByGeometryId[e];if(r)for(let i of r){let s=o.getById("enterprise-location",i);s&&n.push(s)}return n}y();var xr=o=>o!==void 0&&o.length>=2;function Ht(o){if(o?.type!=="LineString")return;let[e,t]=o.coordinates;if(!(!xr(e)||!xr(t)))return{geoJSON:{geometry:{coordinates:[[e[0],e[1]],[t[0],t[1]]]}}}}var Be=(o,e)=>`${o} is not supported for mvfVersion '3.0.0-native': use the async ${e} instead.`;var zo=class o extends Y{static __type="node";__type=o.__type;#e;#t={};#o;#n;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id),this.#e=e,this.#o=t.record.floorId,this.#n=t.record}get locations(){return this.#t.locations?this.#t.locations:(this.#t.locations=(this.#e.nodeIndex.locationIdsByNodeId[this.id]||[]).map(e=>this.#e.getById("enterprise-location",e)).filter(Boolean),this.#t.locations)}get space(){let e=this.#n.populated?.spaceIds??this.#e.navigationNodes.spaceIdsForNode(this.id);return this.#e.getById("space",e[0])}get object(){let e=this.#n.populated?.objectIds??this.#e.navigationNodes.objectIdsForNode(this.id);return this.#e.getById("object",e[0])}get floor(){let e=this.#e.getById("floor",this.#o);if(e==null)throw new Error(`Floor ${this.#o} not found!`);return e}get coordinate(){return this.#t.coordinate==null&&(this.#t.coordinate=K(this.#n.geometry,this.#o,void 0,this.#n.id)),this.#t.coordinate}get externalId(){return this.#n.externalId??""}get neighbors(){if(this.#e.mvf==null)throw new Q(Be("Node.neighbors","node.getNeighbors()"));return this.#t.neighbors==null&&(this.#t.neighbors=this.#e.navigationNodes.nodes(this.#n.neighborIds)),this.#t.neighbors}async getNeighbors(){let e=this.#e.navigationNodes;return e.nodes(e.neighborIdsForNode(this.id))}get navigationFlags(){return this.#t.navigationFlags==null&&(this.#t.navigationFlags=Object.freeze(zt(this.#n.flags,this.#e.navigationFlags))),this.#t.navigationFlags}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:[...this.#n.neighborIds]}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},le=zo;y();y();var Xo=class o extends Y{static __type="hyperlink";__type=o.__type;#e={};#t;static is(e){return e.__type===o.__type}constructor(e){super(String($())),this.#t=e.mvfData}get url(){return this.#t.url}get name(){if("displayName"in this.#t)return this.#t.displayName;if("label"in this.#t)return this.#t.label}toJSON(){return{__type:o.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(this.#e))delete this.#e[e]}},at=Xo;y();y();function xl(o){return typeof o=="string"?o:o?.id??""}function Ml(o){return Array.isArray(o)&&Number.isFinite(o[0])&&Number.isFinite(o[1])}var ya=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,ma=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,ha=o=>ya.test(o)||ma.test(o),Ia=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,ba=/^https:\/\/cdn-staging\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,xa=o=>ha(o)?!1:Ia.test(o)||ba.test(o),ct=o=>{if(!xa(o))return null;let e="";o.startsWith("https://")?(e="https://",o=o.slice(8)):o.startsWith("http://")&&(e="http://",o=o.slice(7));let[t,n,r]=o.split("/"),i=r.split(".").pop()??"";return{origin:e+t,mapId:n,fileName:r,fileType:i}};function Fl(o){return o.reduce((e,t,n)=>n===0?e:e+Ve(o[n-1].toGeoJSON().coordinates,t.toGeoJSON().coordinates),0)}function Ho(o){return o!=null&&typeof o=="object"&&"__type"in o&&o.__type!==null&&typeof o.__type=="string"}function Ma(o){return o!=null&&typeof o=="object"&&"name"in o&&o.name!=null&&typeof o.name=="string"&&o.name!==""}function vl(o){return Ho(o)&&Ma(o)}var Yo=class o extends Y{static __type="image";__type=o.__type;#e={};#t;#o;static is(e){return e.__type===o.__type}constructor(e){super(String($())),this.#t=e.mvfData,this.#o=e.mapData}get url(){let e=this.#t.url;if(this.#o.tokenManager==null)return e;let t=ct(this.#t.url);if(t==null)return e;let n=t.mapId;try{if(this.#o.tokenManager.isEnterpriseMode())return e;let r=this.#o.tokenManager.getSasToken(n).token;if(r==null||r==="")throw new Error("SAS token empty!");return`${e}?${r}`}catch(r){return t.fileType!=="svg"&&A.error("Error getting SAS token for image",{error:r,url:e}),e}}get name(){return this.#t.altText}get altText(){return this.#t.altText}toJSON(){return{__type:o.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(this.#e))delete this.#e[e]}},Ae=Yo;y();y();var Ee=class{id;constructor(e,t){this.id=e}#e=void 0;get geoJSONBoundingBox(){return this.#e?this.#e:"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(this.#e=ot(this.geoJSON),this.#e)}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};var Z=class extends Ee{#e;#t;#o={};constructor(e,t){super(t.properties.id,e),this.#e=e,this.#t=t}get externalId(){return this.#t.properties.externalId??""}get name(){let e=this.#t.properties.details?.name??"";return e===""&&(e=this.locationProfiles.find(t=>t.name&&t.name.length>0)?.name??""),e}get icon(){return this.locationProfiles.find(e=>e.icon!=null&&e.icon.url!=null&&e.icon.url.length>0)?.icon}get description(){let e=this.#t.properties.details?.description??"";return e===""&&(e=this.locationProfiles.find(t=>t.description&&t.description.length>0)?.description??""),e}get images(){if(this.#o.images!=null)return this.#o.images;let e=this.#t.properties.details?.images?.map(t=>new Ae({mvfData:t,mapData:this.#e}))??[];return(e==null||e.length===0)&&(e=this.locationProfiles.find(t=>t.images.length>0)?.images??[]),this.#o.images=e,e}get links(){if(this.#o.links!=null)return this.#o.links;let e=this.#t.properties.details?.links?.map(t=>new at({mvfData:t}))??[];return(e==null||e.length===0)&&(e=this.locationProfiles.find(t=>t.links.length>0)?.links??[]),this.#o.links=e,e}get locationProfiles(){return this.#e.locationProfilesByAttachedFeatureId[this.id]??[]}_serializeDetailedMapData(){return{externalId:this.externalId,name:this.name,description:this.description,images:this.images,links:this.links,locationProfiles:this.locationProfiles}}};y();var bt={debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building-outline","building-top","building","building-wall","building-buffer"],__EXPERIMENTAL_CameraControlsMode:"native"},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!0,floorGap:"auto",footprintColor:"#ffffff"},disableUpdateStateValidation:!1},Mr="ExteriorWalls",Fr="Walls",Vl=0,vr="InteriorDoors",Tr="ExteriorDoors",Gl="InteriorDoorsLayer",Ul="ExteriorDoorsLayer",Rr="GeometryLayer",Wl="Focusable-",$l="LabelsLayer",Jl="MarkersLayer",zl="FootprintLayer",Xl="OcclusionLayer",Hl="AreasLayer",Yl="ImagesLayer",ql="FacadesLayer",Ql="PathsLayer",Kl="ModelsLayer",Fa="Text3DLayer",va="geometryText",Ta="floortext";function Zl(o){return`${Fa}-${o}`}function ep(o){return`${va}-${o}`}function tp(o){return`${Ta}-${o}`}var op=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com","https://staging.mappedin.com","https://mappedin-staging.auth0.com/userinfo","https://mappedin.com","https://mappedin.auth0.com/userinfo"],np={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};y();var Ra=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors","shadows"]),Sa=new Set(["style","enabled","layersHiddenByGeometry","lowDpi","__EXPERIMENTAL_CameraControlsMode"]);function Ba(o){o.outdoorView?.enabled&&!o.outdoorView?.token&&A.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function Ea(o){let e=o.__EXPERIMENTAL_shadows;if(e===void 0)return o.shadows;if(typeof e=="boolean")return e;if(typeof e!="object"||e===null||Array.isArray(e))return o.shadows;let{enabled:t,...n}=e;return t===!1?!1:Object.keys(n).length>0?n:!0}function _a(o){return o.__EXPERIMENTAL_shadows!==void 0&&A.warn("`__EXPERIMENTAL_shadows` is deprecated \u2014 use `shadows` instead."),o.shadows??Ea(o)}function Na(o,e){let t=o?.outdoorView?.token||e.outdoorViewToken,n={...bt,...o,outdoorView:{enabled:o?.outdoorView?.enabled===void 0?!!t:o?.outdoorView?.enabled,layersHiddenByGeometry:bt.outdoorView?.layersHiddenByGeometry,...o?.outdoorView},bearing:o?.bearing??e.naturalBearing??0,imagePlacementOptions:{...bt.imagePlacementOptions,...o?.imagePlacementOptions},multiFloorView:{...bt.multiFloorView,...o?.multiFloorView},disableUpdateStateValidation:o?.disableUpdateStateValidation??!1,shadows:_a(o??{})};return t&&n.outdoorView&&(n.outdoorView.token=t),n}function dp(o){let e={remove_watermark:!1};if(o)try{let t=er(o);Object.assign(e,t.capabilities)}catch(t){A.error("Error decoding capabilities from token",t)}return e}function lp(o){let e=Object.fromEntries(Object.entries(o).filter(([t])=>Ra.has(t)));return e.outdoorView&&(e.outdoorView=Object.fromEntries(Object.entries(e.outdoorView).filter(([t])=>Sa.has(t)))),e}y();y();var Ge=o=>o!=null;y();y();y();y();var Ue=class o{#e;#t;#o;target;static __type="image-3d";__type=o.__type;static is(e){return e.__type===o.__type}constructor(e,t,n,r){this.#e=e,this.#t=t,this.target=n,this.#o=r}get id(){return this.#e}get url(){if(this.#o==null)return this.#t;let e=ct(this.#t);if(e==null)return this.#t;let t=e.mapId;try{if(this.#o.isEnterpriseMode())return this.#t;let n=this.#o.getSasToken(t).token;if(n==null||n==="")throw new Error("SAS token empty!");return`${this.#t}?${n}`}catch(n){return e.fileType!=="svg"&&A.error("Error getting SAS token for image",{error:n,url:this.#t}),this.#t}}};var qo=class o extends Z{static __type="area";__type=o.__type;#e;#t;#o={};#n;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:t.record.geometry,properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#e=e,this.#t=t.floorId,this.#n=t.record}get center(){return this.#o.center==null&&(this.#o.center=K(this.#n.geometry,this.#t,this.#n.center,this.#n.id)),this.#o.center}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#r();return t?[...e,t]:e}#r(){if(this.#n.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new Ue(`${this.id}-polygon-image-${$()}`,this.#n.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}},ye=qo;y();var Qo=class o extends Z{static __type="door";__type=o.__type;#e;#t;#o;#n;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:t.record.geometry,properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#t={},this.#n=t.record,this.#e=e,this.#o=t.floorId}get floor(){let e=this.#e.getById("floor",this.#o);if(e==null)throw new Error(`Floor ${this.#o} not found!`);return e}get center(){return this.#t.center==null&&(this.#t.center=K(this.#n.geometry,this.#o,void 0,this.#n.id)),this.#t.center}get isExterior(){return this.#n.isExterior??!1}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},me=Qo;y();var Ko=class o extends Z{static __type="space";__type=o.__type;#e;#t;#o={};#n;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:t.record.geometry,properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#e=e,this.#t=t.floorId,this.#n=t.record}get type(){return Pa(this.#n.kind)}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=Xt(this.#e,this.id),this.#o.enterpriseLocations)}get locations(){return this.enterpriseLocations}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get doors(){return this.#o.doors?this.#o.doors:(this.#o.doors=this.#n.doorIds.map(e=>this.#e.getById("door",e)).filter(Ge),this.#o.doors)}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#r();return t?[...e,t]:e}#r(){if(this.#n.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new Ue(`${this.id}-polygon-image-${$()}`,this.#n.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get center(){return this.#o.center==null&&(this.#o.center=K(this.#n.geometry,this.#t,this.#n.center,this.#n.id)),this.#o.center}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(this.#o))delete this.#o[e]}},Oa=["room","hallway","exterior","void","gate","otb"];function Pa(o){if(o==null||o==="default")return"room";let e=o.toLowerCase();return Oa.includes(e)?e:"room"}var ee=Ko;y();var Zo=class o extends Ee{static __type="floor";__type=o.__type;#e;#t={};#o;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id,e),this.#e=e,this.#o=t.record}#n(e){let t=this.#o[e];return this.#e.getPropTranslation(this.__type,e,this.id,t)}get focusTarget(){return this}get name(){if(!("name"in this.#o))return this.#o.externalId??"";let e=this.#n("name");return typeof e=="string"?e:""}get shortName(){if(!("shortName"in this.#o))return this.#o.externalId??"";let e=this.#n("shortName");return typeof e=="string"?e:""}get subtitle(){let e=this.#n("subtitle");return typeof e=="string"?e:""}get externalId(){return this.#o.externalId??""}get elevation(){return this.#o.elevation}get maxHeight(){return this.#o.maxHeight}get spaces(){if(this.#t.spaces==null){let e=this.#e.spaces.filter(t=>t.floor.id===this.id);this.#t.spaces=e}return this.#t.spaces}get spacesOpenToBelow(){if(this.#t.spacesOpenToBelow==null){let e=[];for(let t of this.spaces)(t.type==="void"||t.type==="otb")&&e.push(t);this.#t.spacesOpenToBelow=e}return this.#t.spacesOpenToBelow}get geoJSON(){return{type:"Feature",properties:null,geometry:this.#o.geometry??{type:"Polygon",coordinates:[]}}}get objects(){if(this.#t.objects==null){let e=this.#e.objects.filter(t=>t.floor.id===this.id);this.#t.objects=e}return this.#t.objects}get connections(){if(this.#t.connections==null){let e=this.#e.connections.filter(t=>t.floors.includes(this));this.#t.connections=e}return this.#t.connections}get doors(){if(this.#t.doors==null){let e=this.#e.doors.filter(t=>t.floor.id===this.id);this.#t.doors=e}return this.#t.doors}get annotations(){if(this.#t.annotations==null){let e=this.#e.annotations.filter(t=>t.floor.id===this.id);this.#t.annotations=e}return this.#t.annotations}get pois(){if(this.#t.pois==null){let e=this.#e.pointsOfInterest.filter(t=>t.floor.id===this.id);this.#t.pois=e}return this.#t.pois}get floorStack(){if(this.#t.floorStack==null){let e=this.#e.floorStacks.find(t=>t.floors.includes(this));this.#t.floorStack=e}return this.#t.floorStack}get center(){return this.#t.center==null&&(this.#t.center=K(this.#o.geometry??null,this.id,void 0,this.id)),this.#t.center}toJSON(){return{__type:o.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,maxHeight:this.maxHeight,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(this.#t))delete this.#t[e]}},We=Zo;y();var en=class o extends Z{static __type="connection";__type=o.__type;#e;#t;#o;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#t={},this.#e=e,this.#o=t.record}get accessible(){return this.#o.accessible??!1}get navigationFlags(){return this.#t.navigationFlags==null&&(this.#t.navigationFlags=Object.freeze(zt(this.#o.flags,this.#e.navigationFlags))),this.#t.navigationFlags}get type(){return this.#o.type??"unknown"}get extra(){return this.#o.extra}get coordinates(){return this.#t.coordinates==null&&(this.#t.coordinates=this.#o.anchors.map(e=>new W({latitude:e.coordinates[1],longitude:e.coordinates[0],floorId:e.floorId}))),this.#t.coordinates}get nodes(){if(this.#e.mvf==null)throw new Q(Be("Connection.nodes","mapData.Nodes.getByType(connection)"));return this.#t.nodes?this.#t.nodes:(this.#t.nodes=this.#o.nodeIds.map(e=>this.#e.getById("node",e)).filter(Ge),this.#t.nodes)}get floors(){return this.coordinates.map(e=>e.floorId?this.#e.getById("floor",e.floorId):void 0).filter(Ge)}get focusTarget(){return this.coordinates}get navigationTarget(){return this.coordinates}toJSON(){return{__type:o.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id),extra:this.extra}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},te=en;y();var tn=class o extends Z{static __type="object";__type=o.__type;#e;#t;#o={};#n;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:t.record.geometry,properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#e=e,this.#t=t.floorId,this.#n=t.record}get type(){let e=this.#n.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=Xt(this.#e,this.id),this.#o.enterpriseLocations)}get locations(){return this.enterpriseLocations}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get center(){return this.#o.center==null&&(this.#o.center=K(this.#n.geometry,this.#t,this.#n.center,this.#n.id)),this.#o.center}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#r();return t?[...e,t]:e}#r(){if(this.#n.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new Ue(`${this.id}-polygon-image-${$()}`,this.#n.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(this.#o))this.#o[e]=null}},ce=tn;y();var on=class o extends Z{static __type="point-of-interest";__type=o.__type;#e;#t;#o={};#n;static is(e){return e.__type===o.__type}get navigationTarget(){return this.coordinate}constructor(e,t){super(e,{type:"Feature",geometry:t.record.geometry,properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#e=e,this.#n=t.record,this.#t=t.floorId}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=K(this.#n.geometry,this.#t,this.#n.center,this.#n.id)),this.#o.coordinate}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get images3D(){return this.#e.floorImagesByAnchorId.get(this.id)??[]}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:o.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in this.#o)this.#o[e]=null}},Oe=on;y();var nn=class o extends Z{static __type="annotation";__type=o.__type;#e;#t;#o={};#n;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:t.record.geometry,properties:{id:t.record.id,externalId:t.record.externalId,details:t.record.details}}),this.#e=e,this.#t=t.floorId,this.#n=t.record}#r(){let[e,t]=this.#n.symbolId.split("--");return{group:e,type:t}}get group(){return this.#r().group}get type(){return this.#r().type}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=K(this.#n.geometry,this.#t,void 0,this.#n.id)),this.#o.coordinate}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get name(){return super.name||this.#n.symbol?.name||""}get icon(){if(this.#o.icon==null){let e=this.#n.symbol??{url:"",name:""};this.#o.icon=super.icon||new Ae({mvfData:{url:e.url,altText:e.name},mapData:this.#e})}return this.#o.icon}get geoJSON(){return{type:"Feature",geometry:this.#n.geometry,properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}get navigationTarget(){return this.coordinate}toJSON(){return{__type:o.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(this.#o))delete this.#o[e]}},Pe=nn;y();y();var Br=Gn(Sr(),1);function Da(o,e,t){t===void 0&&(t={});var n=Lo(o),r=Lo(e),i=Br.default.union(n.coordinates,r.coordinates);return i.length===0?null:i.length===1?zn(i[0],t.properties):Xn(i,t.properties)}var Er=Da;var an=class o extends Ee{static __type="floor-stack";__type=o.__type;#e;#t={};#o;#n;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id,e),this.#e=e,this.#o=t.record,this.#n=t.facadeId}#r(e){let t=this.#o[e];return this.#e.getPropTranslation(this.__type,e,this.id,t)}get type(){return this.#o.type}get name(){let e=this.#r("name");return typeof e=="string"?e:""}get shortName(){let e=this.#r("shortName");return typeof e=="string"?e:""}get externalId(){return this.#o.externalId??""}get floors(){if(this.#t.floors==null){let e=this.#o.floorIds.reduce((t,n)=>{let r=this.#e.floorsById[n];return r&&t.push(r),t},[]);e.length===0&&A.error(`Floor stack ${this.id} has no floors`),this.#t.floors=e.sort((t,n)=>t.elevation-n.elevation)}return this.#t.floors}get defaultFloor(){if(this.#t.defaultFloor!=null)return this.#t.defaultFloor;let e=this.#o.defaultFloor?this.#e.getById("floor",this.#o.defaultFloor):void 0;if(e)return this.#t.defaultFloor=e,this.#t.defaultFloor;let t=this.floors;if(t.length!==0)return this.#t.defaultFloor=t.reduce((n,r)=>Math.abs(r.elevation)<Math.abs(n.elevation)?r:n),this.#t.defaultFloor}get facade(){return this.#n?this.#e.facadesById[this.#n]:void 0}get focusTarget(){return this}get geoJSON(){if(this.#t.geoJSON!=null)return this.#t.geoJSON;let e=null;for(let t of this.floors){let n=t.geoJSON;e==null?e=n:e=Er(e,n)}return this.#t.geoJSON=e??{type:"Feature",properties:null,geometry:{type:"Polygon",coordinates:[]}},this.#t.geoJSON}toJSON(){return{__type:o.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(this.#t))delete this.#t[e]}},xt=an;y();var cn=class o extends Ee{static __type="facade";__type=o.__type;static is(e){return e.__type===o.__type}#e;#t;#o={};constructor(e,t){super(t.record.id,e),this.#e=t.record,this.#t=e}get floorStack(){return this.#t.getById("floor-stack",this.#e.floorStackId)}get spaces(){if(!this.#o.spaces){this.#o.spaces=[];for(let e of this.#e.spaceIds){let t=this.#t.getById("space",e);t&&this.#o.spaces.push(t)}}return this.#o.spaces}get center(){if(!this.#o.center){let e=[];for(let n of this.spaces){let r=this.#t.geometryById[n.id];r?.kind==="space"&&e.push({type:"Feature",geometry:r.geometry,properties:null})}if(e.length===0)throw new Q("No geometry found for facade!");let t=st({type:"FeatureCollection",features:e});this.#o.center=new W({latitude:t.geometry.coordinates[1],longitude:t.geometry.coordinates[0],floorId:this.#e.floorId})}return this.#o.center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{id:this.id,__type:o.__type,floorStackId:this.#e.floorStackId,floorStack:this.floorStack,spaces:this.spaces}}},he=cn;y();y();var de=()=>({byId:Object.create(null),byFloorId:Object.create(null)});y();var Yt=()=>({spaceIdsByNodeId:Object.create(null),objectIdsByNodeId:Object.create(null),doorsByNodeId:Object.create(null),mvfConnectionsByNodeId:Object.create(null),locationIdsByNodeId:Object.create(null),entranceNodeIdsBySpaceId:Object.create(null),objectEntranceNodeIdsByObstructionId:Object.create(null),obstructionIdByEntranceId:Object.create(null)});y();var _r=(o,e,t)=>{let n=Object.create(null),r=Object.create(null),i=Object.create(null);if(o.annotations==null||o.annotationSymbols==null||o.geometry==null)return{annotationsById:n,annotationRecordsById:r,annotationRecordsByFloorId:i};let s=o.annotationSymbols;for(let[a,c]of Object.entries(o.annotations))if(!(c==null||c.length===0||!o.geometry[a]?.features.length)){i[a]=[];for(let l of c){let u=t.featureById.get(l.geometryId)?.geometry;if(u?.type!=="Point")continue;let f={id:l.id,floorId:a,symbolId:l.symbolKey,geometry:u,symbol:s[l.symbolKey],details:void 0,externalId:l.externalId};r[l.id]=f,i[a].push(f),n[l.id]=new Pe(e,{floorId:a,record:f})}}return{annotationsById:n,annotationRecordsById:r,annotationRecordsByFloorId:i}};y();y();function dt(o){let e=new Set,t=[];for(let n of o){let r=`${n.floorId}:${n.coordinates[0]},${n.coordinates[1]}`;e.has(r)||(e.add(r),t.push(n))}return t}y();function Nr(o){let e=0;for(let n of o)n!=null&&n.length>e&&(e=n.length);let t=new Array(e).fill(0);for(let n of o)if(n!=null)for(let r=0;r<n.length;r++)t[r]|=n[r]??0;return t}y();function Or(o,e){let t=o.featureById.get(e.geometryId)?.geometry;if(t==null)return null;let n=K(t,e.floorId);return{floorId:e.floorId,coordinates:[n.longitude,n.latitude]}}y();function dn(o,e){return o.type==="door"&&o.entrances.every(t=>e.featureById.get(t.geometryId)?.geometry.type==="LineString")}function wa(o){return o.entrances.length===0||o.exits.length===0?!1:new Set([...o.entrances,...o.exits].map(e=>e.floorId)).size>=2}var ln=(o,e)=>dn(o,e)&&!wa(o),Pr=(o,e,t)=>{let n={doorsById:Object.create(null),doorsByExternalId:Object.create(null),doorRecordsById:Object.create(null),doorRecordsByFloorId:Object.create(null),geometryIndex:de(),entranceGeometryIdsByDoorId:new Map},r=o.navigationFlags?.outdoors;for(let i of o.connections??[]){if(!ln(i,t))continue;let s=i.entrances.some(f=>Ye(f,r))||i.exits.some(f=>Ye(f,r)),{details:a}=i,c=a!=null?{name:a.name,description:a.description,...a.icon?{images:[{url:a.icon,altText:`${a.name} icon`}]}:{}}:void 0,l=a?.externalId||void 0,u=[];for(let f of i.entrances){let I=t.featureById.get(f.geometryId)?.geometry;if(I?.type!=="LineString")continue;u.push(f.geometryId);let b={id:i.id,floorId:f.floorId,geometry:I,externalId:l,details:c,isExterior:!!s};n.doorRecordsById[i.id]=b,(n.doorRecordsByFloorId[f.floorId]??=[]).push(b),n.geometryIndex.byId[i.id]={id:i.id,floorId:f.floorId,kind:"entrance",geometry:I},(n.geometryIndex.byFloorId[f.floorId]??=[]).push(n.geometryIndex.byId[i.id]),n.doorsById[i.id]=new me(e,{floorId:f.floorId,record:b}),l&&(n.doorsByExternalId[l]??=[]).push(n.doorsById[i.id])}n.entranceGeometryIdsByDoorId.set(i.id,u)}return n};var Dr=(o,e,t)=>{let n=Object.create(null),r=Object.create(null),i=o.navigationFlags?.accessible;for(let s of o.connections??[]){if(ln(s,t))continue;let a=i!=null&&s.entrances.some(l=>Ye(l,i))&&s.exits.some(l=>Ye(l,i)),c={id:s.id,type:s.type,externalId:s.details?.externalId??"",accessible:!!a,flags:Nr([...s.entrances.map(l=>l.flags),...s.exits.map(l=>l.flags)]),nodeIds:[],anchors:dt([...s.entrances,...s.exits].map(l=>Or(t,l)).filter(l=>l!=null))};s.extra&&(c.extra=s.extra),s.details?.name&&(c.details={name:s.details.name}),r[s.id]=c,s.type!=="door"&&(n[s.id]=new te(e,{record:c}))}return{connectionsById:n,connectionRecordsById:r}};y();var Aa=o=>`fc_${o.slice(3)}`,ka="outdoors",wr=(o,e,t)=>{let n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=Object.create(null),l=Object.create(null),u=Object.create(null),f=Object.create(null);for(let R of o.floors.features){let{id:E,elevation:x,subtitle:O,maxHeight:k,details:w}=R.properties,U={id:E,elevation:x,geometry:R.geometry??void 0,name:w?.name??"",externalId:w?.externalId??""};w?.shortName!==void 0&&(U.shortName=w.shortName),O!==void 0&&(U.subtitle=O),k!==void 0&&(U.maxHeight=k),i[E]=U,n[E]=new We(e,{record:U}),U.externalId&&(r[U.externalId]??=[]).push(n[E])}let I=new Map;for(let[R,E]of Object.entries(o.facade??{}))for(let x of Object.values(E??{})){let O=I.get(x.floorStackId)??[];for(let k of x.geometryIds)O.push({floorId:R,spaceId:t.space.get(k)?.ids[0]??""});I.set(x.floorStackId,O)}let b=(o.floorStacks??[]).map(R=>{let E={id:R.id,floorIds:R.floors,type:"Building",name:R.details?.name??"",shortName:R.details?.shortName??"",externalId:R.details?.externalId??""};return R.defaultFloor&&(E.defaultFloor=R.defaultFloor),E});o.outdoors!=null&&o.outdoors.floors.length>0&&b.push({id:ka,floorIds:o.outdoors.floors,type:"Outdoor",name:"Outdoor",externalId:"outdoors"});for(let R of b){let E=I.get(R.id),x=E!=null?Aa(R.id):void 0;if(c[R.id]=R,s[R.id]=new xt(e,{record:R,facadeId:x}),R.externalId&&(a[R.externalId]??=[]).push(s[R.id]),E!=null&&x!=null){let O={id:x,floorStackId:R.id,spaceIds:E.map(k=>k.spaceId),floorId:E[0]?.floorId};u[x]=O,l[x]=new he(e,{record:O});for(let k of E)f[k.spaceId]=l[x]}}return{floorsById:n,floorsByExternalId:r,floorRecordsById:i,floorStacksById:s,floorStacksByExternalId:a,floorStackRecordsById:c,facadesById:l,facadeRecordsById:u,facadesBySpaceId:f}};y();var qt=(o,e,t)=>o.startsWith(e)?t+o.slice(e.length):o,Ar=o=>qt(o,"g_","s_"),kr=o=>qt(o,"g_","o_"),Ca=o=>qt(o,"g_","ar_"),ja=o=>qt(o,"g_","w_");function La(o,e,t){switch(o.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=o.type.replace("Multi","");return o.coordinates.map((r,i)=>({id:`${e}-${i}`,geometry:{type:n,coordinates:r},kind:t}))}default:return[{id:e,geometry:o,kind:t}]}}function Va(o){let e=new Map;for(let t of Object.values(o.kinds??{}))if(t!=null)for(let[n,r]of Object.entries(t))e.set(n,r);for(let t of o.connections??[])if(t.type!=="door")for(let n of[...t.entrances,...t.exits])e.set(n.geometryId,`connection.${t.type}`);return e}var Cr=o=>{let e=new Set;for(let t of Object.values(o??{}))if(t!=null)for(let n of Object.keys(t))e.add(n);return e};function jr(o){let e=Va(o),t=new Map,n=[];for(let[f,I]of Object.entries(o.geometry??{}))for(let b of I?.features??[])t.set(b.properties.id,b),n.push({feature:b,floorId:f});let r=Cr(o.walkable),i=Cr(o.nonwalkable),s=f=>new Set([...e].filter(([,I])=>I===f).map(([I])=>I)),a=s("area"),c=(f,I)=>{let b=new Map;if(f.size===0)return b;for(let{feature:R,floorId:E}of n){let x=R.properties.id;if(!f.has(x))continue;let O=La(R.geometry,I(x),e.get(x));b.set(x,{ids:O.map(k=>k.id),parts:O,floorId:E,source:R})}return b},l=new Set([...r].filter(f=>!a.has(f))),u={space:c(l,Ar),obstruction:c(i,kr),area:c(a,Ca),object:c(s("object"),kr),window:c(s("window"),ja),kindById:e,featureById:t,footprintIds:new Set((o.defaultStyle?.ExteriorWalls?.geometryAnchors??[]).map(f=>f.geometryId))};return r.size===0&&i.size===0&&a.size===0&&(u.space=c(new Set(n.map(({feature:f})=>f.properties.id)),Ar)),u}y();var Lr=(o,e,t)=>{let n=o.get(e);n?n.push(t):o.set(e,[t])};function Ga(o,e){let t={annotationIdsByGeometryId:new Map,connectionIdsByGeometryId:new Map,doorIdsByGeometryId:new Map};for(let n of Object.values(o.annotations??{}))for(let r of n??[])Lr(t.annotationIdsByGeometryId,r.geometryId,r.id);for(let n of o.connections??[]){let r=dn(n,e)?t.doorIdsByGeometryId:t.connectionIdsByGeometryId,i=new Set;for(let s of[...n.entrances,...n.exits]){let a=`${s.geometryId}_${s.floorId}`;i.has(a)||(i.add(a),Lr(r,s.geometryId,n.id))}}return t}function Ua(o){let e=new Set,t=0;for(let n of o)e.has(n)||(e.add(n),o[t++]=n);o.length=t}var Vr=(o,e,t)=>{let n={locationProfilesById:Object.create(null),locationCategoriesById:Object.create(null),locationProfileRecordsById:Object.create(null),locationCategoryRecordsById:Object.create(null),locationProfilesByExternalId:Object.create(null),locationProfilesByCategoryId:Object.create(null),locationCategoriesByParentId:Object.create(null),locationProfilesByAttachedFeatureId:Object.create(null)},r=Ga(o,t);for(let i of o.locations??[]){let s={id:i.id,name:i.details.name,externalId:i.details.externalId,description:i.details.description,logo:i.logo,phone:i.phone,social:i.social,pictures:i.images,links:i.links,website:i.website,icon:i.details.icon,searchTags:i.searchTags,categoryIds:i.categories,spaceIds:[],objectIds:[],doorIds:[],connectionIds:[],annotationIds:[],areaIds:[],openingHoursSpecification:i.openingHours??[],extra:i.extra};for(let{geometryId:c}of i.geometryAnchors)s.spaceIds.push(...t.space.get(c)?.ids??[]),s.objectIds.push(...t.obstruction.get(c)?.ids??[]),s.areaIds.push(...t.area.get(c)?.ids??[]),s.doorIds.push(...r.doorIdsByGeometryId.get(c)??[]),s.connectionIds.push(...r.connectionIdsByGeometryId.get(c)??[]),s.annotationIds.push(...r.annotationIdsByGeometryId.get(c)??[]);for(let c of[s.spaceIds,s.objectIds,s.areaIds,s.doorIds,s.connectionIds,s.annotationIds])Ua(c);let a=new De(e,{record:s});n.locationProfileRecordsById[i.id]=s,n.locationProfilesById[i.id]=a,s.externalId&&(n.locationProfilesByExternalId[s.externalId]??=[]).push(a);for(let c of s.categoryIds??[])(n.locationProfilesByCategoryId[c]??=[]).push(a);for(let c of[...s.objectIds,...s.spaceIds,...s.annotationIds,...s.connectionIds,...s.doorIds,...s.areaIds])c&&(n.locationProfilesByAttachedFeatureId[c]??=[]).push(a)}for(let i of o.locationCategories??[]){let s={id:i.id,name:i.details.name,icon:i.details.icon??"",parent:i.parent};n.locationCategoryRecordsById[i.id]=s,n.locationCategoriesById[i.id]=new Mt(e,{record:s}),i.parent&&(n.locationCategoriesByParentId[i.parent]??=[]).push(n.locationCategoriesById[i.id])}return n};y();y();var Gr=new Set(["wall","area"]),Ur=new Set(["desk-entrance"]);function Qt(o,e){return!(o==="Polygon"||o==="MultiPolygon")&&e===null||e?.includes("connection")||Ur.has(e??"")?"skip":e==="poi"||o==="Point"&&e==null?"poi":o==="Point"?"unknown-point":"space"}function Kt(o){return!Gr.has(o?.toLowerCase()??"")}y();var $r=Gn(Ws(),1);function Ft(o){if(o.type==="Polygon")try{let e=Wa(o);if(e==null)return;if($a(e,o))return e;let[t,n]=(0,$r.default)(o.coordinates,Ja(o));return[t,n]}catch{return}}function Wa(o){let e=o.coordinates,t=0,n=0,r=0;for(let b of e)for(let R=0;R<b.length-1;R++)t+=b[R][0],n+=b[R][1],r++;if(r===0)return;let i=t/r,s=n/r,a=0,c=0,l=0,u,f;for(let b of e)for(let R of b){let E=R[0]-i,x=R[1]-s;if(u!==void 0&&f!==void 0){let O=u*x-E*f;l+=O,a+=(u+E)*O,c+=(f+x)*O}u=E,f=x}if(l===0)return[i,s];let I=1/(3*l);return[i+I*a,s+I*c]}function $a([o,e],t){let n=t.coordinates;if(!Wr(o,e,n[0]))return!1;for(let r=1;r<n.length;r++)if(Wr(o,e,n[r]))return!1;return!0}function Wr(o,e,t){let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let[s,a]=t[r],[c,l]=t[i];a>e!=l>e&&o<(c-s)*(e-a)/(l-a)+s&&(n=!n)}return n}function Ja(o){let e=o.coordinates[0],t=0;for(let n=0;n<e.length-1;n++)t+=e[n][0]*e[n+1][1]-e[n+1][0]*e[n][1];return t=Math.abs(t/2),!Number.isFinite(t)||t<=0?1e-9:Math.sqrt(t)*.01}function pn(o){if(o!=null)return{name:o.name,description:o.description,images:o.icon?[{url:o.icon,altText:o.name?`${o.name} icon`:"icon"}]:void 0}}var Jr=o=>o?.externalId||void 0;function Zt(o,e,t,n,r){o.byId[e]={id:e,floorId:t,kind:n,geometry:r},(o.byFloorId[t]??=[]).push(o.byId[e])}var zr=(o,e)=>{let t={spacesById:Object.create(null),spacesByExternalId:Object.create(null),poisById:Object.create(null),poisByExternalId:Object.create(null),objectsById:Object.create(null),objectsByExternalId:Object.create(null),areasById:Object.create(null),areasByExternalId:Object.create(null),spaceRecordsById:Object.create(null),poiRecordsById:Object.create(null),objectRecordsById:Object.create(null),objectRecordsByFloorId:Object.create(null),areaRecordsById:Object.create(null),spaceRecordsByFloorId:Object.create(null),poiRecordsByFloorId:Object.create(null),areaRecordsByFloorId:Object.create(null),geometryIndex:de()};for(let n of e.space.values())za(o,n,t);for(let n of e.obstruction.values())Xa(o,n,e,t);for(let n of e.area.values())Ha(o,n,t);return t};function za(o,e,t){let{floorId:n,source:r}=e,i=pn(r.properties.details),s=Jr(r.properties.details);for(let a of e.parts){if(a.geometry.type.startsWith("Multi"))continue;let c=Qt(a.geometry.type,a.kind??null);if(c!=="skip")if(c==="poi"){let l={id:a.id,floorId:n,geometry:a.geometry,center:Ft(a.geometry),externalId:s,details:i};t.poiRecordsById[a.id]=l,(t.poiRecordsByFloorId[n]??=[]).push(l),Zt(t.geometryIndex,a.id,n,"space",a.geometry),t.poisById[a.id]=new Oe(o,{floorId:n,record:l}),s&&(t.poisByExternalId[s]??=[]).push(t.poisById[a.id])}else if(c==="unknown-point")A.warn("Encountered a point space with an unknown kind!",a.kind);else{let l={id:a.id,floorId:n,geometry:a.geometry,kind:a.kind,center:Ft(a.geometry),externalId:s,details:i,doorIds:[],enterpriseLocationIds:[]};t.spaceRecordsById[a.id]=l,(t.spaceRecordsByFloorId[n]??=[]).push(l),Zt(t.geometryIndex,a.id,n,"space",a.geometry),t.spacesById[a.id]=new ee(o,{floorId:n,record:l}),s&&(t.spacesByExternalId[s]??=[]).push(t.spacesById[a.id])}}}function Xa(o,e,t,n){let{floorId:r,source:i}=e,s=pn(i.properties.details),a=Jr(i.properties.details);for(let c of e.parts){if(c.geometry.type==="Point"||c.geometry.type.startsWith("Multi")||!Kt(c.kind))continue;let l={id:c.id,floorId:r,geometry:c.geometry,kind:c.kind,center:Ft(c.geometry),externalId:a,details:s,footprintComponent:t.footprintIds.has(i.properties.id)};n.objectRecordsById[c.id]=l,(n.objectRecordsByFloorId[r]??=[]).push(l),Zt(n.geometryIndex,c.id,r,"obstruction",c.geometry),n.objectsById[c.id]=new ce(o,{floorId:r,record:l}),a&&(n.objectsByExternalId[a]??=[]).push(n.objectsById[c.id])}}function Ha(o,e,t){let{floorId:n,source:r}=e,i=pn(r.properties.details),s=r.properties.details?.externalId??"";for(let a of e.parts){if(a.geometry.type!=="Polygon")continue;let c={id:a.id,floorId:n,geometry:a.geometry,details:i,externalId:s},l=Ft(a.geometry);l!==void 0&&(c.center=l),t.areaRecordsById[a.id]=c,(t.areaRecordsByFloorId[n]??=[]).push(c),Zt(t.geometryIndex,a.id,n,"area",a.geometry),t.areasById[a.id]=new ye(o,{floorId:n,record:c}),s&&(t.areasByExternalId[s]??=[]).push(t.areasById[a.id])}}y();function Xr(o){for(let e of Object.keys(o))o[e]===void 0&&delete o[e];return o}var Hr=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=o.defaultStyle;if(r==null)return{styleRecordsById:t,styleIdByGeometryId:n};let i=new Map;for(let a of[...e.space.values(),...e.obstruction.values()])for(let c of a.parts)i.set(c.id,c.geometry.type);let s=a=>{t[a.id]=a;for(let c of a.geometryIds)n[c]=a.id};for(let[a,c]of Object.entries(r)){let l=c.geometryAnchors.flatMap(I=>[...e.space.get(I.geometryId)?.ids??[],...e.obstruction.get(I.geometryId)?.ids??[]]),u={};for(let I of l){let b=i.get(I);b!=null&&(u[b]??=[]).push(I)}let f=c.extra?.showImage;u.Point?.length&&s({id:`${a}.Point`,type:"point",geometryIds:u.Point,showImage:f!==void 0?f===!0:c.opacity!==0}),u.LineString?.length&&s(Xr({id:`${a}.LineString`,type:"lineString",geometryIds:u.LineString,altitude:c.altitude,color:c.color,height:c.height,opacity:c.opacity,width:c.buffer,topColor:c.topColor})),u.Polygon?.length&&s(Xr({id:`${a}.Polygon`,type:"polygon",geometryIds:u.Polygon,altitude:c.altitude,color:c.color,height:c.height,opacity:c.opacity,showImage:f!==void 0?f===!0:void 0,topColor:c.topColor}))}return{styleRecordsById:t,styleIdByGeometryId:n}};y();var Yr=o=>{let e=Object.create(null);for(let[t,n]of o.obstruction){let r=o.footprintIds.has(t);for(let i of n.parts){if(i.geometry.type!=="LineString"||i.kind?.toLowerCase()!=="wall")continue;let s={id:i.id,floorId:n.floorId,geometry:i.geometry,exterior:r};(e[n.floorId]??=[]).push(s)}}return{wallRecordsByFloorId:e}};y();var qr=(o,e)=>{let t=Object.create(null);for(let[n,r]of Object.entries(o.floorImages??{})){let i=[];for(let s of r?.features??[]){let a=[...s.geometry.coordinates];if("verticalOffset"in s.properties){i.push({floorId:n,coordinates:a,properties:{...s.properties}});continue}let{geometryId:c,...l}=s.properties,u=e.space.get(c)?.ids[0]??e.obstruction.get(c)?.ids[0];u!=null&&i.push({floorId:n,coordinates:a,properties:{...l,anchorId:u}})}t[n]=i}return{floorImageRecordsByFloorId:t}};y();var Qr=o=>{let e=o.manifest.features[0],[t,n]=e.geometry.coordinates;return{manifestRecord:{name:e.properties.name,organizationId:e.properties.orgId??"",center:[t,n],naturalBearing:e.properties.naturalBearing??0}}};var Zr=(o,e)=>{let t=jr(e),n=wr(e,o,t),r=zr(o,t),i=Pr(e,o,t),s=Dr(e,o,t),a=_r(e,o,t),c=Vr(e,o,t),l=Hr(e,t),u=Yr(t),f=qr(e,t),I=Qr(e);qa(r.spaceRecordsById,i.doorRecordsById);let{geometryIndex:b,...R}=r,{geometryIndex:E,entranceGeometryIdsByDoorId:x,...O}=i;return{...n,...R,...O,...s,...a,...c,...l,...u,...f,...I,decorationsById:Object.create(null),floorTextRecordsByFloorId:Object.create(null),geometryIndex:Ya([b,E]),nodeIndex:Yt(),nodesById:Object.create(null),nodesByExternalId:Object.create(null),nodeRecordsById:Object.create(null),nodeRecordsByFloorId:Object.create(null),mvfSpacesById:Object.create(null),mvfObstructionById:Object.create(null),mvfEntrancesById:Object.create(null),mvfAreasById:Object.create(null),mvfAnnotationsById:Object.create(null)}};function Ya(o){let e=de();for(let t of o){for(let n in t.byId)e.byId[n]=t.byId[n];for(let n in t.byFloorId)(e.byFloorId[n]??=[]).push(...t.byFloorId[n])}return e}var Kr=1e-7;function qa(o,e){let t=new Map;for(let n in o){let{floorId:r,geometry:i}=o[n];if(i.type!=="Polygon")continue;let s=t.get(r)??[];s.push({id:n,geometry:i}),t.set(r,s)}for(let n in e){let r=e[n];if(r.geometry.type!=="LineString")continue;let[[i,s],[a,c]]=r.geometry.coordinates,l=(i+a)/2,u=(s+c)/2,f=Math.hypot(a-i,c-s)||1,I=-(c-s)/f*Kr,b=(a-i)/f*Kr,R=[l+I,u+b],E=[l-I,u-b];for(let x of t.get(r.floorId)??[])(It(R,x.geometry)||It(E,x.geometry))&&o[x.id].doorIds.push(n)}}y();y();var ei=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=Object.create(null),i=Object.create(null);for(let s of o["node.geojson"].features){let a=s.properties.floor??s.properties.map,c={id:s.properties.id,floorId:a,geometry:s.geometry,externalId:s.properties.externalId,neighborIds:s.properties.neighbors.map(u=>u.id),spaceIds:s.properties.space,flags:s.properties.flags};r[s.properties.id]=c;let l=new le(e,{record:c});t[s.properties.id]=l,s.properties.externalId&&(n[s.properties.externalId]==null&&(n[s.properties.externalId]=[]),n[s.properties.externalId].push(l)),i[a]||(i[a]=[]),i[a].push(c)}return{nodesById:t,nodesByExternalId:n,nodeRecordsById:r,nodeRecordsByFloorId:i}};y();var ti=(o,e,t)=>{let n=new Map;for(let s of o["node.geojson"]?.features??[])n.set(s.properties.id,{floorId:s.properties.floor??s.properties.map,coordinates:s.geometry.coordinates});let r=Object.create(null),i=Object.create(null);for(let s of o["connection.json"]){s.nodes.forEach(c=>t.mvfConnectionsByNodeId[c]=s);let a={id:s.id,type:s.type,externalId:s.externalId,extra:s.extra,accessible:s.accessible??!1,flags:s.flags!=null?[...s.flags]:[],nodeIds:s.nodes,anchors:dt(s.nodes.map(c=>n.get(c)).filter(c=>c!=null)),details:s.details};i[s.id]=a,s.type!=="door"&&(r[s.id]=new te(e,{record:a}))}return{connectionsById:r,connectionRecordsById:i}};y();var oi=(o,e,t)=>{let n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=Object.create(null),l=Object.create(null),u=Object.create(null),f=Object.create(null),I=de(),b=globalThis.Object.keys(o.space);for(let R of b){let E=o.space[R];if(E!=null)for(let x of E.features){if(f[x.properties.id]=x,x.properties.kind==="desk-entrance"){let k=t.objectEntranceNodeIdsByObstructionId[x.properties.externalId]??(t.objectEntranceNodeIdsByObstructionId[x.properties.externalId]=[]);for(let w of x.properties.destinationNodes??[])k.push(w)}let O=Qt(x.geometry.type,"kind"in x.properties?x.properties.kind??null:void 0);if(O!=="skip")if(O==="poi"){let k={id:x.properties.id,floorId:R,geometry:x.geometry,center:x.properties.center,externalId:x.properties.externalId||void 0,details:x.properties.details};c[x.properties.id]=k,I.byId[x.properties.id]={id:x.properties.id,floorId:R,kind:"space",geometry:x.geometry},I.byFloorId[R]==null&&(I.byFloorId[R]=[]),I.byFloorId[R].push(I.byId[x.properties.id]);let w=new Oe(e,{floorId:R,record:k});i[x.properties.id]=w,u[R]==null&&(u[R]=[]),u[R].push(k),x.properties.externalId&&(s[x.properties.externalId]==null&&(s[x.properties.externalId]=[]),s[x.properties.externalId].push(w))}else if(O==="unknown-point")A.warn("Encountered a point space with an unknown kind!",x.properties.kind);else{let k={id:x.properties.id,floorId:R,geometry:x.geometry,kind:x.properties.kind,center:x.properties.center,externalId:x.properties.externalId||void 0,details:x.properties.details,doorIds:[],enterpriseLocationIds:[],destinationNodes:x.properties.destinationNodes};a[x.properties.id]=k,I.byId[x.properties.id]={id:x.properties.id,floorId:R,kind:"space",geometry:x.geometry},I.byFloorId[R]==null&&(I.byFloorId[R]=[]),I.byFloorId[R].push(I.byId[x.properties.id]);let w=new ee(e,{floorId:R,record:k});n[x.properties.id]=w,l[R]==null&&(l[R]=[]),l[R].push(k),x.properties.externalId&&(r[x.properties.externalId]==null&&(r[x.properties.externalId]=[]),r[x.properties.externalId].push(w))}}}return{spacesById:n,spacesByExternalId:r,poisById:i,poisByExternalId:s,spaceRecordsById:a,poiRecordsById:c,spaceRecordsByFloorId:l,poiRecordsByFloorId:u,geometryIndex:I,mvfSpacesById:f}};y();var ni=(o,e,t)=>{let n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=de(),l=globalThis.Object.keys(o.obstruction);for(let u of l){let f=o.obstruction[u];if(f!=null)for(let I of f.features){a[I.properties.id]=I;for(let E of I.properties.entrances)t.obstructionIdByEntranceId[E]=I.properties.id;if(!Kt(I.properties.kind))continue;let b={id:I.properties.id,floorId:u,geometry:I.geometry,kind:I.properties.kind,center:I.properties.center,externalId:I.properties.externalId||void 0,details:I.properties.details,footprintComponent:I.properties.footprintComponent};i[I.properties.id]=b,(s[u]??=[]).push(b),c.byId[I.properties.id]={id:I.properties.id,floorId:u,kind:"obstruction",geometry:I.geometry},c.byFloorId[u]==null&&(c.byFloorId[u]=[]),c.byFloorId[u].push(c.byId[I.properties.id]);let R=new ce(e,{floorId:u,record:b});n[I.properties.id]=R,I.properties.externalId&&(r[I.properties.externalId]==null&&(r[I.properties.externalId]=[]),r[I.properties.externalId].push(R))}}return{objectsById:n,objectsByExternalId:r,objectRecordsById:i,objectRecordsByFloorId:s,geometryIndex:c,mvfObstructionById:a}};y();var ri=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=Object.create(null);if("floor.geojson"in o&&o["floor.geojson"]!=null)for(let i of o["floor.geojson"].features){let s={id:i.properties.id,elevation:i.properties.elevation,geometry:i.geometry??void 0};i.properties.name!==void 0&&(s.name=i.properties.name),i.properties.shortName!==void 0&&(s.shortName=i.properties.shortName),i.properties.subtitle!==void 0&&(s.subtitle=i.properties.subtitle),i.properties.externalId!==void 0&&(s.externalId=i.properties.externalId),i.properties.maxHeight!==void 0&&(s.maxHeight=i.properties.maxHeight),i.properties.metadata!==void 0&&(s.metadata=i.properties.metadata),r[i.properties.id]=s;let a=new We(e,{record:s});t[i.properties.id]=a,i.properties.externalId&&(n[i.properties.externalId]==null&&(n[i.properties.externalId]=[]),n[i.properties.externalId].push(a))}else for(let i of o["map.geojson"]){let s={id:i.id,elevation:i.elevation};i.name!==void 0&&(s.name=i.name),i.shortName!==void 0&&(s.shortName=i.shortName),i.subtitle!==void 0&&(s.subtitle=i.subtitle),i.externalId!==void 0&&(s.externalId=i.externalId),i.maxHeight!==void 0&&(s.maxHeight=i.maxHeight),i.metadata!==void 0&&(s.metadata=i.metadata),r[i.id]=s;let a=new We(e,{record:s});t[i.id]=a}return{floorsById:t,floorsByExternalId:n,floorRecordsById:r}};y();var ii=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=o["floorstack.json"]||o["mapstack.json"]||o["mapstack.geojson"];if(c!=null)for(let l of c){let u=o.facade?.[l.id],f={id:l.id,floorIds:l.floors??l.maps??[]};l.type!==void 0&&(f.type=l.type),l.name!==void 0&&(f.name=l.name),l.shortName!==void 0&&(f.shortName=l.shortName),l.externalId!==void 0&&(f.externalId=l.externalId),l.defaultFloor!==void 0&&(f.defaultFloor=l.defaultFloor),l.metadata!==void 0&&(f.metadata=l.metadata),r[l.id]=f;let I=new xt(e,{record:f,facadeId:u?.id});if(t[l.id]=I,l.externalId&&(n[l.externalId]==null&&(n[l.externalId]=[]),n[l.externalId].push(I)),u){let b={id:u.id,floorStackId:l.id,spaceIds:u.spaces.map(E=>E.spaceId),floorId:u.spaces[0]?.floorId};i[u.id]=b;let R=new he(e,{record:b});s[u.id]=R;for(let E of u.spaces)a[E.spaceId]=R}}return{floorStacksById:t,floorStacksByExternalId:n,floorStackRecordsById:r,facadeRecordsById:i,facadesById:s,facadesBySpaceId:a}};y();var Qa={polygon:"polygons",lineString:"lineStrings",point:"points"},si=o=>{let e=Object.create(null),t=Object.create(null);for(let[n,r]of Object.entries(o["styles.json"]??{})){if(r==null)continue;let i="polygons"in r?"polygon":"lineStrings"in r?"lineString":"points"in r?"point":null;if(i==null)continue;let{[Qa[i]]:s,...a}=r,c={...a,id:n,type:i,geometryIds:[...s]};e[n]=c;for(let l of c.geometryIds)t[l]=n}return{styleRecordsById:e,styleIdByGeometryId:t}};y();var ai=o=>{let e=Object.create(null);for(let[t,n]of Object.entries(o.obstruction??{}))if(n!=null)for(let r of n.features){if(r.geometry?.type!=="LineString"||r.properties.kind?.toLowerCase()!=="wall")continue;let i={id:r.properties.id,floorId:t,geometry:r.geometry,exterior:r.properties.footprintComponent===!0,doorIds:[...r.properties.entrances??[]]};(e[t]??=[]).push(i)}return{wallRecordsByFloorId:e}};y();var ci=o=>{let e=Object.create(null);for(let[t,n]of Object.entries(o.floorImages??{}))n!=null&&(e[t]=n.features.map(r=>({floorId:t,coordinates:[...r.geometry.coordinates],properties:{...r.properties}})));return{floorImageRecordsByFloorId:e}};y();var di=o=>{let e=Object.create(null);for(let[t,n]of Object.entries(o.enterprise?.floorText??{}))n!=null&&(e[t]=n.features.map(r=>({floorId:t,geometry:{type:"Point",coordinates:[...r.geometry.coordinates]},properties:{...r.properties}})));return{floorTextRecordsByFloorId:e}};y();var li=o=>{let e=o["manifest.geojson"].features[0],[t,n]=e.geometry.coordinates,r={name:e.properties.name,organizationId:e.properties.org_id??"",center:[t,n],naturalBearing:e.properties.naturalBearing??0},i=o.enterprise?.venue?.defaultMap;return i&&(r.defaultFloorId=i),{manifestRecord:r}};y();y();function pi(o){let e;for(let t of o??[])t.effect==="bevel"&&(e={enabled:!0,thickness:t.thickness,size:t.size,segments:t.segments});return e}var ui=o=>{let e=Object.create(null),t=new Set,n=new Set,r=a=>e[a]??={};for(let a of Object.values(o.space??{}))for(let c of a?.features??[])t.add(c.properties.id);let i=o["manifest.geojson"]?.features?.[0]?.properties?.extensions,s=i?.["geometry-effects"]!=null?o["geometry-effects.json"]:void 0;s==null&&i?.["geometry-effects"]==null&&o["geometry-effects.json"]!=null&&A.warn("geometry-effects.json is present but not declared in manifest extensions; ignoring it. Re-export the bundle to enable geometry effects.");for(let[a,c]of Object.entries(s??{})){if(!t.has(a))continue;let l=pi(c);l!=null&&(r(a).bevel=l)}for(let a of Object.values(o.obstruction??{}))for(let c of a?.features??[])n.add(c.properties.id);for(let a of Object.values(o.textAreas??{}))for(let c of a?.features??[]){if(!("anchorId"in c.properties))continue;let{anchorId:l}=c.properties;if(!t.has(l)&&!n.has(l))continue;let[u,f]=c.geometry.coordinates;r(l).textArea={...c.properties,position:[u,f]}}for(let[a,c]of Object.entries(o.enterprise?.enterpriseStyles??{}))for(let l of c.geometryAnchors)t.has(l.geometryId)&&(r(l.geometryId).style={styleId:a,edgeOffset:c.edgeOffset});for(let a of o.enterprise?.textures??[])for(let c of a.geometryAnchors)!t.has(c.geometryId)&&!n.has(c.geometryId)||(r(c.geometryId).textures??=[]).push(a);return{decorationsById:e}};y();var fi=(o,e,t,n)=>{let r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=Object.create(null),l=de(),u=globalThis.Object.keys(o.entrance);for(let f of u){let I=o.entrance[f];if(I!=null)for(let b of I.features){c[b.properties.id]=b;let R=t.obstructionIdByEntranceId[b.properties.id],E=b.properties.isExterior!==void 0?b.properties.isExterior:R!=null?n[R]?.properties.footprintComponent??!1:!1,x={id:b.properties.id,floorId:f,geometry:b.geometry,externalId:b.properties.externalId||void 0,details:b.properties.details,isExterior:E,obstructionId:R,nodeId:b.properties.node};s[b.properties.id]=x,a[f]==null&&(a[f]=[]),a[f].push(x),l.byId[b.properties.id]={id:b.properties.id,floorId:f,kind:"entrance",geometry:b.geometry},l.byFloorId[f]==null&&(l.byFloorId[f]=[]),l.byFloorId[f].push(l.byId[b.properties.id]);let O=new me(e,{floorId:f,record:x});b.properties.node&&(t.doorsByNodeId[b.properties.node]=O),r[b.properties.id]=O,b.properties.externalId&&(i[b.properties.externalId]==null&&(i[b.properties.externalId]=[]),i[b.properties.externalId].push(O))}}return{doorsById:r,doorsByExternalId:i,doorRecordsById:s,doorRecordsByFloorId:a,geometryIndex:l,mvfEntrancesById:c}};y();var gi=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=Object.create(null),i=Object.create(null);if(o.annotation==null)return{annotationsById:t,annotationRecordsById:n,annotationRecordsByFloorId:r,mvfAnnotationsById:i};let s=o["annotation-symbols.json"]||{},a=globalThis.Object.keys(o.annotation);for(let c of a){let l=o.annotation[c];if(l!=null)for(let u of l.features){i[u.properties.id]=u;let f={id:u.properties.id,floorId:c,symbolId:u.properties.symbolId,geometry:u.geometry,symbol:s[u.properties.symbolId],details:u.properties.details};u.properties.externalId!==void 0&&(f.externalId=u.properties.externalId),n[u.properties.id]=f,r[c]==null&&(r[c]=[]),r[c].push(f);let I=new Pe(e,{floorId:c,record:f});t[u.properties.id]=I}}return{annotationsById:t,annotationRecordsById:n,annotationRecordsByFloorId:r,mvfAnnotationsById:i}};y();var yi=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=de();if(o.area==null)return{areasById:t,areasByExternalId:n,areaRecordsById:r,areaRecordsByFloorId:i,geometryIndex:a,mvfAreasById:s};let c=globalThis.Object.keys(o.area);for(let l of c){let u=o.area[l];if(u!=null)for(let f of u.features){s[f.properties.id]=f;let I={id:f.properties.id,floorId:l,geometry:f.geometry,details:f.properties.details};f.properties.externalId!==void 0&&(I.externalId=f.properties.externalId),f.properties.center!==void 0&&(I.center=f.properties.center),r[f.properties.id]=I,i[l]==null&&(i[l]=[]),i[l].push(I),a.byId[f.properties.id]={id:f.properties.id,floorId:l,kind:"area",geometry:f.geometry},a.byFloorId[l]==null&&(a.byFloorId[l]=[]),a.byFloorId[l].push(a.byId[f.properties.id]);let b=new ye(e,{floorId:l,record:I});t[f.properties.id]=b,f.properties.externalId&&(n[f.properties.externalId]==null&&(n[f.properties.externalId]=[]),n[f.properties.externalId].push(b))}}return{areasById:t,areasByExternalId:n,areaRecordsById:r,areaRecordsByFloorId:i,geometryIndex:a,mvfAreasById:s}};y();var mi=(o,e,t,n,r,i)=>{if(o.floorImages!=null)for(let s in o.floorImages){let a=o.floorImages[s]?.features;if(a!=null){for(let c of a)if("anchorId"in c.properties){let l=c.properties;if(e[l.anchorId]!=null||t[l.anchorId]!=null){let u=r[l.anchorId]??i[l.anchorId];u!=null&&(u.image={path:l.path})}else{let u=n[l.anchorId];u!=null&&(u.image={path:l.path})}}}}};y();var hi=o=>{let e=Object.create(null);for(let t of o?.locations??[])e[t.id]=t;return{mvf3LocationsById:e}},Ii=(o,e,t)=>{let n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=Object.create(null),l=Object.create(null),u=Object.create(null);for(let f of e["location.json"]||[]){let I={id:f.id,name:f.name,externalId:f.externalId,description:f.description,logo:f.logo,phone:f.phone,social:f.social,pictures:f.pictures,links:f.links,website:f.website,icon:f.icon,searchTags:f.searchTags,categoryIds:f.categories,spaceIds:f.spaces?.map(E=>E.id)??[],objectIds:f.obstructions?.map(E=>E.id)??[],doorIds:f.entrances?.map(E=>E.id)??[],connectionIds:f.connections??[],annotationIds:f.annotations?.map(E=>E.id)??[],areaIds:f.areas?.map(E=>E.id)??[],openingHoursSpecification:f.openingHoursSpecification,extra:t[f.id]?.extra};i[f.id]=I;let b=new De(o,{record:I});if(n[f.id]=b,f.externalId&&(c[f.externalId]==null&&(c[f.externalId]=[]),c[f.externalId].push(b)),f.categories)for(let E of f.categories)l[E]==null&&(l[E]=[]),l[E].push(b);let R=[...f.obstructions?.map(E=>E.id)??[],...f.spaces?.map(E=>E.id)??[],...f.annotations?.map(E=>E.id)??[],...f.connections??[],...f.entrances?.map(E=>E.id)??[],...f.areas?.map(E=>E.id)??[]];for(let E of R)E&&(u[E]==null&&(u[E]=[]),u[E].push(b))}for(let f of e["category.json"]||[]){let I={id:f.id,name:f.name,icon:f.icon,parent:f.parent};s[f.id]=I;let b=new Mt(o,{record:I});r[f.id]=b,f.parent&&(a[f.parent]==null&&(a[f.parent]=[]),a[f.parent].push(b))}return{locationCategoriesByParentId:a,locationProfilesById:n,locationCategoriesById:r,locationProfileRecordsById:i,locationCategoryRecordsById:s,locationProfilesByExternalId:c,locationProfilesByCategoryId:l,locationProfilesByAttachedFeatureId:u}};y();var bi=(o,e)=>{for(let t in e){let n=e[t];if(n==null)continue;let r=n.destinationNodes??[];if(r.length<1)continue;let i=[];for(let s of r)o.doorsByNodeId[s]!=null&&i.push(s),o.spaceIdsByNodeId[s]==null&&(o.spaceIdsByNodeId[s]=[]),o.spaceIdsByNodeId[s].push(n.id);i.length>0&&(o.entranceNodeIdsBySpaceId[t]=i)}for(let t in o.objectEntranceNodeIdsByObstructionId){let n=o.objectEntranceNodeIdsByObstructionId[t];for(let r of n)o.objectIdsByNodeId[r]==null&&(o.objectIdsByNodeId[r]=[]),o.objectIdsByNodeId[r].push(t)}};y();var xi=(o,e,t)=>{let n=o.polygons??[],r=o.nodes??[],i=Array.isArray(o.spaces)?o.spaces:n,s={id:o.id,externalId:o.externalId,name:o.name,description:o.description,amenity:o.amenity,extra:o.extra,geometryIds:n.map(a=>a.id),nodeIds:r.map(a=>a.id),spaceIds:i.map(a=>a.id),categoryIds:e??[],logo:o.logo,picture:o.picture,shortName:o.shortName,showFloatingLabelWhenImagePresent:o.showFloatingLabelWhenImagePresent,showLogo:o.showLogo,siblingGroups:o.siblingGroups,social:o.social,sortOrder:o.sortOrder,states:o.states,tags:o.tags,type:o.type,hidden:o.hidden,primaryCategory:o.primaryCategory,phone:o.phone,operationHours:o.operationHours,gallery:o.gallery,links:o.links,filterFlags:o.filterFlags,headerImage:o.headerImage};return t!=null&&(s.parentId=t),s},un=(o,e)=>{let t=Object.create(null),n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),a=Object.create(null),c=Object.create(null),l=Object.create(null),u=Object.create(null),f=Object.create(null),I=Object.create(null),b=o.enterprise?.venue??{},R=Object.create(null);for(let x of o.enterprise?.categories??[]){let O={id:x.id,externalId:x.externalId,name:x.name,color:x.color,extra:x.extra,icon:x.icon,iconFromDefaultList:x.iconFromDefaultList,sortOrder:x.sortOrder,picture:x.picture,childIds:x.children,locationIds:x.locations};f[x.id]=O;let k=new fn(e,{record:O});s[x.id]=k,x.externalId&&(a[x.externalId]==null&&(a[x.externalId]=[]),a[x.externalId].push(k)),x.locations.forEach(w=>{R[w]==null&&(R[w]=[]),R[w].push(x.id)})}let E=Object.create(null);for(let x of o.enterprise?.locationInstances??[]){let O=o.enterprise?.categoryPriorities?.[x.id]||R[x.id],k=xi(x,O,x.parent);u[x.id]=k;let w=new pe(e,{record:k});E[x.parent]==null&&(E[x.parent]=[]),E[x.parent].push(w);for(let U of x.polygons??[])l[U.id]=w;c[x.id]=w,x.externalId&&(i[x.externalId]==null&&(i[x.externalId]=[]),i[x.externalId].push(w))}for(let x of o.enterprise?.locations??[]){let O=o.enterprise?.categoryPriorities?.[x.id]||R[x.id],k=xi(x,O),w=E[x.id];w!=null&&(k.instances=w.map(V=>u[V.id])),u[x.id]=k;let U=new pe(e,{record:k,instances:w});r[x.id]=U,x.externalId&&(i[x.externalId]==null&&(i[x.externalId]=[]),i[x.externalId].push(U)),x.nodes.forEach(V=>{e.nodeIndex.locationIdsByNodeId[V.id]==null&&(e.nodeIndex.locationIdsByNodeId[V.id]=[]),e.nodeIndex.locationIdsByNodeId[V.id].push(x.id)});for(let V of x.polygons)I[V.id]==null&&(I[V.id]=[]),I[V.id].push(x.id)}if(e.enterpriseMode===!0){let x=(o["connection.json"]??[]).reduce((O,k)=>(O[k.id]=k,O),Object.create(null));for(let O in x){let k=Object.create(null),w=x[O],U={id:O,externalId:w.externalId,kind:"enterprise."+w.type,destinationNodes:[],flags:w.flags,type:w.type,nodes:w.nodes,accessible:w.accessible,extra:w.extra,details:w.details};for(let V of x[O].nodes){let z=e.nodesById[V];z!=null&&(k[z.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[z.coordinate.longitude,z.coordinate.latitude]},properties:U})}Object.keys(k).length>0&&(t[O]=new te(e,{record:{id:O,type:w.type,externalId:w.externalId,extra:w.extra,accessible:w.accessible??!1,flags:e.connectionRecordsById[O]?.flags,nodeIds:w.nodes,anchors:dt(w.nodes.map(V=>{let z=e.nodesById[V];return z==null?null:{floorId:z.floor.id,coordinates:[z.coordinate.longitude,z.coordinate.latitude]}}).filter(V=>V!=null)),details:w.details}}),w.externalId&&(n[w.externalId]==null&&(n[w.externalId]=[]),n[w.externalId].push(t[O])))}e.connectionsById=t}return{connectionsByExternalId:n,locationsById:r,locationInstancesById:c,instanceLocationsByPolygonId:l,locationsByExternalId:i,categoriesById:s,categoriesByExternalId:a,locationRecordsById:u,categoryRecordsById:f,venueRecord:b,locationIdsByGeometryId:I}};var Mi=(o,e,t)=>{let n=Yt(),{nodesById:r,nodesByExternalId:i,nodeRecordsById:s,nodeRecordsByFloorId:a}=ei(e,o),{connectionsById:c,connectionRecordsById:l}=ti(e,o,n),{spacesById:u,spacesByExternalId:f,poisById:I,poisByExternalId:b,spaceRecordsById:R,poiRecordsById:E,spaceRecordsByFloorId:x,poiRecordsByFloorId:O,geometryIndex:k,mvfSpacesById:w}=oi(e,o,n),{objectsById:U,objectsByExternalId:V,objectRecordsById:z,objectRecordsByFloorId:fe,geometryIndex:q,mvfObstructionById:gt}=ni(e,o,n),{floorsById:yt,floorsByExternalId:Mo,floorRecordsById:He}=ri(e,o),{floorStacksById:Fo,floorStacksByExternalId:vo,floorStackRecordsById:To,facadeRecordsById:Ce,facadesById:Ot,facadesBySpaceId:Pt}=ii(e,o),{doorsById:Dt,doorsByExternalId:ne,doorRecordsById:Ro,doorRecordsByFloorId:So,geometryIndex:Qe,mvfEntrancesById:wt}=fi(e,o,n,gt),{annotationsById:At,annotationRecordsById:Ke,annotationRecordsByFloorId:Bo,mvfAnnotationsById:Eo}=gi(e,o),{areasById:kt,areasByExternalId:Ct,areaRecordsById:jt,areaRecordsByFloorId:ge,geometryIndex:_o,mvfAreasById:_e}=yi(e,o),je=de();for(let d of[k,q,Qe,_o]){for(let p in d.byId)je.byId[p]=d.byId[p];for(let p in d.byFloorId)je.byFloorId[p]==null&&(je.byFloorId[p]=[]),je.byFloorId[p].push(...d.byFloorId[p])}mi(e,w,gt,jt,R,z);let{floorImageRecordsByFloorId:No}=ci(e),{floorTextRecordsByFloorId:Lt}=di(e),{manifestRecord:Ze}=li(e),{decorationsById:Vt}=ui(e),{mvf3LocationsById:Oo}=hi(t),{locationCategoriesByParentId:Po,locationProfilesById:Gt,locationCategoriesById:Do,locationProfileRecordsById:wo,locationCategoryRecordsById:Ie,locationProfilesByExternalId:Cn,locationProfilesByCategoryId:jn,locationProfilesByAttachedFeatureId:Ln}=Ii(o,e,Oo);bi(n,R);let{styleRecordsById:Vn,styleIdByGeometryId:Ao}=si(e),{wallRecordsByFloorId:M}=ai(e);for(let d in n.entranceNodeIdsBySpaceId){let p=R[d];p!=null&&(p.doorIds=n.entranceNodeIdsBySpaceId[d].map(g=>n.doorsByNodeId[g]?.id).filter(g=>g!=null))}return{styleRecordsById:Vn,styleIdByGeometryId:Ao,wallRecordsByFloorId:M,floorImageRecordsByFloorId:No,floorTextRecordsByFloorId:Lt,manifestRecord:Ze,decorationsById:Vt,spacesById:u,spacesByExternalId:f,nodesById:r,nodesByExternalId:i,objectsById:U,objectsByExternalId:V,floorsById:yt,floorsByExternalId:Mo,floorStacksById:Fo,floorStacksByExternalId:vo,facadesById:Ot,facadesBySpaceId:Pt,connectionsById:c,doorsById:Dt,doorsByExternalId:ne,poisById:I,poisByExternalId:b,annotationsById:At,areasById:kt,areasByExternalId:Ct,locationProfilesById:Gt,locationCategoriesById:Do,locationProfileRecordsById:wo,locationCategoryRecordsById:Ie,locationProfilesByExternalId:Cn,locationProfilesByCategoryId:jn,locationCategoriesByParentId:Po,floorRecordsById:He,floorStackRecordsById:To,facadeRecordsById:Ce,spaceRecordsById:R,poiRecordsById:E,objectRecordsById:z,objectRecordsByFloorId:fe,doorRecordsById:Ro,spaceRecordsByFloorId:x,poiRecordsByFloorId:O,areaRecordsByFloorId:ge,annotationRecordsByFloorId:Bo,doorRecordsByFloorId:So,geometryIndex:je,nodeRecordsById:s,nodeRecordsByFloorId:a,connectionRecordsById:l,annotationRecordsById:Ke,areaRecordsById:jt,locationProfilesByAttachedFeatureId:Ln,nodeIndex:n,mvfSpacesById:w,mvfObstructionById:gt,mvfEntrancesById:wt,mvfAreasById:_e,mvfAnnotationsById:Eo}};y();y();y();var Ka=(function(){let e=globalThis.fetch;return{fetch(...t){if(!Ge(e))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return e?.(...t)},setFetch(t){e=t}}})(),Fi=Ka.fetch;var Bi=["websdk","web","webv2","kiosk","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk","minimap","app-framework"],vi=Bi[0],Ei="https://api-gateway.mappedin.com/track-analytics/a/",_i="deny-watchposition",Ni="load-mapview",Oi="load-mapdata",Pi="change-language",Di="query-directions";var lt=class{#e=Object.freeze({});#t;oneTimeEventsSent=new Set;constructor(){this.#t=this.#n(this.#e)}init(e){this.reset(),this.updateStateWithOptions(e)}reset(){this.#e={},this.#t=this.#n({}),this.oneTimeEventsSent.clear()}updateStateWithOptions(e){return this.#e=Object.freeze(Object.assign({},this.#e,e)),this.#t=this.#n(e),this.#o(this.#t),this.#t}#o(e){e.sessionId&&Re.getInstance().saveSessionData("id",e.sessionId),e.deviceId&&Re.getInstance().saveLocalData("deviceId",e.deviceId)}#n(e){let t=e.baseUri??Ei;return{baseUri:t,analyticsBaseUrl:gn({...e,baseUri:t}),version:e.version||T?.env?.npm_package_version||"v6",deviceId:e.deviceId||Ti(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||Ri(),platformString:e.platformString||"",context:Si(e.context)||vi,geolocationMode:!1,sendEvents:e.sendEvents??!0,logEvents:e.logEvents??!1,noAuth:e.noAuth||!1,key:e.key,secret:e.secret,enterprise:e.enterprise??!1,externalId:e.externalId}}updateState(e){let t={...e};t.mapId&&(t.analyticsBaseUrl=gn({...this.#t,mapId:t.mapId})),t.context&&(t.context=Si(t.context)),t.baseUri&&(t.analyticsBaseUrl=gn({baseUri:t.baseUri,mapId:this.#t.mapId})),Object.assign(this.#t,t),this.handleStateUpdate(e),this.#o(t)}handleStateUpdate(e){e.userPosition?.floorLevel?this.sendBlueDotEvents("found-floor"):e.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:e,secret:t,accessToken:n}=this.getState();return!!(e&&t)||!!n}getState(){return this.#t}getContext(){return this.getState().context||this.#e.context||vi}getSessionId(){return this.getState().sessionId||this.#e.sessionId||Ri()}getDeviceId(){return this.getState().deviceId||this.#e.deviceId||Ti()}sendAnalyticEvent(e,t={}){let n=this.getState(),r=Za(n.analyticsBaseUrl,e),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&A.log("Analytics.track",r,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return!n.key&&!n.secret&&!n.accessToken?void 0:A.warn("Auth needs to be ready to send analytics.");let s={...t,g:n.geolocationMode,sdk_version:n.version,...n.externalId?{externalId:n.externalId}:{}};return n.userPosition&&Object.assign(s,n.userPosition),n.anchor&&Object.assign(s,n.anchor),i["Content-Type"]="application/json",!n.noAuth&&n.enterprise&&n.secret&&n.key?(i["x-mappedin-key"]=btoa(n.key),i["x-mappedin-secret"]=btoa(n.secret)):n.accessToken&&(i.Authorization=`Bearer ${n.accessToken}`),Fi(r,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(s)})}capture(e,t){if(tc.includes(e))return A.warn(`${e} event is sent internally.`),Promise.resolve();let n=ec.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(n,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(Oi,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(Pi,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(_i)}sendMapViewLoadedEvent({firstRenderDurationMs:e,dimension:t,collisionWorkerDisabled:n,outdoorsWorkerDisabled:r}){return this.sendAnalyticEvent(Ni,{type:"3d",firstRenderDurationMs:e,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:n,outdoorsWorkerDisabled:r})}sendGetDirectionsEvent=Un((e,t,n)=>{let r={start:e,end:t,type:"location_to_location"};return n!==void 0&&(r.accessible=n),this.sendAnalyticEvent(Di,r)},2500);sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};function gn({mapId:o,baseUri:e=Ei}){return`${e}${o}/`}function Ti(){return Re.getInstance().loadLocalData("deviceId")}function Ri(){return Re.getInstance().loadSessionData("id")}function Za(o,e){return o+e}function Si(o){return Bi.find(e=>e===o)}var ec=["$select-location","$select-category","$query-suggest","$query-search"],tc=[Ni,Oi,Di,_i,Pi],By=new lt,yn=class{#e;constructor(e){this.#e=e,this.capture=this.#e.capture.bind(this.#e),this.updateState=this.#e.updateState.bind(this.#e)}capture;updateState;getState(){let{sessionId:e,deviceId:t,...n}=this.#e.getState();return n}getContext(){return this.#e.getContext()}getSessionId(){return this.#e.getSessionId()}getDeviceId(){return this.#e.getDeviceId()}};y();var oc=["externalId","name","description","amenity","extra","gallery","logo","operationHours","phone","picture","shortName","showFloatingLabelWhenImagePresent","showLogo","siblingGroups","social","sortOrder","states","tags","type","hidden","primaryCategory","links","filterFlags","headerImage"],mn=class o extends Y{static __type="enterprise-location";__type=o.__type;description;name="";amenity;externalId="";extra;gallery;instances;logo;operationHours;phone;picture;shortName;showFloatingLabelWhenImagePresent;showLogo;siblingGroups;social;sortOrder=-1;states;tags;filterFlags;type="";hidden=!1;primaryCategory;#e;#t={};#o;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id),this.#e=e,this.#o=t.record,this.instances=t.instances||[];for(let n of oc)n in t.record&&Object.defineProperty(this,n,{enumerable:!0,get(){if(this.#o.parentId){let r=this.#e.locationsById[this.#o.parentId];return this.#o[n]!=null?this.#e.getPropTranslation(this.__type,n,this.#o.id,this.#o[n]):this.#e.getPropTranslation(this.__type,n,this.#o.id,r[n])}return this.#e.getPropTranslation(this.__type,n,this.#o.id,this.#o[n])}})}get focusTarget(){return this.spaces.length>0?this.spaces:this.coordinates}get navigationTarget(){return this.spaces}get categories(){return this.#t.categories?this.#t.categories:(this.#t.categories=(this.#o.categoryIds.map(e=>this.#e.getById("enterprise-category",e))||[]).filter(Boolean),this.#t.categories)}get coordinates(){if(this.#t.coordinates)return this.#t.coordinates;this.#t.coordinates=[];for(let e=0;e<this.nodes.length;e++)this.#t.coordinates.push(this.nodes[e].coordinate);return this.#t.coordinates}get nodes(){if(this.#e.mvf==null)throw new Q(Be("EnterpriseLocation.nodes","mapData.Nodes.getByType(location)"));if(this.#t.nodes)return this.#t.nodes;this.#t.nodes=[];for(let e=0;e<this.#o.nodeIds.length;e++){let t=this.#e.getById("node",this.#o.nodeIds[e]);t&&this.#t.nodes.push(t)}return this.#t.nodes}get points(){if(this.#t.points)return this.#t.points;this.#t.points=[];for(let e=0;e<this.#o.spaceIds.length;e++){let t=this.#e.getById("point-of-interest",this.#o.spaceIds[e]);t&&this.#t.points.push(t)}return this.#t.points}get spaces(){if(this.#t.spaces)return this.#t.spaces;this.#t.spaces=[];for(let e=0;e<this.#o.spaceIds.length;e++){let t=this.#e.getById("space",this.#o.spaceIds[e]);t&&this.#t.spaces.push(t)}return this.#t.spaces}get objects(){if(this.#t.objects)return this.#t.objects;this.#t.objects=[];for(let e=0;e<this.#o.geometryIds.length;e++){let t=this.#e.getById("object",this.#o.geometryIds[e]);t&&this.#t.objects.push(t)}return this.#t.objects}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},pe=mn;y();var nc=["externalId","name","color","extra","icon","iconFromDefaultList","sortOrder","picture"],hn=class o extends Y{static __type="enterprise-category";__type=o.__type;name="";color;externalId="";extra;icon;iconFromDefaultList;sortOrder=-1;picture;#e;#t={};#o;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id),this.#e=e,this.#o=t.record;for(let n of nc)n in t.record&&Object.defineProperty(this,n,{get(){return this.#e.getPropTranslation(this.__type,n,this.#o.id,this.#o[n])}})}get children(){if(this.#t.children)return this.#t.children;this.#t.children=[];for(let e=0;e<this.#o.childIds.length;e++){let t=this.#e.getById("enterprise-category",this.#o.childIds[e]);t&&this.#t.children.push(t)}return this.#t.children}get locations(){if(this.#t.locations)return this.#t.locations;this.#t.locations=[];for(let e=0;e<this.#o.locationIds.length;e++){let t=this.#e.getById("enterprise-location",this.#o.locationIds[e]);t&&this.#t.locations.push(t)}return this.#t.locations}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},fn=hn;y();var rc=new Set,In=class o extends Y{static __type="enterprise-venue";__type=o.__type;countrycode;coverImage;externalId="";defaultLanguage={code:"en",name:"English"};defaultFloor;extra;icon;languages=[];links=[];logo;mappedinWebUrl;operationHours;slug="";topLocations;tzid;#e={};#t;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.externalId??""),this.#t=t.record;for(let n in t.record)!rc.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=t.record[n])}get name(){return this.#t.name??""}get defaultMap(){return this.#t.defaultMap??this.defaultFloor??""}get enterpriseType(){return this.#t.type??void 0}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(this.#e))delete this.#e[e]}},wi=In;y();var bn=o=>"kind"in o&&o.kind==="v3-native";y();y();y();y();y();var ic=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(ic||{}),Ai=(s=>(s.Straight="Straight",s.Right="Right",s.SlightRight="SlightRight",s.Left="Left",s.SlightLeft="SlightLeft",s.Back="Back",s))(Ai||{}),sc=(u=>(u.stairs="stairs",u.elevator="elevator",u.escalator="escalator",u.door="door",u.ramp="ramp",u.slide="slide",u.portal="portal",u.security="security",u.shuttle="shuttle",u.ladder="ladder",u))(sc||{}),ki=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(ki||{}),Ci=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(Ci||{});y();y();function ac(o,e,t){t===void 0&&(t={});for(var n=Le(o),r=tt(e),i=0;i<r.length-1;i++){var s=!1;if(t.ignoreEndVertices&&(i===0&&(s="start"),i===r.length-2&&(s="end"),i===0&&i+1===r.length-1&&(s="both")),cc(r[i],r[i+1],n,s,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function cc(o,e,t,n,r){var i=t[0],s=t[1],a=o[0],c=o[1],l=e[0],u=e[1],f=t[0]-a,I=t[1]-c,b=l-a,R=u-c,E=f*R-I*b;if(r!==null){if(Math.abs(E)>r)return!1}else if(E!==0)return!1;if(n){if(n==="start")return Math.abs(b)>=Math.abs(R)?b>0?a<i&&i<=l:l<=i&&i<a:R>0?c<s&&s<=u:u<=s&&s<c;if(n==="end")return Math.abs(b)>=Math.abs(R)?b>0?a<=i&&i<l:l<i&&i<=a:R>0?c<=s&&s<u:u<s&&s<=c;if(n==="both")return Math.abs(b)>=Math.abs(R)?b>0?a<i&&i<l:l<i&&i<a:R>0?c<s&&s<u:u<s&&s<c}else return Math.abs(b)>=Math.abs(R)?b>0?a<=i&&i<=l:l<=i&&i<=a:R>0?c<=s&&s<=u:u<=s&&s<=c;return!1}var ji=ac;y();y();function dc(o,e,t){t===void 0&&(t={});var n=Le(o),r=Le(e),i=Ne(r[1]-n[1]),s=Ne(r[0]-n[0]),a=Ne(n[1]),c=Ne(r[1]),l=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(c);return Hn(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t.units)}var $e=dc;function eo(o,e){return e===void 0&&(e={}),Kn(o,function(t,n){var r=n.geometry.coordinates;return t+$e(r[0],r[1],e)},0)}y();y();y();function to(o,e,t){if(t===void 0&&(t={}),t.final===!0)return lc(o,e);var n=Le(o),r=Le(e),i=Ne(n[0]),s=Ne(r[0]),a=Ne(n[1]),c=Ne(r[1]),l=Math.sin(s-i)*Math.cos(c),u=Math.cos(a)*Math.sin(c)-Math.sin(a)*Math.cos(c)*Math.cos(s-i);return Yn(Math.atan2(l,u))}function lc(o,e){var t=to(e,o);return t=(t+180)%360,t}function pc(o,e,t){t===void 0&&(t={});var n=et([1/0,1/0],{dist:1/0}),r=0;return Qn(o,function(i){for(var s=tt(i),a=0;a<s.length-1;a++){var c=et(s[a]);c.properties.dist=$e(e,c,t);var l=et(s[a+1]);l.properties.dist=$e(e,l,t);var u=$e(c,l,t),f=Math.max(c.properties.dist,l.properties.dist),I=to(c,l),b=Vo(e,f,I+90,t),R=Vo(e,f,I-90,t),E=Zn(ht([b.geometry.coordinates,R.geometry.coordinates]),ht([c.geometry.coordinates,l.geometry.coordinates])),x=null;E.features.length>0&&(x=E.features[0],x.properties.dist=$e(e,x,t),x.properties.location=r+$e(c,x,t)),c.properties.dist<n.properties.dist&&(n=c,n.properties.index=a,n.properties.location=r),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a+1,n.properties.location=r+u),x&&x.properties.dist<n.properties.dist&&(n=x,n.properties.index=a),r+=u}}),n}var vt=pc;function uc(o,e,t){var n=tt(t);if(qn(t)!=="LineString")throw new Error("line must be a LineString");var r=vt(t,o),i=vt(t,e),s;r.properties.index<=i.properties.index?s=[r,i]:s=[i,r];for(var a=[s[0].geometry.coordinates],c=s[0].properties.index+1;c<s[1].properties.index+1;c++)a.push(n[c]);return a.push(s[1].geometry.coordinates),ht(a,t.properties)}var xn=uc;var fc=1e-7;function Mn(o){return{type:"Point",coordinates:o}}function gc(o,e){let{coordinates:t}=e.geometry,{coordinates:n}=o.geometry,r=t.map(i=>vt(o,Mn(i)));return n.reduce((i,s)=>{let a=xn(Mn(s),r[0],o),c=xn(Mn(s),r[1],o),l=eo(a)<eo(c)?a:c;return l.properties={...o.properties,entrances:[]},i.concat([l])},[])}function Li(o,e){return e.reduce((t,n)=>{let r={epsilon:fc},i=t.obstructions.findIndex(a=>ji(st(n),a,r)),s=t.obstructions[i];if(s){let[a,c]=gc(s,n);t.entrances.push(n),t.obstructions.splice(i,1,a,c)}return t},{obstructions:[o],entrances:[]})}y();function Vi(o){let{fromPosition:e,toPosition:t,junctionInset:n,fromAltitude:r,toAltitude:i}=o;if(n<=0)return null;let s=(e[1]+t[1])/2,{toCartesian:a,toGeographic:c}=or(s),l=a(e),u=a(t),f=u.x-l.x,I=u.y-l.y,b=i-r,R=Math.sqrt(f*f+I*I+b*b);if(R<=n*2)return null;let E=n/R,x={x:l.x+f*E,y:l.y+I*E},O=c(x.x,x.y),k=e[2]!==void 0?e[2]+b*E:void 0,w={x:u.x-f*E,y:u.y-I*E},U=c(w.x,w.y),V=t[2]!==void 0?t[2]-b*E:void 0;return{fromPosition:k!==void 0?[O.lon,O.lat,k]:[O.lon,O.lat],toPosition:V!==void 0?[U.lon,U.lat,V]:[U.lon,U.lat]}}function yc(o,e,t,n,r){let i=Vi({fromPosition:o,toPosition:e,junctionInset:t,fromAltitude:n,toAltitude:r});return i?(o[0]=i.fromPosition[0],o[1]=i.fromPosition[1],o[2]!==void 0&&i.fromPosition[2]!==void 0&&(o[2]=i.fromPosition[2]),e[0]=i.toPosition[0],e[1]=i.toPosition[1],e[2]!==void 0&&i.toPosition[2]!==void 0&&(e[2]=i.toPosition[2]),!0):!1}function Lm(o){return o.verticalOffset===0?[o.longitude,o.latitude]:[o.longitude,o.latitude,o.verticalOffset]}function Ic(o){return new Map(o.map(e=>{let{properties:t}=e,{id:n}=t;return[n,e]}))}var Vm=(o,e)=>{let t=Ic(e),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:o[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let r of o){let i=[r.geometry.coordinates],s=(r.properties.entrances||[]).reduce((a,c)=>(t.has(c)&&a.push(t.get(c)),a),[]);if(s.length){let{entrances:a,obstructions:c}=Li(r,s);i=c.map(l=>l.geometry.coordinates),n.entrances.features.push(...a)}n.walls.geometry.coordinates.push(...i)}return n};function Ui(o,e){return((e-o+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function Wi(o,e){let t="Left";return o<=-Math.PI/4?t="Right":o<=-e?t="SlightRight":o<=e?t="Straight":o<=Math.PI/4?t="SlightLeft":t="Left",t}function Gm(o,e){return o.reduce((t,n)=>{let r=e[n.properties.id];if(r==null)return t;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let i={...r,id:r.id+"-textures"};t.set(i,[n])}else t.has(r)||t.set(r,[]),t.get(r).push(n);return t},new Map)}function Um(o,e={}){let t={...o,flipImageToFaceCamera:e?.flipImagesToFaceCamera??!0},n=e?.style?.shading??e?.shadingAndOutlines;n===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(t.shading={start:n.start,end:n.end,intensity:n.intensity});let r=e?.style?.outlines??e?.shadingAndOutlines;if(t.outline=typeof r=="object"?!0:r,"lineStrings"in o){let i=e?.style?.wallTopColor??e?.wallTopColor;i!=null&&(t.topColor=i)}return t}var Wm=(o,e)=>{let n=(e.currentMap?.currentFloor).layers.get(Rr);switch(o){case"interior-walls":return n?.layers.get(Fr);case"exterior-walls":return n?.layers.get(Mr);case"interior-doors":return n?.layers.get(vr);case"exterior-doors":return n?.layers.get(Tr);default:return typeof o=="string"?o:o?.id==null?void 0:e.Models.getById(o.id)?.entityId??o.id}};function $m(o){return new Promise(e=>{o.onComplete(e),o.onStop(e)})}function Jm(o){return o.bbox?o.bbox:ot(o)}function zm(o,e,t){return o.floorId&&e.has(o.floorId)?e.get(o.floorId):t}function Xm(o){if(ee.is(o)||ce.is(o))return o.id}function Hm(o,e,t){let n=o.coordinates.length===2&&o.coordinates[0].floorId!==o.coordinates[1].floorId,r=!0;if(n&&o.coordinates[0].floorId!=null&&o.coordinates[1].floorId!=null){let i=e?.getById("floor",o.coordinates[0].floorId),s=e?.getById("floor",o.coordinates[1].floorId);if(i&&s){let a=t.getState(i),c=t.getState(s);a!=null&&c!=null&&(r=a.visible&&c.visible&&a.altitude!==c.altitude)}}else{let i=o.coordinates[0].floorId!=null?e?.getById("floor",o.coordinates[0].floorId):void 0;r=i?t.getState(i)?.visible??!0:!0}return r}function Ym(o,e){let t=o.properties.path.split("/"),n=t[t.length-1].split(".")[0],r=atob(n);return"img_"+Ut(r).toString()+"-"+e}function Fn(o="auto",e,t=1,n){return o!=="auto"?o*t:e!=null?e*t:n!=null?n*t:3*t}function Gi(o,e,t,n){if(o.maxHeight!=null&&o.maxHeight>0)return Fn(e,o.maxHeight,t,n);let r=Fn(e,void 0,t,n);if(e==="auto"&&"geometryMaxHeight"in o){let i=o.geometryMaxHeight;if(i!=null&&i>0){let s=Math.ceil(i*1.1);if(s>r)return s}}return r}function qm(o,e="auto",t=1,n,r){if(!o.length)return new Map;let i=o.sort((u,f)=>u.elevation-f.elevation),s=i.findIndex(u=>u.elevation>=0);s===-1&&(s=i.length);let a=0,c=new Map,l=-1;for(let u=s;u<i.length;u+=1){let f=i[u],I=Gi(f,e,t,n);if(!r){let b=f.elevation-l-1;b>0&&(a+=b*I)}c.set(f.elevation,{altitude:a,visualHeight:I}),a+=I,l=f.elevation}a=0;for(let u=s-1;u>=0;u-=1){let f=i[u],I=Gi(f,e,t,n),b=-(a+I);c.set(f.elevation,{altitude:b,visualHeight:I}),a+=I}return c}function Qm(o,e,t="auto",n=1,r){let i=[...o].sort((l,u)=>l.elevation-u.elevation),s=i.findIndex(l=>l.elevation>=0);if(s===-1)return[];let a=[],c=-1;for(let l=s;l<i.length;l+=1){let u=i[l],f=u.elevation-c-1;if(f>0){let I=e.get(u.elevation),b=I?.visualHeight??Fn(t,void 0,n,r),R=f*b,E=I?.altitude??0;a.push({altitude:E-R,height:R,floorAboveElevation:u.elevation,missingCount:f})}c=u.elevation}return a}function Km(o,e){let t=e(o.center);return{center:new W({latitude:t[1],longitude:t[0]}),radius:o.radius}}function Zm(o){if(o.geometry.type==="Polygon")return{type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[0]]},properties:o.properties};let e=[];for(let t of o.geometry.coordinates)e.push([t[0]]);return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:e},properties:o.properties}}var $i=Math.PI*.1,Je=class{id;#e={};#t;#o;constructor(e,t,n,r,i){this.id=i?.id??$(),this.#t=t,this.#o=e.features,this.departure=n,this.destination=r}get path(){if(this.#e.path==null){let e=[];for(let t of this.#o){let n=this.#t.navigationNodes.node(t.properties.id);n&&e.push(n)}this.#e.path=e}return this.#e.path}departure;destination;get coordinates(){return this.#e.coordinates?this.#e.coordinates:(this.#e.coordinates=this.#o.map(e=>new W(e.geometry.coordinates[1],e.geometry.coordinates[0],e.properties.groupBy)),this.#e.coordinates)}get distance(){return this.#e.distance?this.#e.distance:(this.#e.distance=this.#o.reduce((e,t)=>e+(t.properties.distance||0),0),this.#e.distance)}get instructions(){if(this.#o.length<2)return[];if(this.#e.instructions)return this.#e.instructions;let e=[],t=0;for(let n=0;n<this.#o.length;n++){let r=this.#o[n],i=this.#o[n-1],s=this.#o[n+1],a=new W(r.geometry.coordinates[1],r.geometry.coordinates[0],r.properties.groupBy),c=this.#c({prevDirection:i,direction:r,nextDirection:s});t+=i?.properties.distance||0;for(let l of c)l&&(e.push({action:l,distance:t,coordinate:a,node:this.#t.navigationNodes.node(r.properties.id)}),t=0)}return this.#e.instructions=e,this.#e.instructions}#n;#r;#i;#c(e){let{prevDirection:t,direction:n,nextDirection:r}=e,i=t&&this.#t.getById("floor",t.properties.groupBy),s=this.#t.getById("floor",n.properties.groupBy),a=r&&this.#t.getById("floor",r.properties.groupBy),c=[];t||c.push({type:"Departure"});let l=this.#t.navigationNodes.connectionForNode(n.properties.id),u=l?this.#t.getById("connection",l.id):void 0,f=l&&l.nodeIds.length>1,I=this.#t.enterpriseMode&&(!n.properties.destination||!l?.nodeIds.includes(n.properties.destination)||!l?.nodeIds.includes(n.properties.id));if(l&&!(!f||I))if(!this.#n||this.#n==="exit")c.push(this.#s("TakeConnection",s,a,u,l)),this.#n="take",this.#r=u,this.#i=l;else{let R=this.#t.navigationNodes.connectionForNode(t?.properties.id??""),E=this.#t.getById("connection",R?.id??"");c.push(this.#s("ExitConnection",s,i,E,R)),this.#n="exit",this.#r=u,this.#i=l}else this.#n==="take"?(c.push(this.#s("ExitConnection",s,i,this.#r,this.#i)),this.#n="exit",this.#r=u):a&&s?.id!==a.id?c.push(this.#s("TakeConnection",s,a,u)):i&&i.id!==s?.id?c.push(this.#s("ExitConnection",s,i,u)):c.push(this.#a(t,n));return r||c.push({type:"Arrival"}),c}#s(e,t,n,r,i){let s="none",a=t?t.elevation:0;if(a!=null&&n?.elevation!=null){let l=a-n.elevation;l>0?s="down":l<0&&(s="up")}let c=r?.type??i?.type??"stairs";return{type:e,fromFloor:t,toFloor:n,direction:s,connection:r,connectionType:c}}#a(e,t){let n=e?-Ui(e.properties.angle,t.properties.angle):0;return Math.abs(n)>=$i?{type:"Turn",bearing:Wi(n,$i),referencePosition:"At"}:null}toJSON(){return{id:this.id,directions:this.#o,__type:"directions",from:this.departure,to:this.destination,coordinates:this.coordinates,distance:this.distance,instructions:this.instructions}}};y();y();y();function Ji(o){return Ho(o)?"navigationTarget"in o&&o.navigationTarget!=null:!1}var bc={lineOfSight:!0,mode:"absolute-distance",maxResults:1};function zi(o){return{...bc,lineOfSight:!o}}var X=new WeakMap;function Xi(o,e,t){let n=zi(t),i=e.Query.__LEGACY_NEAREST_SYNC(o,e.getByType("node"),n)?.[0]?.feature.id;return i?[i]:[]}async function Hi(o,e,t){let n=zi(t),i=(await e.Query.nearest(o,e.getByType("node"),n))?.[0]?.feature.id;return i?[i]:[]}function xc(o,e,t){let n=[];for(let r of o.navigationTarget)for(let i of ze(r,e,t))n.push(i);return n}async function Mc(o,e,t){let n=[];for(let r of o.navigationTarget)for(let i of await Xe(r,e,t))n.push(i);return n}function Yi(o,e){let n=e?.getMVFFeatureById("entrance",o.id)?.properties.node;return n?[n]:[]}function qi(o,e){return e?.getMVFFeatureById("area",o.id)?.properties.destinationNodes??[]}function Qi(o,e){let t=e?.getMVFFeatureById("space",o.id);if(t==null)return[];let n=e.nodeIndex.entranceNodeIdsBySpaceId?.[o.id];return n&&n.length>0?n:t.properties.destinationNodes??[]}function Fc(o,e){let t=[];for(let n of o.coordinates){let r=e.navigationNodes.nearestNodeIdsSync(n);r.length>0&&t.push(r[0])}return t}async function vc(o,e){let t=[];for(let n of o.coordinates){let r=await e.navigationNodes.nearestNodeIds(n);r.length>0&&t.push(r[0])}return t}function Ki(o,e){return e?.nodeIndex.objectEntranceNodeIdsByObstructionId[o.id]??[]}function Zi(o,e){return o.spaces.flatMap(t=>e?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string")}function es(o){return o.nodes.map(e=>e.id)}function ze(o,e,t){if(X.has(o))return X.get(o);if(De.is(o)){let n=xc(o,e,t);return X.set(o,n),n}else if(Pe.is(o)){let n=e.navigationNodes.nearestNodeIdsSync(o);return X.set(o,n),n}else if(W.is(o)){let n=e.navigationNodes.nearestNodeIdsSync(o);return X.set(o,n),n}else{if(Oe.is(o))return e.navigationNodes.nearestNodeIdsSync(o);if(me.is(o)||ye.is(o)||ee.is(o)||ce.is(o)||he.is(o)){let n=e.navigationNodes.nodeIdsForFeature(o);return X.set(o,n),n}else if(te.is(o)){let n=Fc(o,e);return X.set(o,n),n}else if(pe.is(o)){let n=es(o);return X.set(o,n),n}else if(le.is(o)){let n=[o.id];return X.set(o,n),n}else return[]}}async function Xe(o,e,t){if(X.has(o))return X.get(o);if(De.is(o)){let n=await Mc(o,e,t);return X.set(o,n),n}else if(Pe.is(o)){let n=await e.navigationNodes.nearestNodeIds(o);return X.set(o,n),n}else if(W.is(o)){let n=await e.navigationNodes.nearestNodeIds(o);return X.set(o,n),n}else if(Oe.is(o)){let n=await e.navigationNodes.nearestNodeIds(o);return X.set(o,n),n}else if(me.is(o)){let n=e.navigationNodes.nodeIdsForFeature(o);return X.set(o,n),n}else if(ye.is(o)){let n=e.navigationNodes.nodeIdsForFeature(o);return X.set(o,n),n}else if(ee.is(o)){let n=e.navigationNodes.nodeIdsForFeature(o);return X.set(o,n),n}else if(te.is(o)){let n=await vc(o,e);return X.set(o,n),n}else if(ce.is(o)){let n=e.navigationNodes.nodeIdsForFeature(o);return X.set(o,n),n}else{if(he.is(o))return e.navigationNodes.nodeIdsForFeature(o);if(pe.is(o)){let n=es(o);return X.set(o,n),n}else if(le.is(o)){let n=[o.id];return X.set(o,n),n}else return[]}}function ts(o,e){if(!o.instances||o.instances.length===0)return o;for(let t of o.instances)if(t.nodes.map(r=>r.id).includes(e))return t;return o}function os(o,e,t){let n=o.features[0]?.properties.id,r=e[0];if(e.length>1){for(let i of e)if((t.get(i)??[]).includes(n)){r=i;break}}return pe.is(r)&&(r=ts(r,n)),r}function ns(o,e,t){let n=o.features[o.features.length-1]?.properties.id,r=e[0];if(e.length>1){for(let i of e)if((t.get(i)??[]).includes(n)){r=i;break}}return pe.is(r)&&(r=ts(r,n)),r}function Tn(o){if(W.is(o))return o;if(!(!Ji(o)||Array.isArray(o.navigationTarget)||!W.is(o.navigationTarget)))return o.navigationTarget}var Tc=o=>"type"in o&&o.type==="FeatureCollection";function Rc(o,e){let t=o.features;for(let n=t.length-2;n>=0;n--){let r=t[n],i=t[n+1];e.navigationNodes.sameDoorNode(r.properties.id,i.properties.id)&&(t[n]={...r,properties:{...i.properties,distance:(r.properties.distance??0)+(i.properties.distance??0),id:r.properties.id}},t.splice(n+1,1))}}var qe=class{navigator;constructor({nodes:e,geojsonCollection:t,groupBy:n,multiplicativeDistanceWeightScaling:r,flagDeclarations:i,getDoorByNodeId:s}){this.navigator=new nr({nodes:e,geojsonCollection:Tc(t)?t:this.createCollection(t),groupBy:n,multiplicativeDistanceWeightScaling:r,flagDeclarations:i,getDoorByNodeId:s})}processTargets(e,t,n){let r=[],i=[],s=new Map,a=new Set,c=new Set;for(let[l,u]of e){let f=s.get(l);f||(f=[],s.set(l,f)),ee.is(l)&&a.add(l.id);for(let I of u)f.push(I),r.push(I)}for(let[l,u]of t){let f=s.get(l);f||(f=[],s.set(l,f)),ee.is(l)&&c.add(l.id);for(let I of u)f.push(I),i.push(I)}if(a.size===0&&c.size===0)return{originIds:r,destinationNodeIds:i,featureToNodeIdsMap:s};for(let l of r){let u=n.navigationNodes.spaceIdsForNode(l);for(let f of u)if(c.has(f)){i.push(l);break}}for(let l of i){let u=n.navigationNodes.spaceIdsForNode(l);for(let f of u)if(a.has(f)){r.push(l);break}}return{originIds:r,destinationNodeIds:i,featureToNodeIdsMap:s}}getDirections=async(e,t,n,r)=>{let i=new Map,s=new Map;for(let u of e)i.set(u,await Xe(u,r,r.enterpriseMode));for(let u of t)s.set(u,await Xe(u,r,r.enterpriseMode));let{originIds:a,destinationNodeIds:c,featureToNodeIdsMap:l}=this.processTargets(i,s,r);return this.#e(e,t,a,c,n,r,l)};getDirectionsSync=(e,t,n,r)=>{let i=new Map(e.map(u=>[u,ze(u,r,r.enterpriseMode)])),s=new Map(t.map(u=>[u,ze(u,r,r.enterpriseMode)])),{originIds:a,destinationNodeIds:c,featureToNodeIdsMap:l}=this.processTargets(i,s,r);return this.#e(e,t,a,c,n,r,l)};#e=(e,t,n,r,i,s,a)=>{let c=this.getDisabledConnectionNodeIds(i.accessible,s).filter(O=>!n.includes(O)&&!r.includes(O)),l=new Map,u={...i.connectionIdWeightMap};for(let O of i.excludedConnections)u[O.id]=1/0;for(let O in u){let k=s.getById("connection",O);k&&this.#n(s.navigationNodes.connectionNodeIds(k),u[O],l)}if(i.__EXPERIMENTAL_overrideDoorWeight!==void 0)for(let O of this.#o(s))l.set(O,i.__EXPERIMENTAL_overrideDoorWeight);let I=(i.smoothing.method??"greedy-los")!=="greedy-los",b=this.navigator.getDirections({zones:i.zones.map(O=>({geometry:O.geometry,cost:O.cost,costAccumulation:O.costAccumulation,map:O.floor?.id})),originIds:n,from:I?rs(e):[],to:I?rs(t):[],destinationNodeIds:r,disabledConnectionNodeIds:c,simplify:i.smoothing,overrideEdgeWeights:l,multiplicativeDistanceWeightScaling:!s.enterpriseMode,includeNonPublic:i.includeNonPublic,outdoorPathWeightMultiplier:i.__EXPERIMENTAL_outdoorPathWeightMultiplier});Rc(b,s),this.addCoordinateDirections(b,e,t);let R=os(b,e,a),E=ns(b,t,a),x=new Je(b,s,R,E);if(!(x.distance===0&&new Set([...n,...r]).size===n.length+r.length))return x};getDisabledConnectionNodeIds=(e,t)=>e===!1?[]:t.navigationNodes.inaccessibleConnectionNodeIds();#t;#o=e=>{if(this.#t)return this.#t;let t=[],n=e.navigationNodes.doorNodeIds();if(n.size>0)for(let r of Object.values(this.navigator.graph.edges))for(let i of r){let s=i.origin.properties.id,a=i.destination.properties.id;!n.has(s)&&!n.has(a)||e.navigationNodes.sameDoorNode(s,a)||t.push(i)}return this.#t=t,t};#n=(e,t,n)=>{if(e.length<2)return;let r=new Set(e);for(let i of e){let s=this.navigator.graph.edges[i];if(s)for(let a of s)r.has(a.destination.properties.id)&&n.set(a,t)}};addCoordinateDirections=(e,[t],[n])=>{if(!e.features.length)return;let r=Tn(t);if(r){let s=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,s)}let i=Tn(n);if(i){let s=this.createDirectionFeature(i,0,0),a=e.features[e.features.length-1];a.properties.distance=this.navigator.getDistance(a.geometry.coordinates,[i.longitude,i.latitude]),a.properties.angle=this.navigator.getAngle(a.geometry.coordinates,[i.longitude,i.latitude]),e.features.push(s)}};createCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[n,r])=>t.concat(r.features.map(i=>(i.properties.map=n,i))),[])}}createDirectionFeature=(e,t,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:n,edges:[]}})};function Sc(o){if(W.is(o))return o.floorId;if(ee.is(o)||me.is(o)||Oe.is(o)||Pe.is(o)||ce.is(o)||ye.is(o)||le.is(o))return o.floor.id;if((te.is(o)||pe.is(o))&&o.coordinates.length>0)return o.coordinates[0].floorId;if(he.is(o)&&o.spaces.length>0)return o.spaces[0].floor.id}function rs(o){return o.reduce((e,t)=>{let n=ke(t);if(!n)return e;let r=Sc(t);return e.push({type:"Feature",geometry:{type:"Point",coordinates:[n.longitude,n.latitude]},properties:{id:t.id,neighbors:[],map:r}}),e},[])}y();function Bc(o){if(!(!o.languages||!tr()||!globalThis.navigator?.languages?.length))for(let e=0;e<globalThis.navigator.languages.length;e++){let t=o.languages.find(n=>n.code.toLowerCase()===globalThis.navigator.languages[e].toLowerCase());if(t)return{code:t.code,name:t.name}}}function is(o,e){let t=e?.languageCode??"",n=e?.fallbackToNavigatorLanguage??!0,r=o?.languages?.find(s=>s.code.toLowerCase()===t.toLowerCase()),i;if(r)i=r;else if(n??!0)try{let s=Bc(o);s&&(i=s)}catch(s){A.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",s)}return i??o.defaultLanguage}y();var ss=!1;function wh(o){ss=o}function as(){return ss}y();y();y();import xe from"zod";var pt=50,Bn=1,oo=!1,Ec=o=>{if(o===null||typeof o!="object")return!1;let e=o;return typeof e.cost=="number"&&!Number.isNaN(e.cost)&&e.geometry?.type==="Feature"&&(e.costAccumulation===void 0||e.costAccumulation==="per-node"||e.costAccumulation==="per-zone-entry")},Rn=xe.object({limit:xe.enum(["same-floor","same-elevation","all-floors"]).optional(),mode:xe.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:xe.boolean().optional().or(xe.literal("auto")),maxDistance:xe.number().optional(),maxResults:xe.number().optional(),travelDistanceOptions:xe.object({excludedConnections:xe.array(xe.custom(o=>typeof o=="object"&&o!==null&&te.is(o))).optional(),zones:xe.array(xe.custom(Ec)).optional()}).optional()}),Sn={lineOfSight:oo,mode:"travel-distance",maxDistance:pt,limit:"same-floor",maxResults:Bn,travelDistanceOptions:{}},Tt=class{#e;#t;#o=new WeakMap;constructor(e,t){this.#e=e,this.#t=t}__LEGACY_NEAREST_SYNC=(e,t,n)=>{if(this.#e.mvf==null)throw new Q(Be("Query.__LEGACY_NEAREST_SYNC","Query.nearest"));let r={...Sn,...n};try{Rn.parse(r)}catch(u){A.error(u);return}let i=ke(e);if(!i)return;let s=this.#n(i,r),a=[],c={},l=[];for(let u of t){let f=ze(u,this.#e,this.#e.enterpriseMode);if(f)for(let I of f)c[I]||(c[I]=[]),c[I].push(u),l.push(I)}return n?.mode==="absolute-distance"?a=this.#r(i,s,t,r):a=this.#d(e,s,l,c,r),a.sort((u,f)=>u.distance-f.distance)};async nearest(e,t,n){let r={...Sn,...n};try{Rn.parse(r)}catch(f){A.error(f);return}let i=ke(e);if(!i)return;let s=this.#n(i,r),a=[],c={},l=[],u=[];if(n?.mode==="absolute-distance")a=this.#r(i,s,t,r);else{for(let f of t)u.push(Xe(f,this.#e,this.#e.enterpriseMode).then(I=>{if(I)for(let b of I)c[b]||(c[b]=[]),c[b].push(f),l.push(b)}));await Promise.all(u),a=await this.#a(e,s,l,c,r)}return a.sort((f,I)=>f.distance-I.distance)}async nearestNode(e,t){let n={...Sn,...t,mode:"absolute-distance"};try{Rn.parse(n)}catch(a){A.error(a);return}let r=ke(e);if(!r)return;let i=this.#e.navigationNodes;return i.nearestNodesOnFloors(r,this.#n(r,n),{lineOfSight:n.lineOfSight==="auto"?oo:n.lineOfSight,maxDistance:n.maxDistance,maxResults:n.maxResults}).slice(0,n.maxResults).flatMap(({id:a,distance:c})=>{let l=i.node(a);return l?[{distance:c,feature:l}]:[]})}#n(e,t){let n=e.floorId?[e.floorId]:[];if(t?.limit==="all-floors")n=this.#e.getByType("floor").map(r=>r.id);else if(e.floorId==null)for(let r of this.#e.getByType("floor-stack")){let i=r.defaultFloor;i&&n.push(i.id)}else if(t?.limit==="same-elevation"){let r=this.#e.floorsById[e.floorId];if(r){let i=r?.elevation;i!=null&&(n=this.#e.getByType("floor-stack").map(s=>s.floors.find(a=>a.elevation===i)?.id).filter(Boolean))}}return n}#r=(e,t,n,r)=>{let i=[],s=this.#i(n);for(let a of t)for(let[c,l]of s){let u=this.#t.searchWithIncludedIds([e.longitude,e.latitude],c,this.#e.mapName,a,l,r?.maxDistance??pt,r?.lineOfSight==="auto"?oo:r?.lineOfSight,r?.maxResults??1);if(u)for(let f of u)i.push({distance:f.distance,feature:this.#e.getById(c,f.node.properties.parentId)||this.#e.getById(c,f.node.properties.id)})}return i};nearestNodesOnFloors=(e,t,{lineOfSight:n,maxDistance:r,maxResults:i})=>this.#r(e,[...t],this.#e.getByType("node"),{limit:"same-floor",lineOfSight:n,mode:"absolute-distance",maxDistance:r,maxResults:i,travelDistanceOptions:{}}).map(s=>({id:s.feature.id,distance:s.distance})).sort((s,a)=>s.distance-a.distance);nearestNodeOnFloor=(e,t,{lineOfSight:n,maxDistance:r})=>{let[i]=this.#r(e,[t],this.#e.getByType("node").filter(s=>s.floor.id===t),{limit:"same-floor",lineOfSight:n,mode:"absolute-distance",maxDistance:r,maxResults:1,travelDistanceOptions:{}});return i?{id:i.feature.id,distance:i.distance}:void 0};#i=e=>{let t=this.#o.get(e);if(t)return t;let n=new Map;for(let r of e){let i=n.get(r.__type);i?i.push(r.id):n.set(r.__type,[r.id])}return this.#o.set(e,n),n};#c=e=>{let t=new Map,{edges:n}=this.#e.requireDirections().navigator.graph;for(let r of e){let i=this.#e.navigationNodes.connectionNodeIds(r);if(i.length<2)continue;let s=new Set(i);for(let a of i){let c=n[a];if(c)for(let l of c)s.has(l.destination.properties.id)&&t.set(l,1/0)}}return t};#s=e=>{let t=e?.travelDistanceOptions?.excludedConnections??[],n=(e?.travelDistanceOptions?.zones??[]).map(r=>({geometry:r.geometry,cost:r.cost,costAccumulation:r.costAccumulation,map:r.floor?.id}));return{overrideEdgeWeights:this.#c(t),zones:n}};#a=async(e,t,n,r,i)=>{let s=[],a=i?.limit==="all-floors"&&!le.is(e)&&e.anchorTarget.floorId?[e.anchorTarget.floorId]:t,{overrideEdgeWeights:c,zones:l}=this.#s(i);for(let u of a){let f=0,I;if(!le.is(e)){let b=this.#e.navigationNodes.nearestNodeOnFloor(e.anchorTarget,u,{lineOfSight:i?.lineOfSight??!0,maxDistance:i?.maxDistance??pt});b&&(I=b.id,f=b.distance)}if(I){let b=new Set,R=this.#e.requireDirections().navigator.findNearestNodesOnGraph(I,(i?.maxDistance??pt)-f,u,n,!1,i?.maxResults??Bn,c,l);for(let E of R)for(let x of r[E.feature.properties.id])b.has(x.id)||(s.push({distance:E.distance+f,feature:x}),b.add(x.id))}}return s};#d=(e,t,n,r,i)=>{let s=[],a=i?.limit==="all-floors"&&!le.is(e)&&e.anchorTarget.floorId?[e.anchorTarget.floorId]:t,{overrideEdgeWeights:c,zones:l}=this.#s(i);for(let u of a){let f;if(le.is(e)||(f=this.__LEGACY_NEAREST_SYNC(e,this.#e.getByType("node"),{lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??pt,maxResults:1})?.[0].feature),f){let I=this.#e.requireDirections().navigator.findNearestNodesOnGraph(f.id,i?.maxDistance??pt,u,n,i?.lineOfSight==="auto"?oo:i?.lineOfSight,i?.maxResults??Bn,c,l);for(let b of I)for(let R of r[b.feature.properties.id])s.push({distance:b.distance,feature:R})}}return s}};y();var no=class{#e;constructor(e){this.#e=e}at(e){let t=[],n=[e.longitude,e.latitude],r=e.floorId?[e.floorId]:this.#e.getAllFloorIds();for(let i of r){let s=this.#e.searchAtCoordinate(e,i);for(let a of s)this.#t(n,a)&&t.push(a)}return t}#t(e,t){let n=t.geoJSON;if(!n||!n.geometry)return!1;let r=n.geometry.type;return r==="Point"?e[0]===n.geometry.coordinates[0]&&e[1]===n.geometry.coordinates[1]:r!=="Polygon"&&r!=="MultiPolygon"?!1:It(e,n)}};y();y();y();y();function cs(o){let e=+this._x.call(null,o),t=+this._y.call(null,o);return ds(this.cover(e,t),e,t,o)}function ds(o,e,t,n){if(isNaN(e)||isNaN(t))return o;var r,i=o._root,s={data:n},a=o._x0,c=o._y0,l=o._x1,u=o._y1,f,I,b,R,E,x,O,k;if(!i)return o._root=s,o;for(;i.length;)if((E=e>=(f=(a+l)/2))?a=f:l=f,(x=t>=(I=(c+u)/2))?c=I:u=I,r=i,!(i=i[O=x<<1|E]))return r[O]=s,o;if(b=+o._x.call(null,i.data),R=+o._y.call(null,i.data),e===b&&t===R)return s.next=i,r?r[O]=s:o._root=s,o;do r=r?r[O]=new Array(4):o._root=new Array(4),(E=e>=(f=(a+l)/2))?a=f:l=f,(x=t>=(I=(c+u)/2))?c=I:u=I;while((O=x<<1|E)===(k=(R>=I)<<1|b>=f));return r[k]=i,r[O]=s,o}function ls(o){var e,t,n=o.length,r,i,s=new Array(n),a=new Array(n),c=1/0,l=1/0,u=-1/0,f=-1/0;for(t=0;t<n;++t)isNaN(r=+this._x.call(null,e=o[t]))||isNaN(i=+this._y.call(null,e))||(s[t]=r,a[t]=i,r<c&&(c=r),r>u&&(u=r),i<l&&(l=i),i>f&&(f=i));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),t=0;t<n;++t)ds(this,s[t],a[t],o[t]);return this}y();function ps(o,e){if(isNaN(o=+o)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,r=this._x1,i=this._y1;if(isNaN(t))r=(t=Math.floor(o))+1,i=(n=Math.floor(e))+1;else{for(var s=r-t||1,a=this._root,c,l;t>o||o>=r||n>e||e>=i;)switch(l=(e<n)<<1|o<t,c=new Array(4),c[l]=a,a=c,s*=2,l){case 0:r=t+s,i=n+s;break;case 1:t=r-s,i=n+s;break;case 2:r=t+s,n=i-s;break;case 3:t=r-s,n=i-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=t,this._y0=n,this._x1=r,this._y1=i,this}y();function us(){var o=[];return this.visit(function(e){if(!e.length)do o.push(e.data);while(e=e.next)}),o}y();function fs(o){return arguments.length?this.cover(+o[0][0],+o[0][1]).cover(+o[1][0],+o[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}y();y();function oe(o,e,t,n,r){this.node=o,this.x0=e,this.y0=t,this.x1=n,this.y1=r}function gs(o,e,t){var n,r=this._x0,i=this._y0,s,a,c,l,u=this._x1,f=this._y1,I=[],b=this._root,R,E;for(b&&I.push(new oe(b,r,i,u,f)),t==null?t=1/0:(r=o-t,i=e-t,u=o+t,f=e+t,t*=t);R=I.pop();)if(!(!(b=R.node)||(s=R.x0)>u||(a=R.y0)>f||(c=R.x1)<r||(l=R.y1)<i))if(b.length){var x=(s+c)/2,O=(a+l)/2;I.push(new oe(b[3],x,O,c,l),new oe(b[2],s,O,x,l),new oe(b[1],x,a,c,O),new oe(b[0],s,a,x,O)),(E=(e>=O)<<1|o>=x)&&(R=I[I.length-1],I[I.length-1]=I[I.length-1-E],I[I.length-1-E]=R)}else{var k=o-+this._x.call(null,b.data),w=e-+this._y.call(null,b.data),U=k*k+w*w;if(U<t){var V=Math.sqrt(t=U);r=o-V,i=e-V,u=o+V,f=e+V,n=b.data}}return n}y();function ys(o){if(isNaN(u=+this._x.call(null,o))||isNaN(f=+this._y.call(null,o)))return this;var e,t=this._root,n,r,i,s=this._x0,a=this._y0,c=this._x1,l=this._y1,u,f,I,b,R,E,x,O;if(!t)return this;if(t.length)for(;;){if((R=u>=(I=(s+c)/2))?s=I:c=I,(E=f>=(b=(a+l)/2))?a=b:l=b,e=t,!(t=t[x=E<<1|R]))return this;if(!t.length)break;(e[x+1&3]||e[x+2&3]||e[x+3&3])&&(n=e,O=x)}for(;t.data!==o;)if(r=t,!(t=t.next))return this;return(i=t.next)&&delete t.next,r?(i?r.next=i:delete r.next,this):e?(i?e[x]=i:delete e[x],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[O]=t:this._root=t),this):(this._root=i,this)}function ms(o){for(var e=0,t=o.length;e<t;++e)this.remove(o[e]);return this}y();function hs(){return this._root}y();function Is(){var o=0;return this.visit(function(e){if(!e.length)do++o;while(e=e.next)}),o}y();function bs(o){var e=[],t,n=this._root,r,i,s,a,c;for(n&&e.push(new oe(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!o(n=t.node,i=t.x0,s=t.y0,a=t.x1,c=t.y1)&&n.length){var l=(i+a)/2,u=(s+c)/2;(r=n[3])&&e.push(new oe(r,l,u,a,c)),(r=n[2])&&e.push(new oe(r,i,u,l,c)),(r=n[1])&&e.push(new oe(r,l,s,a,u)),(r=n[0])&&e.push(new oe(r,i,s,l,u))}return this}y();function xs(o){var e=[],t=[],n;for(this._root&&e.push(new oe(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var r=n.node;if(r.length){var i,s=n.x0,a=n.y0,c=n.x1,l=n.y1,u=(s+c)/2,f=(a+l)/2;(i=r[0])&&e.push(new oe(i,s,a,u,f)),(i=r[1])&&e.push(new oe(i,u,a,c,f)),(i=r[2])&&e.push(new oe(i,s,f,u,l)),(i=r[3])&&e.push(new oe(i,u,f,c,l))}t.push(n)}for(;n=t.pop();)o(n.node,n.x0,n.y0,n.x1,n.y1);return this}y();function Ms(o){return o[0]}function Fs(o){return arguments.length?(this._x=o,this):this._x}y();function vs(o){return o[1]}function Ts(o){return arguments.length?(this._y=o,this):this._y}function Rt(o,e,t){var n=new En(e??Ms,t??vs,NaN,NaN,NaN,NaN);return o==null?n:n.addAll(o)}function En(o,e,t,n,r,i){this._x=o,this._y=e,this._x0=t,this._y0=n,this._x1=r,this._y1=i,this._root=void 0}function Rs(o){for(var e={data:o.data},t=e;o=o.next;)t=t.next={data:o.data};return e}var ue=Rt.prototype=En.prototype;ue.copy=function(){var o=new En(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return o;if(!e.length)return o._root=Rs(e),o;for(t=[{source:e,target:o._root=new Array(4)}];e=t.pop();)for(var r=0;r<4;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(4)}):e.target[r]=Rs(n));return o};ue.add=cs;ue.addAll=ls;ue.cover=ps;ue.data=us;ue.extent=fs;ue.find=gs;ue.remove=ys;ue.removeAll=ms;ue.root=hs;ue.size=Is;ue.visit=bs;ue.visitAfter=xs;ue.x=Fs;ue.y=Ts;y();function _n(o,e,t,n=0,r=0,i=0,s=0){if(t===void 0){t=o.root();let c=o.extent();if(c&&([[n,r],[i,s]]=c,e(t,n,r,i,s)))return!0;if(!t)return!1}let a=[[n,r,(i+n)/2,(s+r)/2],[(i+n)/2,r,i,(s+r)/2],[n,(s+r)/2,(i+n)/2,s],[(i+n)/2,(s+r)/2,i,s]];for(let c=0;c<4;c++){let l=t[c];if(l){let[u,f,I,b]=a[c];e(l,u,f,I,b)||_n(o,e,l,u,f,I,b)}}return!1}var Ss=1e3,_c=.1,Nc=5,Oc=1.5,ro=class{#e={};#t=new Map;#o=new WeakMap;getMaxSearchRadiusForFloorId=(e,t)=>{let n=this.#t.get(this.#i.mapName)?.get(t);if(n)return n;let r=this.getNodeTreeByTypeAndFloorId(e,this.#i.mapName,t);if(typeof r.extent=="function")if(r.extent()){let[[i,s],[a,c]]=r.extent(),l=a-i,u=c-s;n=Math.max(l,u)}else n=Ss;else n=Ss;return this.#t.set(this.#i.mapName,new Map([[t,n]])),n};searchWithIncludedIds(e,t,n,r,i,s,a=!1,c=1/0){let l=this.getNodeTreeByTypeAndFloorId(t,n,r),u=this.#n(i),f=new Set,I=[],b=Nc,R=Math.max(s,this.getMaxSearchRadiusForFloorId(t,r));for(;I.length<c&&b<=R;){let E=this.#r(e,l,u,b,s,f);E.sort((x,O)=>x.distance-O.distance);for(let x of E){if(I.length>=c)break;a?this.#i.requireDirections().navigator.hasLineOfSight(e,x.node.geometry.coordinates,r,_c)&&I.push(x):I.push(x)}b=b*Oc}return I}#n=e=>{let t=this.#o.get(e);if(t)return t;let n=new Set(e);return this.#o.set(e,n),n};#r(e,t,n,r,i,s){let{x:a,y:c}=this.#s(e[0],e[1]),l=a-r,u=a+r,f=c-r,I=c+r,b=[];return _n(t,(R,E,x,O,k)=>{let w=E>=u||x>=I||O<l||k<f;if("data"in R){let U=R;for(;U;){let V=U.data,z=V.properties.parentId||V.properties.id;if(n.has(z)&&!s.has(z)){s.add(z);let fe=Ve(e,V.geometry.coordinates);fe<=i&&b.push({node:V,distance:fe})}U=U.next}}return w}),b}#i;getNodeTreeByTypeAndFloorId(e,t,n){if(this.#e[e]||(this.#e[e]={}),this.#e[e][t]?.[n])return this.#e[e][t][n];this.#e[e][t]||(this.#e[e][t]={}),this.#e[e][t][n]=Rt();let r=this.#e[e][t][n];r.x(s=>{let a=s.geometry.coordinates;return this.#s(a[0],a[1]).x}),r.y(s=>{let a=s.geometry.coordinates;return this.#s(a[0],a[1]).y});let i=[];switch(e){case"space":{i=this.#i.navigationNodes.spaceNearestPointsOnFloor(n).map(c=>({type:"Feature",geometry:{type:"Point",coordinates:c.coordinate},properties:{id:c.nodeId,parentId:c.spaceId,neighbors:[]}}));break}case"node":i=(this.#i.nodeRecordsByFloorId[n]??[]).filter(c=>c.neighborIds.length>0).map(c=>({type:"Feature",geometry:c.geometry,properties:{id:c.id}}));break;case"point-of-interest":i=(this.#i.poiRecordsByFloorId[n]??[]).map(c=>({type:"Feature",geometry:c.geometry,properties:{id:c.id}}));break;case"door":i=(this.#i.doorRecordsByFloorId[n]??[]).map(c=>({type:"Feature",geometry:c.geometry,properties:{id:c.id}}));break;case"annotation":i=(this.#i.annotationRecordsByFloorId[n]??[]).map(c=>({type:"Feature",geometry:c.geometry,properties:{id:c.id}}));break;case"enterprise-location":let s=this.#i.nodeRecordsByFloorId[n]||[],a=this.#i.nodeIndex.locationIdsByNodeId;i=[];for(let c=0;c<s.length;c++){let l=s[c],u=a[l.id];u?.length>0&&i.push({type:"Feature",geometry:l.geometry,properties:{id:l.id,parentId:u[0]}})}break;case"object":case"location-profile":case"connection":case"area":case"facade":i=this.#c(this.#i.getByType(e),n);break}return i?.length>0&&r.addAll(i),r}#c(e,t){let n=[];for(let r of e){let i=ze(r,this.#i,this.#i.enterpriseMode);for(let s=0;s<i.length;s++){let a=this.#i.navigationNodes.nodePosition(i[s]);a?.floorId===t&&n.push({type:"Feature",geometry:{type:"Point",coordinates:a.coordinate},properties:{id:i[s],parentId:r.id,neighbors:[]}})}}return n}#s;constructor(e,t){this.#i=e,this.#s=t}};y();y();y();y();function io(o,e,t=0,n=o.length-1,r=Pc){for(;n>t;){if(n-t>600){let c=n-t+1,l=e-t+1,u=Math.log(c),f=.5*Math.exp(2*u/3),I=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),b=Math.max(t,Math.floor(e-l*f/c+I)),R=Math.min(n,Math.floor(e+(c-l)*f/c+I));io(o,e,b,R,r)}let i=o[e],s=t,a=n;for(St(o,t,e),r(o[n],i)>0&&St(o,t,n);s<a;){for(St(o,s,a),s++,a--;r(o[s],i)<0;)s++;for(;r(o[a],i)>0;)a--}r(o[t],i)===0?St(o,t,a):(a++,St(o,a,n)),a<=e&&(t=a+1),e<=a&&(n=a-1)}}function St(o,e,t){let n=o[e];o[e]=o[t],o[t]=n}function Pc(o,e){return o<e?-1:o>e?1:0}var _t=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!ao(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let s=0;s<t.children.length;s++){let a=t.children[s],c=t.leaf?r(a):a;ao(e,c)&&(t.leaf?n.push(a):On(e,c)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!ao(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],s=t.leaf?this.toBBox(i):i;if(ao(e,s)){if(t.leaf||On(e,s))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let n=0;n<e.length;n++)this.insert(e[n]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let n=this.data;this.data=t,t=n}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=ft([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],s=[],a,c,l;for(;n||i.length;){if(n||(n=i.pop(),c=i[i.length-1],a=s.pop(),l=!0),n.leaf){let u=Dc(e,n.children,t);if(u!==-1)return n.children.splice(u,1),i.push(n),this._condense(i),this}!l&&!n.leaf&&On(n,r)?(i.push(n),s.push(a),a=0,c=n,n=n.children[0]):c?(a++,n=c.children[a],l=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,s=this._maxEntries,a;if(i<=s)return a=ft(e.slice(t,n+1)),ut(a,this.toBBox),a;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),a=ft([]),a.leaf=!1,a.height=r;let c=Math.ceil(i/s),l=c*Math.ceil(Math.sqrt(s));Bs(e,t,n,l,this.compareMinX);for(let u=t;u<=n;u+=l){let f=Math.min(u+l-1,n);Bs(e,u,f,c,this.compareMinY);for(let I=u;I<=f;I+=c){let b=Math.min(I+c-1,f);a.children.push(this._build(e,I,b,r-1))}}return ut(a,this.toBBox),a}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let i=1/0,s=1/0,a;for(let c=0;c<t.children.length;c++){let l=t.children[c],u=Nn(l),f=kc(e,l)-u;f<s?(s=f,i=u<i?u:i,a=l):f===s&&u<i&&(i=u,a=l)}t=a||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],s=this._chooseSubtree(r,this.data,t,i);for(s.children.push(e),Et(s,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let s=this._chooseSplitIndex(n,i,r),a=ft(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,ut(n,this.toBBox),ut(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=ft([e,t]),this.data.height=e.height+1,this.data.leaf=!1,ut(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,s=1/0;for(let a=t;a<=n-t;a++){let c=Bt(e,0,a,this.toBBox),l=Bt(e,a,n,this.toBBox),u=Cc(c,l),f=Nn(c)+Nn(l);u<i?(i=u,r=a,s=f<s?f:s):u===i&&f<s&&(s=f,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:wc,i=e.leaf?this.compareMinY:Ac,s=this._allDistMargin(e,t,n,r),a=this._allDistMargin(e,t,n,i);s<a&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,s=Bt(e,0,t,i),a=Bt(e,n-t,n,i),c=so(s)+so(a);for(let l=t;l<n-t;l++){let u=e.children[l];Et(s,e.leaf?i(u):u),c+=so(s)}for(let l=n-t-1;l>=t;l--){let u=e.children[l];Et(a,e.leaf?i(u):u),c+=so(a)}return c}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Et(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():ut(e[t],this.toBBox)}};function Dc(o,e,t){if(!t)return e.indexOf(o);for(let n=0;n<e.length;n++)if(t(o,e[n]))return n;return-1}function ut(o,e){Bt(o,0,o.children.length,e,o)}function Bt(o,e,t,n,r){r||(r=ft(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let i=e;i<t;i++){let s=o.children[i];Et(r,o.leaf?n(s):s)}return r}function Et(o,e){return o.minX=Math.min(o.minX,e.minX),o.minY=Math.min(o.minY,e.minY),o.maxX=Math.max(o.maxX,e.maxX),o.maxY=Math.max(o.maxY,e.maxY),o}function wc(o,e){return o.minX-e.minX}function Ac(o,e){return o.minY-e.minY}function Nn(o){return(o.maxX-o.minX)*(o.maxY-o.minY)}function so(o){return o.maxX-o.minX+(o.maxY-o.minY)}function kc(o,e){return(Math.max(e.maxX,o.maxX)-Math.min(e.minX,o.minX))*(Math.max(e.maxY,o.maxY)-Math.min(e.minY,o.minY))}function Cc(o,e){let t=Math.max(o.minX,e.minX),n=Math.max(o.minY,e.minY),r=Math.min(o.maxX,e.maxX),i=Math.min(o.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,i-n)}function On(o,e){return o.minX<=e.minX&&o.minY<=e.minY&&e.maxX<=o.maxX&&e.maxY<=o.maxY}function ao(o,e){return e.minX<=o.maxX&&e.minY<=o.maxY&&e.maxX>=o.minX&&e.maxY>=o.minY}function ft(o){return{children:o,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Bs(o,e,t,n,r){let i=[e,t];for(;i.length;){if(t=i.pop(),e=i.pop(),t-e<=n)continue;let s=e+Math.ceil((t-e)/n/2)*n;io(o,s,e,t,r),i.push(e,s,s,t)}}var co=class extends _t{#e;constructor(e){super(),this.#e=e}toBBox=e=>{let t=e.geoJSONBoundingBox;t==null&&A.warn(`Item "${e.id}" has no geoJSONBoundingBox; falling back to zero-size bbox at origin.`);let n=t!=null&&t.length===6,r=t?.[0]??0,i=t?.[1]??0,s=(n?t?.[3]:t?.[2])??0,a=(n?t?.[4]:t?.[3])??0,c=this.#e(r,i),l=this.#e(s,a);return{minX:c.x,minY:c.y,maxX:l.x,maxY:l.y}};compareMinX=(e,t)=>{let n=this.toBBox(e),r=this.toBBox(t);return n.minX-r.minX};compareMinY=(e,t)=>{let n=this.toBBox(e),r=this.toBBox(t);return n.minY-r.minY};search(e,t,n,r){if(typeof e=="object")return super.search(e);let i=this.#e(e,t),s=this.#e(n,r);return super.search({minX:i.x,minY:i.y,maxX:s.x,maxY:s.y})}searchCoordinate(e){return this.search(e.longitude,e.latitude,e.longitude,e.latitude)}};var lo=class{#e;#t;#o=new Map;constructor(e,t){this.#e=e,this.#t=t}getTreeByFloorId(e){let t=this.#o.get(e);if(t)return t;let n=new co(this.#t),r=this.#e.floorsById[e];if(r){let i=[r,...r.spaces,...r.objects];for(let s of this.#e.areas)s.floor.id===e&&i.push(s);n.load(i)}return this.#o.set(e,n),n}searchAtCoordinate(e,t){return this.getTreeByFloorId(t).searchCoordinate(e)}getAllFloorIds(){return this.#e.floors.map(e=>e.id)}};y();function Es(o,e){let t=111319.9*Math.cos(e*Math.PI/180);return(n,r)=>({x:(n-o)*t,y:(r-e)*111319.9})}var _s=new WeakMap,Pn=o=>{let e=_s.get(o);if(e==null)throw new Error("Query has no nearest search.");return e},Nt=class{#e;#t;#o;#n;constructor(e){let t=Es(e.mapCenter.longitude,e.mapCenter.latitude);this.#o=new ro(e,t),this.#n=new lo(e,t),this.#e=new Tt(e,this.#o),_s.set(this,this.#e),this.#t=new no(this.#n)}__LEGACY_NEAREST_SYNC=(e,t,n)=>this.#e.__LEGACY_NEAREST_SYNC(e,t,n);async nearest(e,t,n){return this.#e.nearest(e,t,n)}async nearestNode(e,t){return this.#e.nearestNode(e,t)}async at(e){return this.#t.at(e)}};y();y();var po=class{#e;constructor(e){this.#e=e||[]}get raw(){return this.#e}};var Dn=class o extends Y{static is(e){return e.__type===o.__type}static __type="location-profile";__type=o.__type;name="";externalId;description;logo;logoImage;phone;social=[];images=[];links=[];website;icon;extra;searchTags;#e;#t={};#o;constructor(e,t){super(t.record.id),this.#e=e,this.#o=t.record,this.links=(t.record.links??[]).map(n=>new at({mvfData:n})),this.images=(t.record.pictures??[]).map(n=>n.url?new Ae({mvfData:{...n,url:n.url??""},mapData:this.#e}):void 0).filter(n=>n!=null),t.record.website&&(this.website=new at({mvfData:t.record.website})),t.record.icon&&(this.icon=new Ae({mvfData:{url:t.record.icon},mapData:this.#e})),t.record.logo&&(this.logoImage=new Ae({mvfData:{url:t.record.logo},mapData:this.#e}),Object.defineProperty(this,"logo",{get(){return this.logoImage?.url}})),this.name=t.record.name??"",this.externalId=t.record.externalId,this.description=t.record.description,this.phone=t.record.phone,this.social=t.record.social??[],this.searchTags=t.record.searchTags,this.extra=t.record.extra}get spaces(){if(this.#t.spaces)return this.#t.spaces;this.#t.spaces=[];for(let e=0;e<this.#o.spaceIds.length;e++){let t=this.#e.getById("space",this.#o.spaceIds[e]);t&&this.#t.spaces.push(t)}return this.#t.spaces}get points(){if(this.#t.points)return this.#t.points;this.#t.points=[];for(let e=0;e<this.#o.spaceIds.length;e++){let t=this.#e.getById("point-of-interest",this.#o.spaceIds[e]);t&&this.#t.points.push(t)}return this.#t.points}get doors(){if(this.#t.doors)return this.#t.doors;this.#t.doors=[];for(let e=0;e<this.#o.doorIds.length;e++){let t=this.#e.getById("door",this.#o.doorIds[e]);t&&this.#t.doors.push(t)}return this.#t.doors}get connections(){if(this.#t.connections)return this.#t.connections;this.#t.connections=[];for(let e of this.#o.connectionIds){let t=this.#e.getById("connection",e);t&&this.#t.connections.push(t)}return this.#t.connections}get annotations(){if(this.#t.annotations)return this.#t.annotations;this.#t.annotations=[];for(let e=0;e<this.#o.annotationIds.length;e++){let t=this.#e.getById("annotation",this.#o.annotationIds[e]);t&&this.#t.annotations.push(t)}return this.#t.annotations}get categories(){return this.#t.categories?this.#t.categories:(this.#t.categories=(this.#o.categoryIds??[]).map(e=>this.#e.getById("location-category",e)).filter(e=>e!=null),this.#t.categories)}get mapObjects(){return this.#t.mapObjects?this.#t.mapObjects:(this.#t.mapObjects=this.#o.objectIds.map(e=>this.#e.getById("object",e)).filter(e=>e!=null),this.#t.mapObjects)}get areas(){return this.#t.areas?this.#t.areas:(this.#t.areas=this.#o.areaIds.map(e=>this.#e.getById("area",e)).filter(e=>e!=null),this.#t.areas)}get focusTarget(){if(this.#t.focusTarget)return this.#t.focusTarget;let e=[];for(let t of this.spaces)e.push(t);for(let t of this.connections)e.push(...t.coordinates);for(let t of this.doors)e.push(t.focusTarget);for(let t of this.mapObjects)e.push(t.focusTarget);for(let t of this.annotations)e.push(t.focusTarget);for(let t of this.points)e.push(t.focusTarget);for(let t of this.areas)e.push(t.focusTarget);return this.#t.focusTarget=e,e}get openingHours(){return this.#t.openingHours?this.#t.openingHours:(this.#t.openingHours=new po(this.#o.openingHoursSpecification??[]),this.#t.openingHours)}get navigationTarget(){if(this.#t.navigationTarget)return this.#t.navigationTarget;let e=[];for(let t of this.spaces)e.push(t);for(let t of this.connections)e.push(...t.coordinates);for(let t of this.doors)e.push(t.focusTarget);for(let t of this.mapObjects)e.push(t.focusTarget);for(let t of this.annotations)e.push(t.focusTarget);for(let t of this.points)e.push(t.focusTarget);return this.#t.navigationTarget=e,e}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}},De=Dn;y();var wn=class o extends Y{static is(e){return e.__type===o.__type}static __type="location-category";__type=o.__type;name="";icon="";#e;#t={};#o;constructor(e,t){super(t.record.id),this.#e=e,this.#o=t.record,this.name=t.record.name??"",this.icon=t.record.icon??""}get parent(){return this.#t.parent?this.#t.parent:(this.#t.parent=this.#o.parent?this.#e.getById("location-category",this.#o.parent):void 0,this.#t.parent)}get children(){return this.#t.children?this.#t.children:(this.#t.children=this.#e.locationCategoriesByParentId[this.id]||[],this.#t.children)}get locationProfiles(){if(this.#t.locationProfiles)return this.#t.locationProfiles;let e=[];for(let t of this.#e.locationProfilesByCategoryId[this.id]||[]){let n=this.#e.getById("location-profile",t.id);n&&e.push(n)}return this.#t.locationProfiles=e,e}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}},Mt=wn;y();var jc=["id","externalId","name","shortName","subtitle","elevation","maxHeight"];function An(o){let e={};for(let t of jc)o[t]!==void 0&&(e[t]=o[t]);return{type:"Feature",geometry:o.geometry??null,properties:e}}function Db(o){let e=o?.geometry;if(!(e==null||e.type!=="Polygon"&&e.type!=="MultiPolygon")&&e.coordinates.length!==0)return An(o)}var Lc=new Set(["void","otb"]);function wb(o){let e=[];for(let t of o??[]){if(t.geometry?.type!=="Polygon")continue;let n=t.kind??"";Lc.has(n.toLowerCase())&&e.push({type:"Feature",geometry:t.geometry,properties:{id:t.id,kind:n}})}return e}function Ab(o){return{id:o.id,elevation:o.elevation,externalId:o.externalId??"",...o.name!==void 0&&{name:o.name},...o.shortName!==void 0&&{shortName:o.shortName},...o.subtitle!==void 0&&{subtitle:o.subtitle},...o.maxHeight!==void 0&&{maxHeight:o.maxHeight},...o.metadata!==void 0&&{metadata:o.metadata}}}function kb(o){return{id:o.id,floors:o.floorIds,maps:o.floorIds,externalId:o.externalId??"",name:o.name??"",...o.shortName!==void 0&&{shortName:o.shortName},...o.type!==void 0&&{type:o.type},...o.defaultFloor!==void 0&&{defaultFloor:o.defaultFloor},...o.metadata!==void 0&&{metadata:o.metadata}}}y();var uo=class{#e;constructor(e){this.#e=e}sameDoorNode(){return!1}spaceIdsForNode(e){return this.#e.nodeIndex.spaceIdsByNodeId[e]??[]}objectIdsForNode(e){return this.#e.nodeIndex.objectIdsByNodeId[e]??[]}doorForNode(e){let t=this.#e.nodeIndex.doorsByNodeId[e];return t==null?void 0:Ht(t.geoJSON.geometry)}doorNodeIds(){return new Set(Object.keys(this.#e.nodeIndex.doorsByNodeId))}connectionNodeIds(e){return e.nodes.map(t=>t.id)}inaccessibleConnectionNodeIds(){return(this.#e.mvf?.["connection.json"]??[]).flatMap(e=>e.accessible?[]:e.nodes)}connectionForNode(e){let t=this.#e.nodeIndex.mvfConnectionsByNodeId[e];return t==null?void 0:{id:t.id,type:t.type,nodeIds:t.nodes}}node(e){return this.#e.getById("node",e)}neighborIdsForNode(e){return this.#e.nodeRecordsById[e]?.neighborIds??[]}cachedNodeCount(){return Object.keys(this.#e.nodesById).length}nodes(e){return e.map(t=>this.#e.getById("node",t)).filter(t=>t!==void 0)}allNodeIds(){return this.#e.getByType("node").map(e=>e.id)}nodeIdsOnFloor(e){return(this.#e.nodeRecordsByFloorId[e]??[]).map(t=>t.id)}nodesByExternalId(e){return this.#e.getByExternalId("node",e)}nodeIdsForFeature(e){return ee.is(e)?Qi(e,this.#e):me.is(e)?Yi(e,this.#e):ye.is(e)?qi(e,this.#e):ce.is(e)?Ki(e,this.#e):he.is(e)?Zi(e,this.#e):[]}nearestNodeIds(e){return Hi(e,this.#e,this.#e.enterpriseMode)}nearestNodeIdsSync(e){return Xi(e,this.#e,this.#e.enterpriseMode)}nodePosition(e){let t=this.#e.nodeRecordsById[e];if(t?.geometry.type==="Point")return{floorId:t.floorId,coordinate:t.geometry.coordinates}}spaceNearestPointsOnFloor(e){let t=[];for(let n of this.#e.spaceRecordsByFloorId[e]??[])for(let r of n.destinationNodes??[]){let i=this.#e.nodeRecordsById[r],s=i?.spaceIds?.[0];i?.geometry.type!=="Point"||s==null||t.push({nodeId:r,spaceId:s,coordinate:i.geometry.coordinates})}return t}nearestNodesOnFloors(e,t,n){return Pn(this.#e.Query).nearestNodesOnFloors(e,t,n)}nearestNodeOnFloor(e,t,{lineOfSight:n,maxDistance:r}){return Pn(this.#e.Query).nearestNodeOnFloor(e,t,{lineOfSight:n,maxDistance:r})}};y();var fo=class{#e;constructor(e){this.#e=e}async getAll(){return this.#e.navigationNodes.nodes(this.#e.navigationNodes.allNodeIds())}async getById(e){return this.#e.navigationNodes.node(e)}async getByExternalId(e){return this.#e.navigationNodes.nodesByExternalId(e)}async getByType(e){let t=this.#e.navigationNodes;return We.is(e)?t.nodes(t.nodeIdsOnFloor(e.id)):te.is(e)?t.nodes(t.connectionNodeIds(e)):pe.is(e)?e.nodes:e instanceof Je?e.path:[]}};y();y();var go=class{#e;#t;#o=new Map;#n=1/0;#r=-1/0;#i=1/0;#c=-1/0;constructor(e,t){this.#e=t;let n=0;for(let[,i]of e)n+=i;let r=e.length>0?n/e.length:0;this.#t=1/Math.max(Math.cos(r*Math.PI/180),1e-6);for(let i=0;i<e.length;i++){let[s,a]=e[i],c=this.#s(s),l=this.#a(a),u=this.#d(c,l),f=this.#o.get(u);f?f.indexes.push(i):this.#o.set(u,{column:c,row:l,indexes:[i]}),c<this.#n&&(this.#n=c),c>this.#r&&(this.#r=c),l<this.#i&&(this.#i=l),l>this.#c&&(this.#c=l)}}candidates(e,t){let n=t*this.#t,r=this.#s(e[0]-n),i=this.#s(e[0]+n),s=this.#a(e[1]-t),a=this.#a(e[1]+t),c=[];if(i<this.#n||r>this.#r||a<this.#i||s>this.#c)return c;if((i-r+1)*(a-s+1)>this.#o.size){for(let{column:l,row:u,indexes:f}of this.#o.values())if(!(l<r||l>i||u<s||u>a))for(let I of f)c.push(I)}else for(let l=r;l<=i;l++)for(let u=s;u<=a;u++){let f=this.#o.get(this.#d(l,u));if(f)for(let I of f.indexes)c.push(I)}return c.sort((l,u)=>l-u)}#s(e){return Math.floor(e/(this.#e*this.#t))}#a(e){return Math.floor(e/this.#e)}#d(e,t){return`${e},${t}`}};y();function Ns(o){let e=new Map;for(let a of o.floors?.features??[])e.set(a.properties.id,a.properties.elevation);let t=new Map,n=new Map;for(let a of Object.values(o.nodes??{}))for(let c of a?.features??[]){for(let l of c.properties.geometryIds){let u=t.get(l)??[];u.includes(c.properties.id)||u.push(c.properties.id),t.set(l,u)}for(let l of c.properties.neighbors){let u=n.get(l.id)??[];u.push(l.flags??[]),n.set(l.id,u)}}let r=new Map;for(let a of o.connections??[]){let c=1/0,l=-1/0;for(let f of[a.entrances,a.exits])for(let I of f){let b=e.get(I.floorId)??0;b<c&&(c=b),b>l&&(l=b)}let u=l>=c?l-c:0;for(let f of a.entrances)for(let I of t.get(f.geometryId)??[]){let b=r.get(I)??[];for(let R of a.exits){let E=Math.abs((e.get(f.floorId)??0)-(e.get(R.floorId)??0)),x=f.floorId===R.floorId,O=Vc(a,x,E,u),k=a.type==="door"&&x;for(let w of t.get(R.geometryId)??[])w!==I&&b.push(k?{id:w,weight:O,sameStop:k}:{id:w,weight:O})}r.set(I,b)}}let i=Object.values(o.navigationFlags??{}),s=[];for(let[a,c]of Object.entries(o.nodes??{}))for(let l of c?.features??[]){let u=l.properties.id,f=Uc(n.get(u)??[],i),I=[];for(let b of l.properties.neighbors)I.push({id:b.id,weight:b.extraCost});for(let b of r.get(u)??[])I.push(b);s.push({type:"Feature",geometry:l.geometry,properties:{id:u,map:a,floor:a,geometryIds:l.properties.geometryIds,neighbors:I,...f!==void 0&&{flags:f}}})}return{type:"FeatureCollection",features:s}}function Vc(o,e,t,n){return o.type==="door"&&e?0:o.floorCostMultiplier>1&&n>0?o.entryCost*t/n:o.entryCost}var Gc=(o,e)=>((o[e.index]??0)&1<<e.bit)!==0;function Uc(o,e){let t=e.filter(i=>o.some(s=>Gc(s,i)));if(t.length===0)return;let n=0;for(let i of t)i.index+1>n&&(n=i.index+1);let r=new Array(n).fill(0);for(let i of t)r[i.index]|=1<<i.bit;return r}var Ds=111319.9,Wc=5/Ds,$c=5,mo=class{collection;#e=new Map;#t=new Map;#o=new Map;#n=new Map;#r;#i=new Map;#c=new Map;#s=new Map;#a=new Map;#d;#l=new Map;constructor(e){this.collection=Ns(e);let t=new Map;for(let n of this.collection.features){let r=n.properties.flags;Array.isArray(r)&&r.every(i=>typeof i=="number")&&t.set(n.properties.id,r)}for(let n of this.collection.features)this.#l.set(n.properties.id,n.properties.neighbors.map(r=>r.id));for(let[n,r]of Object.entries(e.nodes??{})){let i=[];for(let s of r?.features??[]){let{id:a,geometryIds:c}=s.properties,[l,u]=s.geometry.coordinates,f=t.get(a);this.#e.set(a,{id:a,coordinate:[l,u],floorId:n,geometryIds:c,...f!==void 0&&{flags:f}}),this.#s.set(a,s.properties.neighbors.map(I=>I.id)),i.push(a);for(let I of c){let b=this.#t.get(I)??[];b.push(a),this.#t.set(I,b)}}this.#o.set(n,i)}this.#d=Jc(e);for(let n of e.connections??[]){let r=[...n.entrances,...n.exits].map(c=>c.geometryId),i=this.nodeIdsForGeometry(r);if(this.#c.set(n.id,i),n.type==="door"&&!Xc(n)){for(let c of i)this.#i.has(c)||this.#i.set(c,n.id);continue}let a={id:n.id,type:n.type,nodeIds:i};for(let c of i)this.#a.has(c)||this.#a.set(c,a)}}nodeIdsForGeometry(e){let t=[];for(let n of e)for(let r of this.#t.get(n)??[])t.includes(r)||t.push(r);return t}geometryIdsForNode(e){return this.#e.get(e)?.geometryIds??[]}doorIdForNode(e){return this.#i.get(e)}entranceNodeIds(e,t){let n=this.nodeIdsForGeometry([e]),r=n.filter(c=>this.#i.has(c));if(r.length===0)return n;let i=new Map;for(let c of r){let l=c.replace(/-p\d+$/,""),u=i.get(l);u?u.push(c):i.set(l,[c])}let s=c=>t!=null&&(this.#s.get(c)??[]).some(l=>{let u=this.#e.get(l);return u!=null&&Os(u.coordinate,t)}),a=[];for(let c of i.values())a.push(c.find(s)??c[0]);return a}nodeIdsForConnection(e){return this.#c.get(e)??[]}connectionForNode(e){return this.#a.get(e)}doorNodeIds(){return this.#r??=new Set(this.#i.keys()),this.#r}nodeIdsInPolygon(e,t){let n=this.#o.get(e)??[],[r]=t;if(r==null||r.length===0||n.length===0)return[];let i=1/0,s=-1/0,a=1/0,c=-1/0;for(let[I,b]of r)I<i&&(i=I),I>s&&(s=I),b<a&&(a=b),b>c&&(c=b);let l=[(i+s)/2,(a+c)/2],u=Math.max((c-a)/2,(s-i)/2*Math.cos(l[1]*Math.PI/180)),f=[];for(let I of this.#p(e).candidates(l,u)){let b=n[I];Os(this.#e.get(b).coordinate,t)&&f.push(b)}return f}nearestNodes(e,t,{maxDistance:n,limit:r=1/0}){let i=this.#o.get(t);if(i==null||i.length===0||r<=0)return[];let s=[e[0],e[1]],a=this.#p(t),c=new Map,l=u=>{let f=[];for(let I of a.candidates(s,u/Ds*1.01)){let b=c.get(I);b===void 0&&(b=Ve(s,this.#e.get(i[I]).coordinate),c.set(I,b)),b<=u&&f.push({id:i[I],distance:b})}return f.sort((I,b)=>I.distance-b.distance)};for(let u=Math.min($c,n);;u=Math.min(u*2,n)){let f=l(u);if(f.length>=r||u>=n)return f.length>r?f.slice(0,r):f}}#p(e){let t=this.#n.get(e);if(t==null){let n=(this.#o.get(e)??[]).map(r=>this.#e.get(r).coordinate);t=new go(n,Wc),this.#n.set(e,t)}return t}obstructions(){return this.#d}nodeIdsOnFloor(e){return this.#o.get(e)??[]}allNodeIds(){let e=[];for(let t of this.#o.values())for(let n of t)e.push(n);return e}neighborIds(e){return this.#l.get(e)??[]}node(e){return this.#e.get(e)}};function Jc(o){let e=[];for(let[t,n]of Object.entries(o.geometry??{})){let r=o.nonwalkable?.[t];if(r!=null)for(let i of n?.features??[]){let s=i.properties.id;if(!(s in r))continue;let a=zc(i.geometry);a.forEach((c,l)=>{e.push({type:"Feature",geometry:c,properties:{id:a.length>1?`${s}-${l}`:s,externalId:"",entrances:[],map:t}})})}}return{type:"FeatureCollection",features:e}}var yo=([o,e])=>[o,e];function zc(o){switch(o.type){case"LineString":return[{type:"LineString",coordinates:o.coordinates.map(yo)}];case"Polygon":return[{type:"Polygon",coordinates:o.coordinates.map(e=>e.map(yo))}];case"MultiLineString":return o.coordinates.map(e=>({type:"LineString",coordinates:e.map(yo)}));case"MultiPolygon":return o.coordinates.map(e=>({type:"Polygon",coordinates:e.map(t=>t.map(yo))}));default:return[]}}function Xc(o){let e=o.entrances[0]?.floorId??o.exits[0]?.floorId;for(let t of[o.entrances,o.exits])for(let n of t)if(n.floorId!==e)return!0;return!1}function Os(o,e){let[t,...n]=e;return Ps(o,t)&&!n.some(r=>Ps(o,r))}function Ps(o,e){if(e==null)return!1;let t=!1;for(let n=0,r=e.length-1;n<e.length;r=n++){let[i,s]=e[n],[a,c]=e[r];s>o[1]!=c>o[1]&&o[0]<(a-i)*(o[1]-s)/(c-s)+i&&(t=!t)}return t}y();y();var ho=class{#e;#t=new Map;constructor(e){if(!(e>=1))throw new RangeError(`BoundedCache capacity must be at least 1, got ${e}.`);this.#e=e}get size(){return this.#t.size}get(e){let t=this.#t.get(e);if(t!==void 0)return this.#t.delete(e),this.#t.set(e,t),t}set(e,t){if(this.#t.delete(e),this.#t.set(e,t),this.#t.size>this.#e){let n=this.#t.keys().next();n.done||this.#t.delete(n.value)}}};var Hc=5e3;function As(o){let e={};for(let[n,r]of Object.entries(o.doorRecordsById)){let i=Ht(r?.geometry);i!=null&&(e[n]=i)}let t={};for(let[n,r]of Object.entries(o.spaceRecordsByFloorId))t[n]=(r??[]).map(i=>i.id);return{spaceIds:Object.keys(o.spacesById),spaceIdsByFloorId:t,objectIds:Object.keys(o.objectsById),doorsById:e,inaccessibleConnectionIds:Object.values(o.connectionRecordsById).filter(n=>!n.accessible).map(n=>n.id),defaultFloorIds:o.getByType("floor-stack").map(n=>n.defaultFloor?.id).filter(n=>n!=null)}}var Io=class{#e;#t;#o=new ho(Hc);constructor(e,t){this.#e=e,this.#t=t}sameDoorNode(e,t){return this.#t.sameDoorNode(e,t)}spaceIdsForNode(e){return this.#t.spaceIdsForNode(e)}objectIdsForNode(e){return this.#t.objectIdsForNode(e)}doorForNode(e){return this.#t.doorForNode(e)}doorNodeIds(){return this.#t.doorNodeIds()}connectionNodeIds(e){return this.#t.connectionNodeIds(e.id)}inaccessibleConnectionNodeIds(){return this.#t.inaccessibleConnectionNodeIds()}connectionForNode(e){return this.#t.connectionForNode(e)}node(e){let t=this.#o.get(e);if(t)return t;let n=this.#t.nodeFacts(e);if(n==null)return;let r=new le(this.#e,{record:{id:n.id,floorId:n.floorId,geometry:{type:"Point",coordinates:[...n.coordinate]},neighborIds:n.neighborIds,spaceIds:n.spaceIds,...n.flags!==void 0&&{flags:n.flags},populated:{spaceIds:n.spaceIds,objectIds:n.objectIds}}});return this.#o.set(e,r),r}neighborIdsForNode(e){return this.#t.neighborIds(e)}cachedNodeCount(){return this.#o.size}nodes(e){return e.map(t=>this.node(t)).filter(t=>t!==void 0)}allNodeIds(){return this.#t.allNodeIds()}nodeIdsOnFloor(e){return this.#t.nodeIdsOnFloor(e)}nodesByExternalId(){return[]}nodeIdsForFeature(e){let t=this.#n(e);return t==null?[]:this.#t.nodeIdsForFeature(t)}async nearestNodeIds(e){return this.nearestNodeIdsSync(e)}nodePosition(e){return this.#t.nodePosition(e)}spaceNearestPointsOnFloor(e){return this.#t.spaceNearestPointsOnFloor(e)}nearestNodeIdsSync(e){return this.#t.nearestNodeIds(ws(e.anchorTarget))}nearestNodesOnFloors(e,t,n){return this.#t.nearestNodesOnFloors([e.longitude,e.latitude],t,n)}nearestNodeOnFloor(e,t,n){return this.#t.nearestNodeOnFloor([e.longitude,e.latitude],t,n)}#n(e){if(ee.is(e))return{type:"space",id:e.id,polygon:this.#r(e.id)};if(me.is(e))return{type:"door",id:e.id};if(ye.is(e)){let t=this.#e.areaRecordsById[e.id];return t==null?void 0:{type:"area",id:e.id,floorId:t.floorId,polygon:t.geometry.type==="Polygon"?t.geometry.coordinates:void 0}}if(ce.is(e))return{type:"object",id:e.id,center:ws(e.center)};if(he.is(e))return{type:"facade",spaces:e.spaces.map(t=>({id:t.id,polygon:this.#r(t.id)}))}}#r(e){let t=this.#e.spacesById[e]?.geoJSON.geometry;return t?.type==="Polygon"?t.coordinates:void 0}},ws=o=>({coordinate:[o.longitude,o.latitude],...o.floorId!=null&&{floorId:o.floorId}});y();var ks=o=>o.replace(/-p\d+$/,""),bo=o=>`g_${o.slice(o.indexOf("_")+1)}`,xo=class{#e;#t;#o;#n;#r;#i;#c;constructor(e,t,n){this.#e=e,this.#t=t,this.#o=n,this.#n=new Set(t.spaceIds),this.#r=new Set(t.objectIds)}sameDoorNode(e,t){let n=this.#e.doorIdForNode(e);return e!==t&&n!=null&&n===this.#e.doorIdForNode(t)&&ks(e)===ks(t)}spaceIdsForNode(e){let t=new Set(this.#e.geometryIdsForNode(e).map(r=>`s_${r.slice(2)}`).filter(r=>this.#n.has(r)));if(t.size<2)return[...t];let n=this.#s();return[...t].sort((r,i)=>n.get(r)-n.get(i))}#s(){return this.#i??=new Map(this.#t.spaceIds.map((e,t)=>[e,t])),this.#i}objectIdsForNode(e){let t=this.#e.geometryIdsForNode(e).map(n=>`o_${n.slice(2)}`).filter(n=>this.#r.has(n));return[...new Set(t)]}doorForNode(e){let t=this.#e.doorIdForNode(e);return t==null?void 0:this.#t.doorsById[t]}doorNodeIds(){return this.#e.doorNodeIds()}connectionNodeIds(e){return this.#e.nodeIdsForConnection(e)}inaccessibleConnectionNodeIds(){return this.#c??=this.#t.inaccessibleConnectionIds.flatMap(e=>this.#e.nodeIdsForConnection(e)),this.#c}connectionForNode(e){return this.#e.connectionForNode(e)}nodeFacts(e){let t=this.#e.node(e);if(t!=null)return{id:t.id,floorId:t.floorId,coordinate:t.coordinate,neighborIds:this.#e.neighborIds(e),spaceIds:this.spaceIdsForNode(e),objectIds:this.objectIdsForNode(e),...t.flags!==void 0&&{flags:t.flags}}}neighborIds(e){return this.#e.neighborIds(e)}allNodeIds(){return this.#e.allNodeIds()}nodeIdsOnFloor(e){return this.#e.nodeIdsOnFloor(e)}nodeIdsForFeature(e){switch(e.type){case"space":return this.#d(e.id,e.polygon);case"door":return this.#e.nodeIdsForGeometry([bo(e.id)]);case"area":return e.polygon==null?[]:this.#e.nodeIdsInPolygon(e.floorId,e.polygon);case"object":return this.#l(e.id,e.center);case"facade":return e.spaces.flatMap(t=>this.#d(t.id,t.polygon))}}nodePosition(e){let t=this.#e.node(e);return t==null?void 0:{floorId:t.floorId,coordinate:t.coordinate}}spaceNearestPointsOnFloor(e){let t=[];for(let n of this.#t.spaceIdsByFloorId[e]??[])for(let r of this.#e.nodeIdsForGeometry([bo(n)])){let i=this.#e.node(r);i==null||i.floorId!==e||t.push({nodeId:r,spaceId:n,coordinate:i.coordinate})}return t}nearestNodeIds(e){let n=(e.floorId!=null?[e.floorId]:this.#t.defaultFloorIds).map(r=>this.nearestNodeOnFloor(e.coordinate,r,{lineOfSight:!0,maxDistance:50})).filter(r=>r!==void 0).sort((r,i)=>r.distance-i.distance);return n.length>0?[n[0].id]:[]}nearestNodesOnFloors(e,t,{lineOfSight:n,maxDistance:r,maxResults:i}){let s=[e[0],e[1]],a=[];for(let c of t){let l=0,u=n?1/0:i;for(let f of this.#e.nearestNodes(s,c,{maxDistance:r,limit:u})){if(l>=i)break;n&&!this.#a(s,f.id,c)||(a.push(f),l++)}}return a.sort((c,l)=>c.distance-l.distance)}nearestNodeOnFloor(e,t,{lineOfSight:n,maxDistance:r}){let i=[e[0],e[1]],s=this.#e.nearestNodes(i,t,{maxDistance:r,limit:n===!0?1/0:1});return n!==!0?s[0]:s.find(a=>this.#a(i,a.id,t))}#a(e,t,n){let[r,i]=this.#e.node(t).coordinate;return this.#o(e,[r,i],n,.1)}#d(e,t){return this.#e.entranceNodeIds(bo(e),t)}#l(e,t){let n=this.#e.nodeIdsForGeometry([bo(e)]);if(n.length>0)return n;if(t?.floorId==null)return[];let r=this.#e.nearestNodes([t.coordinate[0],t.coordinate[1]],t.floorId,{maxDistance:50,limit:1});return r.length>0?[r[0].id]:[]}};var kn=.75;function Yc(o){let e=[];if(o.geometry.type==="Polygon")for(let t=1;t<o.geometry.coordinates.length;t++)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[t]]},properties:{...o.properties,id:$()}});else if(o.geometry.type==="MultiPolygon")for(let t of o.geometry.coordinates)for(let n=1;n<t.length;n++)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:[t[n]]},properties:{...o.properties,id:$()}});return e}function qc(o){let e={};for(let t of Object.values(o)){let n=t.geometry,r=[];if((n?.type==="Polygon"||n?.type==="MultiPolygon")&&n.coordinates.length>0){let i=Yc(An(t));for(let s of i)r.push(s)}e[t.id]={voids:{type:"FeatureCollection",features:r}}}return e}var Qc=()=>{throw new Q("MapDataInternal needs a parsed MVFv2 or a native MVFv3 bundle.")},Cs=class extends Wn{Analytics;#e={};Query;mvf;outdoorViewToken;nodeIndex;navigationNodes;Nodes;venue;tokenManager;directions;enterpriseMode=!1;nodesById;spacesById;floorsById;floorStacksById;facadesById;facadesBySpaceId;floorRecordsById;floorStackRecordsById;facadeRecordsById;annotationRecordsById;areaRecordsById;spaceRecordsByFloorId;poiRecordsByFloorId;doorRecordsById;geometryById;geometryByFloorId;connectionsById;objectsById;objectRecordsById;objectRecordsByFloorId;doorsById;pointsOfInterestById;annotationsById;areasById;locationProfilesById;locationCategoriesById;locationProfilesByExternalId;locationProfilesByCategoryId;locationCategoriesByParentId;styleRecordsById;styleIdByGeometryId;wallRecordsByFloorId;floorImageRecordsByFloorId;floorTextRecordsByFloorId;manifestRecord;decorationsById;mvfConnectionsById;mvfSpacesById;mvfObstructionById;mvfEntrancesById;mvfAreasById;mvfAnnotationsById;nodeRecordsById;nodeRecordsByFloorId;connectionRecordsById;doorRecordsByFloorId;annotationRecordsByFloorId;areaRecordsByFloorId;spacesByExternalId;nodesByExternalId;objectsByExternalId;poisByExternalId;floorsByExternalId;floorStacksByExternalId;doorsByExternalId;areasByExternalId;locationProfilesByAttachedFeatureId={};locationsById={};locationInstancesById={};instanceLocationsByPolygonId={};categoriesById={};locationIdsByGeometryId={};connectionsByExternalId={};locationsByExternalId={};categoriesByExternalId={};voidsByFloorId={};floorImagesByAnchorId=new Map;localePacksUrls;currentLanguage;languagePacks={};tilesets=Object.create(null);navigationFlags;binaryBundle;envControl;getMapDataOptions;updatedAt;#t;constructor(e,t){super();let n=bn(e)?e:void 0,r=bn(e)?void 0:e,i=t?.env??yr();this.envControl=i,this.binaryBundle=t?.binaryBundle,this.Analytics=new lt,this.localePacksUrls=t?.localePacksUrls??{},this.mvf=r;let s=n!=null?n.mvf3.tileset:r?.["tileset.json"];if(this.outdoorViewToken=t?.outdoorViewToken,this.getMapDataOptions=t?.getMapDataOptions,this.updatedAt=t?.updatedAt,this.#t=n?.mvf3??t?.mvf3,s?.default!=null&&(this.tilesets[s.default.key]=s.default,i.updateTileServerBaseUrl(s.default.url),s.others!=null))for(let l of s.others)this.tilesets[l.key]=l;this.navigationFlags=(n!=null?n.mvf3.navigationFlags:r?.["navigationFlags.json"])??{},this.enterpriseMode=t?.enterprise??!1,this.tokenManager=t?.tokenManager;let a=n!=null?Zr(this,n.mvf3):r!=null?Mi(this,r,t?.mvf3):Qc();this.nodesById=a.nodesById,this.spacesById=a.spacesById,this.floorsById=a.floorsById,this.floorStacksById=a.floorStacksById,this.facadesById=a.facadesById,this.facadesBySpaceId=a.facadesBySpaceId,this.floorRecordsById=a.floorRecordsById,this.floorStackRecordsById=a.floorStackRecordsById,this.facadeRecordsById=a.facadeRecordsById,this.annotationRecordsById=a.annotationRecordsById,this.areaRecordsById=a.areaRecordsById,this.connectionsById=a.connectionsById,this.objectsById=a.objectsById,this.objectRecordsById=a.objectRecordsById,this.objectRecordsByFloorId=a.objectRecordsByFloorId,this.doorsById=a.doorsById,this.pointsOfInterestById=a.poisById,this.annotationsById=a.annotationsById,this.areasById=a.areasById,this.locationProfilesById=a.locationProfilesById,this.locationCategoriesById=a.locationCategoriesById,this.locationProfilesByCategoryId=a.locationProfilesByCategoryId,this.locationCategoriesByParentId=a.locationCategoriesByParentId,this.styleRecordsById=a.styleRecordsById,this.styleIdByGeometryId=a.styleIdByGeometryId,this.wallRecordsByFloorId=a.wallRecordsByFloorId,this.floorImageRecordsByFloorId=a.floorImageRecordsByFloorId,this.floorTextRecordsByFloorId=a.floorTextRecordsByFloorId,this.manifestRecord=a.manifestRecord,this.decorationsById=a.decorationsById,this.spacesByExternalId=a.spacesByExternalId,this.nodesByExternalId=a.nodesByExternalId,this.objectsByExternalId=a.objectsByExternalId,this.floorsByExternalId=a.floorsByExternalId,this.locationProfilesByExternalId=a.locationProfilesByExternalId,this.floorStacksByExternalId=a.floorStacksByExternalId,this.poisByExternalId=a.poisByExternalId,this.doorsByExternalId=a.doorsByExternalId,this.areasByExternalId=a.areasByExternalId,this.mvfConnectionsById=(r?.["connection.json"]??[]).reduce((l,u)=>(l[u.id]=u,l),Object.create(null)),this.mvfSpacesById=a.mvfSpacesById,this.mvfObstructionById=a.mvfObstructionById,this.mvfEntrancesById=a.mvfEntrancesById,this.mvfAreasById=a.mvfAreasById,this.mvfAnnotationsById=a.mvfAnnotationsById,this.nodeRecordsById=a.nodeRecordsById,this.nodeRecordsByFloorId=a.nodeRecordsByFloorId,this.connectionRecordsById=a.connectionRecordsById,this.spaceRecordsByFloorId=a.spaceRecordsByFloorId,this.poiRecordsByFloorId=a.poiRecordsByFloorId,this.doorRecordsById=a.doorRecordsById,this.doorRecordsByFloorId=a.doorRecordsByFloorId,this.annotationRecordsByFloorId=a.annotationRecordsByFloorId,this.areaRecordsByFloorId=a.areaRecordsByFloorId,this.geometryById=a.geometryIndex.byId,this.geometryByFloorId=a.geometryIndex.byFloorId,this.locationProfilesByAttachedFeatureId=a.locationProfilesByAttachedFeatureId,this.nodeIndex=a.nodeIndex;let c=n!=null?new mo(n.mvf3):void 0;if(this.navigationNodes=c!=null?new Io(this,new xo(c,As(this),(l,u,f,I)=>this.requireDirections().navigator.hasLineOfSight(l,u,f,I))):new uo(this),this.voidsByFloorId=qc(a.floorRecordsById),r!=null&&(this.enterpriseMode||as())){let l=un(r,this);this.locationsById=l.locationsById,this.locationInstancesById=l.locationInstancesById,this.instanceLocationsByPolygonId=l.instanceLocationsByPolygonId,this.categoriesById=l.categoriesById,this.locationIdsByGeometryId=l.locationIdsByGeometryId,this.connectionsByExternalId=l.connectionsByExternalId,this.locationsByExternalId=l.locationsByExternalId,this.categoriesByExternalId=l.categoriesByExternalId,l.venueRecord.name!=null&&(this.venue=new wi(this,{record:l.venueRecord}),this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":l.locationRecordsById,"enterprise-category":l.categoryRecordsById,"floor-stack":a.floorStackRecordsById,floor:a.floorRecordsById}},t?.languagePacks?.forEach(({language:u,localePack:f})=>{this.languagePacks[u.code]=Jo(f)}),this.currentLanguage=this.venue.defaultLanguage)}n!=null&&c!=null&&(this.directions=new qe({nodes:c.collection,geojsonCollection:c.obstructions(),groupBy:"map",multiplicativeDistanceWeightScaling:!0,flagDeclarations:n.mvf3.navigationFlags,getDoorByNodeId:l=>this.navigationNodes.doorForNode(l)})),this.directions??=r==null?void 0:new qe({nodes:r["node.geojson"],geojsonCollection:this.enterpriseMode&&r.enterprise?r.space:r.obstruction,groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode,flagDeclarations:r["navigationFlags.json"],getDoorByNodeId:l=>this.navigationNodes.doorForNode(l)}),this.Query=new Nt(this),this.Nodes=new fo(this)}requireMVF(){if(this.mvf==null)throw new Q("This needs the parsed MVFv2, which mvfVersion '3.0.0-native' does not produce.");return this.mvf}requireDirections(){if(this.directions==null)throw new Q("This map has no navigation graph.");return this.directions}getEnv(){let e=this;return{get baseUri(){return e.envControl.getBaseUri()},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.manifestRecord.name}get organizationId(){return this.manifestRecord.organizationId}#o=new W(0,0,"initializing");get mapCenter(){if(this.#o.floorId==="initializing"){let[e,t]=this.manifestRecord.center;this.#o=new W(t,e)}return this.#o}get naturalBearing(){return this.manifestRecord.naturalBearing}get spaces(){return this.#e.spaces==null&&(this.#e.spaces=globalThis.Object.values(this.spacesById)),this.#e.spaces}get objects(){return this.#e.objects==null&&(this.#e.objects=globalThis.Object.values(this.objectsById)),this.#e.objects}get connections(){return this.#e.connections==null&&(this.#e.connections=globalThis.Object.values(this.connectionsById)),this.#e.connections}get floors(){return this.#e.floors==null&&(this.#e.floors=globalThis.Object.values(this.floorsById)),this.#e.floors}get floorStacks(){return this.#e.floorStacks==null&&(this.#e.floorStacks=globalThis.Object.values(this.floorStacksById)),this.#e.floorStacks}get facades(){return this.#e.facades==null&&(this.#e.facades=globalThis.Object.values(this.facadesById)),this.#e.facades}get doors(){return this.#e.doors==null&&(this.#e.doors=globalThis.Object.values(this.doorsById)),this.#e.doors}get pointsOfInterest(){return this.#e.pointsOfInterest==null&&(this.#e.pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),this.#e.pointsOfInterest}get annotations(){return this.#e.annotations==null&&(this.#e.annotations=globalThis.Object.values(this.annotationsById)),this.#e.annotations}get areas(){return this.#e.areas==null&&(this.#e.areas=globalThis.Object.values(this.areasById)),this.#e.areas}get nodes(){return this.#e.nodes==null&&(this.#e.nodes=globalThis.Object.values(this.nodesById)),this.#e.nodes}get locations(){return this.#e.locations==null&&(this.#e.locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return this.#e.categories==null&&(this.#e.categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return this.#e.locationProfiles==null&&(this.#e.locationProfiles=globalThis.Object.values(this.locationProfilesById)),this.#e.locationProfiles}get locationCategories(){return this.#e.locationCategories==null&&(this.#e.locationCategories=globalThis.Object.values(this.locationCategoriesById)),this.#e.locationCategories}get mvfFloors(){if(this.#e.mvfFloors==null){let e=this.mvf;e==null?this.#e.mvfFloors=[]:"floor.geojson"in e&&e["floor.geojson"]!=null?this.#e.mvfFloors=e["floor.geojson"].features.map(t=>t.properties):this.#e.mvfFloors=e["map.geojson"]}return this.#e.mvfFloors}get mvfFloorStacks(){if(this.#e.mvfFloorStacks==null){let e=this.mvf;this.#e.mvfFloorStacks=e==null?[]:e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"]||[]}return this.#e.mvfFloorStacks}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getAllOfTypes(e,t){let n=e instanceof Set?e:new Set(e);return t!=null&&Array.isArray(t)?t.filter(r=>n.has(r.__type)):Array.from(n).flatMap(r=>this.getByType(r))}getById(e,t){let n={"location-profile":this.locationProfilesById,"location-category":this.locationCategoriesById,space:this.spacesById,floor:this.floorsById,"floor-stack":this.floorStacksById,facade:this.facadesById,node:this.nodesById,door:this.doorsById,connection:this.connectionsById,"mvf-connection":this.mvfConnectionsById,object:this.objectsById,"point-of-interest":this.pointsOfInterestById,annotation:this.annotationsById,area:this.areasById,"enterprise-location":s=>this.locationsById[s]??this.locationInstancesById[s],"enterprise-category":this.categoriesById},r=s=>{let a=n[s];if(a!=null)return typeof a=="function"?a(t):a[t]},i=()=>{for(let s of Object.keys(n)){let a=r(s);if(a!=null)return a}};return e==="unknown"?i():r(e)}getByExternalId(e,t){switch(e){case"location-profile":return this.locationProfilesByExternalId[t]??[];case"location-category":return[];case"space":return this.spacesByExternalId[t]??[];case"floor":return this.floorsByExternalId[t]??[];case"floor-stack":return this.floorStacksByExternalId[t]??[];case"node":return this.nodesByExternalId[t]??[];case"door":return this.doorsByExternalId[t]??[];case"connection":return this.connectionsByExternalId[t]??[];case"object":return this.objectsByExternalId[t]??[];case"point-of-interest":return this.poisByExternalId[t]??[];case"area":return this.areasByExternalId[t]??[];case"enterprise-location":return this.locationsByExternalId[t]??[];case"enterprise-category":return this.categoriesByExternalId[t]??[];default:return[]}}getMapDataById(e){return this.spacesById[e]??this.floorsById[e]??this.floorStacksById[e]??this.facadesById[e]??this.nodesById[e]??this.doorsById[e]??this.connectionsById[e]??this.objectsById[e]??this.pointsOfInterestById[e]??this.annotationsById[e]??this.areasById[e]}getMVFFeatureById(e,t){let n=this.mvf;if(n!=null)switch(e){case"space":return this.#c(t);case"node":return n["node.geojson"].features.find(r=>r.properties.id===t);case"obstruction":return this.#s(t);case"floor":return"floor.geojson"in n&&n["floor.geojson"]!=null?n["floor.geojson"].features.find(r=>r.properties.id===t)?.properties:n["map.geojson"].find(r=>r.id===t);case"floor-stack":return(n["floorstack.json"]||n["mapstack.json"]||n["mapstack.geojson"]||[]).find(r=>r.id===t);case"connection":return this.mvfConnectionsById[t];case"entrance":return this.#n(t);case"annotation":return this.#r(t);case"area":return this.#i(t);default:throw new Error(`Unknown MVF feature type: ${e}`)}}#n(e){return this.mvfEntrancesById[e]}#r(e){return this.mvfAnnotationsById[e]}#i(e){return this.mvfAreasById[e]}#c(e){return this.mvfSpacesById[e]}#s(e){return this.mvfObstructionById[e]}getMVFFeatureByNodeId(e,t){switch(e){case"connection":return this.nodeIndex.mvfConnectionsByNodeId[t];default:throw new Error(`Unsupported MVF feature type: ${e}`)}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error(`Unsupported MVF feature type: ${e}`)}}propTranslationCache=new Map;getPropTranslation(e,t,n,r){if(!this.currentLanguage)return r;let{code:i}=this.currentLanguage,s=this.languagePacks[i]?.optimized?.[e];if(s){let a=s[n];if(a!=null&&a[t]!==void 0){let c=a[t];if(c!=null&&typeof c=="object"){if(typeof r=="object"&&typeof c=="object"&&!Array.isArray(c)){let l=Ut(i+e+n+t.toString());if(this.propTranslationCache.has(l))return this.propTranslationCache.get(l);let u=$n(r,c,["id"]);return this.propTranslationCache.set(l,u),u}return c}return c}}return r}findPreferredLanguage(e){if(!this.venue)return;let t=is(this.venue,e);return e?.languageCode!=null&&e.languageCode.toLowerCase()!==t.code.toLowerCase()&&A.warn(`Language code "${e.languageCode}" could not be found in the venue. Using "${t.code}" instead.`),t}#a;async changeLanguage(e){let t=e.toLowerCase();if(!t){A.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){A.error("Changing the language is not supported for this map.");return}let n=this.currentLanguage.code,r=this.venue?.languages.find(({code:s})=>s.toLowerCase()===t.toLowerCase());if(!r){A.warn(`Language code "${t}" could not be found in the venue.`);return}if(n===r.code)return;let i=this.languagePacks[r.code];if(!i){let s=this.localePacksUrls[r.code];if(!s){A.error(`Locale pack URL not found for language code "${r.code}".`);return}this.#a&&this.#a.abort();let a=new AbortController;this.#a=a;let c;try{c=await gr(s,{signal:a.signal})}catch(l){A.error(`Failed to download language pack for language code "${r.code}".`,l);return}if(!c||a.signal.aborted)return;i=Jo(c),this.languagePacks[r.code]=i}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=r,this.publish("language-change",this.currentLanguage)}__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,n)=>this.__LEGACY_GET_DIRECTIONS_SYNC(e,t,{...n,multiDestination:!0});__LEGACY_GET_DIRECTIONS_SYNC=(e,t,n)=>{if(this.mvf==null)throw new Q(n?.multiDestination?Be("__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC","getDirectionsMultiDestination"):Be("__LEGACY_GET_DIRECTIONS_SYNC","getDirections"));this.requireDirections();let{accessible:r=!1,multiDestination:i=!1}=n||{},s=js(this.enterpriseMode,n),a=n?.zones||[],c={accessible:r,zones:a,smoothing:s,excludedConnections:n?.excludedConnections||[],connectionIdWeightMap:n?.connectionIdWeightMap||{},includeNonPublic:n?.includeNonPublic??!1,__EXPERIMENTAL_outdoorPathWeightMultiplier:n?.__EXPERIMENTAL_outdoorPathWeightMultiplier,__EXPERIMENTAL_overrideDoorWeight:n?.__EXPERIMENTAL_overrideDoorWeight};if(i&&Array.isArray(t)){let l=Array.isArray(e)?e:[e],u=[];for(let f of t){let I=Array.isArray(f)?f:[f],b=this.requireDirections().getDirectionsSync(l,I,c,this);if(!b){A.error("getDirections failed due to missing directions for one of the segments");return}l=I,u.push(b)}return u}else{let l=Array.isArray(e)?e:[e],u=Array.isArray(t)?t:[t];if(Array.isArray(u[0])){A.error("getDirections does not support multi-destination without multisegment option");return}l[0].id&&u[0].id&&this.Analytics.sendGetDirectionsEvent(l[0].id,u[0].id,r);try{return this.requireDirections().getDirectionsSync(l,u,c,this)}catch(f){A.error("Unable to get directions",f);return}}};getDirections=async(e,t,n)=>{this.requireDirections();let{accessible:r=!1}=n||{},i=js(this.enterpriseMode,n),s=n?.zones||[],a={accessible:r,zones:s,smoothing:i,excludedConnections:n?.excludedConnections||[],connectionIdWeightMap:n?.connectionIdWeightMap||{},includeNonPublic:n?.includeNonPublic??!1,__EXPERIMENTAL_outdoorPathWeightMultiplier:n?.__EXPERIMENTAL_outdoorPathWeightMultiplier,__EXPERIMENTAL_overrideDoorWeight:n?.__EXPERIMENTAL_overrideDoorWeight},c=Array.isArray(e)?e:[e],l=Array.isArray(t)?t:[t];if(Array.isArray(l[0])){A.error("getDirections does not support multi-destination without multisegment option");return}c[0].id&&l[0].id&&n?.__sendAnalytics!==!1&&this.Analytics.sendGetDirectionsEvent(c[0].id,l[0].id,r);try{return this.requireDirections().getDirections(c,l,a,this)}catch(u){A.error("Unable to get directions",u);return}};getDirectionsMultiDestination=async(e,t,n)=>{if(this.mvf!=null)return Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,n));let r=Array.isArray(t)?t:[t],i=e,s=[];for(let a of r){let c=await this.getDirections(i,a,{...n,__sendAnalytics:!1});if(!c){A.error("getDirections failed due to missing directions for one of the segments");return}s.push(c),i=a}return s};getDistance(e,t){let n=ke(e),r=ke(t);return Ve([n.longitude,n.latitude],[r.longitude,r.latitude])}getDoorByNodeId=e=>this.nodeIndex.doorsByNodeId[e];transformImageRequest=async e=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!Ir(e))return{url:e};if(br(e))return{url:e};let t=ct(e);if(!t)return{url:e};try{let r=(await this.tokenManager?.getSasTokensAsync())?.tokens?.[t.mapId];if(r==null)throw new Error("SAS token not found");let[i]=e.split("?");return{url:`${i}?${r.token}`}}catch(n){return A.error("Failed to append SAS token to image request. Requests for private images may fail.",n),{url:e}}};async toJSONBundle({downloadLanguagePacks:e=!0}={}){let t=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let r of this.venue?.languages||[])try{if(this.localePacksUrls[r.code]){let i=await Uo(this.localePacksUrls[r.code],{signal:n.signal}),s=await Wo(i);s&&t.push({language:{code:r.code,name:r.name},localePack:s})}}catch(i){A.warn("failed downloading language pack",i)}}if(this.mvf==null){if(this.#t==null)throw new Q("No MVF data to export.");return{type:"json",options:{version:"3.0.0-native",mvf3:this.#t},languagePacks:t,updatedAt:this.updatedAt}}return{type:"json",options:{enterprise:this.enterpriseMode,mvf3:this.#t},languagePacks:t,main:this.mvf,updatedAt:this.updatedAt}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){if(!this.binaryBundle){A.error("binary bundle not found");return}let t=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let r of this.venue?.languages||[])try{if(this.localePacksUrls[r.code]){let i=await Uo(this.localePacksUrls[r.code],{signal:n.signal});i&&t.push({language:{code:r.code,name:r.name},localePack:i})}}catch(i){A.warn("failed downloading language pack",i)}}return{type:"binary",options:{enterprise:this.enterpriseMode,...this.mvf==null?{version:"3.0.0-native"}:{}},languagePacks:t,main:this.binaryBundle,updatedAt:this.updatedAt}}destroy(){for(let e of globalThis.Object.keys(this.#e))this.#e[e]=null;this.propTranslationCache.clear()}};var js=(o,e)=>{let t=!o,n=e?.smoothing,i=n!=null?typeof n=="object"?n.enabled??t:n:t,s=typeof n=="object"?n.radius:void 0,a=typeof n=="object"?n.method??n.__EXPERIMENTAL_METHOD??"greedy-los":"greedy-los",c=typeof n=="object"?n.includeDoorBufferNodes??(a==="rdp"?n.__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES:a==="dp-optimal"?n.__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:void 0)??a==="rdp":a==="rdp";return a==="dp-optimal"?{enabled:i,radius:s??kn,method:"dp-optimal",includeDoorBufferNodes:c}:a==="rdp"?{enabled:i,radius:s??kn,method:"rdp",includeDoorBufferNodes:c}:{enabled:i,radius:s??kn,method:a}};function ke(o){let e;if(W.is(o))e=o;else if(pe.is(o))e=o.coordinates[0];else if(De.is(o))if(o.spaces.length>0)e=o.spaces[0].center;else return;else if(te.is(o))if(o.coordinates.length>0)e=o.coordinates[0];else return;else if("center"in o&&W.is(o.center))e=o.center;else if("coordinate"in o&&W.is(o.coordinate))e=o.coordinate;else return;return e}export{yn as a,Be as b,Ld as c,Vd as d,Gd as e,ud as f,fd as g,Se as h,na as i,Wo as j,ra as k,Fd as l,vd as m,Td as n,ia as o,Rd as p,aa as q,yr as r,Sd as s,Bd as t,Ed as u,_d as v,W as w,le as x,at as y,xl as z,Ml as A,Fl as B,Ho as C,Ma as D,vl as E,Ae as F,Z as G,Ue as H,Mr as I,Fr as J,Vl as K,vr as L,Tr as M,Gl as N,Ul as O,Rr as P,Wl as Q,$l as R,Jl as S,zl as T,Xl as U,Hl as V,Yl as W,ql as X,Ql as Y,Kl as Z,Fa as _,Zl as $,ep as aa,tp as ba,op as ca,np as da,Ba as ea,_a as fa,Na as ga,dp as ha,lp as ia,ye as ja,me as ka,ee as la,We as ma,te as na,ce as oa,Oe as pa,Pe as qa,Sr as ra,Er as sa,xt as ta,he as ua,pe as va,fn as wa,wi as xa,ic as ya,Ai as za,sc as Aa,ki as Ba,Ci as Ca,yc as Da,Lm as Ea,Vm as Fa,Gm as Ga,Um as Ha,Wm as Ia,$m as Ja,Jm as Ka,zm as La,Xm as Ma,Hm as Na,Ym as Oa,qm as Pa,Qm as Qa,Km as Ra,Zm as Sa,Je as Ta,is as Ua,wh as Va,as as Wa,De as Xa,Mt as Ya,Db as Za,wb as _a,Ab as $a,kb as ab,Cs as bb};