@mappedin/mappedin-js 6.30.0 → 6.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +60 -123
- package/lib/esm/chunk-KVLT22ON.js +1254 -0
- package/lib/esm/chunk-X2E2A75O.js +1785 -0
- package/lib/esm/chunk-YLNWGJAU.js +661 -0
- package/lib/esm/index.d.ts +632 -59
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-6TN57EHG.js → inspector-ZUNZBXJH.js} +2 -2
- package/lib/esm/internal-2IB3DTOO.js +1 -0
- package/lib/esm/src-2IR6EZ5S.js +1 -0
- package/lib/esm/text3d-PXV6OP4G.js +1 -0
- package/lib/esm/workers/collision-worker.csp.js +1 -1
- package/package.json +2 -1
- package/lib/esm/GLTFExporter-6CFIB35E.js +0 -1
- package/lib/esm/GLTFLoader-4HJWTRLM.js +0 -1
- package/lib/esm/chunk-7WSSZSL2.js +0 -661
- package/lib/esm/chunk-NO3DWTOG.js +0 -1515
- package/lib/esm/chunk-NRL4CNJO.js +0 -1222
- package/lib/esm/chunk-Q7BEUNXA.js +0 -1
- package/lib/esm/chunk-UHBPXUGN.js +0 -3819
- package/lib/esm/internal-GAAKLDRM.js +0 -1
- package/lib/esm/src-PT63JZBF.js +0 -1
- package/lib/esm/text3d-CZ52NRGO.js +0 -252
|
@@ -1,661 +0,0 @@
|
|
|
1
|
-
import{B as Dd,a as cd,b as rs,c as gy,d as dd,e as ns,f as Po,g as xr,h as Mr,i as fd,j as as,k as md,l as Ei,m as Ci,n as un,o as Dt,p as tr,q as yd,r as _i,s as fn,t as bd,u as hs,x as Rd}from"./chunk-NRL4CNJO.js";import{$ as us,A as gd,B as Er,F as ss,J as Id,K as Td,L as vd,M as Sd,P as mo,Pa as wd,Q as Fi,R as xd,S as Cr,T as ls,U as hn,Uc as Ad,V as Md,W as Ed,X as Cd,Y as cs,Z as ds,_ as ps,ba as fs,ca as _d,e as _,f as ae,fa as Fd,g as Si,h as sd,j as St,ja as Pi,k as re,l as ld,ma as gs,n as Sr,na as ms,o as xi,oa as Od,p as pn,pa as Pd,ra as my,s as Mi,sa as ys,t as pd,v as ud,w as ro,x as is,z as hd}from"./chunk-NO3DWTOG.js";import{a as f,b as x,ea as Oi}from"./chunk-UHBPXUGN.js";import{b as Oe,d as dn}from"./chunk-PWEV3AFA.js";var il=Oe((rl,nl)=>{f();(function(o,e){typeof rl=="object"&&typeof nl<"u"?nl.exports=e():typeof define=="function"&&define.amd?define(e):(o=typeof globalThis<"u"?globalThis:o||self,o.polygonClipping=e())})(rl,(function(){"use strict";function o(C,u){var h={label:0,sent:function(){if(S[0]&1)throw S[1];return S[1]},trys:[],ops:[]},b,M,S,A;return A={next:O(0),throw:O(1),return:O(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function O(R){return function(Y){return L([R,Y])}}function L(R){if(b)throw new TypeError("Generator is already executing.");for(;h;)try{if(b=1,M&&(S=R[0]&2?M.return:R[0]?M.throw||((S=M.return)&&S.call(M),0):M.next)&&!(S=S.call(M,R[1])).done)return S;switch(M=0,S&&(R=[R[0]&2,S.value]),R[0]){case 0:case 1:S=R;break;case 4:return h.label++,{value:R[1],done:!1};case 5:h.label++,M=R[1],R=[0];continue;case 7:R=h.ops.pop(),h.trys.pop();continue;default:if(S=h.trys,!(S=S.length>0&&S[S.length-1])&&(R[0]===6||R[0]===2)){h=0;continue}if(R[0]===3&&(!S||R[1]>S[0]&&R[1]<S[3])){h.label=R[1];break}if(R[0]===6&&h.label<S[1]){h.label=S[1],S=R;break}if(S&&h.label<S[2]){h.label=S[2],h.ops.push(R);break}S[2]&&h.ops.pop(),h.trys.pop();continue}R=u.call(C,h)}catch(Y){R=[6,Y],M=0}finally{b=S=0}if(R[0]&5)throw R[1];return{value:R[0]?R[1]:void 0,done:!0}}}var e=(function(){function C(u,h){this.next=null,this.key=u,this.data=h,this.left=null,this.right=null}return C})();function t(C,u){return C>u?1:C<u?-1:0}function r(C,u,h){for(var b=new e(null,null),M=b,S=b;;){var A=h(C,u.key);if(A<0){if(u.left===null)break;if(h(C,u.left.key)<0){var O=u.left;if(u.left=O.right,O.right=u,u=O,u.left===null)break}S.left=u,S=u,u=u.left}else if(A>0){if(u.right===null)break;if(h(C,u.right.key)>0){var O=u.right;if(u.right=O.left,O.left=u,u=O,u.right===null)break}M.right=u,M=u,u=u.right}else break}return M.right=u.left,S.left=u.right,u.left=b.right,u.right=b.left,u}function n(C,u,h,b){var M=new e(C,u);if(h===null)return M.left=M.right=null,M;h=r(C,h,b);var S=b(C,h.key);return S<0?(M.left=h.left,M.right=h,h.left=null):S>=0&&(M.right=h.right,M.left=h,h.right=null),M}function i(C,u,h){var b=null,M=null;if(u){u=r(C,u,h);var S=h(u.key,C);S===0?(b=u.left,M=u.right):S<0?(M=u.right,u.right=null,b=u):(b=u.left,u.left=null,M=u)}return{left:b,right:M}}function a(C,u,h){return u===null?C:(C===null||(u=r(C.key,u,h),u.left=C),u)}function s(C,u,h,b,M){if(C){b(""+u+(h?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+M(C)+`
|
|
2
|
-
`);var S=u+(h?" ":"\u2502 ");C.left&&s(C.left,S,!1,b,M),C.right&&s(C.right,S,!0,b,M)}}var l=(function(){function C(u){u===void 0&&(u=t),this._root=null,this._size=0,this._comparator=u}return C.prototype.insert=function(u,h){return this._size++,this._root=n(u,h,this._root,this._comparator)},C.prototype.add=function(u,h){var b=new e(u,h);this._root===null&&(b.left=b.right=null,this._size++,this._root=b);var M=this._comparator,S=r(u,this._root,M),A=M(u,S.key);return A===0?this._root=S:(A<0?(b.left=S.left,b.right=S,S.left=null):A>0&&(b.right=S.right,b.left=S,S.right=null),this._size++,this._root=b),this._root},C.prototype.remove=function(u){this._root=this._remove(u,this._root,this._comparator)},C.prototype._remove=function(u,h,b){var M;if(h===null)return null;h=r(u,h,b);var S=b(u,h.key);return S===0?(h.left===null?M=h.right:(M=r(u,h.left,b),M.right=h.right),this._size--,M):h},C.prototype.pop=function(){var u=this._root;if(u){for(;u.left;)u=u.left;return this._root=r(u.key,this._root,this._comparator),this._root=this._remove(u.key,this._root,this._comparator),{key:u.key,data:u.data}}return null},C.prototype.findStatic=function(u){for(var h=this._root,b=this._comparator;h;){var M=b(u,h.key);if(M===0)return h;M<0?h=h.left:h=h.right}return null},C.prototype.find=function(u){return this._root&&(this._root=r(u,this._root,this._comparator),this._comparator(u,this._root.key)!==0)?null:this._root},C.prototype.contains=function(u){for(var h=this._root,b=this._comparator;h;){var M=b(u,h.key);if(M===0)return!0;M<0?h=h.left:h=h.right}return!1},C.prototype.forEach=function(u,h){for(var b=this._root,M=[],S=!1;!S;)b!==null?(M.push(b),b=b.left):M.length!==0?(b=M.pop(),u.call(h,b),b=b.right):S=!0;return this},C.prototype.range=function(u,h,b,M){for(var S=[],A=this._comparator,O=this._root,L;S.length!==0||O;)if(O)S.push(O),O=O.left;else{if(O=S.pop(),L=A(O.key,h),L>0)break;if(A(O.key,u)>=0&&b.call(M,O))return this;O=O.right}return this},C.prototype.keys=function(){var u=[];return this.forEach(function(h){var b=h.key;return u.push(b)}),u},C.prototype.values=function(){var u=[];return this.forEach(function(h){var b=h.data;return u.push(b)}),u},C.prototype.min=function(){return this._root?this.minNode(this._root).key:null},C.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},C.prototype.minNode=function(u){if(u===void 0&&(u=this._root),u)for(;u.left;)u=u.left;return u},C.prototype.maxNode=function(u){if(u===void 0&&(u=this._root),u)for(;u.right;)u=u.right;return u},C.prototype.at=function(u){for(var h=this._root,b=!1,M=0,S=[];!b;)if(h)S.push(h),h=h.left;else if(S.length>0){if(h=S.pop(),M===u)return h;M++,h=h.right}else b=!0;return null},C.prototype.next=function(u){var h=this._root,b=null;if(u.right){for(b=u.right;b.left;)b=b.left;return b}for(var M=this._comparator;h;){var S=M(u.key,h.key);if(S===0)break;S<0?(b=h,h=h.left):h=h.right}return b},C.prototype.prev=function(u){var h=this._root,b=null;if(u.left!==null){for(b=u.left;b.right;)b=b.right;return b}for(var M=this._comparator;h;){var S=M(u.key,h.key);if(S===0)break;S<0?h=h.left:(b=h,h=h.right)}return b},C.prototype.clear=function(){return this._root=null,this._size=0,this},C.prototype.toList=function(){return p(this._root)},C.prototype.load=function(u,h,b){h===void 0&&(h=[]),b===void 0&&(b=!1);var M=u.length,S=this._comparator;if(b&&I(u,h,0,M-1,S),this._root===null)this._root=c(u,h,0,M),this._size=M;else{var A=m(this.toList(),d(u,h),S);M=this._size+M,this._root=g({head:A},0,M)}return this},C.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(C.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),C.prototype.toString=function(u){u===void 0&&(u=function(b){return String(b.key)});var h=[];return s(this._root,"",!0,function(b){return h.push(b)},u),h.join("")},C.prototype.update=function(u,h,b){var M=this._comparator,S=i(u,this._root,M),A=S.left,O=S.right;M(u,h)<0?O=n(h,b,O,M):A=n(h,b,A,M),this._root=a(A,O,M)},C.prototype.split=function(u){return i(u,this._root,this._comparator)},C.prototype[Symbol.iterator]=function(){var u,h,b;return o(this,function(M){switch(M.label){case 0:u=this._root,h=[],b=!1,M.label=1;case 1:return b?[3,6]:u===null?[3,2]:(h.push(u),u=u.left,[3,5]);case 2:return h.length===0?[3,4]:(u=h.pop(),[4,u]);case 3:return M.sent(),u=u.right,[3,5];case 4:b=!0,M.label=5;case 5:return[3,1];case 6:return[2]}})},C})();function c(C,u,h,b){var M=b-h;if(M>0){var S=h+Math.floor(M/2),A=C[S],O=u[S],L=new e(A,O);return L.left=c(C,u,h,S),L.right=c(C,u,S+1,b),L}return null}function d(C,u){for(var h=new e(null,null),b=h,M=0;M<C.length;M++)b=b.next=new e(C[M],u[M]);return b.next=null,h.next}function p(C){for(var u=C,h=[],b=!1,M=new e(null,null),S=M;!b;)u?(h.push(u),u=u.left):h.length>0?(u=S=S.next=h.pop(),u=u.right):b=!0;return S.next=null,M.next}function g(C,u,h){var b=h-u;if(b>0){var M=u+Math.floor(b/2),S=g(C,u,M),A=C.head;return A.left=S,C.head=C.head.next,A.right=g(C,M+1,h),A}return null}function m(C,u,h){for(var b=new e(null,null),M=b,S=C,A=u;S!==null&&A!==null;)h(S.key,A.key)<0?(M.next=S,S=S.next):(M.next=A,A=A.next),M=M.next;return S!==null?M.next=S:A!==null&&(M.next=A),b.next}function I(C,u,h,b,M){if(!(h>=b)){for(var S=C[h+b>>1],A=h-1,O=b+1;;){do A++;while(M(C[A],S)<0);do O--;while(M(C[O],S)>0);if(A>=O)break;var L=C[A];C[A]=C[O],C[O]=L,L=u[A],u[A]=u[O],u[O]=L}I(C,u,h,O,M),I(C,u,O+1,b,M)}}let v=(C,u)=>C.ll.x<=u.x&&u.x<=C.ur.x&&C.ll.y<=u.y&&u.y<=C.ur.y,y=(C,u)=>{if(u.ur.x<C.ll.x||C.ur.x<u.ll.x||u.ur.y<C.ll.y||C.ur.y<u.ll.y)return null;let h=C.ll.x<u.ll.x?u.ll.x:C.ll.x,b=C.ur.x<u.ur.x?C.ur.x:u.ur.x,M=C.ll.y<u.ll.y?u.ll.y:C.ll.y,S=C.ur.y<u.ur.y?C.ur.y:u.ur.y;return{ll:{x:h,y:M},ur:{x:b,y:S}}},E=Number.EPSILON;E===void 0&&(E=Math.pow(2,-52));let k=E*E,w=(C,u)=>{if(-E<C&&C<E&&-E<u&&u<E)return 0;let h=C-u;return h*h<k*C*u?0:C<u?-1:1};class B{constructor(){this.reset()}reset(){this.xRounder=new D,this.yRounder=new D}round(u,h){return{x:this.xRounder.round(u),y:this.yRounder.round(h)}}}class D{constructor(){this.tree=new l,this.round(0)}round(u){let h=this.tree.add(u),b=this.tree.prev(h);if(b!==null&&w(h.key,b.key)===0)return this.tree.remove(u),b.key;let M=this.tree.next(h);return M!==null&&w(h.key,M.key)===0?(this.tree.remove(u),M.key):u}}let j=new B,G=11102230246251565e-32,W=134217729,N=(3+8*G)*G;function q(C,u,h,b,M){let S,A,O,L,R=u[0],Y=b[0],P=0,V=0;Y>R==Y>-R?(S=R,R=u[++P]):(S=Y,Y=b[++V]);let z=0;if(P<C&&V<h)for(Y>R==Y>-R?(A=R+S,O=S-(A-R),R=u[++P]):(A=Y+S,O=S-(A-Y),Y=b[++V]),S=A,O!==0&&(M[z++]=O);P<C&&V<h;)Y>R==Y>-R?(A=S+R,L=A-S,O=S-(A-L)+(R-L),R=u[++P]):(A=S+Y,L=A-S,O=S-(A-L)+(Y-L),Y=b[++V]),S=A,O!==0&&(M[z++]=O);for(;P<C;)A=S+R,L=A-S,O=S-(A-L)+(R-L),R=u[++P],S=A,O!==0&&(M[z++]=O);for(;V<h;)A=S+Y,L=A-S,O=S-(A-L)+(Y-L),Y=b[++V],S=A,O!==0&&(M[z++]=O);return(S!==0||z===0)&&(M[z++]=S),z}function oe(C,u){let h=u[0];for(let b=1;b<C;b++)h+=u[b];return h}function ie(C){return new Float64Array(C)}let be=(3+16*G)*G,De=(2+12*G)*G,ke=(9+64*G)*G*G,ue=ie(4),Ke=ie(8),rt=ie(12),Pt=ie(16),ve=ie(4);function Eo(C,u,h,b,M,S,A){let O,L,R,Y,P,V,z,te,Q,le,ee,he,Ne,Me,We,Ve,nt,je,pt=C-M,Tt=h-M,et=u-S,vt=b-S;Me=pt*vt,V=W*pt,z=V-(V-pt),te=pt-z,V=W*vt,Q=V-(V-vt),le=vt-Q,We=te*le-(Me-z*Q-te*Q-z*le),Ve=et*Tt,V=W*et,z=V-(V-et),te=et-z,V=W*Tt,Q=V-(V-Tt),le=Tt-Q,nt=te*le-(Ve-z*Q-te*Q-z*le),ee=We-nt,P=We-ee,ue[0]=We-(ee+P)+(P-nt),he=Me+ee,P=he-Me,Ne=Me-(he-P)+(ee-P),ee=Ne-Ve,P=Ne-ee,ue[1]=Ne-(ee+P)+(P-Ve),je=he+ee,P=je-he,ue[2]=he-(je-P)+(ee-P),ue[3]=je;let jt=oe(4,ue),Ie=De*A;if(jt>=Ie||-jt>=Ie||(P=C-pt,O=C-(pt+P)+(P-M),P=h-Tt,R=h-(Tt+P)+(P-M),P=u-et,L=u-(et+P)+(P-S),P=b-vt,Y=b-(vt+P)+(P-S),O===0&&L===0&&R===0&&Y===0)||(Ie=ke*A+N*Math.abs(jt),jt+=pt*Y+vt*O-(et*R+Tt*L),jt>=Ie||-jt>=Ie))return jt;Me=O*vt,V=W*O,z=V-(V-O),te=O-z,V=W*vt,Q=V-(V-vt),le=vt-Q,We=te*le-(Me-z*Q-te*Q-z*le),Ve=L*Tt,V=W*L,z=V-(V-L),te=L-z,V=W*Tt,Q=V-(V-Tt),le=Tt-Q,nt=te*le-(Ve-z*Q-te*Q-z*le),ee=We-nt,P=We-ee,ve[0]=We-(ee+P)+(P-nt),he=Me+ee,P=he-Me,Ne=Me-(he-P)+(ee-P),ee=Ne-Ve,P=Ne-ee,ve[1]=Ne-(ee+P)+(P-Ve),je=he+ee,P=je-he,ve[2]=he-(je-P)+(ee-P),ve[3]=je;let Fo=q(4,ue,4,ve,Ke);Me=pt*Y,V=W*pt,z=V-(V-pt),te=pt-z,V=W*Y,Q=V-(V-Y),le=Y-Q,We=te*le-(Me-z*Q-te*Q-z*le),Ve=et*R,V=W*et,z=V-(V-et),te=et-z,V=W*R,Q=V-(V-R),le=R-Q,nt=te*le-(Ve-z*Q-te*Q-z*le),ee=We-nt,P=We-ee,ve[0]=We-(ee+P)+(P-nt),he=Me+ee,P=he-Me,Ne=Me-(he-P)+(ee-P),ee=Ne-Ve,P=Ne-ee,ve[1]=Ne-(ee+P)+(P-Ve),je=he+ee,P=je-he,ve[2]=he-(je-P)+(ee-P),ve[3]=je;let Qa=q(Fo,Ke,4,ve,rt);Me=O*Y,V=W*O,z=V-(V-O),te=O-z,V=W*Y,Q=V-(V-Y),le=Y-Q,We=te*le-(Me-z*Q-te*Q-z*le),Ve=L*R,V=W*L,z=V-(V-L),te=L-z,V=W*R,Q=V-(V-R),le=R-Q,nt=te*le-(Ve-z*Q-te*Q-z*le),ee=We-nt,P=We-ee,ve[0]=We-(ee+P)+(P-nt),he=Me+ee,P=he-Me,Ne=Me-(he-P)+(ee-P),ee=Ne-Ve,P=Ne-ee,ve[1]=Ne-(ee+P)+(P-Ve),je=he+ee,P=je-he,ve[2]=he-(je-P)+(ee-P),ve[3]=je;let yi=q(Qa,rt,4,ve,Pt);return Pt[yi-1]}function de(C,u,h,b,M,S){let A=(u-S)*(h-M),O=(C-M)*(b-S),L=A-O,R=Math.abs(A+O);return Math.abs(L)>=be*R?L:-Eo(C,u,h,b,M,S,R)}let wt=(C,u)=>C.x*u.y-C.y*u.x,Kt=(C,u)=>C.x*u.x+C.y*u.y,ho=(C,u,h)=>{let b=de(C.x,C.y,u.x,u.y,h.x,h.y);return b>0?-1:b<0?1:0},Vt=C=>Math.sqrt(Kt(C,C)),Co=(C,u,h)=>{let b={x:u.x-C.x,y:u.y-C.y},M={x:h.x-C.x,y:h.y-C.y};return wt(M,b)/Vt(M)/Vt(b)},_o=(C,u,h)=>{let b={x:u.x-C.x,y:u.y-C.y},M={x:h.x-C.x,y:h.y-C.y};return Kt(M,b)/Vt(M)/Vt(b)},$o=(C,u,h)=>u.y===0?null:{x:C.x+u.x/u.y*(h-C.y),y:h},yr=(C,u,h)=>u.x===0?null:{x:h,y:C.y+u.y/u.x*(h-C.x)},Xo=(C,u,h,b)=>{if(u.x===0)return yr(h,b,C.x);if(b.x===0)return yr(C,u,h.x);if(u.y===0)return $o(h,b,C.y);if(b.y===0)return $o(C,u,h.y);let M=wt(u,b);if(M==0)return null;let S={x:h.x-C.x,y:h.y-C.y},A=wt(S,u)/M,O=wt(S,b)/M,L=C.x+O*u.x,R=h.x+A*b.x,Y=C.y+O*u.y,P=h.y+A*b.y,V=(L+R)/2,z=(Y+P)/2;return{x:V,y:z}};class se{static compare(u,h){let b=se.comparePoints(u.point,h.point);return b!==0?b:(u.point!==h.point&&u.link(h),u.isLeft!==h.isLeft?u.isLeft?1:-1:ce.compare(u.segment,h.segment))}static comparePoints(u,h){return u.x<h.x?-1:u.x>h.x?1:u.y<h.y?-1:u.y>h.y?1:0}constructor(u,h){u.events===void 0?u.events=[this]:u.events.push(this),this.point=u,this.isLeft=h}link(u){if(u.point===this.point)throw new Error("Tried to link already linked events");let h=u.point.events;for(let b=0,M=h.length;b<M;b++){let S=h[b];this.point.events.push(S),S.point=this.point}this.checkForConsuming()}checkForConsuming(){let u=this.point.events.length;for(let h=0;h<u;h++){let b=this.point.events[h];if(b.segment.consumedBy===void 0)for(let M=h+1;M<u;M++){let S=this.point.events[M];S.consumedBy===void 0&&b.otherSE.point.events===S.otherSE.point.events&&b.segment.consume(S.segment)}}}getAvailableLinkedEvents(){let u=[];for(let h=0,b=this.point.events.length;h<b;h++){let M=this.point.events[h];M!==this&&!M.segment.ringOut&&M.segment.isInResult()&&u.push(M)}return u}getLeftmostComparator(u){let h=new Map,b=M=>{let S=M.otherSE;h.set(M,{sine:Co(this.point,u.point,S.point),cosine:_o(this.point,u.point,S.point)})};return(M,S)=>{h.has(M)||b(M),h.has(S)||b(S);let{sine:A,cosine:O}=h.get(M),{sine:L,cosine:R}=h.get(S);return A>=0&&L>=0?O<R?1:O>R?-1:0:A<0&&L<0?O<R?-1:O>R?1:0:L<A?-1:L>A?1:0}}}let Yo=0;class ce{static compare(u,h){let b=u.leftSE.point.x,M=h.leftSE.point.x,S=u.rightSE.point.x,A=h.rightSE.point.x;if(A<b)return 1;if(S<M)return-1;let O=u.leftSE.point.y,L=h.leftSE.point.y,R=u.rightSE.point.y,Y=h.rightSE.point.y;if(b<M){if(L<O&&L<R)return 1;if(L>O&&L>R)return-1;let P=u.comparePoint(h.leftSE.point);if(P<0)return 1;if(P>0)return-1;let V=h.comparePoint(u.rightSE.point);return V!==0?V:-1}if(b>M){if(O<L&&O<Y)return-1;if(O>L&&O>Y)return 1;let P=h.comparePoint(u.leftSE.point);if(P!==0)return P;let V=u.comparePoint(h.rightSE.point);return V<0?1:V>0?-1:1}if(O<L)return-1;if(O>L)return 1;if(S<A){let P=h.comparePoint(u.rightSE.point);if(P!==0)return P}if(S>A){let P=u.comparePoint(h.rightSE.point);if(P<0)return 1;if(P>0)return-1}if(S!==A){let P=R-O,V=S-b,z=Y-L,te=A-M;if(P>V&&z<te)return 1;if(P<V&&z>te)return-1}return S>A?1:S<A||R<Y?-1:R>Y?1:u.id<h.id?-1:u.id>h.id?1:0}constructor(u,h,b,M){this.id=++Yo,this.leftSE=u,u.segment=this,u.otherSE=h,this.rightSE=h,h.segment=this,h.otherSE=u,this.rings=b,this.windings=M}static fromRing(u,h,b){let M,S,A,O=se.comparePoints(u,h);if(O<0)M=u,S=h,A=1;else if(O>0)M=h,S=u,A=-1;else throw new Error(`Tried to create degenerate segment at [${u.x}, ${u.y}]`);let L=new se(M,!0),R=new se(S,!1);return new ce(L,R,[b],[A])}replaceRightSE(u){this.rightSE=u,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let u=this.leftSE.point.y,h=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:u<h?u:h},ur:{x:this.rightSE.point.x,y:u>h?u:h}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(u){return u.x===this.leftSE.point.x&&u.y===this.leftSE.point.y||u.x===this.rightSE.point.x&&u.y===this.rightSE.point.y}comparePoint(u){if(this.isAnEndpoint(u))return 0;let h=this.leftSE.point,b=this.rightSE.point,M=this.vector();if(h.x===b.x)return u.x===h.x?0:u.x<h.x?1:-1;let S=(u.y-h.y)/M.y,A=h.x+S*M.x;if(u.x===A)return 0;let O=(u.x-h.x)/M.x,L=h.y+O*M.y;return u.y===L?0:u.y<L?-1:1}getIntersection(u){let h=this.bbox(),b=u.bbox(),M=y(h,b);if(M===null)return null;let S=this.leftSE.point,A=this.rightSE.point,O=u.leftSE.point,L=u.rightSE.point,R=v(h,O)&&this.comparePoint(O)===0,Y=v(b,S)&&u.comparePoint(S)===0,P=v(h,L)&&this.comparePoint(L)===0,V=v(b,A)&&u.comparePoint(A)===0;if(Y&&R)return V&&!P?A:!V&&P?L:null;if(Y)return P&&S.x===L.x&&S.y===L.y?null:S;if(R)return V&&A.x===O.x&&A.y===O.y?null:O;if(V&&P)return null;if(V)return A;if(P)return L;let z=Xo(S,this.vector(),O,u.vector());return z===null||!v(M,z)?null:j.round(z.x,z.y)}split(u){let h=[],b=u.events!==void 0,M=new se(u,!0),S=new se(u,!1),A=this.rightSE;this.replaceRightSE(S),h.push(S),h.push(M);let O=new ce(M,A,this.rings.slice(),this.windings.slice());return se.comparePoints(O.leftSE.point,O.rightSE.point)>0&&O.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),b&&(M.checkForConsuming(),S.checkForConsuming()),h}swapEvents(){let u=this.rightSE;this.rightSE=this.leftSE,this.leftSE=u,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let h=0,b=this.windings.length;h<b;h++)this.windings[h]*=-1}consume(u){let h=this,b=u;for(;h.consumedBy;)h=h.consumedBy;for(;b.consumedBy;)b=b.consumedBy;let M=ce.compare(h,b);if(M!==0){if(M>0){let S=h;h=b,b=S}if(h.prev===b){let S=h;h=b,b=S}for(let S=0,A=b.rings.length;S<A;S++){let O=b.rings[S],L=b.windings[S],R=h.rings.indexOf(O);R===-1?(h.rings.push(O),h.windings.push(L)):h.windings[R]+=L}b.rings=null,b.windings=null,b.consumedBy=h,b.leftSE.consumedBy=h.leftSE,b.rightSE.consumedBy=h.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 u=this.prev.consumedBy||this.prev;this._beforeState=u.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let u=this.beforeState();this._afterState={rings:u.rings.slice(0),windings:u.windings.slice(0),multiPolys:[]};let h=this._afterState.rings,b=this._afterState.windings,M=this._afterState.multiPolys;for(let O=0,L=this.rings.length;O<L;O++){let R=this.rings[O],Y=this.windings[O],P=h.indexOf(R);P===-1?(h.push(R),b.push(Y)):b[P]+=Y}let S=[],A=[];for(let O=0,L=h.length;O<L;O++){if(b[O]===0)continue;let R=h[O],Y=R.poly;if(A.indexOf(Y)===-1)if(R.isExterior)S.push(Y);else{A.indexOf(Y)===-1&&A.push(Y);let P=S.indexOf(R.poly);P!==-1&&S.splice(P,1)}}for(let O=0,L=S.length;O<L;O++){let R=S[O].multiPoly;M.indexOf(R)===-1&&M.push(R)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let u=this.beforeState().multiPolys,h=this.afterState().multiPolys;switch(Fe.type){case"union":{let b=u.length===0,M=h.length===0;this._isInResult=b!==M;break}case"intersection":{let b,M;u.length<h.length?(b=u.length,M=h.length):(b=h.length,M=u.length),this._isInResult=M===Fe.numMultiPolys&&b<M;break}case"xor":{let b=Math.abs(u.length-h.length);this._isInResult=b%2===1;break}case"difference":{let b=M=>M.length===1&&M[0].isSubject;this._isInResult=b(u)!==b(h);break}default:throw new Error(`Unrecognized operation type found ${Fe.type}`)}return this._isInResult}}class At{constructor(u,h,b){if(!Array.isArray(u)||u.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=h,this.isExterior=b,this.segments=[],typeof u[0][0]!="number"||typeof u[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let M=j.round(u[0][0],u[0][1]);this.bbox={ll:{x:M.x,y:M.y},ur:{x:M.x,y:M.y}};let S=M;for(let A=1,O=u.length;A<O;A++){if(typeof u[A][0]!="number"||typeof u[A][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let L=j.round(u[A][0],u[A][1]);L.x===S.x&&L.y===S.y||(this.segments.push(ce.fromRing(S,L,this)),L.x<this.bbox.ll.x&&(this.bbox.ll.x=L.x),L.y<this.bbox.ll.y&&(this.bbox.ll.y=L.y),L.x>this.bbox.ur.x&&(this.bbox.ur.x=L.x),L.y>this.bbox.ur.y&&(this.bbox.ur.y=L.y),S=L)}(M.x!==S.x||M.y!==S.y)&&this.segments.push(ce.fromRing(S,M,this))}getSweepEvents(){let u=[];for(let h=0,b=this.segments.length;h<b;h++){let M=this.segments[h];u.push(M.leftSE),u.push(M.rightSE)}return u}}class xe{constructor(u,h){if(!Array.isArray(u))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new At(u[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 b=1,M=u.length;b<M;b++){let S=new At(u[b],this,!1);S.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=S.bbox.ll.x),S.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=S.bbox.ll.y),S.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=S.bbox.ur.x),S.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=S.bbox.ur.y),this.interiorRings.push(S)}this.multiPoly=h}getSweepEvents(){let u=this.exteriorRing.getSweepEvents();for(let h=0,b=this.interiorRings.length;h<b;h++){let M=this.interiorRings[h].getSweepEvents();for(let S=0,A=M.length;S<A;S++)u.push(M[S])}return u}}class eo{constructor(u,h){if(!Array.isArray(u))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof u[0][0][0]=="number"&&(u=[u])}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 b=0,M=u.length;b<M;b++){let S=new xe(u[b],this);S.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=S.bbox.ll.x),S.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=S.bbox.ll.y),S.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=S.bbox.ur.x),S.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=S.bbox.ur.y),this.polys.push(S)}this.isSubject=h}getSweepEvents(){let u=[];for(let h=0,b=this.polys.length;h<b;h++){let M=this.polys[h].getSweepEvents();for(let S=0,A=M.length;S<A;S++)u.push(M[S])}return u}}class go{static factory(u){let h=[];for(let b=0,M=u.length;b<M;b++){let S=u[b];if(!S.isInResult()||S.ringOut)continue;let A=null,O=S.leftSE,L=S.rightSE,R=[O],Y=O.point,P=[];for(;A=O,O=L,R.push(O),O.point!==Y;)for(;;){let V=O.getAvailableLinkedEvents();if(V.length===0){let Q=R[0].point,le=R[R.length-1].point;throw new Error(`Unable to complete output ring starting at [${Q.x}, ${Q.y}]. Last matching segment found ends at [${le.x}, ${le.y}].`)}if(V.length===1){L=V[0].otherSE;break}let z=null;for(let Q=0,le=P.length;Q<le;Q++)if(P[Q].point===O.point){z=Q;break}if(z!==null){let Q=P.splice(z)[0],le=R.splice(Q.index);le.unshift(le[0].otherSE),h.push(new go(le.reverse()));continue}P.push({index:R.length,point:O.point});let te=O.getLeftmostComparator(A);L=V.sort(te)[0].otherSE;break}h.push(new go(R))}return h}constructor(u){this.events=u;for(let h=0,b=u.length;h<b;h++)u[h].segment.ringOut=this;this.poly=null}getGeom(){let u=this.events[0].point,h=[u];for(let R=1,Y=this.events.length-1;R<Y;R++){let P=this.events[R].point,V=this.events[R+1].point;ho(P,u,V)!==0&&(h.push(P),u=P)}if(h.length===1)return null;let b=h[0],M=h[1];ho(b,u,M)===0&&h.shift(),h.push(h[0]);let S=this.isExteriorRing()?1:-1,A=this.isExteriorRing()?0:h.length-1,O=this.isExteriorRing()?h.length:-1,L=[];for(let R=A;R!=O;R+=S)L.push([h[R].x,h[R].y]);return L}isExteriorRing(){if(this._isExteriorRing===void 0){let u=this.enclosingRing();this._isExteriorRing=u?!u.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let u=this.events[0];for(let M=1,S=this.events.length;M<S;M++){let A=this.events[M];se.compare(u,A)>0&&(u=A)}let h=u.segment.prevInResult(),b=h?h.prevInResult():null;for(;;){if(!h)return null;if(!b)return h.ringOut;if(b.ringOut!==h.ringOut)return b.ringOut.enclosingRing()!==h.ringOut?h.ringOut:h.ringOut.enclosingRing();h=b.prevInResult(),b=h?h.prevInResult():null}}}class It{constructor(u){this.exteriorRing=u,u.poly=this,this.interiorRings=[]}addInterior(u){this.interiorRings.push(u),u.poly=this}getGeom(){let u=[this.exteriorRing.getGeom()];if(u[0]===null)return null;for(let h=0,b=this.interiorRings.length;h<b;h++){let M=this.interiorRings[h].getGeom();M!==null&&u.push(M)}return u}}class br{constructor(u){this.rings=u,this.polys=this._composePolys(u)}getGeom(){let u=[];for(let h=0,b=this.polys.length;h<b;h++){let M=this.polys[h].getGeom();M!==null&&u.push(M)}return u}_composePolys(u){let h=[];for(let b=0,M=u.length;b<M;b++){let S=u[b];if(!S.poly)if(S.isExteriorRing())h.push(new It(S));else{let A=S.enclosingRing();A.poly||h.push(new It(A)),A.poly.addInterior(S)}}return h}}class Zo{constructor(u){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ce.compare;this.queue=u,this.tree=new l(h),this.segments=[]}process(u){let h=u.segment,b=[];if(u.consumedBy)return u.isLeft?this.queue.remove(u.otherSE):this.tree.remove(h),b;let M=u.isLeft?this.tree.add(h):this.tree.find(h);if(!M)throw new Error(`Unable to find segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] in SweepLine tree.`);let S=M,A=M,O,L;for(;O===void 0;)S=this.tree.prev(S),S===null?O=null:S.key.consumedBy===void 0&&(O=S.key);for(;L===void 0;)A=this.tree.next(A),A===null?L=null:A.key.consumedBy===void 0&&(L=A.key);if(u.isLeft){let R=null;if(O){let P=O.getIntersection(h);if(P!==null&&(h.isAnEndpoint(P)||(R=P),!O.isAnEndpoint(P))){let V=this._splitSafely(O,P);for(let z=0,te=V.length;z<te;z++)b.push(V[z])}}let Y=null;if(L){let P=L.getIntersection(h);if(P!==null&&(h.isAnEndpoint(P)||(Y=P),!L.isAnEndpoint(P))){let V=this._splitSafely(L,P);for(let z=0,te=V.length;z<te;z++)b.push(V[z])}}if(R!==null||Y!==null){let P=null;R===null?P=Y:Y===null?P=R:P=se.comparePoints(R,Y)<=0?R:Y,this.queue.remove(h.rightSE),b.push(h.rightSE);let V=h.split(P);for(let z=0,te=V.length;z<te;z++)b.push(V[z])}b.length>0?(this.tree.remove(h),b.push(u)):(this.segments.push(h),h.prev=O)}else{if(O&&L){let R=O.getIntersection(L);if(R!==null){if(!O.isAnEndpoint(R)){let Y=this._splitSafely(O,R);for(let P=0,V=Y.length;P<V;P++)b.push(Y[P])}if(!L.isAnEndpoint(R)){let Y=this._splitSafely(L,R);for(let P=0,V=Y.length;P<V;P++)b.push(Y[P])}}}this.tree.remove(h)}return b}_splitSafely(u,h){this.tree.remove(u);let b=u.rightSE;this.queue.remove(b);let M=u.split(h);return M.push(b),u.consumedBy===void 0&&this.tree.add(u),M}}let Jo=typeof x<"u"&&x.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ir=typeof x<"u"&&x.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Rt{run(u,h,b){Fe.type=u,j.reset();let M=[new eo(h,!0)];for(let P=0,V=b.length;P<V;P++)M.push(new eo(b[P],!1));if(Fe.numMultiPolys=M.length,Fe.type==="difference"){let P=M[0],V=1;for(;V<M.length;)y(M[V].bbox,P.bbox)!==null?V++:M.splice(V,1)}if(Fe.type==="intersection")for(let P=0,V=M.length;P<V;P++){let z=M[P];for(let te=P+1,Q=M.length;te<Q;te++)if(y(z.bbox,M[te].bbox)===null)return[]}let S=new l(se.compare);for(let P=0,V=M.length;P<V;P++){let z=M[P].getSweepEvents();for(let te=0,Q=z.length;te<Q;te++)if(S.insert(z[te]),S.size>Jo)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let A=new Zo(S),O=S.size,L=S.pop();for(;L;){let P=L.key;if(S.size===O){let z=P.segment;throw new Error(`Unable to pop() ${P.isLeft?"left":"right"} SweepEvent [${P.point.x}, ${P.point.y}] from segment #${z.id} [${z.leftSE.point.x}, ${z.leftSE.point.y}] -> [${z.rightSE.point.x}, ${z.rightSE.point.y}] from queue.`)}if(S.size>Jo)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(A.segments.length>Ir)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let V=A.process(P);for(let z=0,te=V.length;z<te;z++){let Q=V[z];Q.consumedBy===void 0&&S.insert(Q)}O=S.size,L=S.pop()}j.reset();let R=go.factory(A.segments);return new br(R).getGeom()}}let Fe=new Rt;var Ko={union:function(C){for(var u=arguments.length,h=new Array(u>1?u-1:0),b=1;b<u;b++)h[b-1]=arguments[b];return Fe.run("union",C,h)},intersection:function(C){for(var u=arguments.length,h=new Array(u>1?u-1:0),b=1;b<u;b++)h[b-1]=arguments[b];return Fe.run("intersection",C,h)},xor:function(C){for(var u=arguments.length,h=new Array(u>1?u-1:0),b=1;b<u;b++)h[b-1]=arguments[b];return Fe.run("xor",C,h)},difference:function(C){for(var u=arguments.length,h=new Array(u>1?u-1:0),b=1;b<u;b++)h[b-1]=arguments[b];return Fe.run("difference",C,h)}};return Ko}))});var qt=Oe(Ft=>{"use strict";f();Ft.__esModule=!0;Ft.extend=hg;Ft.indexOf=gI;Ft.escapeExpression=mI;Ft.isEmpty=yI;Ft.createFrame=bI;Ft.blockParams=II;Ft.appendContextPath=TI;var pI={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},uI=/[&<>"'`=]/g,fI=/[&<>"'`=]/;function hI(o){return pI[o]}function hg(o){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&(o[t]=arguments[e][t]);return o}var pc=Object.prototype.toString;Ft.toString=pc;var dc=function(e){return typeof e=="function"};dc(/x/)&&(Ft.isFunction=dc=function(o){return typeof o=="function"&&pc.call(o)==="[object Function]"});Ft.isFunction=dc;var gg=Array.isArray||function(o){return o&&typeof o=="object"?pc.call(o)==="[object Array]":!1};Ft.isArray=gg;function gI(o,e){for(var t=0,r=o.length;t<r;t++)if(o[t]===e)return t;return-1}function mI(o){if(typeof o!="string"){if(o&&o.toHTML)return o.toHTML();if(o==null)return"";if(!o)return o+"";o=""+o}return fI.test(o)?o.replace(uI,hI):o}function yI(o){return!o&&o!==0?!0:!!(gg(o)&&o.length===0)}function bI(o){var e=hg({},o);return e._parent=o,e}function II(o,e){return o.path=e,o}function TI(o,e){return(o?o+".":"")+e}});var Uo=Oe((wa,mg)=>{"use strict";f();wa.__esModule=!0;var uc=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function fc(o,e){var t=e&&e.loc,r=void 0,n=void 0,i=void 0,a=void 0;t&&(r=t.start.line,n=t.end.line,i=t.start.column,a=t.end.column,o+=" - "+r+":"+i);for(var s=Error.prototype.constructor.call(this,o),l=0;l<uc.length;l++)this[uc[l]]=s[uc[l]];Error.captureStackTrace&&Error.captureStackTrace(this,fc);try{t&&(this.lineNumber=r,this.endLineNumber=n,Object.defineProperty?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=i,this.endColumn=a))}catch{}}fc.prototype=new Error;wa.default=fc;mg.exports=wa.default});var bg=Oe((Aa,yg)=>{"use strict";f();Aa.__esModule=!0;var hc=qt();Aa.default=function(o){o.registerHelper("blockHelperMissing",function(e,t){var r=t.inverse,n=t.fn;if(e===!0)return n(this);if(e===!1||e==null)return r(this);if(hc.isArray(e))return e.length>0?(t.ids&&(t.ids=[t.name]),o.helpers.each(e,t)):r(this);if(t.data&&t.ids){var i=hc.createFrame(t.data);i.contextPath=hc.appendContextPath(t.data.contextPath,t.name),t={data:i}}return n(e,t)})};yg.exports=Aa.default});var Tg=Oe((Ra,Ig)=>{"use strict";f();Ra.__esModule=!0;function vI(o){return o&&o.__esModule?o:{default:o}}var si=qt(),SI=Uo(),xI=vI(SI);Ra.default=function(o){o.registerHelper("each",function(e,t){if(!t)throw new xI.default("Must pass iterator to #each");var r=t.fn,n=t.inverse,i=0,a="",s=void 0,l=void 0;t.data&&t.ids&&(l=si.appendContextPath(t.data.contextPath,t.ids[0])+"."),si.isFunction(e)&&(e=e.call(this)),t.data&&(s=si.createFrame(t.data));function c(I,v,y){s&&(s.key=I,s.index=v,s.first=v===0,s.last=!!y,l&&(s.contextPath=l+I)),a=a+r(e[I],{data:s,blockParams:si.blockParams([e[I],I],[l+I,null])})}if(e&&typeof e=="object")if(si.isArray(e))for(var d=e.length;i<d;i++)i in e&&c(i,i,i===e.length-1);else if(typeof Symbol=="function"&&e[Symbol.iterator]){for(var p=[],g=e[Symbol.iterator](),m=g.next();!m.done;m=g.next())p.push(m.value);e=p;for(var d=e.length;i<d;i++)c(i,i,i===e.length-1)}else(function(){var I=void 0;Object.keys(e).forEach(function(v){I!==void 0&&c(I,i-1),I=v,i++}),I!==void 0&&c(I,i-1,!0)})();return i===0&&(a=n(this)),a})};Ig.exports=Ra.default});var Sg=Oe((Da,vg)=>{"use strict";f();Da.__esModule=!0;function MI(o){return o&&o.__esModule?o:{default:o}}var EI=Uo(),CI=MI(EI);Da.default=function(o){o.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new CI.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};vg.exports=Da.default});var Cg=Oe((ka,Eg)=>{"use strict";f();ka.__esModule=!0;function _I(o){return o&&o.__esModule?o:{default:o}}var xg=qt(),FI=Uo(),Mg=_I(FI);ka.default=function(o){o.registerHelper("if",function(e,t){if(arguments.length!=2)throw new Mg.default("#if requires exactly one argument");return xg.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||xg.isEmpty(e)?t.inverse(this):t.fn(this)}),o.registerHelper("unless",function(e,t){if(arguments.length!=2)throw new Mg.default("#unless requires exactly one argument");return o.helpers.if.call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})};Eg.exports=ka.default});var Fg=Oe((Na,_g)=>{"use strict";f();Na.__esModule=!0;Na.default=function(o){o.registerHelper("log",function(){for(var e=[void 0],t=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)e.push(arguments[r]);var n=1;t.hash.level!=null?n=t.hash.level:t.data&&t.data.level!=null&&(n=t.data.level),e[0]=n,o.log.apply(o,e)})};_g.exports=Na.default});var Pg=Oe((La,Og)=>{"use strict";f();La.__esModule=!0;La.default=function(o){o.registerHelper("lookup",function(e,t,r){return e&&r.lookupProperty(e,t)})};Og.exports=La.default});var Ag=Oe((Ba,wg)=>{"use strict";f();Ba.__esModule=!0;function OI(o){return o&&o.__esModule?o:{default:o}}var li=qt(),PI=Uo(),wI=OI(PI);Ba.default=function(o){o.registerHelper("with",function(e,t){if(arguments.length!=2)throw new wI.default("#with requires exactly one argument");li.isFunction(e)&&(e=e.call(this));var r=t.fn;if(li.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&(n=li.createFrame(t.data),n.contextPath=li.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:li.blockParams([e],[n&&n.contextPath])})})};wg.exports=Ba.default});var gc=Oe(Va=>{"use strict";f();Va.__esModule=!0;Va.registerDefaultHelpers=$I;Va.moveHelperToHooks=XI;function fr(o){return o&&o.__esModule?o:{default:o}}var AI=bg(),RI=fr(AI),DI=Tg(),kI=fr(DI),NI=Sg(),LI=fr(NI),BI=Cg(),VI=fr(BI),jI=Fg(),GI=fr(jI),UI=Pg(),HI=fr(UI),WI=Ag(),zI=fr(WI);function $I(o){RI.default(o),kI.default(o),LI.default(o),VI.default(o),GI.default(o),HI.default(o),zI.default(o)}function XI(o,e,t){o.helpers[e]&&(o.hooks[e]=o.helpers[e],t||(o.helpers[e]=void 0))}});var Dg=Oe((ja,Rg)=>{"use strict";f();ja.__esModule=!0;var YI=qt();ja.default=function(o){o.registerDecorator("inline",function(e,t,r,n){var i=e;return t.partials||(t.partials={},i=function(a,s){var l=r.partials;r.partials=YI.extend({},l,t.partials);var c=e(a,s);return r.partials=l,c}),t.partials[n.args[0]]=n.fn,i})};Rg.exports=ja.default});var kg=Oe(mc=>{"use strict";f();mc.__esModule=!0;mc.registerDefaultDecorators=QI;function ZI(o){return o&&o.__esModule?o:{default:o}}var JI=Dg(),qI=ZI(JI);function QI(o){qI.default(o)}});var yc=Oe((Ga,Ng)=>{"use strict";f();Ga.__esModule=!0;var KI=qt(),Kr={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var t=KI.indexOf(Kr.methodMap,e.toLowerCase());t>=0?e=t:e=parseInt(e,10)}return e},log:function(e){if(e=Kr.lookupLevel(e),typeof console<"u"&&Kr.lookupLevel(Kr.level)<=e){var t=Kr.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];console[t].apply(console,n)}}};Ga.default=Kr;Ng.exports=Ga.default});var bc=Oe(ci=>{"use strict";f();ci.__esModule=!0;ci.createProtoAccessControl=rT;ci.resultIsAllowed=nT;ci.resetLoggedProperties=aT;function eT(o){return o&&o.__esModule?o:{default:o}}var Lg=qt(),tT=yc(),oT=eT(tT),Ua=Object.create(null);function rT(o){var e=Object.create(null);e.__proto__=!1,Lg.extend(e,o.allowedProtoProperties);var t=Object.create(null);return t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1,t.__lookupSetter__=!1,Lg.extend(t,o.allowedProtoMethods),{properties:{whitelist:e,defaultValue:o.allowProtoPropertiesByDefault},methods:{whitelist:t,defaultValue:o.allowProtoMethodsByDefault}}}function nT(o,e,t){return Bg(typeof o=="function"?e.methods:e.properties,t)}function Bg(o,e){return o.whitelist[e]!==void 0?o.whitelist[e]===!0:o.defaultValue!==void 0?o.defaultValue:(iT(e),!1)}function iT(o){Ua[o]!==!0&&(Ua[o]=!0,oT.default.log("error",'Handlebars: Access has been denied to resolve the property "'+o+`" because it is not an "own property" of its parent.
|
|
3
|
-
You can add a runtime option to disable the check or this warning:
|
|
4
|
-
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function aT(){Object.keys(Ua).forEach(function(o){delete Ua[o]})}});var Sc=Oe(fo=>{"use strict";f();fo.__esModule=!0;fo.HandlebarsEnvironment=vc;function Vg(o){return o&&o.__esModule?o:{default:o}}var hr=qt(),sT=Uo(),Ic=Vg(sT),lT=gc(),cT=kg(),dT=yc(),Ha=Vg(dT),pT=bc(),uT="4.7.9";fo.VERSION=uT;var fT=8;fo.COMPILER_REVISION=fT;var hT=7;fo.LAST_COMPATIBLE_COMPILER_REVISION=hT;var gT={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};fo.REVISION_CHANGES=gT;var Tc="[object Object]";function vc(o,e,t){this.helpers=o||{},this.partials=e||{},this.decorators=t||{},lT.registerDefaultHelpers(this),cT.registerDefaultDecorators(this)}vc.prototype={constructor:vc,logger:Ha.default,log:Ha.default.log,registerHelper:function(e,t){if(hr.toString.call(e)===Tc){if(t)throw new Ic.default("Arg not supported with multiple helpers");hr.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(hr.toString.call(e)===Tc)hr.extend(this.partials,e);else{if(typeof t>"u")throw new Ic.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(hr.toString.call(e)===Tc){if(t)throw new Ic.default("Arg not supported with multiple decorators");hr.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){pT.resetLoggedProperties()}};var mT=Ha.default.log;fo.log=mT;fo.createFrame=hr.createFrame;fo.logger=Ha.default});var Gg=Oe((Wa,jg)=>{"use strict";f();Wa.__esModule=!0;function xc(o){this.string=o}xc.prototype.toString=xc.prototype.toHTML=function(){return""+this.string};Wa.default=xc;jg.exports=Wa.default});var Ug=Oe(Mc=>{"use strict";f();Mc.__esModule=!0;Mc.wrapHelper=yT;function yT(o,e){if(typeof o!="function")return o;var t=function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=e(n),o.apply(this,arguments)};return t}});var Yg=Oe(Ho=>{"use strict";f();Ho.__esModule=!0;Ho.checkRevision=xT;Ho.template=MT;Ho.wrapProgram=za;Ho.resolvePartial=ET;Ho.invokePartial=CT;Ho.noop=$g;function bT(o){return o&&o.__esModule?o:{default:o}}function IT(o){if(o&&o.__esModule)return o;var e={};if(o!=null)for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e.default=o,e}var TT=qt(),en=IT(TT),vT=Uo(),xo=bT(vT),Mo=Sc(),Hg=gc(),ST=Ug(),Wg=bc();function xT(o){var e=o&&o[0]||1,t=Mo.COMPILER_REVISION;if(!(e>=Mo.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Mo.COMPILER_REVISION))if(e<Mo.LAST_COMPATIBLE_COMPILER_REVISION){var r=Mo.REVISION_CHANGES[t],n=Mo.REVISION_CHANGES[e];throw new xo.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+n+").")}else throw new xo.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+o[1]+").")}function MT(o,e){if(!e)throw new xo.default("No environment passed to template");if(!o||!o.main)throw new xo.default("Unknown template object: "+typeof o);o.main.decorator=o.main_d,e.VM.checkRevision(o.compiler);var t=o.compiler&&o.compiler[0]===7;function r(a,s,l){l.hash&&(s=en.extend({},s,l.hash),l.ids&&(l.ids[0]=!0)),a=e.VM.resolvePartial.call(this,a,s,l),l.hooks=this.hooks,l.protoAccessControl=this.protoAccessControl;var c=e.VM.invokePartial.call(this,a,s,l);if(c==null&&e.compile&&(l.partials[l.name]=e.compile(a,o.compilerOptions,e),c=l.partials[l.name](s,l)),c!=null){if(l.indent){for(var d=c.split(`
|
|
5
|
-
`),p=0,g=d.length;p<g&&!(!d[p]&&p+1===g);p++)d[p]=l.indent+d[p];c=d.join(`
|
|
6
|
-
`)}return c}else throw new xo.default("The partial "+l.name+" could not be compiled when running in runtime-only mode")}var n={strict:function(s,l,c){if(!s||!(l in s))throw new xo.default('"'+l+'" not defined in '+s,{loc:c});return n.lookupProperty(s,l)},lookupProperty:function(s,l){var c=s[l];if(c==null||Object.prototype.hasOwnProperty.call(s,l)||Wg.resultIsAllowed(c,n.protoAccessControl,l))return c},lookup:function(s,l){for(var c=s.length,d=0;d<c;d++){var p=s[d]&&n.lookupProperty(s[d],l);if(p!=null)return p}},lambda:function(s,l){return typeof s=="function"?s.call(l):s},escapeExpression:en.escapeExpression,invokePartial:r,fn:function(s){var l=o[s];return l.decorator=o[s+"_d"],l},programs:[],program:function(s,l,c,d,p){var g=this.programs[s],m=this.fn(s);return l||p||d||c?g=za(this,s,m,l,c,d,p):g||(g=this.programs[s]=za(this,s,m)),g},data:function(s,l){for(;s&&l--;)s=s._parent;return s},mergeIfNeeded:function(s,l){var c=s||l;return s&&l&&s!==l&&(c=en.extend({},l,s)),c},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:o.compiler};function i(a){var s=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],l=s.data;i._setup(s),!s.partial&&o.useData&&(l=_T(a,l));var c=void 0,d=o.useBlockParams?[]:void 0;o.useDepths&&(s.depths?c=a!=s.depths[0]?[a].concat(s.depths):s.depths:c=[a]);function p(g){return""+o.main(n,g,n.helpers,n.partials,l,d,c)}return p=Xg(o.main,p,n,s.depths||[],l,d),p(a,s)}return i.isTop=!0,i._setup=function(a){if(a.partial)n.protoAccessControl=a.protoAccessControl,n.helpers=a.helpers,n.partials=a.partials,n.decorators=a.decorators,n.hooks=a.hooks;else{var s={};zg(s,e.helpers,n),zg(s,a.helpers,n),n.helpers=s,o.usePartial&&(n.partials=n.mergeIfNeeded(a.partials,e.partials)),(o.usePartial||o.useDecorators)&&(n.decorators=en.extend({},e.decorators,a.decorators)),n.hooks={},n.protoAccessControl=Wg.createProtoAccessControl(a);var l=a.allowCallsToHelperMissing||t;Hg.moveHelperToHooks(n,"helperMissing",l),Hg.moveHelperToHooks(n,"blockHelperMissing",l)}},i._child=function(a,s,l,c){if(o.useBlockParams&&!l)throw new xo.default("must pass block params");if(o.useDepths&&!c)throw new xo.default("must pass parent depths");return za(n,a,o[a],s,0,l,c)},i}function za(o,e,t,r,n,i,a){function s(l){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],d=a;return a&&l!=a[0]&&!(l===o.nullContext&&a[0]===null)&&(d=[l].concat(a)),t(o,l,o.helpers,o.partials,c.data||r,i&&[c.blockParams].concat(i),d)}return s=Xg(t,s,o,a,r,i),s.program=e,s.depth=a?a.length:0,s.blockParams=n||0,s}function ET(o,e,t){return o?!o.call&&!t.name&&(t.name=o,o=$a(t.partials,o)):t.name==="@partial-block"?o=$a(t.data,"partial-block"):o=$a(t.partials,t.name),o}function CT(o,e,t){var r=$a(t.data,"partial-block");t.partial=!0,t.ids&&(t.data.contextPath=t.ids[0]||t.data.contextPath);var n=void 0;if(t.fn&&t.fn!==$g&&(function(){t.data=Mo.createFrame(t.data);var i=t.fn;n=t.data["partial-block"]=function(s){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return l.data=Mo.createFrame(l.data),l.data["partial-block"]=r,i(s,l)},i.partials&&(t.partials=en.extend({},t.partials,i.partials))})(),o===void 0&&n&&(o=n),o===void 0)throw new xo.default("The partial "+t.name+" could not be found");if(o instanceof Function)return o(e,t)}function $g(){return""}function $a(o,e){if(o&&Object.prototype.hasOwnProperty.call(o,e))return o[e]}function _T(o,e){return(!e||!("root"in e))&&(e=e?Mo.createFrame(e):{},e.root=o),e}function Xg(o,e,t,r,n,i){if(o.decorator){var a={};e=o.decorator(e,a,t,r&&r[0],n,i,r),en.extend(e,a)}return e}function zg(o,e,t){e&&Object.keys(e).forEach(function(r){var n=e[r];o[r]=FT(n,t)})}function FT(o,e){var t=e.lookupProperty;return ST.wrapHelper(o,function(r){return r.lookupProperty=t,r})}});var Jg=Oe((Xa,Zg)=>{"use strict";f();Xa.__esModule=!0;Xa.default=function(o){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;o.noConflict=function(){return globalThis.Handlebars===o&&(globalThis.Handlebars=e),o}};Zg.exports=Xa.default});var tm=Oe((Ya,em)=>{"use strict";f();Ya.__esModule=!0;function Cc(o){return o&&o.__esModule?o:{default:o}}function _c(o){if(o&&o.__esModule)return o;var e={};if(o!=null)for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e.default=o,e}var OT=Sc(),qg=_c(OT),PT=Gg(),wT=Cc(PT),AT=Uo(),RT=Cc(AT),DT=qt(),Ec=_c(DT),kT=Yg(),Qg=_c(kT),NT=Jg(),LT=Cc(NT);function Kg(){var o=new qg.HandlebarsEnvironment;return Ec.extend(o,qg),o.SafeString=wT.default,o.Exception=RT.default,o.Utils=Ec,o.escapeExpression=Ec.escapeExpression,o.VM=Qg,o.template=function(e){return Qg.template(e,o)},o}var di=Kg();di.create=Kg;LT.default(di);di.default=di;Ya.default=di;em.exports=Ya.default});var rm=Oe((cR,om)=>{f();om.exports=tm().default});f();f();f();f();f();var kd="mi-session-data",Nd="mi-local-data",gn="id",mn="deviceId",kt=class o{static#e;#t;#o;constructor(){try{let e=sessionStorage.getItem(kd);e?this.#t=JSON.parse(e):this.#t={[gn]:ae()}}catch{this.#t={[gn]:ae()}}try{let e=localStorage.getItem(Nd);e?this.#o=JSON.parse(e):this.#o={[mn]:ae()}}catch{this.#o={[mn]:ae()}}this.#t[gn]||(this.#t[gn]=ae()),this.#o[mn]||(this.#o[mn]=ae())}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(kd,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(Nd,JSON.stringify(this.#o)),!0}catch{return!1}}loadLocalData(e){let t=this.#o[e];if(t!=null)return t}};f();f();var wo=o=>o!=null;var yy=(function(){let e=globalThis.fetch;return{fetch(...t){if(!wo(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}}})(),Ld=yy.fetch;var Ud=["websdk","web","webv2","kiosk","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk","minimap","app-framework"],Bd=Ud[0],Hd="https://api-gateway.mappedin.com/track-analytics/a/",Wd="deny-watchposition",zd="load-mapview",$d="load-mapdata",Xd="change-language",Yd="query-directions";var _r=class{#e=Object.freeze({});#t;oneTimeEventsSent=new Set;constructor(){this.#t=this.#r(this.#e)}init(e){this.reset(),this.updateStateWithOptions(e)}reset(){this.#e={},this.#t=this.#r({}),this.oneTimeEventsSent.clear()}updateStateWithOptions(e){return this.#e=Object.freeze(Object.assign({},this.#e,e)),this.#t=this.#r(e),this.#o(this.#t),this.#t}#o(e){e.sessionId&&kt.getInstance().saveSessionData("id",e.sessionId),e.deviceId&&kt.getInstance().saveLocalData("deviceId",e.deviceId)}#r(e){let t=e.baseUri??Hd;return{baseUri:t,analyticsBaseUrl:bs({...e,baseUri:t}),version:e.version||x?.env?.npm_package_version||"v6",deviceId:e.deviceId||Vd(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||jd(),platformString:e.platformString||"",context:Gd(e.context)||Bd,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=bs({...this.#t,mapId:t.mapId})),t.context&&(t.context=Gd(t.context)),t.baseUri&&(t.analyticsBaseUrl=bs({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:r}=this.getState();return!!(e&&t)||!!r}getState(){return this.#t}getContext(){return this.getState().context||this.#e.context||Bd}getSessionId(){return this.getState().sessionId||this.#e.sessionId||jd()}getDeviceId(){return this.getState().deviceId||this.#e.deviceId||Vd()}sendAnalyticEvent(e,t={}){let r=this.getState(),n=by(r.analyticsBaseUrl,e),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(r.logEvents&&_.log("Analytics.track",n,i),!r.sendEvents)return Promise.resolve();if(!this.authReady)return!r.key&&!r.secret&&!r.accessToken?void 0:_.warn("Auth needs to be ready to send analytics.");let a={...t,g:r.geolocationMode,sdk_version:r.version,...r.externalId?{externalId:r.externalId}:{}};return r.userPosition&&Object.assign(a,r.userPosition),r.anchor&&Object.assign(a,r.anchor),i["Content-Type"]="application/json",!r.noAuth&&r.enterprise&&r.secret&&r.key?(i["x-mappedin-key"]=btoa(r.key),i["x-mappedin-secret"]=btoa(r.secret)):r.accessToken&&(i.Authorization=`Bearer ${r.accessToken}`),Ld(n,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(e,t){if(Ty.includes(e))return _.warn(`${e} event is sent internally.`),Promise.resolve();let r=Iy.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(r,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent($d,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(Xd,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(Wd)}sendMapViewLoadedEvent({firstRenderDurationMs:e,dimension:t,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n}){return this.sendAnalyticEvent(zd,{type:"3d",firstRenderDurationMs:e,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n})}sendGetDirectionsEvent=sd((e,t,r)=>{let n={start:e,end:t,type:"location_to_location"};return r!==void 0&&(n.accessible=r),this.sendAnalyticEvent(Yd,n)},2500);sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};function bs({mapId:o,baseUri:e=Hd}){return`${e}${o}/`}function Vd(){return kt.getInstance().loadLocalData("deviceId")}function jd(){return kt.getInstance().loadSessionData("id")}function by(o,e){return o+e}function Gd(o){return Ud.find(e=>e===o)}var Iy=["$select-location","$select-category","$query-suggest","$query-search"],Ty=[zd,$d,Yd,Wd,Xd],m0=new _r,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,...r}=this.#e.getState();return r}getContext(){return this.#e.getContext()}getSessionId(){return this.#e.getSessionId()}getDeviceId(){return this.#e.getDeviceId()}};f();var Zd=o=>o!==void 0&&o.length>=2;function wi(o){if(o?.type!=="LineString")return;let[e,t]=o.coordinates;if(!(!Zd(e)||!Zd(t)))return{geoJSON:{geometry:{coordinates:[[e[0],e[1]],[t[0],t[1]]]}}}}var xt=(o,e)=>`${o} is not supported for mvfVersion '3.0.0-native': use the async ${e} instead.`;f();f();f();f();f();function Fr(o){return o.endsWith("/")?o:`${o}/`}f();var Or="https://app.mappedin.com/",Jd="https://auth.mappedin.com/",qd=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"}),vy=Object.freeze({...qd,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Sy=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"}),xy=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"}),My=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"}),Ey={eu:Sy,us:qd,"us-enterprise":vy,"us-staging-enterprise":xy,"us-staging-self-serve":My};function Qd(o){return Ey[o]}f();f();var Cy=o=>{let e=Date.now();return o-e},Ai=(o,e)=>Cy(o)<=e*60*1e3;var ep=10,tp=ep*60*1e3,Kd="accessTokens",_y="mik_";function op(o){return typeof o=="string"&&o.startsWith(_y)}async function bn(o,e=!1,t=!1){let r=`${o.key}`,n=kt.getInstance(),i=n?.loadSessionData(Kd)||{},a=Math.floor(Date.now()/1e3);if(!t&&i[r]&&!Ai(i[r].expiresTimestamp*1e3,ep))return i[r];let s=e?await Fy(o,a):await Oy(o,a),l={...i,[r]:s};return n?.saveSessionData(Kd,l),s}async function Fy(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri??Jd}oauth2/token`;let r;try{r=await Mt()(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 a=i instanceof Error?i.message:String(i);throw new Error(`Failed to fetch enterprise access token from ${t}: ${a}`)}if(!r.ok)throw new Error(`${r.status} ${r.statusText}: ${await r.text()}`);let n=await r.json();return{accessToken:n.access_token,expiresTimestamp:e+n.expires_in}}async function Oy(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri?Fr(o.baseAuthUri):Or}api/v1/api-key/token`;let r;try{r=await Mt()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:o.key,secret:o.secret})})}catch(i){let a=i instanceof Error?i.message:String(i);throw new Error(`Failed to fetch access token from ${t}: ${a}`)}if(!r.ok)throw new Error(`${r.status} ${r.statusText}: ${await r.text()}`);let n=await r.json();return{accessToken:n.access_token,expiresTimestamp:e+n.expires_in}}f();var np=10,ip=np*60*1e3,rp="miSasTokens";async function Is(o,e){let t=`${e}__${o.mapId}`,r=kt.getInstance(),n=r?.loadSessionData(rp)||{};if(n[t]&&!Ai(n[t].expires,np))return n[t];let i=await Py(o,e),a={...n,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return r?.saveSessionData(rp,a),i}async function Py(o,e){let t=`${o.baseUri?Fr(o.baseUri):Or}api/v1/venue/${o.mapId}/sas-token`,r=await Mt()(t,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`${r.status} ${r.statusText}: ${await r.text()}`);let n=await r.json();return{token:n.token,expires:new Date(n.expires).getTime()}}f();var Et=Uint8Array,or=Uint16Array,ap=Uint32Array,sp=new Et([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),lp=new Et([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),wy=new Et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cp=function(o,e){for(var t=new or(31),r=0;r<31;++r)t[r]=e+=1<<o[r-1];for(var n=new ap(t[30]),r=1;r<30;++r)for(var i=t[r];i<t[r+1];++i)n[i]=i-t[r]<<5|r;return[t,n]},dp=cp(sp,2),pp=dp[0],Ay=dp[1];pp[28]=258,Ay[258]=28;var up=cp(lp,0),Ry=up[0],$0=up[1],xs=new or(32768);for(ge=0;ge<32768;++ge)yo=(ge&43690)>>>1|(ge&21845)<<1,yo=(yo&52428)>>>2|(yo&13107)<<2,yo=(yo&61680)>>>4|(yo&3855)<<4,xs[ge]=((yo&65280)>>>8|(yo&255)<<8)>>>1;var yo,ge,In=(function(o,e,t){for(var r=o.length,n=0,i=new or(e);n<r;++n)o[n]&&++i[o[n]-1];var a=new or(e);for(n=0;n<e;++n)a[n]=a[n-1]+i[n-1]<<1;var s;if(t){s=new or(1<<e);var l=15-e;for(n=0;n<r;++n)if(o[n])for(var c=n<<4|o[n],d=e-o[n],p=a[o[n]-1]++<<d,g=p|(1<<d)-1;p<=g;++p)s[xs[p]>>>l]=c}else for(s=new or(r),n=0;n<r;++n)o[n]&&(s[n]=xs[a[o[n]-1]++]>>>15-o[n]);return s}),Tn=new Et(288);for(ge=0;ge<144;++ge)Tn[ge]=8;var ge;for(ge=144;ge<256;++ge)Tn[ge]=9;var ge;for(ge=256;ge<280;++ge)Tn[ge]=7;var ge;for(ge=280;ge<288;++ge)Tn[ge]=8;var ge,fp=new Et(32);for(ge=0;ge<32;++ge)fp[ge]=5;var ge;var Dy=In(Tn,9,1);var ky=In(fp,5,1),Ts=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},Gt=function(o,e,t){var r=e/8|0;return(o[r]|o[r+1]<<8)>>(e&7)&t},vs=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},Ny=function(o){return(o+7)/8|0},Es=function(o,e,t){(e==null||e<0)&&(e=0),(t==null||t>o.length)&&(t=o.length);var r=new(o.BYTES_PER_ELEMENT==2?or:o.BYTES_PER_ELEMENT==4?ap:Et)(t-e);return r.set(o.subarray(e,t)),r};var Ly=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ut=function(o,e,t){var r=new Error(e||Ly[o]);if(r.code=o,Error.captureStackTrace&&Error.captureStackTrace(r,Ut),!t)throw r;return r},By=function(o,e,t){var r=o.length;if(!r||t&&t.f&&!t.l)return e||new Et(0);var n=!e||t,i=!t||t.i;t||(t={}),e||(e=new Et(r*3));var a=function(Vt){var Co=e.length;if(Vt>Co){var _o=new Et(Math.max(Co*2,Vt));_o.set(e),e=_o}},s=t.f||0,l=t.p||0,c=t.b||0,d=t.l,p=t.d,g=t.m,m=t.n,I=r*8;do{if(!d){s=Gt(o,l,1);var v=Gt(o,l+1,3);if(l+=3,v)if(v==1)d=Dy,p=ky,g=9,m=5;else if(v==2){var w=Gt(o,l,31)+257,B=Gt(o,l+10,15)+4,D=w+Gt(o,l+5,31)+1;l+=14;for(var j=new Et(D),G=new Et(19),W=0;W<B;++W)G[wy[W]]=Gt(o,l+W*3,7);l+=B*3;for(var N=Ts(G),q=(1<<N)-1,oe=In(G,N,1),W=0;W<D;){var ie=oe[Gt(o,l,q)];l+=ie&15;var y=ie>>>4;if(y<16)j[W++]=y;else{var be=0,De=0;for(y==16?(De=3+Gt(o,l,3),l+=2,be=j[W-1]):y==17?(De=3+Gt(o,l,7),l+=3):y==18&&(De=11+Gt(o,l,127),l+=7);De--;)j[W++]=be}}var ke=j.subarray(0,w),ue=j.subarray(w);g=Ts(ke),m=Ts(ue),d=In(ke,g,1),p=In(ue,m,1)}else Ut(1);else{var y=Ny(l)+4,E=o[y-4]|o[y-3]<<8,k=y+E;if(k>r){i&&Ut(0);break}n&&a(c+E),e.set(o.subarray(y,k),c),t.b=c+=E,t.p=l=k*8,t.f=s;continue}if(l>I){i&&Ut(0);break}}n&&a(c+131072);for(var Ke=(1<<g)-1,rt=(1<<m)-1,Pt=l;;Pt=l){var be=d[vs(o,l)&Ke],ve=be>>>4;if(l+=be&15,l>I){i&&Ut(0);break}if(be||Ut(2),ve<256)e[c++]=ve;else if(ve==256){Pt=l,d=null;break}else{var Eo=ve-254;if(ve>264){var W=ve-257,de=sp[W];Eo=Gt(o,l,(1<<de)-1)+pp[W],l+=de}var wt=p[vs(o,l)&rt],Kt=wt>>>4;wt||Ut(3),l+=wt&15;var ue=Ry[Kt];if(Kt>3){var de=lp[Kt];ue+=vs(o,l)&(1<<de)-1,l+=de}if(l>I){i&&Ut(0);break}n&&a(c+131072);for(var ho=c+Eo;c<ho;c+=4)e[c]=e[c-ue],e[c+1]=e[c+1-ue],e[c+2]=e[c+2-ue],e[c+3]=e[c+3-ue];c=ho}}t.l=d,t.p=Pt,t.b=c,t.f=s,d&&(s=1,t.m=g,t.d=p,t.n=m)}while(!s);return c==e.length?e:Es(e,0,c)};var Vy=new Et(0);var no=function(o,e){return o[e]|o[e+1]<<8},Ht=function(o,e){return(o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24)>>>0},Ss=function(o,e){return Ht(o,e)+Ht(o,e+4)*4294967296};function jy(o,e){return By(o,e)}var Ms=typeof TextDecoder<"u"&&new TextDecoder,Gy=0;try{Ms.decode(Vy,{stream:!0}),Gy=1}catch{}var Uy=function(o){for(var e="",t=0;;){var r=o[t++],n=(r>127)+(r>223)+(r>239);if(t+n>o.length)return[e,Es(o,t-1)];n?n==3?(r=((r&15)<<18|(o[t++]&63)<<12|(o[t++]&63)<<6|o[t++]&63)-65536,e+=String.fromCharCode(55296|r>>10,56320|r&1023)):n&1?e+=String.fromCharCode((r&31)<<6|o[t++]&63):e+=String.fromCharCode((r&15)<<12|(o[t++]&63)<<6|o[t++]&63):e+=String.fromCharCode(r)}};function Hy(o,e){if(e){for(var t="",r=0;r<o.length;r+=16384)t+=String.fromCharCode.apply(null,o.subarray(r,r+16384));return t}else{if(Ms)return Ms.decode(o);var n=Uy(o),i=n[0],a=n[1];return a.length&&Ut(8),i}}var Wy=function(o,e){return e+30+no(o,e+26)+no(o,e+28)},zy=function(o,e,t){var r=no(o,e+28),n=Hy(o.subarray(e+46,e+46+r),!(no(o,e+8)&2048)),i=e+46+r,a=Ht(o,e+20),s=t&&a==4294967295?$y(o,i):[a,Ht(o,e+24),Ht(o,e+42)],l=s[0],c=s[1],d=s[2];return[no(o,e+10),l,c,n,i+no(o,e+30)+no(o,e+32),d]},$y=function(o,e){for(;no(o,e)!=1;e+=4+no(o,e+2));return[Ss(o,e+12),Ss(o,e+4),Ss(o,e+20)]};function Cs(o,e){for(var t={},r=o.length-22;Ht(o,r)!=101010256;--r)(!r||o.length-r>65558)&&Ut(13);var n=no(o,r+8);if(!n)return{};var i=Ht(o,r+16),a=i==4294967295||n==65535;if(a){var s=Ht(o,r-12);a=Ht(o,s)==101075792,a&&(n=Ht(o,s+32),i=Ht(o,s+48))}for(var l=e&&e.filter,c=0;c<n;++c){var d=zy(o,i,a),p=d[0],g=d[1],m=d[2],I=d[3],v=d[4],y=d[5],E=Wy(o,y);i=v,(!l||l({name:I,size:g,originalSize:m,compression:p}))&&(p?p==8?t[I]=jy(o.subarray(E,E+g),new Et(m)):Ut(14,"unknown compression type "+p):t[I]=Es(o,E,E+g))}return t}var hp=globalThis.fetch,Yy=x?.env?.npm_package_version;function Mt(){if(hp==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return hp}function mp(o){return o==="3.0.0-native"?"3.0.0":o}async function Zy(o){return typeof o=="function"?o():o}var _s={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function yp(o){let e={..._s,...o};return e.headers={...e.headers,"mappedin-sdk-version":Yy},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 Jy(o,e,t=!1){let r={language:o.language,clientId:o.clientId,clientSecret:o.clientSecret};t&&delete r.language;let{headers:n}=o;n["Content-Type"]=n["Content-Type"]||"text/json",o.accessToken?n.Authorization=`Bearer ${o.accessToken}`:o.noAuth||o.clientId&&o.clientSecret&&(n["x-mappedin-key"]=btoa(o.clientId),n["x-mappedin-secret"]=btoa(o.clientSecret));let i={method:"GET",headers:n};return o.secure&&(e+="&withcdntoken"),{req:i,url:e}}async function qy(o,e,t=!1){let r=Jy(o,e,t),n=await Mt()(r.url,r.req);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}var Qy=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 _.warn("No perspectives available in response!"),null;let t={};for(let[r,n]of Object.entries(e)){let i="url"in n&&typeof n.url=="string"?n.url:null,a="locale_packs"in n&&typeof n.locale_packs=="object"?n.locale_packs:null;if(i==null||a==null){_.warn(`Perspective ${r} is missing url or locale_packs!`);continue}t[r]={url:i,locale_packs:a}}return t};async function Fs(o,e="exports/mvf/1/bundle"){let t=yp({baseUri:"https://api-gateway.mappedin.com/",..._s,...o}),r=`${t.baseUri+e}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let n=await qy(t,r),i=n.url,a=n.locale_packs,s=t.perspective??_s.perspective,l=Qy(n);if(s!=null&&s!==""&&l!=null){let c=l[s];c==null?_.warn(`Perspective ${s} not found in response! Loading default perspective instead.`):(_.log(`Loading perspective "${s}"`),i=c.url,a=c.locale_packs)}return{url:i,localePacks:a,updated_at:n.updated_at}}var Pr=(function(){let o;return()=>(o||(o=new TextDecoder),o)})();async function Os(o,{signal:e}){let t=await(await Mt()(o,{signal:e})).arrayBuffer();return new Uint8Array(t)}async function wr(o){let e=Cs(o),t={};if(e["enterprise/"]!=null){t.enterprise={};let r=e["enterprise/locations.json"];r&&(t.enterprise.locations=JSON.parse(Pr().decode(r)));let n=e["enterprise/locationInstances.json"];n&&(t.enterprise.locationInstances=JSON.parse(Pr().decode(n)));let i=e["enterprise/categories.json"];i&&(t.enterprise.categories=JSON.parse(Pr().decode(i)))}return e["floorstack.json"]&&(t["floorstack.json"]=JSON.parse(Pr().decode(e["floorstack.json"]))),e["floor.geojson"]&&(t["floor.geojson"]=JSON.parse(Pr().decode(e["floor.geojson"]))),e["manifest.json"]&&(t["manifest.geojson"]=JSON.parse(Pr().decode(e["manifest.json"]))),t}async function bp(o,{signal:e}){try{let t=await(await Mt()(o,{signal:e})).arrayBuffer();if(e.aborted)return;let r=new Uint8Array(t);return await wr(r)}catch(t){let r=new Error("downloadLanguagePack failed");throw r.cause=t,r}}function Ps(o){let{mvfVersion:e,useDraftData:t}=o;if(e!=null&&mp(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 vn(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 ws(o){return new Promise(async(e,t)=>{try{let r=Ps(o),{url:n,localePacks:i,updated_at:a}=await Fs(o,r),s=await Mt()(n).then(c=>c.arrayBuffer()),l=new Uint8Array(s);e({compressed:l,localePacks:i,updated_at:a})}catch(r){t(r)}})}async function As(o,e){return new Promise(async(t,r)=>{try{let{url:n,updated_at:i}=await Rs(o,e),a=await Mt()(n).then(l=>l.arrayBuffer()),s=new Uint8Array(a);t({compressed:s,updated_at:i})}catch(n){r(n)}})}async function Rs(o,e){if(o.bundleUri!=null)return{url:await Zy(o.bundleUri),updated_at:""};if(e==null||e==="")throw new Error("Missing access token.");let t=new URL(`${o.baseUri?Fr(o.baseUri):Or}api/v1/venue/${o.mapId}/mvf`);o.viewId&&t.searchParams.set("configId",o.viewId),o.mvfVersion&&t.searchParams.set("version",mp(o.mvfVersion));let r=await Mt()(t.toString(),{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}function Ip(o){return rs(o)}function Ky(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 Ds(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 r=Cs(o);if(!Ky(r))throw new Error("MVF is missing some expect static files. Unzipping failed.");let n={},i=Object.keys(r);for(let a of i){if(r[a].length===0)continue;let s=a.split("/");if(s.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(s.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(s.length===1){n[s[0]]=r[a];continue}if(s[0]==="image"){_.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else n[s[0]]==null&&(n[s[0]]={}),n[s[0]][s[1]]=r[a]}e(n)}catch(r){t(r)}})}function Ao(){let o="us",e={};function t(){return eb(Qd(o),e)}return{updateByUserOption(r){r.environment&&(o=r.environment),r.baseUri&&(e.baseUri=r.baseUri),r.baseAuthUri&&(e.baseAuthUri=r.baseAuthUri),r.analytics?.baseUri&&(e.analyticsBaseUri=r.analytics?.baseUri)},updateTileServerBaseUrl(r){e.tileServerUri=r},updateEnvironment(r){o=r},setEnterprise(r){(o==="us"||o==="us-enterprise")&&(o=r?"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 eb(o,e){return{...o,...e}}var Ri=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_",""))},Sn=o=>o?.cms!=null,Di=o=>{let e=Object.values(o.floorStacks??{}),t=(o.outdoors?.floors?.length??0)>0;return e.length+(t?1:0)<=1?[]:e.map(r=>r.id.replace("fs_",""))};var tb=o=>{let e=performance.now(),t=ns.decompressUnsafeSync(o),r=t.isOk()?t.unwrap():void 0,n=r?.manifest?.features?.[0]?.properties?.version;if(r==null||!String(n).startsWith("3."))throw new re(`mvfVersion '3.0.0-native' needs an MVFv3 bundle, but this bundle is ${n!=null?`MVF ${n}`:"not a valid MVF"}.`);return _.log(`Parsed MVFv3 (native) in ${performance.now()-e}ms`),r},gp=async o=>{let e=performance.now(),t,r=ns.decompressUnsafeSync(o);r.isOk()?t=r.unwrap():_.error("MVFv3 decompression failed!");let n;if(t)try{n=dd(t)}catch(i){_.error("MVFv3 to MVFv2 conversion failed!",i)}if(_.log(`Parsed MVFv3 in ${performance.now()-e}ms`),!n)throw new Error("Failed to parse MVFv2 from MVFv3!");return{kind:"v2",mvf2:n,mvf3:t}};async function ki(o,e="2.0.0"){switch(e){case"2.0.0":case"2.0.0-c":try{let t=performance.now(),r=await Ds(o),n=rs(r);return _.log(`Parsed MVFv2 in ${performance.now()-t}ms`),{kind:"v2",mvf2:n}}catch{return _.error("MVFv2 parsing failed! Trying MVFv3."),gp(o)}case"3.0.0":return gp(o);case"3.0.0-native":return{kind:"v3-native",mvf3:tb(o)};default:throw new Error(`Unsupported MVF version: ${e}`)}}f();f();function ob(o,e,t){t===void 0&&(t={});for(var r=Po(o),n=xr(e),i=0;i<n.length-1;i++){var a=!1;if(t.ignoreEndVertices&&(i===0&&(a="start"),i===n.length-2&&(a="end"),i===0&&i+1===n.length-1&&(a="both")),rb(n[i],n[i+1],r,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function rb(o,e,t,r,n){var i=t[0],a=t[1],s=o[0],l=o[1],c=e[0],d=e[1],p=t[0]-s,g=t[1]-l,m=c-s,I=d-l,v=p*I-g*m;if(n!==null){if(Math.abs(v)>n)return!1}else if(v!==0)return!1;if(r){if(r==="start")return Math.abs(m)>=Math.abs(I)?m>0?s<i&&i<=c:c<=i&&i<s:I>0?l<a&&a<=d:d<=a&&a<l;if(r==="end")return Math.abs(m)>=Math.abs(I)?m>0?s<=i&&i<c:c<i&&i<=s:I>0?l<=a&&a<d:d<a&&a<=l;if(r==="both")return Math.abs(m)>=Math.abs(I)?m>0?s<i&&i<c:c<i&&i<s:I>0?l<a&&a<d:d<a&&a<l}else return Math.abs(m)>=Math.abs(I)?m>0?s<=i&&i<=c:c<=i&&i<=s:I>0?l<=a&&a<=d:d<=a&&a<=l;return!1}var Tp=ob;f();function nb(o,e){e===void 0&&(e={});var t=Er(o),r=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return Sr([r,n],e.properties,e)}var Ar=nb;f();f();function ib(o,e,t){t===void 0&&(t={});var r=Po(o),n=Po(e),i=ro(n[1]-r[1]),a=ro(n[0]-r[0]),s=ro(r[1]),l=ro(n[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return pd(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),t.units)}var Ro=ib;function Ni(o,e){return e===void 0&&(e={}),gd(o,function(t,r){var n=r.geometry.coordinates;return t+Ro(n[0],n[1],e)},0)}f();f();f();function Li(o,e,t){if(t===void 0&&(t={}),t.final===!0)return ab(o,e);var r=Po(o),n=Po(e),i=ro(r[0]),a=ro(n[0]),s=ro(r[1]),l=ro(n[1]),c=Math.sin(a-i)*Math.cos(l),d=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(a-i);return ud(Math.atan2(c,d))}function ab(o,e){var t=Li(e,o);return t=(t+180)%360,t}function sb(o,e,t){t===void 0&&(t={});var r=Sr([1/0,1/0],{dist:1/0}),n=0;return hd(o,function(i){for(var a=xr(i),s=0;s<a.length-1;s++){var l=Sr(a[s]);l.properties.dist=Ro(e,l,t);var c=Sr(a[s+1]);c.properties.dist=Ro(e,c,t);var d=Ro(l,c,t),p=Math.max(l.properties.dist,c.properties.dist),g=Li(l,c),m=as(e,p,g+90,t),I=as(e,p,g-90,t),v=md(pn([m.geometry.coordinates,I.geometry.coordinates]),pn([l.geometry.coordinates,c.geometry.coordinates])),y=null;v.features.length>0&&(y=v.features[0],y.properties.dist=Ro(e,y,t),y.properties.location=n+Ro(l,y,t)),l.properties.dist<r.properties.dist&&(r=l,r.properties.index=s,r.properties.location=n),c.properties.dist<r.properties.dist&&(r=c,r.properties.index=s+1,r.properties.location=n+d),y&&y.properties.dist<r.properties.dist&&(r=y,r.properties.index=s),n+=d}}),r}var xn=sb;function lb(o,e,t){var r=xr(t);if(fd(t)!=="LineString")throw new Error("line must be a LineString");var n=xn(t,o),i=xn(t,e),a;n.properties.index<=i.properties.index?a=[n,i]:a=[i,n];for(var s=[a[0].geometry.coordinates],l=a[0].properties.index+1;l<a[1].properties.index+1;l++)s.push(r[l]);return s.push(a[1].geometry.coordinates),pn(s,t.properties)}var ks=lb;var cb=1e-7;function Ns(o){return{type:"Point",coordinates:o}}function db(o,e){let{coordinates:t}=e.geometry,{coordinates:r}=o.geometry,n=t.map(i=>xn(o,Ns(i)));return r.reduce((i,a)=>{let s=ks(Ns(a),n[0],o),l=ks(Ns(a),n[1],o),c=Ni(s)<Ni(l)?s:l;return c.properties={...o.properties,entrances:[]},i.concat([c])},[])}function Ls(o,e){return e.reduce((t,r)=>{let n={epsilon:cb},i=t.obstructions.findIndex(s=>Tp(Ar(r),s,n)),a=t.obstructions[i];if(a){let[s,l]=db(a,r);t.entrances.push(r),t.obstructions.splice(i,1,s,l)}return t},{obstructions:[o],entrances:[]})}f();f();var Mn=class{#e;searchInstance;#t;#o;enabled=!1;constructor(e,t,{enabled:r=!1}={}){this.#e=e,this.#t=t,this.#o=()=>{this.searchInstance?.then(n=>n.populate())},r&&this.enable()}async query(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return _.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(r){return _.error("Search.query failed due to",r),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return _.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(r){return _.error("Search.suggest failed due to",r),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-GAAKLDRM.js").then(({InternalSearch:e})=>new e(this.#e))),this.#t.on("language-change",this.#o),await this.searchInstance)}};var vp={"enterprise-location":"location-profile","enterprise-category":"location-category"},Sp={"location-profile":"enterprise-location","location-category":"enterprise-category"},xp=new WeakMap,Bs=class{#e;#t;Analytics;Search;Query;Nodes;internal;constructor(e,{search:t}={}){this.#e=new St,this.#t=e,xp.set(this,e),this.Analytics=new yn(e.Analytics),this.Query=e.Query,this.Nodes=e.Nodes,this.internal=e,this.Search=new Mn(this,e,{enabled:t?.enabled}),this.#t.on("language-change",r=>{this.#e.publish("language-change",r)})}on=(e,t)=>{this.#e.on(e,t)};off=(e,t)=>{this.#e.off(e,t)};getEnv(){return this.#t.getEnv()}getAccessToken(){return this.#t.tokenManager?.getAccessToken().token}get updatedAt(){return this.#t.updatedAt}async checkForUpdates(){let e=this.#t,t=e.getMapDataOptions;if(t==null||e.updatedAt==null)throw new re("checkForUpdates requires a MapData loaded via getMapData(). This MapData has no load-time `updated_at` timestamp to compare against (e.g. it was hydrated from a local bundle via hydrateMapData()).");if(t.bundleUri!=null)return{hasChanges:!1,updatedAt:e.updatedAt??""};let r="";if(e.enterpriseMode){let n=vn(t),i=Ps(n),{updated_at:a}=await Fs(n,i);r=a??""}else{let n=await e.tokenManager?.getAccessTokenAsync(),{updated_at:i}=await Rs(t,n?.token);r=i??""}return{hasChanges:r!==(e.updatedAt??""),updatedAt:r}}get mapName(){return this.#t.mapName}get mapId(){return this.#t.getMapDataOptions?.mapId}get isEnterpriseMode(){return this.#t.enterpriseMode}get mapCenter(){return this.#t.mapCenter}get organizationId(){return this.#t.organizationId}get outdoorViewToken(){return this.#t.outdoorViewToken}getByType(e){e==="node"&&this.#o("getByType('node')","mapData.Nodes.getByType(floor)");let t=this.#t.getByType(e);if(Array.isArray(t)&&t.length===0){let r=this.isEnterpriseMode;!r&&e in vp?_.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is a Maker map (API key starts with 'mik_'). Use '${vp[e]}' instead. See https://developer.mappedin.com/web-sdk/getting-started`):r&&e in Sp&&_.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is an Enterprise map. Use '${Sp[e]}' instead. See https://developer.mappedin.com/web-sdk/getting-started`)}return t}getById(e,t){return e==="node"&&this.#o("getById('node', id)","mapData.Nodes.getById(id)"),this.#t.getById(e,t)}getByExternalId(e,t){return e==="node"&&this.#o("getByExternalId('node', id)","mapData.Nodes.getByExternalId(id)"),this.#t.getByExternalId(e,t)}#o(e,t){if(this.#t.mvf==null)throw new re(xt(e,t))}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return this.#t.changeLanguage(e)}get currentLanguage(){return this.#t.currentLanguage}get naturalBearing(){return this.#t.naturalBearing??0}__LEGACY_GET_DIRECTIONS_SYNC=(e,t,r)=>this.#t.__LEGACY_GET_DIRECTIONS_SYNC(e,t,r);getDirections=(e,t,r)=>this.#t.getDirections(e,t,r);__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,r)=>this.#t.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,r);getDirectionsMultiDestination=(e,t,r)=>this.#t.getDirectionsMultiDestination(e,t,r);getDistance(e,t){return this.#t.getDistance(e,t)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return this.#t.toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return this.#t.toJSONBundle({downloadLanguagePacks:e})}},En=Bs;function Cn(o){let e=xp.get(o);if(!e)throw new Error("MapDataInternal not found");return e}f();f();f();var Ge=class{id;constructor(e){this.id=e}};f();f();var Vs=class o{static __type="coordinate";__type=o.__type;id=ae();latitude;longitude;floorId;verticalOffset;#e={};static is(e){return e.__type===o.__type}constructor(e,t,r){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=r,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]}},X=Vs;function js(o){let e=o.enterprise?.locations?.reduce((n,i)=>(n[i.id]=i,n),{})||{};for(let n of o.enterprise?.locationInstances||[])e[n.id]=n;let t={};for(let n of o["floorstack.json"]||[])t[n.id]=n;let r={};for(let n of o["floor.geojson"]?.features||[])n.properties&&n.properties.id&&(r[n.properties.id]=n.properties);return{type:"downloaded",data:o,optimized:{"enterprise-location":e,"enterprise-category":o.enterprise?.categories?.reduce((n,i)=>(n[i.id]=i,n),{})||{},"floor-stack":t,floor:r}}}var pb=/^https?:\/\/cdn(-staging)?\.mappedin\.com(\/|$)/;function Mp(o){return pb.test(o)}function Ep(o){return!!o.split("?")[1]?.includes("sv=")}function ze(o,e,t,r){let n=r||"unknown";if(o==null)return _.error(`Cannot get the center coordinate for "${n}" because it has no geometry.`),new X({latitude:0,longitude:0,floorId:e});try{if(o.type==="LineString"){let[[i,a],[s,l]]=o.coordinates,c=(i+s)/2,d=(a+l)/2;return new X({latitude:d,longitude:c,floorId:e})}else if(o.type==="Point"){let[i,a]=o.coordinates;return new X({latitude:a,longitude:i,floorId:e})}else if(o.type==="Polygon"&&t!=null){let[i,a]=t;return new X({latitude:a,longitude:i,floorId:e})}}catch{}try{let[i,a]=Ar(o).geometry.coordinates;return new X({latitude:a,longitude:i,floorId:e})}catch(i){return _.error(`Failed to get center coordinate for "${n}" ${i instanceof Error?i.stack:""}`),new X({latitude:0,longitude:0,floorId:e})}}function Do(o,e){return e&&(o.flags[e.index]&1<<e.bit)!==0}function Bi(o,e){let t=o.instanceLocationsByPolygonId?.[e];if(t)return[t];let r=[],n=o.locationIdsByGeometryId[e];if(n)for(let i of n){let a=o.getById("enterprise-location",i);a&&r.push(a)}return r}var Gs=class o extends Ge{static __type="node";__type=o.__type;#e;#t={};#o;#r;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id),this.#e=e,this.#o=t.record.floorId,this.#r=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.#r.populated?.spaceIds??this.#e.navigationNodes.spaceIdsForNode(this.id);return this.#e.getById("space",e[0])}get object(){let e=this.#r.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=ze(this.#r.geometry,this.#o,void 0,this.#r.id)),this.#t.coordinate}get externalId(){return this.#r.externalId??""}get neighbors(){if(this.#e.mvf==null)throw new re(xt("Node.neighbors","node.getNeighbors()"));return this.#t.neighbors==null&&(this.#t.neighbors=this.#e.navigationNodes.nodes(this.#r.neighborIds)),this.#t.neighbors}async getNeighbors(){let e=this.#e.navigationNodes;return e.nodes(e.neighborIdsForNode(this.id))}get navigationFlags(){if(this.#t.navigationFlags==null){let e=[],t=this.#r.flags;if(t!=null&&t.length>0)for(let[r,n]of Object.entries(this.#e.navigationFlags))t.length>n.index&&t[n.index]!=null&&Do({flags:t},n)&&e.push(r);this.#t.navigationFlags=Object.freeze(e)}return this.#t.navigationFlags}get geoJSON(){return{type:"Feature",geometry:this.#r.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.#r.neighborIds]}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},it=Gs;f();f();f();f();var Us=class o extends Ge{static __type="hyperlink";__type=o.__type;#e={};#t;static is(e){return e.__type===o.__type}constructor(e){super(String(ae())),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]}},rr=Us;f();f();function _n(o){return typeof o=="string"?o:o?.id??""}function Cp(o){return Array.isArray(o)&&Number.isFinite(o[0])&&Number.isFinite(o[1])}var ub=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,fb=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,hb=o=>ub.test(o)||fb.test(o),gb=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,mb=/^https:\/\/cdn-staging\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,yb=o=>hb(o)?!1:gb.test(o)||mb.test(o),Rr=o=>{if(!yb(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,r,n]=o.split("/"),i=n.split(".").pop()??"";return{origin:e+t,mapId:r,fileName:n,fileType:i}};function Hs(o){return o.reduce((e,t,r)=>r===0?e:e+Dt(o[r-1].toGeoJSON().coordinates,t.toGeoJSON().coordinates),0)}function bo(o){return o!=null&&typeof o=="object"&&"__type"in o&&o.__type!==null&&typeof o.__type=="string"}function Ws(o){return o!=null&&typeof o=="object"&&"name"in o&&o.name!=null&&typeof o.name=="string"&&o.name!==""}function _p(o){return bo(o)&&Ws(o)}var zs=class o extends Ge{static __type="image";__type=o.__type;#e={};#t;#o;static is(e){return e.__type===o.__type}constructor(e){super(String(ae())),this.#t=e.mvfData,this.#o=e.mapData}get url(){let e=this.#t.url;if(this.#o.tokenManager==null)return e;let t=Rr(this.#t.url);if(t==null)return e;let r=t.mapId;try{if(this.#o.tokenManager.isEnterpriseMode())return e;let n=this.#o.tokenManager.getSasToken(r).token;if(n==null||n==="")throw new Error("SAS token empty!");return`${e}?${n}`}catch(n){return t.fileType!=="svg"&&_.error("Error getting SAS token for image",{error:n,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]}},io=zs;f();var Wt=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=Er(this.geoJSON),this.#e)}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};var Ue=class extends Wt{#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 io({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 rr({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}}};f();var Ct=class o{#e;#t;#o;target;static __type="image-3d";__type=o.__type;static is(e){return e.__type===o.__type}constructor(e,t,r,n){this.#e=e,this.#t=t,this.target=r,this.#o=n}get id(){return this.#e}get url(){if(this.#o==null)return this.#t;let e=Rr(this.#t);if(e==null)return this.#t;let t=e.mapId;try{if(this.#o.isEnterpriseMode())return this.#t;let r=this.#o.getSasToken(t).token;if(r==null||r==="")throw new Error("SAS token empty!");return`${this.#t}?${r}`}catch(r){return e.fileType!=="svg"&&_.error("Error getting SAS token for image",{error:r,url:this.#t}),this.#t}}};f();f();function Io(o){let e;if(X.is(o))e=o;else if(at.is(o))e=o.coordinates[0];else if(zt.is(o))if(o.spaces.length>0)e=o.spaces[0].center;else return;else if(Ee.is(o))if(o.coordinates.length>0)e=o.coordinates[0];else return;else if("center"in o&&X.is(o.center))e=o.center;else if("coordinate"in o&&X.is(o.coordinate))e=o.coordinate;else return;return e}f();f();var Fn={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},ao="ExteriorWalls",ko="Walls",Fp=0,Dr="InteriorDoors",kr="ExteriorDoors",Nr="InteriorDoorsLayer",Lr="ExteriorDoorsLayer",Pe="GeometryLayer",On="Focusable-",so="LabelsLayer",$t="MarkersLayer",Pn="FootprintLayer",nr="OcclusionLayer",ir="AreasLayer",Br="ImagesLayer",ar="FacadesLayer",lo="PathsLayer",Xt="ModelsLayer",sr="Text3DLayer",bb="geometryText",Ib="floortext";function Op(o){return`${sr}-${o}`}function No(o){return`${bb}-${o}`}function Vr(o){return`${Ib}-${o}`}var Pp=["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"],Tb={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var vb=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors","shadows"]),Sb=new Set(["style","enabled","layersHiddenByGeometry","lowDpi","__EXPERIMENTAL_CameraControlsMode"]);function $s(o){o.outdoorView?.enabled&&!o.outdoorView?.token&&_.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function xb(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,...r}=e;return t===!1?!1:Object.keys(r).length>0?r:!0}function Xs(o){return o.__EXPERIMENTAL_shadows!==void 0&&_.warn("`__EXPERIMENTAL_shadows` is deprecated \u2014 use `shadows` instead."),o.shadows??xb(o)}function Ys(o,e){let t=o?.outdoorView?.token||e.outdoorViewToken,r={...Fn,...o,outdoorView:{enabled:o?.outdoorView?.enabled===void 0?!!t:o?.outdoorView?.enabled,layersHiddenByGeometry:Fn.outdoorView?.layersHiddenByGeometry,...o?.outdoorView},bearing:o?.bearing??e.naturalBearing??0,imagePlacementOptions:{...Fn.imagePlacementOptions,...o?.imagePlacementOptions},multiFloorView:{...Fn.multiFloorView,...o?.multiFloorView},disableUpdateStateValidation:o?.disableUpdateStateValidation??!1,shadows:Xs(o??{})};return t&&r.outdoorView&&(r.outdoorView.token=t),r}function wp(o){let e={remove_watermark:!1};if(o)try{let t=Ei(o);Object.assign(e,t.capabilities)}catch(t){_.error("Error decoding capabilities from token",t)}return e}function Ap(o){let e=Object.fromEntries(Object.entries(o).filter(([t])=>vb.has(t)));return e.outdoorView&&(e.outdoorView=Object.fromEntries(Object.entries(e.outdoorView).filter(([t])=>Sb.has(t)))),e}var Zs=class o extends Ue{static __type="area";__type=o.__type;#e;#t;#o={};#r;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.#r=t.record}get center(){return this.#o.center==null&&(this.#o.center=ze(this.#r.geometry,this.#t,this.#r.center,this.#r.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.#i();return t?[...e,t]:e}#i(){if(this.#r.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new Ct(`${this.id}-polygon-image-${ae()}`,this.#r.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get geoJSON(){return{type:"Feature",geometry:this.#r.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(){}},$e=Zs;f();var Js=class o extends Ue{static __type="door";__type=o.__type;#e;#t;#o;#r;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.#r=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=ze(this.#r.geometry,this.#o,void 0,this.#r.id)),this.#t.center}get isExterior(){return this.#r.isExterior??!1}get geoJSON(){return{type:"Feature",geometry:this.#r.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]}},Ae=Js;f();var qs=class o extends Ue{static __type="space";__type=o.__type;#e;#t;#o={};#r;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.#r=t.record}get type(){return Eb(this.#r.kind)}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=Bi(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.#r.doorIds.map(e=>this.#e.getById("door",e)).filter(wo),this.#o.doors)}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#i();return t?[...e,t]:e}#i(){if(this.#r.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new Ct(`${this.id}-polygon-image-${ae()}`,this.#r.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get center(){return this.#o.center==null&&(this.#o.center=ze(this.#r.geometry,this.#t,this.#r.center,this.#r.id)),this.#o.center}get geoJSON(){return{type:"Feature",geometry:this.#r.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]}},Mb=["room","hallway","exterior","void","gate","otb"];function Eb(o){if(o==null||o==="default")return"room";let e=o.toLowerCase();return Mb.includes(e)?e:"room"}var Te=qs;f();var Qs=class o extends Wt{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}#r(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.#r("name");return typeof e=="string"?e:""}get shortName(){if(!("shortName"in this.#o))return this.#o.externalId??"";let e=this.#r("shortName");return typeof e=="string"?e:""}get subtitle(){let e=this.#r("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=ze(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]}},Xe=Qs;f();var Ks=class o extends Ue{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 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 X({latitude:e.coordinates[1],longitude:e.coordinates[0],floorId:e.floorId}))),this.#t.coordinates}get nodes(){if(this.#e.mvf==null)throw new re(xt("Connection.nodes","mapData.Nodes.getByType(connection)"));return this.#o.nodeIds.map(e=>this.#e.getById("node",e)).filter(wo)}get floors(){return this.coordinates.map(e=>e.floorId?this.#e.getById("floor",e.floorId):void 0).filter(wo)}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]}},Ee=Ks;f();var el=class o extends Ue{static __type="object";__type=o.__type;#e;#t;#o={};#r;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.#r=t.record}get type(){let e=this.#r.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=Bi(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=ze(this.#r.geometry,this.#t,this.#r.center,this.#r.id)),this.#o.center}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#i();return t?[...e,t]:e}#i(){if(this.#r.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new Ct(`${this.id}-polygon-image-${ae()}`,this.#r.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get geoJSON(){return{type:"Feature",geometry:this.#r.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}},Le=el;f();var tl=class o extends Ue{static __type="point-of-interest";__type=o.__type;#e;#t;#o={};#r;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.#r=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=ze(this.#r.geometry,this.#t,this.#r.center,this.#r.id)),this.#o.coordinate}get geoJSON(){return{type:"Feature",geometry:this.#r.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}},ft=tl;f();var ol=class o extends Ue{static __type="annotation";__type=o.__type;#e;#t;#o={};#r;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.#r=t.record}#i(){let[e,t]=this.#r.symbolId.split("--");return{group:e,type:t}}get group(){return this.#i().group}get type(){return this.#i().type}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=ze(this.#r.geometry,this.#t,void 0,this.#r.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.#r.symbol?.name||""}get icon(){if(this.#o.icon==null){let e=this.#r.symbol??{url:"",name:""};this.#o.icon=super.icon||new io({mvfData:{url:e.url,altText:e.name},mapData:this.#e})}return this.#o.icon}get geoJSON(){return{type:"Feature",geometry:this.#r.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]}},ht=ol;f();f();var Rp=dn(il(),1);function Cb(o,e,t){t===void 0&&(t={});var r=Mr(o),n=Mr(e),i=Rp.default.union(r.coordinates,n.coordinates);return i.length===0?null:i.length===1?xi(i[0],t.properties):Mi(i,t.properties)}var Vi=Cb;var al=class o extends Wt{static __type="floor-stack";__type=o.__type;#e;#t={};#o;#r;static is(e){return e.__type===o.__type}constructor(e,t){super(t.record.id,e),this.#e=e,this.#o=t.record,this.#r=t.facadeId}#i(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.#i("name");return typeof e=="string"?e:""}get shortName(){let e=this.#i("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,r)=>{let n=this.#e.floorsById[r];return n&&t.push(n),t},[]);e.length===0&&_.error(`Floor stack ${this.id} has no floors`),this.#t.floors=e.sort((t,r)=>t.elevation-r.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((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r),this.#t.defaultFloor}get facade(){return this.#r?this.#e.facadesById[this.#r]: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 r=t.geoJSON;e==null?e=r:e=Vi(e,r)}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]}},Lo=al;f();var sl=class o extends Wt{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 r of this.spaces){let n=this.#t.geometryById[r.id];n?.kind==="space"&&e.push({type:"Feature",geometry:n.geometry,properties:null})}if(e.length===0)throw new re("No geometry found for facade!");let t=Ar({type:"FeatureCollection",features:e});this.#o.center=new X({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}}},Ce=sl;f();f();var st=()=>({byId:Object.create(null),byFloorId:Object.create(null)});f();var ji=()=>({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)});f();var Dp=(o,e,t)=>{let r=Object.create(null),n=Object.create(null),i=Object.create(null);if(o.annotations==null||o.annotationSymbols==null||o.geometry==null)return{annotationsById:r,annotationRecordsById:n,annotationRecordsByFloorId:i};let a=o.annotationSymbols;for(let[s,l]of Object.entries(o.annotations))if(!(l==null||l.length===0||!o.geometry[s]?.features.length)){i[s]=[];for(let c of l){let d=t.featureById.get(c.geometryId)?.geometry;if(d?.type!=="Point")continue;let p={id:c.id,floorId:s,symbolId:c.symbolKey,geometry:d,symbol:a[c.symbolKey],details:void 0,externalId:c.externalId};n[c.id]=p,i[s].push(p),r[c.id]=new ht(e,{floorId:s,record:p})}}return{annotationsById:r,annotationRecordsById:n,annotationRecordsByFloorId:i}};f();f();function jr(o){let e=new Set,t=[];for(let r of o){let n=`${r.floorId}:${r.coordinates[0]},${r.coordinates[1]}`;e.has(n)||(e.add(n),t.push(r))}return t}f();function kp(o,e){let t=o.featureById.get(e.geometryId)?.geometry;if(t==null)return null;let r=ze(t,e.floorId);return{floorId:e.floorId,coordinates:[r.longitude,r.latitude]}}f();function ll(o,e){return o.type==="door"&&o.entrances.every(t=>e.featureById.get(t.geometryId)?.geometry.type==="LineString")}function _b(o){return o.entrances.length===0||o.exits.length===0?!1:new Set([...o.entrances,...o.exits].map(e=>e.floorId)).size>=2}var cl=(o,e)=>ll(o,e)&&!_b(o),Np=(o,e,t)=>{let r={doorsById:Object.create(null),doorsByExternalId:Object.create(null),doorRecordsById:Object.create(null),doorRecordsByFloorId:Object.create(null),geometryIndex:st(),entranceGeometryIdsByDoorId:new Map},n=o.navigationFlags?.outdoors;for(let i of o.connections??[]){if(!cl(i,t))continue;let a=i.entrances.some(p=>Do(p,n))||i.exits.some(p=>Do(p,n)),{details:s}=i,l=s!=null?{name:s.name,description:s.description,...s.icon?{images:[{url:s.icon,altText:`${s.name} icon`}]}:{}}:void 0,c=s?.externalId||void 0,d=[];for(let p of i.entrances){let g=t.featureById.get(p.geometryId)?.geometry;if(g?.type!=="LineString")continue;d.push(p.geometryId);let m={id:i.id,floorId:p.floorId,geometry:g,externalId:c,details:l,isExterior:!!a};r.doorRecordsById[i.id]=m,(r.doorRecordsByFloorId[p.floorId]??=[]).push(m),r.geometryIndex.byId[i.id]={id:i.id,floorId:p.floorId,kind:"entrance",geometry:g},(r.geometryIndex.byFloorId[p.floorId]??=[]).push(r.geometryIndex.byId[i.id]),r.doorsById[i.id]=new Ae(e,{floorId:p.floorId,record:m}),c&&(r.doorsByExternalId[c]??=[]).push(r.doorsById[i.id])}r.entranceGeometryIdsByDoorId.set(i.id,d)}return r};var Lp=(o,e,t)=>{let r=Object.create(null),n=Object.create(null),i=o.navigationFlags?.accessible;for(let a of o.connections??[]){if(cl(a,t))continue;let s=i!=null&&a.entrances.some(c=>Do(c,i))&&a.exits.some(c=>Do(c,i)),l={id:a.id,type:a.type,externalId:a.details?.externalId??"",accessible:!!s,nodeIds:[],anchors:jr([...a.entrances,...a.exits].map(c=>kp(t,c)).filter(c=>c!=null))};a.extra&&(l.extra=a.extra),a.details?.name&&(l.details={name:a.details.name}),n[a.id]=l,a.type!=="door"&&(r[a.id]=new Ee(e,{record:l}))}return{connectionsById:r,connectionRecordsById:n}};f();var Fb=o=>`fc_${o.slice(3)}`,Ob="outdoors",Bp=(o,e,t)=>{let r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=Object.create(null),c=Object.create(null),d=Object.create(null),p=Object.create(null);for(let I of o.floors.features){let{id:v,elevation:y,subtitle:E,maxHeight:k,details:w}=I.properties,B={id:v,elevation:y,geometry:I.geometry??void 0,name:w?.name??"",externalId:w?.externalId??""};w?.shortName!==void 0&&(B.shortName=w.shortName),E!==void 0&&(B.subtitle=E),k!==void 0&&(B.maxHeight=k),i[v]=B,r[v]=new Xe(e,{record:B}),B.externalId&&(n[B.externalId]??=[]).push(r[v])}let g=new Map;for(let[I,v]of Object.entries(o.facade??{}))for(let y of Object.values(v??{})){let E=g.get(y.floorStackId)??[];for(let k of y.geometryIds)E.push({floorId:I,spaceId:t.space.get(k)?.ids[0]??""});g.set(y.floorStackId,E)}let m=(o.floorStacks??[]).map(I=>{let v={id:I.id,floorIds:I.floors,type:"Building",name:I.details?.name??"",shortName:I.details?.shortName??"",externalId:I.details?.externalId??""};return I.defaultFloor&&(v.defaultFloor=I.defaultFloor),v});o.outdoors!=null&&o.outdoors.floors.length>0&&m.push({id:Ob,floorIds:o.outdoors.floors,type:"Outdoor",name:"Outdoor",externalId:"outdoors"});for(let I of m){let v=g.get(I.id),y=v!=null?Fb(I.id):void 0;if(l[I.id]=I,a[I.id]=new Lo(e,{record:I,facadeId:y}),I.externalId&&(s[I.externalId]??=[]).push(a[I.id]),v!=null&&y!=null){let E={id:y,floorStackId:I.id,spaceIds:v.map(k=>k.spaceId),floorId:v[0]?.floorId};d[y]=E,c[y]=new Ce(e,{record:E});for(let k of v)p[k.spaceId]=c[y]}}return{floorsById:r,floorsByExternalId:n,floorRecordsById:i,floorStacksById:a,floorStacksByExternalId:s,floorStackRecordsById:l,facadesById:c,facadeRecordsById:d,facadesBySpaceId:p}};f();var Gi=(o,e,t)=>o.startsWith(e)?t+o.slice(e.length):o,Vp=o=>Gi(o,"g_","s_"),jp=o=>Gi(o,"g_","o_"),Pb=o=>Gi(o,"g_","ar_"),wb=o=>Gi(o,"g_","w_");function Ab(o,e,t){switch(o.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let r=o.type.replace("Multi","");return o.coordinates.map((n,i)=>({id:`${e}-${i}`,geometry:{type:r,coordinates:n},kind:t}))}default:return[{id:e,geometry:o,kind:t}]}}function Rb(o){let e=new Map;for(let t of Object.values(o.kinds??{}))if(t!=null)for(let[r,n]of Object.entries(t))e.set(r,n);for(let t of o.connections??[])if(t.type!=="door")for(let r of[...t.entrances,...t.exits])e.set(r.geometryId,`connection.${t.type}`);return e}var Gp=o=>{let e=new Set;for(let t of Object.values(o??{}))if(t!=null)for(let r of Object.keys(t))e.add(r);return e};function Up(o){let e=Rb(o),t=new Map,r=[];for(let[p,g]of Object.entries(o.geometry??{}))for(let m of g?.features??[])t.set(m.properties.id,m),r.push({feature:m,floorId:p});let n=Gp(o.walkable),i=Gp(o.nonwalkable),a=p=>new Set([...e].filter(([,g])=>g===p).map(([g])=>g)),s=a("area"),l=(p,g)=>{let m=new Map;if(p.size===0)return m;for(let{feature:I,floorId:v}of r){let y=I.properties.id;if(!p.has(y))continue;let E=Ab(I.geometry,g(y),e.get(y));m.set(y,{ids:E.map(k=>k.id),parts:E,floorId:v,source:I})}return m},c=new Set([...n].filter(p=>!s.has(p))),d={space:l(c,Vp),obstruction:l(i,jp),area:l(s,Pb),object:l(a("object"),jp),window:l(a("window"),wb),kindById:e,featureById:t,footprintIds:new Set((o.defaultStyle?.ExteriorWalls?.geometryAnchors??[]).map(p=>p.geometryId))};return n.size===0&&i.size===0&&s.size===0&&(d.space=l(new Set(r.map(({feature:p})=>p.properties.id)),Vp)),d}f();var Hp=(o,e,t)=>{let r=o.get(e);r?r.push(t):o.set(e,[t])};function Db(o,e){let t={annotationIdsByGeometryId:new Map,connectionIdsByGeometryId:new Map,doorIdsByGeometryId:new Map};for(let r of Object.values(o.annotations??{}))for(let n of r??[])Hp(t.annotationIdsByGeometryId,n.geometryId,n.id);for(let r of o.connections??[]){let n=ll(r,e)?t.doorIdsByGeometryId:t.connectionIdsByGeometryId,i=new Set;for(let a of[...r.entrances,...r.exits]){let s=`${a.geometryId}_${a.floorId}`;i.has(s)||(i.add(s),Hp(n,a.geometryId,r.id))}}return t}function kb(o){let e=new Set,t=0;for(let r of o)e.has(r)||(e.add(r),o[t++]=r);o.length=t}var Wp=(o,e,t)=>{let r={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)},n=Db(o,t);for(let i of o.locations??[]){let a={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:l}of i.geometryAnchors)a.spaceIds.push(...t.space.get(l)?.ids??[]),a.objectIds.push(...t.obstruction.get(l)?.ids??[]),a.areaIds.push(...t.area.get(l)?.ids??[]),a.doorIds.push(...n.doorIdsByGeometryId.get(l)??[]),a.connectionIds.push(...n.connectionIdsByGeometryId.get(l)??[]),a.annotationIds.push(...n.annotationIdsByGeometryId.get(l)??[]);for(let l of[a.spaceIds,a.objectIds,a.areaIds,a.doorIds,a.connectionIds,a.annotationIds])kb(l);let s=new zt(e,{record:a});r.locationProfileRecordsById[i.id]=a,r.locationProfilesById[i.id]=s,a.externalId&&(r.locationProfilesByExternalId[a.externalId]??=[]).push(s);for(let l of a.categoryIds??[])(r.locationProfilesByCategoryId[l]??=[]).push(s);for(let l of[...a.objectIds,...a.spaceIds,...a.annotationIds,...a.connectionIds,...a.doorIds,...a.areaIds])l&&(r.locationProfilesByAttachedFeatureId[l]??=[]).push(s)}for(let i of o.locationCategories??[]){let a={id:i.id,name:i.details.name,icon:i.details.icon??"",parent:i.parent};r.locationCategoryRecordsById[i.id]=a,r.locationCategoriesById[i.id]=new Gr(e,{record:a}),i.parent&&(r.locationCategoriesByParentId[i.parent]??=[]).push(r.locationCategoriesById[i.id])}return r};f();f();var zp=new Set(["wall","area"]),$p=new Set(["desk-entrance"]);function Ui(o,e){return!(o==="Polygon"||o==="MultiPolygon")&&e===null||e?.includes("connection")||$p.has(e??"")?"skip":e==="poi"||o==="Point"&&e==null?"poi":o==="Point"?"unknown-point":"space"}function Hi(o){return!zp.has(o?.toLowerCase()??"")}f();var Yp=dn(gy(),1);function wn(o){if(o.type==="Polygon")try{let e=Nb(o);if(e==null)return;if(Lb(e,o))return e;let[t,r]=(0,Yp.default)(o.coordinates,Bb(o));return[t,r]}catch{return}}function Nb(o){let e=o.coordinates,t=0,r=0,n=0;for(let m of e)for(let I=0;I<m.length-1;I++)t+=m[I][0],r+=m[I][1],n++;if(n===0)return;let i=t/n,a=r/n,s=0,l=0,c=0,d,p;for(let m of e)for(let I of m){let v=I[0]-i,y=I[1]-a;if(d!==void 0&&p!==void 0){let E=d*y-v*p;c+=E,s+=(d+v)*E,l+=(p+y)*E}d=v,p=y}if(c===0)return[i,a];let g=1/(3*c);return[i+g*s,a+g*l]}function Lb([o,e],t){let r=t.coordinates;if(!Xp(o,e,r[0]))return!1;for(let n=1;n<r.length;n++)if(Xp(o,e,r[n]))return!1;return!0}function Xp(o,e,t){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let[a,s]=t[n],[l,c]=t[i];s>e!=c>e&&o<(l-a)*(e-s)/(c-s)+a&&(r=!r)}return r}function Bb(o){let e=o.coordinates[0],t=0;for(let r=0;r<e.length-1;r++)t+=e[r][0]*e[r+1][1]-e[r+1][0]*e[r][1];return t=Math.abs(t/2),!Number.isFinite(t)||t<=0?1e-9:Math.sqrt(t)*.01}function dl(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 Zp=o=>o?.externalId||void 0;function Wi(o,e,t,r,n){o.byId[e]={id:e,floorId:t,kind:r,geometry:n},(o.byFloorId[t]??=[]).push(o.byId[e])}var Jp=(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:st()};for(let r of e.space.values())Vb(o,r,t);for(let r of e.obstruction.values())jb(o,r,e,t);for(let r of e.area.values())Gb(o,r,t);return t};function Vb(o,e,t){let{floorId:r,source:n}=e,i=dl(n.properties.details),a=Zp(n.properties.details);for(let s of e.parts){if(s.geometry.type.startsWith("Multi"))continue;let l=Ui(s.geometry.type,s.kind??null);if(l!=="skip")if(l==="poi"){let c={id:s.id,floorId:r,geometry:s.geometry,center:wn(s.geometry),externalId:a,details:i};t.poiRecordsById[s.id]=c,(t.poiRecordsByFloorId[r]??=[]).push(c),Wi(t.geometryIndex,s.id,r,"space",s.geometry),t.poisById[s.id]=new ft(o,{floorId:r,record:c}),a&&(t.poisByExternalId[a]??=[]).push(t.poisById[s.id])}else if(l==="unknown-point")_.warn("Encountered a point space with an unknown kind!",s.kind);else{let c={id:s.id,floorId:r,geometry:s.geometry,kind:s.kind,center:wn(s.geometry),externalId:a,details:i,doorIds:[],enterpriseLocationIds:[]};t.spaceRecordsById[s.id]=c,(t.spaceRecordsByFloorId[r]??=[]).push(c),Wi(t.geometryIndex,s.id,r,"space",s.geometry),t.spacesById[s.id]=new Te(o,{floorId:r,record:c}),a&&(t.spacesByExternalId[a]??=[]).push(t.spacesById[s.id])}}}function jb(o,e,t,r){let{floorId:n,source:i}=e,a=dl(i.properties.details),s=Zp(i.properties.details);for(let l of e.parts){if(l.geometry.type==="Point"||l.geometry.type.startsWith("Multi")||!Hi(l.kind))continue;let c={id:l.id,floorId:n,geometry:l.geometry,kind:l.kind,center:wn(l.geometry),externalId:s,details:a,footprintComponent:t.footprintIds.has(i.properties.id)};r.objectRecordsById[l.id]=c,(r.objectRecordsByFloorId[n]??=[]).push(c),Wi(r.geometryIndex,l.id,n,"obstruction",l.geometry),r.objectsById[l.id]=new Le(o,{floorId:n,record:c}),s&&(r.objectsByExternalId[s]??=[]).push(r.objectsById[l.id])}}function Gb(o,e,t){let{floorId:r,source:n}=e,i=dl(n.properties.details),a=n.properties.details?.externalId??"";for(let s of e.parts){if(s.geometry.type!=="Polygon")continue;let l={id:s.id,floorId:r,geometry:s.geometry,details:i,externalId:a},c=wn(s.geometry);c!==void 0&&(l.center=c),t.areaRecordsById[s.id]=l,(t.areaRecordsByFloorId[r]??=[]).push(l),Wi(t.geometryIndex,s.id,r,"area",s.geometry),t.areasById[s.id]=new $e(o,{floorId:r,record:l}),a&&(t.areasByExternalId[a]??=[]).push(t.areasById[s.id])}}f();function qp(o){for(let e of Object.keys(o))o[e]===void 0&&delete o[e];return o}var Qp=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=o.defaultStyle;if(n==null)return{styleRecordsById:t,styleIdByGeometryId:r};let i=new Map;for(let s of[...e.space.values(),...e.obstruction.values()])for(let l of s.parts)i.set(l.id,l.geometry.type);let a=s=>{t[s.id]=s;for(let l of s.geometryIds)r[l]=s.id};for(let[s,l]of Object.entries(n)){let c=l.geometryAnchors.flatMap(g=>[...e.space.get(g.geometryId)?.ids??[],...e.obstruction.get(g.geometryId)?.ids??[]]),d={};for(let g of c){let m=i.get(g);m!=null&&(d[m]??=[]).push(g)}let p=l.extra?.showImage;d.Point?.length&&a({id:`${s}.Point`,type:"point",geometryIds:d.Point,showImage:p!==void 0?p===!0:l.opacity!==0}),d.LineString?.length&&a(qp({id:`${s}.LineString`,type:"lineString",geometryIds:d.LineString,altitude:l.altitude,color:l.color,height:l.height,opacity:l.opacity,width:l.buffer,topColor:l.topColor})),d.Polygon?.length&&a(qp({id:`${s}.Polygon`,type:"polygon",geometryIds:d.Polygon,altitude:l.altitude,color:l.color,height:l.height,opacity:l.opacity,showImage:p!==void 0?p===!0:void 0,topColor:l.topColor}))}return{styleRecordsById:t,styleIdByGeometryId:r}};f();var Kp=o=>{let e=Object.create(null);for(let[t,r]of o.obstruction){let n=o.footprintIds.has(t);for(let i of r.parts){if(i.geometry.type!=="LineString"||i.kind?.toLowerCase()!=="wall")continue;let a={id:i.id,floorId:r.floorId,geometry:i.geometry,exterior:n};(e[r.floorId]??=[]).push(a)}}return{wallRecordsByFloorId:e}};f();var eu=(o,e)=>{let t=Object.create(null);for(let[r,n]of Object.entries(o.floorImages??{})){let i=[];for(let a of n?.features??[]){let s=[...a.geometry.coordinates];if("verticalOffset"in a.properties){i.push({floorId:r,coordinates:s,properties:{...a.properties}});continue}let{geometryId:l,...c}=a.properties,d=e.space.get(l)?.ids[0]??e.obstruction.get(l)?.ids[0];d!=null&&i.push({floorId:r,coordinates:s,properties:{...c,anchorId:d}})}t[r]=i}return{floorImageRecordsByFloorId:t}};f();var tu=o=>{let e=o.manifest.features[0],[t,r]=e.geometry.coordinates;return{manifestRecord:{name:e.properties.name,organizationId:e.properties.orgId??"",center:[t,r],naturalBearing:e.properties.naturalBearing??0}}};var ru=(o,e)=>{let t=Up(e),r=Bp(e,o,t),n=Jp(o,t),i=Np(e,o,t),a=Lp(e,o,t),s=Dp(e,o,t),l=Wp(e,o,t),c=Qp(e,t),d=Kp(t),p=eu(e,t),g=tu(e);Hb(n.spaceRecordsById,i.doorRecordsById);let{geometryIndex:m,...I}=n,{geometryIndex:v,entranceGeometryIdsByDoorId:y,...E}=i;return{...r,...I,...E,...a,...s,...l,...c,...d,...p,...g,decorationsById:Object.create(null),floorTextRecordsByFloorId:Object.create(null),geometryIndex:Ub([m,v]),nodeIndex:ji(),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 Ub(o){let e=st();for(let t of o){for(let r in t.byId)e.byId[r]=t.byId[r];for(let r in t.byFloorId)(e.byFloorId[r]??=[]).push(...t.byFloorId[r])}return e}var ou=1e-7;function Hb(o,e){let t=new Map;for(let r in o){let{floorId:n,geometry:i}=o[r];if(i.type!=="Polygon")continue;let a=t.get(n)??[];a.push({id:r,geometry:i}),t.set(n,a)}for(let r in e){let n=e[r];if(n.geometry.type!=="LineString")continue;let[[i,a],[s,l]]=n.geometry.coordinates,c=(i+s)/2,d=(a+l)/2,p=Math.hypot(s-i,l-a)||1,g=-(l-a)/p*ou,m=(s-i)/p*ou,I=[c+g,d+m],v=[c-g,d-m];for(let y of t.get(n.floorId)??[])(fn(I,y.geometry)||fn(v,y.geometry))&&o[y.id].doorIds.push(r)}}f();f();var nu=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=Object.create(null),i=Object.create(null);for(let a of o["node.geojson"].features){let s=a.properties.floor??a.properties.map,l={id:a.properties.id,floorId:s,geometry:a.geometry,externalId:a.properties.externalId,neighborIds:a.properties.neighbors.map(d=>d.id),spaceIds:a.properties.space,flags:a.properties.flags};n[a.properties.id]=l;let c=new it(e,{record:l});t[a.properties.id]=c,a.properties.externalId&&(r[a.properties.externalId]==null&&(r[a.properties.externalId]=[]),r[a.properties.externalId].push(c)),i[s]||(i[s]=[]),i[s].push(l)}return{nodesById:t,nodesByExternalId:r,nodeRecordsById:n,nodeRecordsByFloorId:i}};f();var iu=(o,e,t)=>{let r=new Map;for(let a of o["node.geojson"]?.features??[])r.set(a.properties.id,{floorId:a.properties.floor??a.properties.map,coordinates:a.geometry.coordinates});let n=Object.create(null),i=Object.create(null);for(let a of o["connection.json"]){a.nodes.forEach(l=>t.mvfConnectionsByNodeId[l]=a);let s={id:a.id,type:a.type,externalId:a.externalId,extra:a.extra,accessible:a.accessible??!1,nodeIds:a.nodes,anchors:jr(a.nodes.map(l=>r.get(l)).filter(l=>l!=null)),details:a.details};i[a.id]=s,a.type!=="door"&&(n[a.id]=new Ee(e,{record:s}))}return{connectionsById:n,connectionRecordsById:i}};f();var au=(o,e,t)=>{let r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=Object.create(null),c=Object.create(null),d=Object.create(null),p=Object.create(null),g=st(),m=globalThis.Object.keys(o.space);for(let I of m){let v=o.space[I];if(v!=null)for(let y of v.features){if(p[y.properties.id]=y,y.properties.kind==="desk-entrance"){let k=t.objectEntranceNodeIdsByObstructionId[y.properties.externalId]??(t.objectEntranceNodeIdsByObstructionId[y.properties.externalId]=[]);for(let w of y.properties.destinationNodes??[])k.push(w)}let E=Ui(y.geometry.type,"kind"in y.properties?y.properties.kind??null:void 0);if(E!=="skip")if(E==="poi"){let k={id:y.properties.id,floorId:I,geometry:y.geometry,center:y.properties.center,externalId:y.properties.externalId||void 0,details:y.properties.details};l[y.properties.id]=k,g.byId[y.properties.id]={id:y.properties.id,floorId:I,kind:"space",geometry:y.geometry},g.byFloorId[I]==null&&(g.byFloorId[I]=[]),g.byFloorId[I].push(g.byId[y.properties.id]);let w=new ft(e,{floorId:I,record:k});i[y.properties.id]=w,d[I]==null&&(d[I]=[]),d[I].push(k),y.properties.externalId&&(a[y.properties.externalId]==null&&(a[y.properties.externalId]=[]),a[y.properties.externalId].push(w))}else if(E==="unknown-point")_.warn("Encountered a point space with an unknown kind!",y.properties.kind);else{let k={id:y.properties.id,floorId:I,geometry:y.geometry,kind:y.properties.kind,center:y.properties.center,externalId:y.properties.externalId||void 0,details:y.properties.details,doorIds:[],enterpriseLocationIds:[],destinationNodes:y.properties.destinationNodes};s[y.properties.id]=k,g.byId[y.properties.id]={id:y.properties.id,floorId:I,kind:"space",geometry:y.geometry},g.byFloorId[I]==null&&(g.byFloorId[I]=[]),g.byFloorId[I].push(g.byId[y.properties.id]);let w=new Te(e,{floorId:I,record:k});r[y.properties.id]=w,c[I]==null&&(c[I]=[]),c[I].push(k),y.properties.externalId&&(n[y.properties.externalId]==null&&(n[y.properties.externalId]=[]),n[y.properties.externalId].push(w))}}}return{spacesById:r,spacesByExternalId:n,poisById:i,poisByExternalId:a,spaceRecordsById:s,poiRecordsById:l,spaceRecordsByFloorId:c,poiRecordsByFloorId:d,geometryIndex:g,mvfSpacesById:p}};f();var su=(o,e,t)=>{let r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=st(),c=globalThis.Object.keys(o.obstruction);for(let d of c){let p=o.obstruction[d];if(p!=null)for(let g of p.features){s[g.properties.id]=g;for(let v of g.properties.entrances)t.obstructionIdByEntranceId[v]=g.properties.id;if(!Hi(g.properties.kind))continue;let m={id:g.properties.id,floorId:d,geometry:g.geometry,kind:g.properties.kind,center:g.properties.center,externalId:g.properties.externalId||void 0,details:g.properties.details,footprintComponent:g.properties.footprintComponent};i[g.properties.id]=m,(a[d]??=[]).push(m),l.byId[g.properties.id]={id:g.properties.id,floorId:d,kind:"obstruction",geometry:g.geometry},l.byFloorId[d]==null&&(l.byFloorId[d]=[]),l.byFloorId[d].push(l.byId[g.properties.id]);let I=new Le(e,{floorId:d,record:m});r[g.properties.id]=I,g.properties.externalId&&(n[g.properties.externalId]==null&&(n[g.properties.externalId]=[]),n[g.properties.externalId].push(I))}}return{objectsById:r,objectsByExternalId:n,objectRecordsById:i,objectRecordsByFloorId:a,geometryIndex:l,mvfObstructionById:s}};f();var lu=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=Object.create(null);if("floor.geojson"in o&&o["floor.geojson"]!=null)for(let i of o["floor.geojson"].features){let a={id:i.properties.id,elevation:i.properties.elevation,geometry:i.geometry??void 0};i.properties.name!==void 0&&(a.name=i.properties.name),i.properties.shortName!==void 0&&(a.shortName=i.properties.shortName),i.properties.subtitle!==void 0&&(a.subtitle=i.properties.subtitle),i.properties.externalId!==void 0&&(a.externalId=i.properties.externalId),i.properties.maxHeight!==void 0&&(a.maxHeight=i.properties.maxHeight),i.properties.metadata!==void 0&&(a.metadata=i.properties.metadata),n[i.properties.id]=a;let s=new Xe(e,{record:a});t[i.properties.id]=s,i.properties.externalId&&(r[i.properties.externalId]==null&&(r[i.properties.externalId]=[]),r[i.properties.externalId].push(s))}else for(let i of o["map.geojson"]){let a={id:i.id,elevation:i.elevation};i.name!==void 0&&(a.name=i.name),i.shortName!==void 0&&(a.shortName=i.shortName),i.subtitle!==void 0&&(a.subtitle=i.subtitle),i.externalId!==void 0&&(a.externalId=i.externalId),i.maxHeight!==void 0&&(a.maxHeight=i.maxHeight),i.metadata!==void 0&&(a.metadata=i.metadata),n[i.id]=a;let s=new Xe(e,{record:a});t[i.id]=s}return{floorsById:t,floorsByExternalId:r,floorRecordsById:n}};f();var cu=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=o["floorstack.json"]||o["mapstack.json"]||o["mapstack.geojson"];if(l!=null)for(let c of l){let d=o.facade?.[c.id],p={id:c.id,floorIds:c.floors??c.maps??[]};c.type!==void 0&&(p.type=c.type),c.name!==void 0&&(p.name=c.name),c.shortName!==void 0&&(p.shortName=c.shortName),c.externalId!==void 0&&(p.externalId=c.externalId),c.defaultFloor!==void 0&&(p.defaultFloor=c.defaultFloor),c.metadata!==void 0&&(p.metadata=c.metadata),n[c.id]=p;let g=new Lo(e,{record:p,facadeId:d?.id});if(t[c.id]=g,c.externalId&&(r[c.externalId]==null&&(r[c.externalId]=[]),r[c.externalId].push(g)),d){let m={id:d.id,floorStackId:c.id,spaceIds:d.spaces.map(v=>v.spaceId),floorId:d.spaces[0]?.floorId};i[d.id]=m;let I=new Ce(e,{record:m});a[d.id]=I;for(let v of d.spaces)s[v.spaceId]=I}}return{floorStacksById:t,floorStacksByExternalId:r,floorStackRecordsById:n,facadeRecordsById:i,facadesById:a,facadesBySpaceId:s}};f();var Wb={polygon:"polygons",lineString:"lineStrings",point:"points"},du=o=>{let e=Object.create(null),t=Object.create(null);for(let[r,n]of Object.entries(o["styles.json"]??{})){if(n==null)continue;let i="polygons"in n?"polygon":"lineStrings"in n?"lineString":"points"in n?"point":null;if(i==null)continue;let{[Wb[i]]:a,...s}=n,l={...s,id:r,type:i,geometryIds:[...a]};e[r]=l;for(let c of l.geometryIds)t[c]=r}return{styleRecordsById:e,styleIdByGeometryId:t}};f();var pu=o=>{let e=Object.create(null);for(let[t,r]of Object.entries(o.obstruction??{}))if(r!=null)for(let n of r.features){if(n.geometry?.type!=="LineString"||n.properties.kind?.toLowerCase()!=="wall")continue;let i={id:n.properties.id,floorId:t,geometry:n.geometry,exterior:n.properties.footprintComponent===!0,doorIds:[...n.properties.entrances??[]]};(e[t]??=[]).push(i)}return{wallRecordsByFloorId:e}};f();var uu=o=>{let e=Object.create(null);for(let[t,r]of Object.entries(o.floorImages??{}))r!=null&&(e[t]=r.features.map(n=>({floorId:t,coordinates:[...n.geometry.coordinates],properties:{...n.properties}})));return{floorImageRecordsByFloorId:e}};f();var fu=o=>{let e=Object.create(null);for(let[t,r]of Object.entries(o.enterprise?.floorText??{}))r!=null&&(e[t]=r.features.map(n=>({floorId:t,geometry:{type:"Point",coordinates:[...n.geometry.coordinates]},properties:{...n.properties}})));return{floorTextRecordsByFloorId:e}};f();var hu=o=>{let e=o["manifest.geojson"].features[0],[t,r]=e.geometry.coordinates,n={name:e.properties.name,organizationId:e.properties.org_id??"",center:[t,r],naturalBearing:e.properties.naturalBearing??0},i=o.enterprise?.venue?.defaultMap;return i&&(n.defaultFloorId=i),{manifestRecord:n}};f();function gu(o,e){o.bevel!=null&&(e(o.id).bevel={...o.bevel})}var mu=o=>{let e=Object.create(null),t=new Set,r=new Set,n=i=>e[i]??={};for(let i of Object.values(o.space??{}))for(let a of i?.features??[])t.add(a.properties.id),gu(a.properties,n);for(let i of Object.values(o.obstruction??{}))for(let a of i?.features??[])r.add(a.properties.id),gu(a.properties,n);for(let i of Object.values(o.textAreas??{}))for(let a of i?.features??[]){if(!("anchorId"in a.properties))continue;let{anchorId:s}=a.properties;if(!t.has(s)&&!r.has(s))continue;let[l,c]=a.geometry.coordinates;n(s).textArea={...a.properties,position:[l,c]}}for(let[i,a]of Object.entries(o.enterprise?.enterpriseStyles??{}))for(let s of a.geometryAnchors)t.has(s.geometryId)&&(n(s.geometryId).style={styleId:i,edgeOffset:a.edgeOffset});for(let i of o.enterprise?.textures??[])for(let a of i.geometryAnchors)!t.has(a.geometryId)&&!r.has(a.geometryId)||(n(a.geometryId).textures??=[]).push(i);return{decorationsById:e}};f();var yu=(o,e,t,r)=>{let n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=Object.create(null),c=st(),d=globalThis.Object.keys(o.entrance);for(let p of d){let g=o.entrance[p];if(g!=null)for(let m of g.features){l[m.properties.id]=m;let I=t.obstructionIdByEntranceId[m.properties.id],v=m.properties.isExterior!==void 0?m.properties.isExterior:I!=null?r[I]?.properties.footprintComponent??!1:!1,y={id:m.properties.id,floorId:p,geometry:m.geometry,externalId:m.properties.externalId||void 0,details:m.properties.details,isExterior:v,obstructionId:I,nodeId:m.properties.node};a[m.properties.id]=y,s[p]==null&&(s[p]=[]),s[p].push(y),c.byId[m.properties.id]={id:m.properties.id,floorId:p,kind:"entrance",geometry:m.geometry},c.byFloorId[p]==null&&(c.byFloorId[p]=[]),c.byFloorId[p].push(c.byId[m.properties.id]);let E=new Ae(e,{floorId:p,record:y});m.properties.node&&(t.doorsByNodeId[m.properties.node]=E),n[m.properties.id]=E,m.properties.externalId&&(i[m.properties.externalId]==null&&(i[m.properties.externalId]=[]),i[m.properties.externalId].push(E))}}return{doorsById:n,doorsByExternalId:i,doorRecordsById:a,doorRecordsByFloorId:s,geometryIndex:c,mvfEntrancesById:l}};f();var bu=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=Object.create(null),i=Object.create(null);if(o.annotation==null)return{annotationsById:t,annotationRecordsById:r,annotationRecordsByFloorId:n,mvfAnnotationsById:i};let a=o["annotation-symbols.json"]||{},s=globalThis.Object.keys(o.annotation);for(let l of s){let c=o.annotation[l];if(c!=null)for(let d of c.features){i[d.properties.id]=d;let p={id:d.properties.id,floorId:l,symbolId:d.properties.symbolId,geometry:d.geometry,symbol:a[d.properties.symbolId],details:d.properties.details};d.properties.externalId!==void 0&&(p.externalId=d.properties.externalId),r[d.properties.id]=p,n[l]==null&&(n[l]=[]),n[l].push(p);let g=new ht(e,{floorId:l,record:p});t[d.properties.id]=g}}return{annotationsById:t,annotationRecordsById:r,annotationRecordsByFloorId:n,mvfAnnotationsById:i}};f();var Iu=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=st();if(o.area==null)return{areasById:t,areasByExternalId:r,areaRecordsById:n,areaRecordsByFloorId:i,geometryIndex:s,mvfAreasById:a};let l=globalThis.Object.keys(o.area);for(let c of l){let d=o.area[c];if(d!=null)for(let p of d.features){a[p.properties.id]=p;let g={id:p.properties.id,floorId:c,geometry:p.geometry,details:p.properties.details};p.properties.externalId!==void 0&&(g.externalId=p.properties.externalId),p.properties.center!==void 0&&(g.center=p.properties.center),n[p.properties.id]=g,i[c]==null&&(i[c]=[]),i[c].push(g),s.byId[p.properties.id]={id:p.properties.id,floorId:c,kind:"area",geometry:p.geometry},s.byFloorId[c]==null&&(s.byFloorId[c]=[]),s.byFloorId[c].push(s.byId[p.properties.id]);let m=new $e(e,{floorId:c,record:g});t[p.properties.id]=m,p.properties.externalId&&(r[p.properties.externalId]==null&&(r[p.properties.externalId]=[]),r[p.properties.externalId].push(m))}}return{areasById:t,areasByExternalId:r,areaRecordsById:n,areaRecordsByFloorId:i,geometryIndex:s,mvfAreasById:a}};f();var Tu=(o,e,t,r,n,i)=>{if(o.floorImages!=null)for(let a in o.floorImages){let s=o.floorImages[a]?.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l.properties;if(e[c.anchorId]!=null||t[c.anchorId]!=null){let d=n[c.anchorId]??i[c.anchorId];d!=null&&(d.image={path:c.path})}else{let d=r[c.anchorId];d!=null&&(d.image={path:c.path})}}}}};f();var vu=o=>{let e=Object.create(null);for(let t of o?.locations??[])e[t.id]=t;return{mvf3LocationsById:e}},Su=(o,e,t)=>{let r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=Object.create(null),c=Object.create(null),d=Object.create(null);for(let p of e["location.json"]||[]){let g={id:p.id,name:p.name,externalId:p.externalId,description:p.description,logo:p.logo,phone:p.phone,social:p.social,pictures:p.pictures,links:p.links,website:p.website,icon:p.icon,searchTags:p.searchTags,categoryIds:p.categories,spaceIds:p.spaces?.map(v=>v.id)??[],objectIds:p.obstructions?.map(v=>v.id)??[],doorIds:p.entrances?.map(v=>v.id)??[],connectionIds:p.connections??[],annotationIds:p.annotations?.map(v=>v.id)??[],areaIds:p.areas?.map(v=>v.id)??[],openingHoursSpecification:p.openingHoursSpecification,extra:t[p.id]?.extra};i[p.id]=g;let m=new zt(o,{record:g});if(r[p.id]=m,p.externalId&&(l[p.externalId]==null&&(l[p.externalId]=[]),l[p.externalId].push(m)),p.categories)for(let v of p.categories)c[v]==null&&(c[v]=[]),c[v].push(m);let I=[...p.obstructions?.map(v=>v.id)??[],...p.spaces?.map(v=>v.id)??[],...p.annotations?.map(v=>v.id)??[],...p.connections??[],...p.entrances?.map(v=>v.id)??[],...p.areas?.map(v=>v.id)??[]];for(let v of I)v&&(d[v]==null&&(d[v]=[]),d[v].push(m))}for(let p of e["category.json"]||[]){let g={id:p.id,name:p.name,icon:p.icon,parent:p.parent};a[p.id]=g;let m=new Gr(o,{record:g});n[p.id]=m,p.parent&&(s[p.parent]==null&&(s[p.parent]=[]),s[p.parent].push(m))}return{locationCategoriesByParentId:s,locationProfilesById:r,locationCategoriesById:n,locationProfileRecordsById:i,locationCategoryRecordsById:a,locationProfilesByExternalId:l,locationProfilesByCategoryId:c,locationProfilesByAttachedFeatureId:d}};f();var xu=(o,e)=>{for(let t in e){let r=e[t];if(r==null)continue;let n=r.destinationNodes??[];if(n.length<1)continue;let i=[];for(let a of n)o.doorsByNodeId[a]!=null&&i.push(a),o.spaceIdsByNodeId[a]==null&&(o.spaceIdsByNodeId[a]=[]),o.spaceIdsByNodeId[a].push(r.id);i.length>0&&(o.entranceNodeIdsBySpaceId[t]=i)}for(let t in o.objectEntranceNodeIdsByObstructionId){let r=o.objectEntranceNodeIdsByObstructionId[t];for(let n of r)o.objectIdsByNodeId[n]==null&&(o.objectIdsByNodeId[n]=[]),o.objectIdsByNodeId[n].push(t)}};f();var Mu=(o,e,t)=>{let r=o.polygons??[],n=o.nodes??[],i=Array.isArray(o.spaces)?o.spaces:r,a={id:o.id,externalId:o.externalId,name:o.name,description:o.description,amenity:o.amenity,extra:o.extra,geometryIds:r.map(s=>s.id),nodeIds:n.map(s=>s.id),spaceIds:i.map(s=>s.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&&(a.parentId=t),a},pl=(o,e)=>{let t=Object.create(null),r=Object.create(null),n=Object.create(null),i=Object.create(null),a=Object.create(null),s=Object.create(null),l=Object.create(null),c=Object.create(null),d=Object.create(null),p=Object.create(null),g=Object.create(null),m=o.enterprise?.venue??{},I=Object.create(null);for(let y of o.enterprise?.categories??[]){let E={id:y.id,externalId:y.externalId,name:y.name,color:y.color,extra:y.extra,icon:y.icon,iconFromDefaultList:y.iconFromDefaultList,sortOrder:y.sortOrder,picture:y.picture,childIds:y.children,locationIds:y.locations};p[y.id]=E;let k=new zi(e,{record:E});a[y.id]=k,y.externalId&&(s[y.externalId]==null&&(s[y.externalId]=[]),s[y.externalId].push(k)),y.locations.forEach(w=>{I[w]==null&&(I[w]=[]),I[w].push(y.id)})}let v=Object.create(null);for(let y of o.enterprise?.locationInstances??[]){let E=o.enterprise?.categoryPriorities?.[y.id]||I[y.id],k=Mu(y,E,y.parent);d[y.id]=k;let w=new at(e,{record:k});v[y.parent]==null&&(v[y.parent]=[]),v[y.parent].push(w);for(let B of y.polygons??[])c[B.id]=w;l[y.id]=w,y.externalId&&(i[y.externalId]==null&&(i[y.externalId]=[]),i[y.externalId].push(w))}for(let y of o.enterprise?.locations??[]){let E=o.enterprise?.categoryPriorities?.[y.id]||I[y.id],k=Mu(y,E),w=v[y.id];w!=null&&(k.instances=w.map(D=>d[D.id])),d[y.id]=k;let B=new at(e,{record:k,instances:w});n[y.id]=B,y.externalId&&(i[y.externalId]==null&&(i[y.externalId]=[]),i[y.externalId].push(B)),y.nodes.forEach(D=>{e.nodeIndex.locationIdsByNodeId[D.id]==null&&(e.nodeIndex.locationIdsByNodeId[D.id]=[]),e.nodeIndex.locationIdsByNodeId[D.id].push(y.id)});for(let D of y.polygons)g[D.id]==null&&(g[D.id]=[]),g[D.id].push(y.id)}if(e.enterpriseMode===!0){let y=(o["connection.json"]??[]).reduce((E,k)=>(E[k.id]=k,E),Object.create(null));for(let E in y){let k=Object.create(null),w=y[E],B={id:E,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 D of y[E].nodes){let j=e.nodesById[D];j!=null&&(k[j.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[j.coordinate.longitude,j.coordinate.latitude]},properties:B})}Object.keys(k).length>0&&(t[E]=new Ee(e,{record:{id:E,type:w.type,externalId:w.externalId,extra:w.extra,accessible:w.accessible??!1,nodeIds:w.nodes,anchors:jr(w.nodes.map(D=>{let j=e.nodesById[D];return j==null?null:{floorId:j.floor.id,coordinates:[j.coordinate.longitude,j.coordinate.latitude]}}).filter(D=>D!=null)),details:w.details}}),w.externalId&&(r[w.externalId]==null&&(r[w.externalId]=[]),r[w.externalId].push(t[E])))}e.connectionsById=t}return{connectionsByExternalId:r,locationsById:n,locationInstancesById:l,instanceLocationsByPolygonId:c,locationsByExternalId:i,categoriesById:a,categoriesByExternalId:s,locationRecordsById:d,categoryRecordsById:p,venueRecord:m,locationIdsByGeometryId:g}};var Eu=(o,e,t)=>{let r=ji(),{nodesById:n,nodesByExternalId:i,nodeRecordsById:a,nodeRecordsByFloorId:s}=nu(e,o),{connectionsById:l,connectionRecordsById:c}=iu(e,o,r),{spacesById:d,spacesByExternalId:p,poisById:g,poisByExternalId:m,spaceRecordsById:I,poiRecordsById:v,spaceRecordsByFloorId:y,poiRecordsByFloorId:E,geometryIndex:k,mvfSpacesById:w}=au(e,o,r),{objectsById:B,objectsByExternalId:D,objectRecordsById:j,objectRecordsByFloorId:G,geometryIndex:W,mvfObstructionById:N}=su(e,o,r),{floorsById:q,floorsByExternalId:oe,floorRecordsById:ie}=lu(e,o),{floorStacksById:be,floorStacksByExternalId:De,floorStackRecordsById:ke,facadeRecordsById:ue,facadesById:Ke,facadesBySpaceId:rt}=cu(e,o),{doorsById:Pt,doorsByExternalId:ve,doorRecordsById:Eo,doorRecordsByFloorId:de,geometryIndex:wt,mvfEntrancesById:Kt}=yu(e,o,r,N),{annotationsById:ho,annotationRecordsById:Vt,annotationRecordsByFloorId:Co,mvfAnnotationsById:_o}=bu(e,o),{areasById:$o,areasByExternalId:yr,areaRecordsById:Xo,areaRecordsByFloorId:se,geometryIndex:Yo,mvfAreasById:ce}=Iu(e,o),At=st();for(let u of[k,W,wt,Yo]){for(let h in u.byId)At.byId[h]=u.byId[h];for(let h in u.byFloorId)At.byFloorId[h]==null&&(At.byFloorId[h]=[]),At.byFloorId[h].push(...u.byFloorId[h])}Tu(e,w,N,Xo,I,j);let{floorImageRecordsByFloorId:xe}=uu(e),{floorTextRecordsByFloorId:eo}=fu(e),{manifestRecord:go}=hu(e),{decorationsById:It}=mu(e),{mvf3LocationsById:br}=vu(t),{locationCategoriesByParentId:Zo,locationProfilesById:Jo,locationCategoriesById:Ir,locationProfileRecordsById:Rt,locationCategoryRecordsById:Fe,locationProfilesByExternalId:to,locationProfilesByCategoryId:Tr,locationProfilesByAttachedFeatureId:qo}=Su(o,e,br);xu(r,I);let{styleRecordsById:Qo,styleIdByGeometryId:Ko}=du(e),{wallRecordsByFloorId:C}=pu(e);for(let u in r.entranceNodeIdsBySpaceId){let h=I[u];h!=null&&(h.doorIds=r.entranceNodeIdsBySpaceId[u].map(b=>r.doorsByNodeId[b]?.id).filter(b=>b!=null))}return{styleRecordsById:Qo,styleIdByGeometryId:Ko,wallRecordsByFloorId:C,floorImageRecordsByFloorId:xe,floorTextRecordsByFloorId:eo,manifestRecord:go,decorationsById:It,spacesById:d,spacesByExternalId:p,nodesById:n,nodesByExternalId:i,objectsById:B,objectsByExternalId:D,floorsById:q,floorsByExternalId:oe,floorStacksById:be,floorStacksByExternalId:De,facadesById:Ke,facadesBySpaceId:rt,connectionsById:l,doorsById:Pt,doorsByExternalId:ve,poisById:g,poisByExternalId:m,annotationsById:ho,areasById:$o,areasByExternalId:yr,locationProfilesById:Jo,locationCategoriesById:Ir,locationProfileRecordsById:Rt,locationCategoryRecordsById:Fe,locationProfilesByExternalId:to,locationProfilesByCategoryId:Tr,locationCategoriesByParentId:Zo,floorRecordsById:ie,floorStackRecordsById:ke,facadeRecordsById:ue,spaceRecordsById:I,poiRecordsById:v,objectRecordsById:j,objectRecordsByFloorId:G,doorRecordsById:Eo,spaceRecordsByFloorId:y,poiRecordsByFloorId:E,areaRecordsByFloorId:se,annotationRecordsByFloorId:Co,doorRecordsByFloorId:de,geometryIndex:At,nodeRecordsById:a,nodeRecordsByFloorId:s,connectionRecordsById:c,annotationRecordsById:Vt,areaRecordsById:Xo,locationProfilesByAttachedFeatureId:qo,nodeIndex:r,mvfSpacesById:w,mvfObstructionById:N,mvfEntrancesById:Kt,mvfAreasById:ce,mvfAnnotationsById:_o}};f();var zb=["externalId","name","description","amenity","extra","gallery","logo","operationHours","phone","picture","shortName","showFloatingLabelWhenImagePresent","showLogo","siblingGroups","social","sortOrder","states","tags","type","hidden","primaryCategory","links","filterFlags","headerImage"],ul=class o extends Ge{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;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 r of zb)r in t.record&&Object.defineProperty(this,r,{enumerable:!0,get(){if(this.#o.parentId){let n=this.#e.locationsById[this.#o.parentId];return this.#o[r]!=null?this.#e.getPropTranslation(this.__type,r,this.#o.id,this.#o[r]):this.#e.getPropTranslation(this.__type,r,this.#o.id,n[r])}return this.#e.getPropTranslation(this.__type,r,this.#o.id,this.#o[r])}})}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 re(xt("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]}},at=ul;f();var $b=["externalId","name","color","extra","icon","iconFromDefaultList","sortOrder","picture"],fl=class o extends Ge{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 r of $b)r in t.record&&Object.defineProperty(this,r,{get(){return this.#e.getPropTranslation(this.__type,r,this.#o.id,this.#o[r])}})}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]}},zi=fl;f();var Xb=new Set,hl=class o extends Ge{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 r in t.record)!Xb.has(r)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),r)&&(this[r]=t.record[r])}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]}},gl=hl;f();var ml=o=>"kind"in o&&o.kind==="v3-native";f();f();f();f();f();var Cu=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(Cu||{}),yl=(a=>(a.Straight="Straight",a.Right="Right",a.SlightRight="SlightRight",a.Left="Left",a.SlightLeft="SlightLeft",a.Back="Back",a))(yl||{}),_u=(d=>(d.stairs="stairs",d.elevator="elevator",d.escalator="escalator",d.door="door",d.ramp="ramp",d.slide="slide",d.portal="portal",d.security="security",d.shuttle="shuttle",d.ladder="ladder",d))(_u||{}),$i=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))($i||{}),Xi=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(Xi||{});f();function Fu(o){let{fromPosition:e,toPosition:t,junctionInset:r,fromAltitude:n,toAltitude:i}=o;if(r<=0)return null;let a=(e[1]+t[1])/2,{toCartesian:s,toGeographic:l}=yd(a),c=s(e),d=s(t),p=d.x-c.x,g=d.y-c.y,m=i-n,I=Math.sqrt(p*p+g*g+m*m);if(I<=r*2)return null;let v=r/I,y={x:c.x+p*v,y:c.y+g*v},E=l(y.x,y.y),k=e[2]!==void 0?e[2]+m*v:void 0,w={x:d.x-p*v,y:d.y-g*v},B=l(w.x,w.y),D=t[2]!==void 0?t[2]-m*v:void 0;return{fromPosition:k!==void 0?[E.lon,E.lat,k]:[E.lon,E.lat],toPosition:D!==void 0?[B.lon,B.lat,D]:[B.lon,B.lat]}}function bl(o,e,t,r,n){let i=Fu({fromPosition:o,toPosition:e,junctionInset:t,fromAltitude:r,toAltitude:n});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 _t(o){return o.verticalOffset===0?[o.longitude,o.latitude]:[o.longitude,o.latitude,o.verticalOffset]}function Jb(o){return new Map(o.map(e=>{let{properties:t}=e,{id:r}=t;return[r,e]}))}var Pu=(o,e)=>{let t=Jb(e),r={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:o[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of o){let i=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((s,l)=>(t.has(l)&&s.push(t.get(l)),s),[]);if(a.length){let{entrances:s,obstructions:l}=Ls(n,a);i=l.map(c=>c.geometry.coordinates),r.entrances.features.push(...s)}r.walls.geometry.coordinates.push(...i)}return r};function wu(o,e){return((e-o+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function Au(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 Ru(o,e){return o.reduce((t,r)=>{let n=e[r.properties.id];if(n==null)return t;if("textures"in r.properties&&Array.isArray(r.properties.textures)&&r.properties.textures.length>0){let i={...n,id:n.id+"-textures"};t.set(i,[r])}else t.has(n)||t.set(n,[]),t.get(n).push(r);return t},new Map)}function Ur(o,e={}){let t={...o,flipImageToFaceCamera:e?.flipImagesToFaceCamera??!0},r=e?.style?.shading??e?.shadingAndOutlines;r===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof r=="object"&&(t.shading={start:r.start,end:r.end,intensity:r.intensity});let n=e?.style?.outlines??e?.shadingAndOutlines;if(t.outline=typeof n=="object"?!0:n,"lineStrings"in o){let i=e?.style?.wallTopColor??e?.wallTopColor;i!=null&&(t.topColor=i)}return t}var vl=(o,e)=>{let r=(e.currentMap?.currentFloor).layers.get(Pe);switch(o){case"interior-walls":return r?.layers.get(ko);case"exterior-walls":return r?.layers.get(ao);case"interior-doors":return r?.layers.get(Dr);case"exterior-doors":return r?.layers.get(kr);default:return typeof o=="string"?o:o?.id}};function Sl(o){return new Promise(e=>{o.onComplete(e),o.onStop(e)})}function Du(o){return o.bbox?o.bbox:Er(o)}function Hr(o,e,t){return o.floorId&&e.has(o.floorId)?e.get(o.floorId):t}function Wr(o){if(Te.is(o)||Le.is(o))return o.id}function ku(o,e,t){let r=o.coordinates.length===2&&o.coordinates[0].floorId!==o.coordinates[1].floorId,n=!0;if(r&&o.coordinates[0].floorId!=null&&o.coordinates[1].floorId!=null){let i=e?.getById("floor",o.coordinates[0].floorId),a=e?.getById("floor",o.coordinates[1].floorId);if(i&&a){let s=t.getState(i),l=t.getState(a);s!=null&&l!=null&&(n=s.visible&&l.visible&&s.altitude!==l.altitude)}}else{let i=o.coordinates[0].floorId!=null?e?.getById("floor",o.coordinates[0].floorId):void 0;n=i?t.getState(i)?.visible??!0:!0}return n}function Nu(o,e){let t=o.properties.path.split("/"),r=t[t.length-1].split(".")[0],n=atob(r);return"img_"+Si(n).toString()+"-"+e}function Il(o="auto",e,t=1,r){return o!=="auto"?o*t:e!=null?e*t:r!=null?r*t:3*t}function Ou(o,e,t,r){if(o.maxHeight!=null&&o.maxHeight>0)return Il(e,o.maxHeight,t,r);let n=Il(e,void 0,t,r);if(e==="auto"&&"geometryMaxHeight"in o){let i=o.geometryMaxHeight;if(i!=null&&i>0){let a=Math.ceil(i*1.1);if(a>n)return a}}return n}function Lu(o,e="auto",t=1,r,n){if(!o.length)return new Map;let i=o.sort((d,p)=>d.elevation-p.elevation),a=i.findIndex(d=>d.elevation>=0);a===-1&&(a=i.length);let s=0,l=new Map,c=-1;for(let d=a;d<i.length;d+=1){let p=i[d],g=Ou(p,e,t,r);if(!n){let m=p.elevation-c-1;m>0&&(s+=m*g)}l.set(p.elevation,{altitude:s,visualHeight:g}),s+=g,c=p.elevation}s=0;for(let d=a-1;d>=0;d-=1){let p=i[d],g=Ou(p,e,t,r),m=-(s+g);l.set(p.elevation,{altitude:m,visualHeight:g}),s+=g}return l}function Bu(o,e,t="auto",r=1,n){let i=[...o].sort((c,d)=>c.elevation-d.elevation),a=i.findIndex(c=>c.elevation>=0);if(a===-1)return[];let s=[],l=-1;for(let c=a;c<i.length;c+=1){let d=i[c],p=d.elevation-l-1;if(p>0){let g=e.get(d.elevation),m=g?.visualHeight??Il(t,void 0,r,n),I=p*m,v=g?.altitude??0;s.push({altitude:v-I,height:I,floorAboveElevation:d.elevation,missingCount:p})}l=d.elevation}return s}function Yi(o,e){let t=e(o.center);return{center:new X({latitude:t[1],longitude:t[0]}),radius:o.radius}}function Vu(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 ju=Math.PI*.1,co=class{id;#e={};#t;#o;constructor(e,t,r,n,i){this.id=i?.id??ae(),this.#t=t,this.#o=e.features,this.departure=r,this.destination=n}get path(){if(this.#e.path==null){let e=[];for(let t of this.#o){let r=this.#t.navigationNodes.node(t.properties.id);r&&e.push(r)}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 X(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 r=0;r<this.#o.length;r++){let n=this.#o[r],i=this.#o[r-1],a=this.#o[r+1],s=new X(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),l=this.#s({prevDirection:i,direction:n,nextDirection:a});t+=i?.properties.distance||0;for(let c of l)c&&(e.push({action:c,distance:t,coordinate:s,node:this.#t.navigationNodes.node(n.properties.id)}),t=0)}return this.#e.instructions=e,this.#e.instructions}#r;#i;#n;#s(e){let{prevDirection:t,direction:r,nextDirection:n}=e,i=t&&this.#t.getById("floor",t.properties.groupBy),a=this.#t.getById("floor",r.properties.groupBy),s=n&&this.#t.getById("floor",n.properties.groupBy),l=[];t||l.push({type:"Departure"});let c=this.#t.navigationNodes.connectionForNode(r.properties.id),d=c?this.#t.getById("connection",c.id):void 0,p=c&&c.nodeIds.length>1,g=this.#t.enterpriseMode&&(!r.properties.destination||!c?.nodeIds.includes(r.properties.destination)||!c?.nodeIds.includes(r.properties.id));if(c&&!(!p||g))if(!this.#r||this.#r==="exit")l.push(this.#l("TakeConnection",a,s,d,c)),this.#r="take",this.#i=d,this.#n=c;else{let I=this.#t.navigationNodes.connectionForNode(t?.properties.id??""),v=this.#t.getById("connection",I?.id??"");l.push(this.#l("ExitConnection",a,i,v,I)),this.#r="exit",this.#i=d,this.#n=c}else this.#r==="take"?(l.push(this.#l("ExitConnection",a,i,this.#i,this.#n)),this.#r="exit",this.#i=d):s&&a?.id!==s.id?l.push(this.#l("TakeConnection",a,s,d)):i&&i.id!==a?.id?l.push(this.#l("ExitConnection",a,i,d)):l.push(this.#a(t,r));return n||l.push({type:"Arrival"}),l}#l(e,t,r,n,i){let a="none",s=t?t.elevation:0;if(s!=null&&r?.elevation!=null){let c=s-r.elevation;c>0?a="down":c<0&&(a="up")}let l=n?.type??i?.type??"stairs";return{type:e,fromFloor:t,toFloor:r,direction:a,connection:n,connectionType:l}}#a(e,t){let r=t.properties.edges;if(!r||r.filter(a=>a.destination.properties.id!==e?.properties.id&&a.destination.properties.id!==t.properties.destination).length===0)return null;let i=e?-wu(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=ju?{type:"Turn",bearing:Au(i,ju),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}}};f();f();f();function Gu(o){return bo(o)?"navigationTarget"in o&&o.navigationTarget!=null:!1}var qb={lineOfSight:!0,mode:"absolute-distance",maxResults:1};function Uu(o){return{...qb,lineOfSight:!o}}var we=new WeakMap;function Hu(o,e,t){let r=Uu(t),i=e.Query.__LEGACY_NEAREST_SYNC(o,e.getByType("node"),r)?.[0]?.feature.id;return i?[i]:[]}async function Wu(o,e,t){let r=Uu(t),i=(await e.Query.nearest(o,e.getByType("node"),r))?.[0]?.feature.id;return i?[i]:[]}function Qb(o,e,t){let r=[];for(let n of o.navigationTarget)for(let i of Bo(n,e,t))r.push(i);return r}async function Kb(o,e,t){let r=[];for(let n of o.navigationTarget)for(let i of await Vo(n,e,t))r.push(i);return r}function zu(o,e){let r=e?.getMVFFeatureById("entrance",o.id)?.properties.node;return r?[r]:[]}function $u(o,e){return e?.getMVFFeatureById("area",o.id)?.properties.destinationNodes??[]}function Xu(o,e){let t=e?.getMVFFeatureById("space",o.id);if(t==null)return[];let r=e.nodeIndex.entranceNodeIdsBySpaceId?.[o.id];return r&&r.length>0?r:t.properties.destinationNodes??[]}function e1(o,e){let t=[];for(let r of o.coordinates){let n=e.navigationNodes.nearestNodeIdsSync(r);n.length>0&&t.push(n[0])}return t}async function t1(o,e){let t=[];for(let r of o.coordinates){let n=await e.navigationNodes.nearestNodeIds(r);n.length>0&&t.push(n[0])}return t}function Yu(o,e){return e?.nodeIndex.objectEntranceNodeIdsByObstructionId[o.id]??[]}function Zu(o,e){return o.spaces.flatMap(t=>e?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string")}function Ju(o){return o.nodes.map(e=>e.id)}function Bo(o,e,t){if(we.has(o))return we.get(o);if(zt.is(o)){let r=Qb(o,e,t);return we.set(o,r),r}else if(ht.is(o)){let r=e.navigationNodes.nearestNodeIdsSync(o);return we.set(o,r),r}else if(X.is(o)){let r=e.navigationNodes.nearestNodeIdsSync(o);return we.set(o,r),r}else{if(ft.is(o))return e.navigationNodes.nearestNodeIdsSync(o);if(Ae.is(o)||$e.is(o)||Te.is(o)||Le.is(o)||Ce.is(o)){let r=e.navigationNodes.nodeIdsForFeature(o);return we.set(o,r),r}else if(Ee.is(o)){let r=e1(o,e);return we.set(o,r),r}else if(at.is(o)){let r=Ju(o);return we.set(o,r),r}else if(it.is(o)){let r=[o.id];return we.set(o,r),r}else return[]}}async function Vo(o,e,t){if(we.has(o))return we.get(o);if(zt.is(o)){let r=await Kb(o,e,t);return we.set(o,r),r}else if(ht.is(o)){let r=await e.navigationNodes.nearestNodeIds(o);return we.set(o,r),r}else if(X.is(o)){let r=await e.navigationNodes.nearestNodeIds(o);return we.set(o,r),r}else if(ft.is(o)){let r=await e.navigationNodes.nearestNodeIds(o);return we.set(o,r),r}else if(Ae.is(o)){let r=e.navigationNodes.nodeIdsForFeature(o);return we.set(o,r),r}else if($e.is(o)){let r=e.navigationNodes.nodeIdsForFeature(o);return we.set(o,r),r}else if(Te.is(o)){let r=e.navigationNodes.nodeIdsForFeature(o);return we.set(o,r),r}else if(Ee.is(o)){let r=await t1(o,e);return we.set(o,r),r}else if(Le.is(o)){let r=e.navigationNodes.nodeIdsForFeature(o);return we.set(o,r),r}else{if(Ce.is(o))return e.navigationNodes.nodeIdsForFeature(o);if(at.is(o)){let r=Ju(o);return we.set(o,r),r}else if(it.is(o)){let r=[o.id];return we.set(o,r),r}else return[]}}function qu(o,e){if(!o.instances||o.instances.length===0)return o;for(let t of o.instances)if(t.nodes.map(n=>n.id).includes(e))return t;return o}function Qu(o,e,t){let r=o.features[0]?.properties.id,n=e[0];if(e.length>1){for(let i of e)if((t.get(i)??[]).includes(r)){n=i;break}}return at.is(n)&&(n=qu(n,r)),n}function Ku(o,e,t){let r=o.features[o.features.length-1]?.properties.id,n=e[0];if(e.length>1){for(let i of e)if((t.get(i)??[]).includes(r)){n=i;break}}return at.is(n)&&(n=qu(n,r)),n}function xl(o){if(X.is(o))return o;if(!(!Gu(o)||Array.isArray(o.navigationTarget)||!X.is(o.navigationTarget)))return o.navigationTarget}var o1=o=>"type"in o&&o.type==="FeatureCollection";function r1(o,e){let t=o.features;for(let r=t.length-2;r>=0;r--){let n=t[r],i=t[r+1];e.navigationNodes.sameDoorNode(n.properties.id,i.properties.id)&&(t[r]={...n,properties:{...i.properties,distance:(n.properties.distance??0)+(i.properties.distance??0),id:n.properties.id}},t.splice(r+1,1))}}var lr=class{navigator;constructor({nodes:e,geojsonCollection:t,groupBy:r,multiplicativeDistanceWeightScaling:n,flagDeclarations:i,getDoorByNodeId:a}){this.navigator=new bd({nodes:e,geojsonCollection:o1(t)?t:this.createCollection(t),groupBy:r,multiplicativeDistanceWeightScaling:n,flagDeclarations:i,getDoorByNodeId:a})}processTargets(e,t,r){let n=[],i=[],a=new Map,s=new Set,l=new Set;for(let[c,d]of e){let p=a.get(c);p||(p=[],a.set(c,p)),Te.is(c)&&s.add(c.id);for(let g of d)p.push(g),n.push(g)}for(let[c,d]of t){let p=a.get(c);p||(p=[],a.set(c,p)),Te.is(c)&&l.add(c.id);for(let g of d)p.push(g),i.push(g)}if(s.size===0&&l.size===0)return{originIds:n,destinationNodeIds:i,featureToNodeIdsMap:a};for(let c of n){let d=r.navigationNodes.spaceIdsForNode(c);for(let p of d)if(l.has(p)){i.push(c);break}}for(let c of i){let d=r.navigationNodes.spaceIdsForNode(c);for(let p of d)if(s.has(p)){n.push(c);break}}return{originIds:n,destinationNodeIds:i,featureToNodeIdsMap:a}}getDirections=async(e,t,r,n)=>{let i=new Map,a=new Map;for(let d of e)i.set(d,await Vo(d,n,n.enterpriseMode));for(let d of t)a.set(d,await Vo(d,n,n.enterpriseMode));let{originIds:s,destinationNodeIds:l,featureToNodeIdsMap:c}=this.processTargets(i,a,n);return this.#e(e,t,s,l,r,n,c)};getDirectionsSync=(e,t,r,n)=>{let i=new Map(e.map(d=>[d,Bo(d,n,n.enterpriseMode)])),a=new Map(t.map(d=>[d,Bo(d,n,n.enterpriseMode)])),{originIds:s,destinationNodeIds:l,featureToNodeIdsMap:c}=this.processTargets(i,a,n);return this.#e(e,t,s,l,r,n,c)};#e=(e,t,r,n,i,a,s)=>{let l=this.getDisabledConnectionNodeIds(i.accessible,a).filter(E=>!r.includes(E)&&!n.includes(E)),c=new Map,d={...i.connectionIdWeightMap};for(let E of i.excludedConnections)d[E.id]=1/0;for(let E in d){let k=a.getById("connection",E);k&&this.#r(a.navigationNodes.connectionNodeIds(k),d[E],c)}if(i.__EXPERIMENTAL_overrideDoorWeight!==void 0)for(let E of this.#o(a))c.set(E,i.__EXPERIMENTAL_overrideDoorWeight);let g=(i.smoothing.method??"greedy-los")!=="greedy-los",m=this.navigator.getDirections({zones:i.zones.map(E=>({geometry:E.geometry,cost:E.cost,costAccumulation:E.costAccumulation,map:E.floor?.id})),originIds:r,from:g?ef(e):[],to:g?ef(t):[],destinationNodeIds:n,disabledConnectionNodeIds:l,simplify:i.smoothing,overrideEdgeWeights:c,multiplicativeDistanceWeightScaling:!a.enterpriseMode,includeNonPublic:i.includeNonPublic,outdoorPathWeightMultiplier:i.__EXPERIMENTAL_outdoorPathWeightMultiplier});r1(m,a),this.addCoordinateDirections(m,e,t);let I=Qu(m,e,s),v=Ku(m,t,s),y=new co(m,a,I,v);if(!(y.distance===0&&new Set([...r,...n]).size===r.length+n.length))return y};getDisabledConnectionNodeIds=(e,t)=>e===!1?[]:t.navigationNodes.inaccessibleConnectionNodeIds();#t;#o=e=>{if(this.#t)return this.#t;let t=[],r=e.navigationNodes.doorNodeIds();if(r.size>0)for(let n of Object.values(this.navigator.graph.edges))for(let i of n){let a=i.origin.properties.id,s=i.destination.properties.id;!r.has(a)&&!r.has(s)||e.navigationNodes.sameDoorNode(a,s)||t.push(i)}return this.#t=t,t};#r=(e,t,r)=>{if(e.length<2)return;let n=new Set(e);for(let i of e){let a=this.navigator.graph.edges[i];if(a)for(let s of a)n.has(s.destination.properties.id)&&r.set(s,t)}};addCoordinateDirections=(e,[t],[r])=>{if(!e.features.length)return;let n=xl(t);if(n){let a=this.createDirectionFeature(n,this.navigator.getAngle([n.longitude,n.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([n.longitude,n.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,a)}let i=xl(r);if(i){let a=this.createDirectionFeature(i,0,0),s=e.features[e.features.length-1];s.properties.distance=this.navigator.getDistance(s.geometry.coordinates,[i.longitude,i.latitude]),s.properties.angle=this.navigator.getAngle(s.geometry.coordinates,[i.longitude,i.latitude]),e.features.push(a)}};createCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[r,n])=>t.concat(n.features.map(i=>(i.properties.map=r,i))),[])}}createDirectionFeature=(e,t,r)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:r,edges:[]}})};function n1(o){if(X.is(o))return o.floorId;if(Te.is(o)||Ae.is(o)||ft.is(o)||ht.is(o)||Le.is(o)||$e.is(o)||it.is(o))return o.floor.id;if((Ee.is(o)||at.is(o))&&o.coordinates.length>0)return o.coordinates[0].floorId;if(Ce.is(o)&&o.spaces.length>0)return o.spaces[0].floor.id}function ef(o){return o.reduce((e,t)=>{let r=Io(t);if(!r)return e;let n=n1(t);return e.push({type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{id:t.id,neighbors:[],map:n}}),e},[])}f();f();f();import Nt from"zod";var zr=50,Cl=1,Zi=!1,i1=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")},Ml=Nt.object({limit:Nt.enum(["same-floor","same-elevation","all-floors"]).optional(),mode:Nt.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:Nt.boolean().optional().or(Nt.literal("auto")),maxDistance:Nt.number().optional(),maxResults:Nt.number().optional(),travelDistanceOptions:Nt.object({excludedConnections:Nt.array(Nt.custom(o=>typeof o=="object"&&o!==null&&Ee.is(o))).optional(),zones:Nt.array(Nt.custom(i1)).optional()}).optional()}),El={lineOfSight:Zi,mode:"travel-distance",maxDistance:zr,limit:"same-floor",maxResults:Cl,travelDistanceOptions:{}},An=class{#e;#t;#o=new WeakMap;constructor(e,t){this.#e=e,this.#t=t}__LEGACY_NEAREST_SYNC=(e,t,r)=>{if(this.#e.mvf==null)throw new re(xt("Query.__LEGACY_NEAREST_SYNC","Query.nearest"));let n={...El,...r};try{Ml.parse(n)}catch(d){_.error(d);return}let i=Io(e);if(!i)return;let a=this.#r(i,n),s=[],l={},c=[];for(let d of t){let p=Bo(d,this.#e,this.#e.enterpriseMode);if(p)for(let g of p)l[g]||(l[g]=[]),l[g].push(d),c.push(g)}return r?.mode==="absolute-distance"?s=this.#i(i,a,t,n):s=this.#c(e,a,c,l,n),s.sort((d,p)=>d.distance-p.distance)};async nearest(e,t,r){let n={...El,...r};try{Ml.parse(n)}catch(p){_.error(p);return}let i=Io(e);if(!i)return;let a=this.#r(i,n),s=[],l={},c=[],d=[];if(r?.mode==="absolute-distance")s=this.#i(i,a,t,n);else{for(let p of t)d.push(Vo(p,this.#e,this.#e.enterpriseMode).then(g=>{if(g)for(let m of g)l[m]||(l[m]=[]),l[m].push(p),c.push(m)}));await Promise.all(d),s=await this.#a(e,a,c,l,n)}return s.sort((p,g)=>p.distance-g.distance)}async nearestNode(e,t){let r={...El,...t,mode:"absolute-distance"};try{Ml.parse(r)}catch(s){_.error(s);return}let n=Io(e);if(!n)return;let i=this.#e.navigationNodes;return i.nearestNodesOnFloors(n,this.#r(n,r),{lineOfSight:r.lineOfSight==="auto"?Zi:r.lineOfSight,maxDistance:r.maxDistance,maxResults:r.maxResults}).slice(0,r.maxResults).flatMap(({id:s,distance:l})=>{let c=i.node(s);return c?[{distance:l,feature:c}]:[]})}#r(e,t){let r=e.floorId?[e.floorId]:[];if(t?.limit==="all-floors")r=this.#e.getByType("floor").map(n=>n.id);else if(e.floorId==null)for(let n of this.#e.getByType("floor-stack")){let i=n.defaultFloor;i&&r.push(i.id)}else if(t?.limit==="same-elevation"){let n=this.#e.floorsById[e.floorId];if(n){let i=n?.elevation;i!=null&&(r=this.#e.getByType("floor-stack").map(a=>a.floors.find(s=>s.elevation===i)?.id).filter(Boolean))}}return r}#i=(e,t,r,n)=>{let i=[],a=this.#n(r);for(let s of t)for(let[l,c]of a){let d=this.#t.searchWithIncludedIds([e.longitude,e.latitude],l,this.#e.mapName,s,c,n?.maxDistance??zr,n?.lineOfSight==="auto"?Zi:n?.lineOfSight,n?.maxResults??1);if(d)for(let p of d)i.push({distance:p.distance,feature:this.#e.getById(l,p.node.properties.parentId)||this.#e.getById(l,p.node.properties.id)})}return i};nearestNodesOnFloors=(e,t,{lineOfSight:r,maxDistance:n,maxResults:i})=>this.#i(e,[...t],this.#e.getByType("node"),{limit:"same-floor",lineOfSight:r,mode:"absolute-distance",maxDistance:n,maxResults:i,travelDistanceOptions:{}}).map(a=>({id:a.feature.id,distance:a.distance})).sort((a,s)=>a.distance-s.distance);nearestNodeOnFloor=(e,t,{lineOfSight:r,maxDistance:n})=>{let[i]=this.#i(e,[t],this.#e.getByType("node").filter(a=>a.floor.id===t),{limit:"same-floor",lineOfSight:r,mode:"absolute-distance",maxDistance:n,maxResults:1,travelDistanceOptions:{}});return i?{id:i.feature.id,distance:i.distance}:void 0};#n=e=>{let t=this.#o.get(e);if(t)return t;let r=new Map;for(let n of e){let i=r.get(n.__type);i?i.push(n.id):r.set(n.__type,[n.id])}return this.#o.set(e,r),r};#s=e=>{let t=new Map,{edges:r}=this.#e.requireDirections().navigator.graph;for(let n of e){let i=this.#e.navigationNodes.connectionNodeIds(n);if(i.length<2)continue;let a=new Set(i);for(let s of i){let l=r[s];if(l)for(let c of l)a.has(c.destination.properties.id)&&t.set(c,1/0)}}return t};#l=e=>{let t=e?.travelDistanceOptions?.excludedConnections??[],r=(e?.travelDistanceOptions?.zones??[]).map(n=>({geometry:n.geometry,cost:n.cost,costAccumulation:n.costAccumulation,map:n.floor?.id}));return{overrideEdgeWeights:this.#s(t),zones:r}};#a=async(e,t,r,n,i)=>{let a=[],s=i?.limit==="all-floors"&&!it.is(e)&&e.anchorTarget.floorId?[e.anchorTarget.floorId]:t,{overrideEdgeWeights:l,zones:c}=this.#l(i);for(let d of s){let p=0,g;if(!it.is(e)){let m=this.#e.navigationNodes.nearestNodeOnFloor(e.anchorTarget,d,{lineOfSight:i?.lineOfSight??!0,maxDistance:i?.maxDistance??zr});m&&(g=m.id,p=m.distance)}if(g){let m=new Set,I=this.#e.requireDirections().navigator.findNearestNodesOnGraph(g,(i?.maxDistance??zr)-p,d,r,!1,i?.maxResults??Cl,l,c);for(let v of I)for(let y of n[v.feature.properties.id])m.has(y.id)||(a.push({distance:v.distance+p,feature:y}),m.add(y.id))}}return a};#c=(e,t,r,n,i)=>{let a=[],s=i?.limit==="all-floors"&&!it.is(e)&&e.anchorTarget.floorId?[e.anchorTarget.floorId]:t,{overrideEdgeWeights:l,zones:c}=this.#l(i);for(let d of s){let p;if(it.is(e)||(p=this.__LEGACY_NEAREST_SYNC(e,this.#e.getByType("node"),{lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??zr,maxResults:1})?.[0].feature),p){let g=this.#e.requireDirections().navigator.findNearestNodesOnGraph(p.id,i?.maxDistance??zr,d,r,i?.lineOfSight==="auto"?Zi:i?.lineOfSight,i?.maxResults??Cl,l,c);for(let m of g)for(let I of n[m.feature.properties.id])a.push({distance:m.distance,feature:I})}}return a}};f();var Ji=class{#e;constructor(e){this.#e=e}at(e){let t=[],r=[e.longitude,e.latitude],n=e.floorId?[e.floorId]:this.#e.getAllFloorIds();for(let i of n){let a=this.#e.searchAtCoordinate(e,i);for(let s of a)this.#t(r,s)&&t.push(s)}return t}#t(e,t){let r=t.geoJSON;if(!r||!r.geometry)return!1;let n=r.geometry.type;return n==="Point"?e[0]===r.geometry.coordinates[0]&&e[1]===r.geometry.coordinates[1]:n!=="Polygon"&&n!=="MultiPolygon"?!1:fn(e,r)}};f();f();f();f();function tf(o){let e=+this._x.call(null,o),t=+this._y.call(null,o);return of(this.cover(e,t),e,t,o)}function of(o,e,t,r){if(isNaN(e)||isNaN(t))return o;var n,i=o._root,a={data:r},s=o._x0,l=o._y0,c=o._x1,d=o._y1,p,g,m,I,v,y,E,k;if(!i)return o._root=a,o;for(;i.length;)if((v=e>=(p=(s+c)/2))?s=p:c=p,(y=t>=(g=(l+d)/2))?l=g:d=g,n=i,!(i=i[E=y<<1|v]))return n[E]=a,o;if(m=+o._x.call(null,i.data),I=+o._y.call(null,i.data),e===m&&t===I)return a.next=i,n?n[E]=a:o._root=a,o;do n=n?n[E]=new Array(4):o._root=new Array(4),(v=e>=(p=(s+c)/2))?s=p:c=p,(y=t>=(g=(l+d)/2))?l=g:d=g;while((E=y<<1|v)===(k=(I>=g)<<1|m>=p));return n[k]=i,n[E]=a,o}function rf(o){var e,t,r=o.length,n,i,a=new Array(r),s=new Array(r),l=1/0,c=1/0,d=-1/0,p=-1/0;for(t=0;t<r;++t)isNaN(n=+this._x.call(null,e=o[t]))||isNaN(i=+this._y.call(null,e))||(a[t]=n,s[t]=i,n<l&&(l=n),n>d&&(d=n),i<c&&(c=i),i>p&&(p=i));if(l>d||c>p)return this;for(this.cover(l,c).cover(d,p),t=0;t<r;++t)of(this,a[t],s[t],o[t]);return this}f();function nf(o,e){if(isNaN(o=+o)||isNaN(e=+e))return this;var t=this._x0,r=this._y0,n=this._x1,i=this._y1;if(isNaN(t))n=(t=Math.floor(o))+1,i=(r=Math.floor(e))+1;else{for(var a=n-t||1,s=this._root,l,c;t>o||o>=n||r>e||e>=i;)switch(c=(e<r)<<1|o<t,l=new Array(4),l[c]=s,s=l,a*=2,c){case 0:n=t+a,i=r+a;break;case 1:t=n-a,i=r+a;break;case 2:n=t+a,r=i-a;break;case 3:t=n-a,r=i-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=t,this._y0=r,this._x1=n,this._y1=i,this}f();function af(){var o=[];return this.visit(function(e){if(!e.length)do o.push(e.data);while(e=e.next)}),o}f();function sf(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]]}f();f();function Ye(o,e,t,r,n){this.node=o,this.x0=e,this.y0=t,this.x1=r,this.y1=n}function lf(o,e,t){var r,n=this._x0,i=this._y0,a,s,l,c,d=this._x1,p=this._y1,g=[],m=this._root,I,v;for(m&&g.push(new Ye(m,n,i,d,p)),t==null?t=1/0:(n=o-t,i=e-t,d=o+t,p=e+t,t*=t);I=g.pop();)if(!(!(m=I.node)||(a=I.x0)>d||(s=I.y0)>p||(l=I.x1)<n||(c=I.y1)<i))if(m.length){var y=(a+l)/2,E=(s+c)/2;g.push(new Ye(m[3],y,E,l,c),new Ye(m[2],a,E,y,c),new Ye(m[1],y,s,l,E),new Ye(m[0],a,s,y,E)),(v=(e>=E)<<1|o>=y)&&(I=g[g.length-1],g[g.length-1]=g[g.length-1-v],g[g.length-1-v]=I)}else{var k=o-+this._x.call(null,m.data),w=e-+this._y.call(null,m.data),B=k*k+w*w;if(B<t){var D=Math.sqrt(t=B);n=o-D,i=e-D,d=o+D,p=e+D,r=m.data}}return r}f();function cf(o){if(isNaN(d=+this._x.call(null,o))||isNaN(p=+this._y.call(null,o)))return this;var e,t=this._root,r,n,i,a=this._x0,s=this._y0,l=this._x1,c=this._y1,d,p,g,m,I,v,y,E;if(!t)return this;if(t.length)for(;;){if((I=d>=(g=(a+l)/2))?a=g:l=g,(v=p>=(m=(s+c)/2))?s=m:c=m,e=t,!(t=t[y=v<<1|I]))return this;if(!t.length)break;(e[y+1&3]||e[y+2&3]||e[y+3&3])&&(r=e,E=y)}for(;t.data!==o;)if(n=t,!(t=t.next))return this;return(i=t.next)&&delete t.next,n?(i?n.next=i:delete n.next,this):e?(i?e[y]=i:delete e[y],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[E]=t:this._root=t),this):(this._root=i,this)}function df(o){for(var e=0,t=o.length;e<t;++e)this.remove(o[e]);return this}f();function pf(){return this._root}f();function uf(){var o=0;return this.visit(function(e){if(!e.length)do++o;while(e=e.next)}),o}f();function ff(o){var e=[],t,r=this._root,n,i,a,s,l;for(r&&e.push(new Ye(r,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!o(r=t.node,i=t.x0,a=t.y0,s=t.x1,l=t.y1)&&r.length){var c=(i+s)/2,d=(a+l)/2;(n=r[3])&&e.push(new Ye(n,c,d,s,l)),(n=r[2])&&e.push(new Ye(n,i,d,c,l)),(n=r[1])&&e.push(new Ye(n,c,a,s,d)),(n=r[0])&&e.push(new Ye(n,i,a,c,d))}return this}f();function hf(o){var e=[],t=[],r;for(this._root&&e.push(new Ye(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var n=r.node;if(n.length){var i,a=r.x0,s=r.y0,l=r.x1,c=r.y1,d=(a+l)/2,p=(s+c)/2;(i=n[0])&&e.push(new Ye(i,a,s,d,p)),(i=n[1])&&e.push(new Ye(i,d,s,l,p)),(i=n[2])&&e.push(new Ye(i,a,p,d,c)),(i=n[3])&&e.push(new Ye(i,d,p,l,c))}t.push(r)}for(;r=t.pop();)o(r.node,r.x0,r.y0,r.x1,r.y1);return this}f();function gf(o){return o[0]}function mf(o){return arguments.length?(this._x=o,this):this._x}f();function yf(o){return o[1]}function bf(o){return arguments.length?(this._y=o,this):this._y}function Rn(o,e,t){var r=new _l(e??gf,t??yf,NaN,NaN,NaN,NaN);return o==null?r:r.addAll(o)}function _l(o,e,t,r,n,i){this._x=o,this._y=e,this._x0=t,this._y0=r,this._x1=n,this._y1=i,this._root=void 0}function If(o){for(var e={data:o.data},t=e;o=o.next;)t=t.next={data:o.data};return e}var gt=Rn.prototype=_l.prototype;gt.copy=function(){var o=new _l(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,r;if(!e)return o;if(!e.length)return o._root=If(e),o;for(t=[{source:e,target:o._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(r=e.source[n])&&(r.length?t.push({source:r,target:e.target[n]=new Array(4)}):e.target[n]=If(r));return o};gt.add=tf;gt.addAll=rf;gt.cover=nf;gt.data=af;gt.extent=sf;gt.find=lf;gt.remove=cf;gt.removeAll=df;gt.root=pf;gt.size=uf;gt.visit=ff;gt.visitAfter=hf;gt.x=mf;gt.y=bf;f();function Fl(o,e,t,r=0,n=0,i=0,a=0){if(t===void 0){t=o.root();let l=o.extent();if(l&&([[r,n],[i,a]]=l,e(t,r,n,i,a)))return!0;if(!t)return!1}let s=[[r,n,(i+r)/2,(a+n)/2],[(i+r)/2,n,i,(a+n)/2],[r,(a+n)/2,(i+r)/2,a],[(i+r)/2,(a+n)/2,i,a]];for(let l=0;l<4;l++){let c=t[l];if(c){let[d,p,g,m]=s[l];e(c,d,p,g,m)||Fl(o,e,c,d,p,g,m)}}return!1}var Tf=1e3,a1=.1,s1=5,l1=1.5,qi=class{#e={};#t=new Map;#o=new WeakMap;getMaxSearchRadiusForFloorId=(e,t)=>{let r=this.#t.get(this.#n.mapName)?.get(t);if(r)return r;let n=this.getNodeTreeByTypeAndFloorId(e,this.#n.mapName,t);if(typeof n.extent=="function")if(n.extent()){let[[i,a],[s,l]]=n.extent(),c=s-i,d=l-a;r=Math.max(c,d)}else r=Tf;else r=Tf;return this.#t.set(this.#n.mapName,new Map([[t,r]])),r};searchWithIncludedIds(e,t,r,n,i,a,s=!1,l=1/0){let c=this.getNodeTreeByTypeAndFloorId(t,r,n),d=this.#r(i),p=new Set,g=[],m=s1,I=Math.max(a,this.getMaxSearchRadiusForFloorId(t,n));for(;g.length<l&&m<=I;){let v=this.#i(e,c,d,m,a,p);v.sort((y,E)=>y.distance-E.distance);for(let y of v){if(g.length>=l)break;s?this.#n.requireDirections().navigator.hasLineOfSight(e,y.node.geometry.coordinates,n,a1)&&g.push(y):g.push(y)}m=m*l1}return g}#r=e=>{let t=this.#o.get(e);if(t)return t;let r=new Set(e);return this.#o.set(e,r),r};#i(e,t,r,n,i,a){let{x:s,y:l}=this.#l(e[0],e[1]),c=s-n,d=s+n,p=l-n,g=l+n,m=[];return Fl(t,(I,v,y,E,k)=>{let w=v>=d||y>=g||E<c||k<p;if("data"in I){let B=I;for(;B;){let D=B.data,j=D.properties.parentId||D.properties.id;if(r.has(j)&&!a.has(j)){a.add(j);let G=Dt(e,D.geometry.coordinates);G<=i&&m.push({node:D,distance:G})}B=B.next}}return w}),m}#n;getNodeTreeByTypeAndFloorId(e,t,r){if(this.#e[e]||(this.#e[e]={}),this.#e[e][t]?.[r])return this.#e[e][t][r];this.#e[e][t]||(this.#e[e][t]={}),this.#e[e][t][r]=Rn();let n=this.#e[e][t][r];n.x(a=>{let s=a.geometry.coordinates;return this.#l(s[0],s[1]).x}),n.y(a=>{let s=a.geometry.coordinates;return this.#l(s[0],s[1]).y});let i=[];switch(e){case"space":{i=this.#n.navigationNodes.spaceNearestPointsOnFloor(r).map(l=>({type:"Feature",geometry:{type:"Point",coordinates:l.coordinate},properties:{id:l.nodeId,parentId:l.spaceId,neighbors:[]}}));break}case"node":i=(this.#n.nodeRecordsByFloorId[r]??[]).filter(l=>l.neighborIds.length>0).map(l=>({type:"Feature",geometry:l.geometry,properties:{id:l.id}}));break;case"point-of-interest":i=(this.#n.poiRecordsByFloorId[r]??[]).map(l=>({type:"Feature",geometry:l.geometry,properties:{id:l.id}}));break;case"door":i=(this.#n.doorRecordsByFloorId[r]??[]).map(l=>({type:"Feature",geometry:l.geometry,properties:{id:l.id}}));break;case"annotation":i=(this.#n.annotationRecordsByFloorId[r]??[]).map(l=>({type:"Feature",geometry:l.geometry,properties:{id:l.id}}));break;case"enterprise-location":let a=this.#n.nodeRecordsByFloorId[r]||[],s=this.#n.nodeIndex.locationIdsByNodeId;i=[];for(let l=0;l<a.length;l++){let c=a[l],d=s[c.id];d?.length>0&&i.push({type:"Feature",geometry:c.geometry,properties:{id:c.id,parentId:d[0]}})}break;case"object":case"location-profile":case"connection":case"area":case"facade":i=this.#s(this.#n.getByType(e),r);break}return i?.length>0&&n.addAll(i),n}#s(e,t){let r=[];for(let n of e){let i=Bo(n,this.#n,this.#n.enterpriseMode);for(let a=0;a<i.length;a++){let s=this.#n.navigationNodes.nodePosition(i[a]);s?.floorId===t&&r.push({type:"Feature",geometry:{type:"Point",coordinates:s.coordinate},properties:{id:i[a],parentId:n.id,neighbors:[]}})}}return r}#l;constructor(e,t){this.#n=e,this.#l=t}};f();f();f();f();function Qi(o,e,t=0,r=o.length-1,n=c1){for(;r>t;){if(r-t>600){let l=r-t+1,c=e-t+1,d=Math.log(l),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(l-p)/l)*(c-l/2<0?-1:1),m=Math.max(t,Math.floor(e-c*p/l+g)),I=Math.min(r,Math.floor(e+(l-c)*p/l+g));Qi(o,e,m,I,n)}let i=o[e],a=t,s=r;for(Dn(o,t,e),n(o[r],i)>0&&Dn(o,t,r);a<s;){for(Dn(o,a,s),a++,s--;n(o[a],i)<0;)a++;for(;n(o[s],i)>0;)s--}n(o[t],i)===0?Dn(o,t,s):(s++,Dn(o,s,r)),s<=e&&(t=s+1),e<=s&&(r=s-1)}}function Dn(o,e,t){let r=o[e];o[e]=o[t],o[t]=r}function c1(o,e){return o<e?-1:o>e?1:0}var Ln=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,r=[];if(!ea(e,t))return r;let n=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let s=t.children[a],l=t.leaf?n(s):s;ea(e,l)&&(t.leaf?r.push(s):Pl(e,l)?this._all(s,r):i.push(s))}t=i.pop()}return r}collides(e){let t=this.data;if(!ea(e,t))return!1;let r=[];for(;t;){for(let n=0;n<t.children.length;n++){let i=t.children[n],a=t.leaf?this.toBBox(i):i;if(ea(e,a)){if(t.leaf||Pl(e,a))return!0;r.push(i)}}t=r.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let r=0;r<e.length;r++)this.insert(e[r]);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 r=this.data;this.data=t,t=r}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=Xr([]),this}remove(e,t){if(!e)return this;let r=this.data,n=this.toBBox(e),i=[],a=[],s,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],s=a.pop(),c=!0),r.leaf){let d=d1(e,r.children,t);if(d!==-1)return r.children.splice(d,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Pl(r,n)?(i.push(r),a.push(s),s=0,l=r,r=r.children[0]):l?(s++,r=l.children[s],c=!1):r=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 r=[];for(;e;)e.leaf?t.push(...e.children):r.push(...e.children),e=r.pop();return t}_build(e,t,r,n){let i=r-t+1,a=this._maxEntries,s;if(i<=a)return s=Xr(e.slice(t,r+1)),$r(s,this.toBBox),s;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),s=Xr([]),s.leaf=!1,s.height=n;let l=Math.ceil(i/a),c=l*Math.ceil(Math.sqrt(a));vf(e,t,r,c,this.compareMinX);for(let d=t;d<=r;d+=c){let p=Math.min(d+c-1,r);vf(e,d,p,l,this.compareMinY);for(let g=d;g<=p;g+=l){let m=Math.min(g+l-1,p);s.children.push(this._build(e,g,m,n-1))}}return $r(s,this.toBBox),s}_chooseSubtree(e,t,r,n){for(;n.push(t),!(t.leaf||n.length-1===r);){let i=1/0,a=1/0,s;for(let l=0;l<t.children.length;l++){let c=t.children[l],d=Ol(c),p=f1(e,c)-d;p<a?(a=p,i=d<i?d:i,s=c):p===a&&d<i&&(i=d,s=c)}t=s||t.children[0]}return t}_insert(e,t,r){let n=r?e:this.toBBox(e),i=[],a=this._chooseSubtree(n,this.data,t,i);for(a.children.push(e),Nn(a,n);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(n,i,t)}_split(e,t){let r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);let a=this._chooseSplitIndex(r,i,n),s=Xr(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,$r(r,this.toBBox),$r(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=Xr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,$r(this.data,this.toBBox)}_chooseSplitIndex(e,t,r){let n,i=1/0,a=1/0;for(let s=t;s<=r-t;s++){let l=kn(e,0,s,this.toBBox),c=kn(e,s,r,this.toBBox),d=h1(l,c),p=Ol(l)+Ol(c);d<i?(i=d,n=s,a=p<a?p:a):d===i&&p<a&&(a=p,n=s)}return n||r-t}_chooseSplitAxis(e,t,r){let n=e.leaf?this.compareMinX:p1,i=e.leaf?this.compareMinY:u1,a=this._allDistMargin(e,t,r,n),s=this._allDistMargin(e,t,r,i);a<s&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);let i=this.toBBox,a=kn(e,0,t,i),s=kn(e,r-t,r,i),l=Ki(a)+Ki(s);for(let c=t;c<r-t;c++){let d=e.children[c];Nn(a,e.leaf?i(d):d),l+=Ki(a)}for(let c=r-t-1;c>=t;c--){let d=e.children[c];Nn(s,e.leaf?i(d):d),l+=Ki(s)}return l}_adjustParentBBoxes(e,t,r){for(let n=r;n>=0;n--)Nn(t[n],e)}_condense(e){for(let t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():$r(e[t],this.toBBox)}};function d1(o,e,t){if(!t)return e.indexOf(o);for(let r=0;r<e.length;r++)if(t(o,e[r]))return r;return-1}function $r(o,e){kn(o,0,o.children.length,e,o)}function kn(o,e,t,r,n){n||(n=Xr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let i=e;i<t;i++){let a=o.children[i];Nn(n,o.leaf?r(a):a)}return n}function Nn(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 p1(o,e){return o.minX-e.minX}function u1(o,e){return o.minY-e.minY}function Ol(o){return(o.maxX-o.minX)*(o.maxY-o.minY)}function Ki(o){return o.maxX-o.minX+(o.maxY-o.minY)}function f1(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 h1(o,e){let t=Math.max(o.minX,e.minX),r=Math.max(o.minY,e.minY),n=Math.min(o.maxX,e.maxX),i=Math.min(o.maxY,e.maxY);return Math.max(0,n-t)*Math.max(0,i-r)}function Pl(o,e){return o.minX<=e.minX&&o.minY<=e.minY&&e.maxX<=o.maxX&&e.maxY<=o.maxY}function ea(o,e){return e.minX<=o.maxX&&e.minY<=o.maxY&&e.maxX>=o.minX&&e.maxY>=o.minY}function Xr(o){return{children:o,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function vf(o,e,t,r,n){let i=[e,t];for(;i.length;){if(t=i.pop(),e=i.pop(),t-e<=r)continue;let a=e+Math.ceil((t-e)/r/2)*r;Qi(o,a,e,t,n),i.push(e,a,a,t)}}var ta=class extends Ln{#e;constructor(e){super(),this.#e=e}toBBox=e=>{let t=e.geoJSONBoundingBox;t==null&&_.warn(`Item "${e.id}" has no geoJSONBoundingBox; falling back to zero-size bbox at origin.`);let r=t!=null&&t.length===6,n=t?.[0]??0,i=t?.[1]??0,a=(r?t?.[3]:t?.[2])??0,s=(r?t?.[4]:t?.[3])??0,l=this.#e(n,i),c=this.#e(a,s);return{minX:l.x,minY:l.y,maxX:c.x,maxY:c.y}};compareMinX=(e,t)=>{let r=this.toBBox(e),n=this.toBBox(t);return r.minX-n.minX};compareMinY=(e,t)=>{let r=this.toBBox(e),n=this.toBBox(t);return r.minY-n.minY};search(e,t,r,n){if(typeof e=="object")return super.search(e);let i=this.#e(e,t),a=this.#e(r,n);return super.search({minX:i.x,minY:i.y,maxX:a.x,maxY:a.y})}searchCoordinate(e){return this.search(e.longitude,e.latitude,e.longitude,e.latitude)}};var oa=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 r=new ta(this.#t),n=this.#e.floorsById[e];if(n){let i=[n,...n.spaces,...n.objects];for(let a of this.#e.areas)a.floor.id===e&&i.push(a);r.load(i)}return this.#o.set(e,r),r}searchAtCoordinate(e,t){return this.getTreeByFloorId(t).searchCoordinate(e)}getAllFloorIds(){return this.#e.floors.map(e=>e.id)}};f();function Sf(o,e){let t=111319.9*Math.cos(e*Math.PI/180);return(r,n)=>({x:(r-o)*t,y:(n-e)*111319.9})}var xf=new WeakMap,wl=o=>{let e=xf.get(o);if(e==null)throw new Error("Query has no nearest search.");return e},Bn=class{#e;#t;#o;#r;constructor(e){let t=Sf(e.mapCenter.longitude,e.mapCenter.latitude);this.#o=new qi(e,t),this.#r=new oa(e,t),this.#e=new An(e,this.#o),xf.set(this,this.#e),this.#t=new Ji(this.#r)}__LEGACY_NEAREST_SYNC=(e,t,r)=>this.#e.__LEGACY_NEAREST_SYNC(e,t,r);async nearest(e,t,r){return this.#e.nearest(e,t,r)}async nearestNode(e,t){return this.#e.nearestNode(e,t)}async at(e){return this.#t.at(e)}};f();f();var ra=class{#e;constructor(e){this.#e=e||[]}get raw(){return this.#e}};var Al=class o extends Ge{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(r=>new rr({mvfData:r})),this.images=(t.record.pictures??[]).map(r=>r.url?new io({mvfData:{...r,url:r.url??""},mapData:this.#e}):void 0).filter(r=>r!=null),t.record.website&&(this.website=new rr({mvfData:t.record.website})),t.record.icon&&(this.icon=new io({mvfData:{url:t.record.icon},mapData:this.#e})),t.record.logo&&(this.logoImage=new io({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 ra(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}}},zt=Al;f();var Rl=class o extends Ge{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 r=this.#e.getById("location-profile",t.id);r&&e.push(r)}return this.#t.locationProfiles=e,e}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}},Gr=Rl;f();var g1=["id","externalId","name","shortName","subtitle","elevation","maxHeight"];function Dl(o){let e={};for(let t of g1)o[t]!==void 0&&(e[t]=o[t]);return{type:"Feature",geometry:o.geometry??null,properties:e}}function Mf(o){let e=o?.geometry;if(!(e==null||e.type!=="Polygon"&&e.type!=="MultiPolygon")&&e.coordinates.length!==0)return Dl(o)}var m1=new Set(["void","otb"]);function Ef(o){let e=[];for(let t of o??[]){if(t.geometry?.type!=="Polygon")continue;let r=t.kind??"";m1.has(r.toLowerCase())&&e.push({type:"Feature",geometry:t.geometry,properties:{id:t.id,kind:r}})}return e}function Cf(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 _f(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}}}f();var na=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:wi(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 Te.is(e)?Xu(e,this.#e):Ae.is(e)?zu(e,this.#e):$e.is(e)?$u(e,this.#e):Le.is(e)?Yu(e,this.#e):Ce.is(e)?Zu(e,this.#e):[]}nearestNodeIds(e){return Wu(e,this.#e,this.#e.enterpriseMode)}nearestNodeIdsSync(e){return Hu(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 r of this.#e.spaceRecordsByFloorId[e]??[])for(let n of r.destinationNodes??[]){let i=this.#e.nodeRecordsById[n],a=i?.spaceIds?.[0];i?.geometry.type!=="Point"||a==null||t.push({nodeId:n,spaceId:a,coordinate:i.geometry.coordinates})}return t}nearestNodesOnFloors(e,t,r){return wl(this.#e.Query).nearestNodesOnFloors(e,t,r)}nearestNodeOnFloor(e,t,{lineOfSight:r,maxDistance:n}){return wl(this.#e.Query).nearestNodeOnFloor(e,t,{lineOfSight:r,maxDistance:n})}};f();var ia=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 Xe.is(e)?t.nodes(t.nodeIdsOnFloor(e.id)):Ee.is(e)?t.nodes(t.connectionNodeIds(e)):at.is(e)?e.nodes:e instanceof co?e.path:[]}};f();f();var aa=class{#e;#t;#o=new Map;#r=1/0;#i=-1/0;#n=1/0;#s=-1/0;constructor(e,t){this.#e=t;let r=0;for(let[,i]of e)r+=i;let n=e.length>0?r/e.length:0;this.#t=1/Math.max(Math.cos(n*Math.PI/180),1e-6);for(let i=0;i<e.length;i++){let[a,s]=e[i],l=this.#l(a),c=this.#a(s),d=this.#c(l,c),p=this.#o.get(d);p?p.indexes.push(i):this.#o.set(d,{column:l,row:c,indexes:[i]}),l<this.#r&&(this.#r=l),l>this.#i&&(this.#i=l),c<this.#n&&(this.#n=c),c>this.#s&&(this.#s=c)}}candidates(e,t){let r=t*this.#t,n=this.#l(e[0]-r),i=this.#l(e[0]+r),a=this.#a(e[1]-t),s=this.#a(e[1]+t),l=[];if(i<this.#r||n>this.#i||s<this.#n||a>this.#s)return l;if((i-n+1)*(s-a+1)>this.#o.size){for(let{column:c,row:d,indexes:p}of this.#o.values())if(!(c<n||c>i||d<a||d>s))for(let g of p)l.push(g)}else for(let c=n;c<=i;c++)for(let d=a;d<=s;d++){let p=this.#o.get(this.#c(c,d));if(p)for(let g of p.indexes)l.push(g)}return l.sort((c,d)=>c-d)}#l(e){return Math.floor(e/(this.#e*this.#t))}#a(e){return Math.floor(e/this.#e)}#c(e,t){return`${e},${t}`}};f();function Ff(o){let e=new Map;for(let s of o.floors?.features??[])e.set(s.properties.id,s.properties.elevation);let t=new Map,r=new Map;for(let s of Object.values(o.nodes??{}))for(let l of s?.features??[]){for(let c of l.properties.geometryIds){let d=t.get(c)??[];d.includes(l.properties.id)||d.push(l.properties.id),t.set(c,d)}for(let c of l.properties.neighbors){let d=r.get(c.id)??[];d.push(c.flags??[]),r.set(c.id,d)}}let n=new Map;for(let s of o.connections??[]){let l=1/0,c=-1/0;for(let p of[s.entrances,s.exits])for(let g of p){let m=e.get(g.floorId)??0;m<l&&(l=m),m>c&&(c=m)}let d=c>=l?c-l:0;for(let p of s.entrances)for(let g of t.get(p.geometryId)??[]){let m=n.get(g)??[];for(let I of s.exits){let v=Math.abs((e.get(p.floorId)??0)-(e.get(I.floorId)??0)),y=p.floorId===I.floorId,E=y1(s,y,v,d),k=s.type==="door"&&y;for(let w of t.get(I.geometryId)??[])w!==g&&m.push(k?{id:w,weight:E,sameStop:k}:{id:w,weight:E})}n.set(g,m)}}let i=Object.values(o.navigationFlags??{}),a=[];for(let[s,l]of Object.entries(o.nodes??{}))for(let c of l?.features??[]){let d=c.properties.id,p=I1(r.get(d)??[],i),g=[];for(let m of c.properties.neighbors)g.push({id:m.id,weight:m.extraCost});for(let m of n.get(d)??[])g.push(m);a.push({type:"Feature",geometry:c.geometry,properties:{id:d,map:s,floor:s,geometryIds:c.properties.geometryIds,neighbors:g,...p!==void 0&&{flags:p}}})}return{type:"FeatureCollection",features:a}}function y1(o,e,t,r){return o.type==="door"&&e?0:o.floorCostMultiplier>1&&r>0?o.entryCost*t/r:o.entryCost}var b1=(o,e)=>((o[e.index]??0)&1<<e.bit)!==0;function I1(o,e){let t=e.filter(i=>o.some(a=>b1(a,i)));if(t.length===0)return;let r=0;for(let i of t)i.index+1>r&&(r=i.index+1);let n=new Array(r).fill(0);for(let i of t)n[i.index]|=1<<i.bit;return n}var wf=111319.9,T1=5/wf,v1=5,la=class{collection;#e=new Map;#t=new Map;#o=new Map;#r=new Map;#i;#n=new Map;#s=new Map;#l=new Map;#a=new Map;#c;#d=new Map;constructor(e){this.collection=Ff(e);let t=new Map;for(let r of this.collection.features){let n=r.properties.flags;Array.isArray(n)&&n.every(i=>typeof i=="number")&&t.set(r.properties.id,n)}for(let r of this.collection.features)this.#d.set(r.properties.id,r.properties.neighbors.map(n=>n.id));for(let[r,n]of Object.entries(e.nodes??{})){let i=[];for(let a of n?.features??[]){let{id:s,geometryIds:l}=a.properties,[c,d]=a.geometry.coordinates,p=t.get(s);this.#e.set(s,{id:s,coordinate:[c,d],floorId:r,geometryIds:l,...p!==void 0&&{flags:p}}),this.#l.set(s,a.properties.neighbors.map(g=>g.id)),i.push(s);for(let g of l){let m=this.#t.get(g)??[];m.push(s),this.#t.set(g,m)}}this.#o.set(r,i)}this.#c=S1(e);for(let r of e.connections??[]){let n=[...r.entrances,...r.exits].map(l=>l.geometryId),i=this.nodeIdsForGeometry(n);if(this.#s.set(r.id,i),r.type==="door"&&!M1(r)){for(let l of i)this.#n.has(l)||this.#n.set(l,r.id);continue}let s={id:r.id,type:r.type,nodeIds:i};for(let l of i)this.#a.has(l)||this.#a.set(l,s)}}nodeIdsForGeometry(e){let t=[];for(let r of e)for(let n of this.#t.get(r)??[])t.includes(n)||t.push(n);return t}geometryIdsForNode(e){return this.#e.get(e)?.geometryIds??[]}doorIdForNode(e){return this.#n.get(e)}entranceNodeIds(e,t){let r=this.nodeIdsForGeometry([e]),n=r.filter(l=>this.#n.has(l));if(n.length===0)return r;let i=new Map;for(let l of n){let c=l.replace(/-p\d+$/,""),d=i.get(c);d?d.push(l):i.set(c,[l])}let a=l=>t!=null&&(this.#l.get(l)??[]).some(c=>{let d=this.#e.get(c);return d!=null&&Of(d.coordinate,t)}),s=[];for(let l of i.values())s.push(l.find(a)??l[0]);return s}nodeIdsForConnection(e){return this.#s.get(e)??[]}connectionForNode(e){return this.#a.get(e)}doorNodeIds(){return this.#i??=new Set(this.#n.keys()),this.#i}nodeIdsInPolygon(e,t){let r=this.#o.get(e)??[],[n]=t;if(n==null||n.length===0||r.length===0)return[];let i=1/0,a=-1/0,s=1/0,l=-1/0;for(let[g,m]of n)g<i&&(i=g),g>a&&(a=g),m<s&&(s=m),m>l&&(l=m);let c=[(i+a)/2,(s+l)/2],d=Math.max((l-s)/2,(a-i)/2*Math.cos(c[1]*Math.PI/180)),p=[];for(let g of this.#u(e).candidates(c,d)){let m=r[g];Of(this.#e.get(m).coordinate,t)&&p.push(m)}return p}nearestNodes(e,t,{maxDistance:r,limit:n=1/0}){let i=this.#o.get(t);if(i==null||i.length===0||n<=0)return[];let a=[e[0],e[1]],s=this.#u(t),l=new Map,c=d=>{let p=[];for(let g of s.candidates(a,d/wf*1.01)){let m=l.get(g);m===void 0&&(m=Dt(a,this.#e.get(i[g]).coordinate),l.set(g,m)),m<=d&&p.push({id:i[g],distance:m})}return p.sort((g,m)=>g.distance-m.distance)};for(let d=Math.min(v1,r);;d=Math.min(d*2,r)){let p=c(d);if(p.length>=n||d>=r)return p.length>n?p.slice(0,n):p}}#u(e){let t=this.#r.get(e);if(t==null){let r=(this.#o.get(e)??[]).map(n=>this.#e.get(n).coordinate);t=new aa(r,T1),this.#r.set(e,t)}return t}obstructions(){return this.#c}nodeIdsOnFloor(e){return this.#o.get(e)??[]}allNodeIds(){let e=[];for(let t of this.#o.values())for(let r of t)e.push(r);return e}neighborIds(e){return this.#d.get(e)??[]}node(e){return this.#e.get(e)}};function S1(o){let e=[];for(let[t,r]of Object.entries(o.geometry??{})){let n=o.nonwalkable?.[t];if(n!=null)for(let i of r?.features??[]){let a=i.properties.id;if(!(a in n))continue;let s=x1(i.geometry);s.forEach((l,c)=>{e.push({type:"Feature",geometry:l,properties:{id:s.length>1?`${a}-${c}`:a,externalId:"",entrances:[],map:t}})})}}return{type:"FeatureCollection",features:e}}var sa=([o,e])=>[o,e];function x1(o){switch(o.type){case"LineString":return[{type:"LineString",coordinates:o.coordinates.map(sa)}];case"Polygon":return[{type:"Polygon",coordinates:o.coordinates.map(e=>e.map(sa))}];case"MultiLineString":return o.coordinates.map(e=>({type:"LineString",coordinates:e.map(sa)}));case"MultiPolygon":return o.coordinates.map(e=>({type:"Polygon",coordinates:e.map(t=>t.map(sa))}));default:return[]}}function M1(o){let e=o.entrances[0]?.floorId??o.exits[0]?.floorId;for(let t of[o.entrances,o.exits])for(let r of t)if(r.floorId!==e)return!0;return!1}function Of(o,e){let[t,...r]=e;return Pf(o,t)&&!r.some(n=>Pf(o,n))}function Pf(o,e){if(e==null)return!1;let t=!1;for(let r=0,n=e.length-1;r<e.length;n=r++){let[i,a]=e[r],[s,l]=e[n];a>o[1]!=l>o[1]&&o[0]<(s-i)*(o[1]-a)/(l-a)+i&&(t=!t)}return t}f();f();var ca=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 r=this.#t.keys().next();r.done||this.#t.delete(r.value)}}};var Af=50,Rf=o=>o.replace(/-p\d+$/,""),da=o=>`g_${o.slice(o.indexOf("_")+1)}`,E1=5e3,pa=class{#e;#t;#o=new ca(E1);#r;constructor(e,t){this.#e=e,this.#t=t}sameDoorNode(e,t){let r=this.#t.doorIdForNode(e);return e!==t&&r!=null&&r===this.#t.doorIdForNode(t)&&Rf(e)===Rf(t)}spaceIdsForNode(e){let t=new Set(this.#t.geometryIdsForNode(e).map(r=>`s_${r.slice(2)}`).filter(r=>this.#e.spacesById[r]!=null));return t.size<2?[...t]:[...t].sort((r,n)=>this.#n().get(r)-this.#n().get(n))}#i;#n(){return this.#i??=new Map(Object.keys(this.#e.spacesById).map((e,t)=>[e,t])),this.#i}objectIdsForNode(e){let t=this.#t.geometryIdsForNode(e).map(r=>`o_${r.slice(2)}`).filter(r=>this.#e.objectsById[r]!=null);return[...new Set(t)]}doorForNode(e){let t=this.#t.doorIdForNode(e);return t==null?void 0:wi(this.#e.doorRecordsById[t]?.geometry)}doorNodeIds(){return this.#t.doorNodeIds()}connectionNodeIds(e){return this.#t.nodeIdsForConnection(e.id)}inaccessibleConnectionNodeIds(){if(this.#r==null){let e=[];for(let t of Object.values(this.#e.connectionRecordsById))if(!t.accessible)for(let r of this.#t.nodeIdsForConnection(t.id))e.push(r);this.#r=e}return this.#r}connectionForNode(e){return this.#t.connectionForNode(e)}node(e){let t=this.#o.get(e);if(t)return t;let r=this.#t.node(e);if(r==null)return;let n=this.spaceIdsForNode(e),i=new it(this.#e,{record:{id:r.id,floorId:r.floorId,geometry:{type:"Point",coordinates:r.coordinate},neighborIds:this.#t.neighborIds(e),spaceIds:n,...r.flags!==void 0&&{flags:r.flags},populated:{spaceIds:n,objectIds:this.objectIdsForNode(e)}}});return this.#o.set(e,i),i}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){return Te.is(e)?this.#s(e.id):Ae.is(e)?this.#t.nodeIdsForGeometry([da(e.id)]):$e.is(e)?this.#l(e):Le.is(e)?this.#a(e):Ce.is(e)?e.spaces.flatMap(t=>this.#s(t.id)):[]}async nearestNodeIds(e){return this.nearestNodeIdsSync(e)}nodePosition(e){let t=this.#t.node(e);return t==null?void 0:{floorId:t.floorId,coordinate:t.coordinate}}spaceNearestPointsOnFloor(e){let t=[];for(let r of this.#e.spaceRecordsByFloorId[e]??[])for(let n of this.#t.nodeIdsForGeometry([da(r.id)])){let i=this.#t.node(n);i==null||i.floorId!==e||t.push({nodeId:n,spaceId:r.id,coordinate:i.coordinate})}return t}nearestNodeIdsSync(e){let t=e.anchorTarget,n=(t.floorId!=null?[t.floorId]:this.#e.getByType("floor-stack").map(i=>i.defaultFloor?.id).filter(i=>i!=null)).map(i=>this.nearestNodeOnFloor(t,i,{lineOfSight:!0,maxDistance:Af})).filter(i=>i!==void 0).sort((i,a)=>i.distance-a.distance);return n.length>0?[n[0].id]:[]}nearestNodesOnFloors(e,t,{lineOfSight:r,maxDistance:n,maxResults:i}){let a=[e.longitude,e.latitude],s=[];for(let l of t){let c=0,d=r?1/0:i;for(let p of this.#t.nearestNodes(a,l,{maxDistance:n,limit:d})){if(c>=i)break;r&&!this.#e.requireDirections().navigator.hasLineOfSight(a,this.#t.node(p.id).coordinate,l,.1)||(s.push(p),c++)}}return s.sort((l,c)=>l.distance-c.distance)}nearestNodeOnFloor(e,t,{lineOfSight:r,maxDistance:n}){let i=[e.longitude,e.latitude],a=this.#t.nearestNodes(i,t,{maxDistance:n,limit:r===!0?1/0:1});if(r!==!0)return a[0];let s=this.#e.requireDirections();return a.find(l=>s.navigator.hasLineOfSight(i,this.#t.node(l.id).coordinate,t,.1))}#s(e){let t=this.#e.spacesById[e]?.geoJSON.geometry;return this.#t.entranceNodeIds(da(e),t?.type==="Polygon"?t.coordinates:void 0)}#l(e){let t=this.#e.areaRecordsById[e.id];return t?.geometry.type!=="Polygon"?[]:this.#t.nodeIdsInPolygon(t.floorId,t.geometry.coordinates)}#a(e){let t=this.#t.nodeIdsForGeometry([da(e.id)]);if(t.length>0)return t;let r=e.center;if(r.floorId==null)return[];let n=this.#t.nearestNodes([r.longitude,r.latitude],r.floorId,{maxDistance:Af,limit:1});return n.length>0?[n[0].id]:[]}};var kl=.75;function C1(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:ae()}});else if(o.geometry.type==="MultiPolygon")for(let t of o.geometry.coordinates)for(let r=1;r<t.length;r++)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:[t[r]]},properties:{...o.properties,id:ae()}});return e}function _1(o){let e={};for(let t of Object.values(o)){let r=t.geometry,n=[];if((r?.type==="Polygon"||r?.type==="MultiPolygon")&&r.coordinates.length>0){let i=C1(Dl(t));for(let a of i)n.push(a)}e[t.id]={voids:{type:"FeatureCollection",features:n}}}return e}var F1=()=>{throw new re("MapDataInternal needs a parsed MVFv2 or a native MVFv3 bundle.")},cr=class extends St{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 r=ml(e)?e:void 0,n=ml(e)?void 0:e,i=t?.env??Ao();this.envControl=i,this.binaryBundle=t?.binaryBundle,this.Analytics=new _r,this.localePacksUrls=t?.localePacksUrls??{},this.mvf=n;let a=r!=null?r.mvf3.tileset:n?.["tileset.json"];if(this.outdoorViewToken=t?.outdoorViewToken,this.getMapDataOptions=t?.getMapDataOptions,this.updatedAt=t?.updatedAt,this.#t=r?.mvf3??t?.mvf3,a?.default!=null&&(this.tilesets[a.default.key]=a.default,i.updateTileServerBaseUrl(a.default.url),a.others!=null))for(let c of a.others)this.tilesets[c.key]=c;this.navigationFlags=(r!=null?r.mvf3.navigationFlags:n?.["navigationFlags.json"])??{},this.enterpriseMode=t?.enterprise??!1,this.tokenManager=t?.tokenManager;let s=r!=null?ru(this,r.mvf3):n!=null?Eu(this,n,t?.mvf3):F1();this.nodesById=s.nodesById,this.spacesById=s.spacesById,this.floorsById=s.floorsById,this.floorStacksById=s.floorStacksById,this.facadesById=s.facadesById,this.facadesBySpaceId=s.facadesBySpaceId,this.floorRecordsById=s.floorRecordsById,this.floorStackRecordsById=s.floorStackRecordsById,this.facadeRecordsById=s.facadeRecordsById,this.annotationRecordsById=s.annotationRecordsById,this.areaRecordsById=s.areaRecordsById,this.connectionsById=s.connectionsById,this.objectsById=s.objectsById,this.objectRecordsById=s.objectRecordsById,this.objectRecordsByFloorId=s.objectRecordsByFloorId,this.doorsById=s.doorsById,this.pointsOfInterestById=s.poisById,this.annotationsById=s.annotationsById,this.areasById=s.areasById,this.locationProfilesById=s.locationProfilesById,this.locationCategoriesById=s.locationCategoriesById,this.locationProfilesByCategoryId=s.locationProfilesByCategoryId,this.locationCategoriesByParentId=s.locationCategoriesByParentId,this.styleRecordsById=s.styleRecordsById,this.styleIdByGeometryId=s.styleIdByGeometryId,this.wallRecordsByFloorId=s.wallRecordsByFloorId,this.floorImageRecordsByFloorId=s.floorImageRecordsByFloorId,this.floorTextRecordsByFloorId=s.floorTextRecordsByFloorId,this.manifestRecord=s.manifestRecord,this.decorationsById=s.decorationsById,this.spacesByExternalId=s.spacesByExternalId,this.nodesByExternalId=s.nodesByExternalId,this.objectsByExternalId=s.objectsByExternalId,this.floorsByExternalId=s.floorsByExternalId,this.locationProfilesByExternalId=s.locationProfilesByExternalId,this.floorStacksByExternalId=s.floorStacksByExternalId,this.poisByExternalId=s.poisByExternalId,this.doorsByExternalId=s.doorsByExternalId,this.areasByExternalId=s.areasByExternalId,this.mvfConnectionsById=(n?.["connection.json"]??[]).reduce((c,d)=>(c[d.id]=d,c),Object.create(null)),this.mvfSpacesById=s.mvfSpacesById,this.mvfObstructionById=s.mvfObstructionById,this.mvfEntrancesById=s.mvfEntrancesById,this.mvfAreasById=s.mvfAreasById,this.mvfAnnotationsById=s.mvfAnnotationsById,this.nodeRecordsById=s.nodeRecordsById,this.nodeRecordsByFloorId=s.nodeRecordsByFloorId,this.connectionRecordsById=s.connectionRecordsById,this.spaceRecordsByFloorId=s.spaceRecordsByFloorId,this.poiRecordsByFloorId=s.poiRecordsByFloorId,this.doorRecordsById=s.doorRecordsById,this.doorRecordsByFloorId=s.doorRecordsByFloorId,this.annotationRecordsByFloorId=s.annotationRecordsByFloorId,this.areaRecordsByFloorId=s.areaRecordsByFloorId,this.geometryById=s.geometryIndex.byId,this.geometryByFloorId=s.geometryIndex.byFloorId,this.locationProfilesByAttachedFeatureId=s.locationProfilesByAttachedFeatureId,this.nodeIndex=s.nodeIndex;let l=r!=null?new la(r.mvf3):void 0;if(this.navigationNodes=l!=null?new pa(this,l):new na(this),this.voidsByFloorId=_1(s.floorRecordsById),n!=null&&(this.enterpriseMode||Vn())){let c=pl(n,this);this.locationsById=c.locationsById,this.locationInstancesById=c.locationInstancesById,this.instanceLocationsByPolygonId=c.instanceLocationsByPolygonId,this.categoriesById=c.categoriesById,this.locationIdsByGeometryId=c.locationIdsByGeometryId,this.connectionsByExternalId=c.connectionsByExternalId,this.locationsByExternalId=c.locationsByExternalId,this.categoriesByExternalId=c.categoriesByExternalId,c.venueRecord.name!=null&&(this.venue=new gl(this,{record:c.venueRecord}),this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":c.locationRecordsById,"enterprise-category":c.categoryRecordsById,"floor-stack":s.floorStackRecordsById,floor:s.floorRecordsById}},t?.languagePacks?.forEach(({language:d,localePack:p})=>{this.languagePacks[d.code]=js(p)}),this.currentLanguage=this.venue.defaultLanguage)}r!=null&&l!=null&&(this.directions=new lr({nodes:l.collection,geojsonCollection:l.obstructions(),groupBy:"map",multiplicativeDistanceWeightScaling:!0,flagDeclarations:r.mvf3.navigationFlags,getDoorByNodeId:c=>this.navigationNodes.doorForNode(c)})),this.directions??=n==null?void 0:new lr({nodes:n["node.geojson"],geojsonCollection:this.enterpriseMode&&n.enterprise?n.space:n.obstruction,groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode,flagDeclarations:n["navigationFlags.json"],getDoorByNodeId:c=>this.navigationNodes.doorForNode(c)}),this.Query=new Bn(this),this.Nodes=new ia(this)}requireMVF(){if(this.mvf==null)throw new re("This needs the parsed MVFv2, which mvfVersion '3.0.0-native' does not produce.");return this.mvf}requireDirections(){if(this.directions==null)throw new re("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 X(0,0,"initializing");get mapCenter(){if(this.#o.floorId==="initializing"){let[e,t]=this.manifestRecord.center;this.#o=new X(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 r=e instanceof Set?e:new Set(e);return t!=null&&Array.isArray(t)?t.filter(n=>r.has(n.__type)):Array.from(r).flatMap(n=>this.getByType(n))}getById(e,t){let r={"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":a=>this.locationsById[a]??this.locationInstancesById[a],"enterprise-category":this.categoriesById},n=a=>{let s=r[a];if(s!=null)return typeof s=="function"?s(t):s[t]},i=()=>{for(let a of Object.keys(r)){let s=n(a);if(s!=null)return s}};return e==="unknown"?i():n(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 r=this.mvf;if(r!=null)switch(e){case"space":return this.#s(t);case"node":return r["node.geojson"].features.find(n=>n.properties.id===t);case"obstruction":return this.#l(t);case"floor":return"floor.geojson"in r&&r["floor.geojson"]!=null?r["floor.geojson"].features.find(n=>n.properties.id===t)?.properties:r["map.geojson"].find(n=>n.id===t);case"floor-stack":return(r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"]||[]).find(n=>n.id===t);case"connection":return this.mvfConnectionsById[t];case"entrance":return this.#r(t);case"annotation":return this.#i(t);case"area":return this.#n(t);default:throw new Error(`Unknown MVF feature type: ${e}`)}}#r(e){return this.mvfEntrancesById[e]}#i(e){return this.mvfAnnotationsById[e]}#n(e){return this.mvfAreasById[e]}#s(e){return this.mvfSpacesById[e]}#l(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,r,n){if(!this.currentLanguage)return n;let{code:i}=this.currentLanguage,a=this.languagePacks[i]?.optimized?.[e];if(a){let s=a[r];if(s!=null&&s[t]!==void 0){let l=s[t];if(l!=null&&typeof l=="object"){if(typeof n=="object"&&typeof l=="object"&&!Array.isArray(l)){let c=Si(i+e+r+t.toString());if(this.propTranslationCache.has(c))return this.propTranslationCache.get(c);let d=cd(n,l,["id"]);return this.propTranslationCache.set(c,d),d}return l}return l}}return n}findPreferredLanguage(e){if(!this.venue)return;let t=Nl(this.venue,e);return e?.languageCode!=null&&e.languageCode.toLowerCase()!==t.code.toLowerCase()&&_.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){_.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){_.error("Changing the language is not supported for this map.");return}let r=this.currentLanguage.code,n=this.venue?.languages.find(({code:a})=>a.toLowerCase()===t.toLowerCase());if(!n){_.warn(`Language code "${t}" could not be found in the venue.`);return}if(r===n.code)return;let i=this.languagePacks[n.code];if(!i){let a=this.localePacksUrls[n.code];if(!a){_.error(`Locale pack URL not found for language code "${n.code}".`);return}this.#a&&this.#a.abort();let s=new AbortController;this.#a=s;let l;try{l=await bp(a,{signal:s.signal})}catch(c){_.error(`Failed to download language pack for language code "${n.code}".`,c);return}if(!l||s.signal.aborted)return;i=js(l),this.languagePacks[n.code]=i}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=n,this.publish("language-change",this.currentLanguage)}__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,r)=>this.__LEGACY_GET_DIRECTIONS_SYNC(e,t,{...r,multiDestination:!0});__LEGACY_GET_DIRECTIONS_SYNC=(e,t,r)=>{if(this.mvf==null)throw new re(r?.multiDestination?xt("__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC","getDirectionsMultiDestination"):xt("__LEGACY_GET_DIRECTIONS_SYNC","getDirections"));this.requireDirections();let{accessible:n=!1,multiDestination:i=!1}=r||{},a=Df(this.enterpriseMode,r),s=r?.zones||[],l={accessible:n,zones:s,smoothing:a,excludedConnections:r?.excludedConnections||[],connectionIdWeightMap:r?.connectionIdWeightMap||{},includeNonPublic:r?.includeNonPublic??!1,__EXPERIMENTAL_outdoorPathWeightMultiplier:r?.__EXPERIMENTAL_outdoorPathWeightMultiplier,__EXPERIMENTAL_overrideDoorWeight:r?.__EXPERIMENTAL_overrideDoorWeight};if(i&&Array.isArray(t)){let c=Array.isArray(e)?e:[e],d=[];for(let p of t){let g=Array.isArray(p)?p:[p],m=this.requireDirections().getDirectionsSync(c,g,l,this);if(!m){_.error("getDirections failed due to missing directions for one of the segments");return}c=g,d.push(m)}return d}else{let c=Array.isArray(e)?e:[e],d=Array.isArray(t)?t:[t];if(Array.isArray(d[0])){_.error("getDirections does not support multi-destination without multisegment option");return}c[0].id&&d[0].id&&this.Analytics.sendGetDirectionsEvent(c[0].id,d[0].id,n);try{return this.requireDirections().getDirectionsSync(c,d,l,this)}catch(p){_.error("Unable to get directions",p);return}}};getDirections=async(e,t,r)=>{this.requireDirections();let{accessible:n=!1}=r||{},i=Df(this.enterpriseMode,r),a=r?.zones||[],s={accessible:n,zones:a,smoothing:i,excludedConnections:r?.excludedConnections||[],connectionIdWeightMap:r?.connectionIdWeightMap||{},includeNonPublic:r?.includeNonPublic??!1,__EXPERIMENTAL_outdoorPathWeightMultiplier:r?.__EXPERIMENTAL_outdoorPathWeightMultiplier,__EXPERIMENTAL_overrideDoorWeight:r?.__EXPERIMENTAL_overrideDoorWeight},l=Array.isArray(e)?e:[e],c=Array.isArray(t)?t:[t];if(Array.isArray(c[0])){_.error("getDirections does not support multi-destination without multisegment option");return}l[0].id&&c[0].id&&r?.__sendAnalytics!==!1&&this.Analytics.sendGetDirectionsEvent(l[0].id,c[0].id,n);try{return this.requireDirections().getDirections(l,c,s,this)}catch(d){_.error("Unable to get directions",d);return}};getDirectionsMultiDestination=async(e,t,r)=>{if(this.mvf!=null)return Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,r));let n=Array.isArray(t)?t:[t],i=e,a=[];for(let s of n){let l=await this.getDirections(i,s,{...r,__sendAnalytics:!1});if(!l){_.error("getDirections failed due to missing directions for one of the segments");return}a.push(l),i=s}return a};getDistance(e,t){let r=Io(e),n=Io(t);return Dt([r.longitude,r.latitude],[n.longitude,n.latitude])}getDoorByNodeId=e=>this.nodeIndex.doorsByNodeId[e];transformImageRequest=async e=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!Mp(e))return{url:e};if(Ep(e))return{url:e};let t=Rr(e);if(!t)return{url:e};try{let n=(await this.tokenManager?.getSasTokensAsync())?.tokens?.[t.mapId];if(n==null)throw new Error("SAS token not found");let[i]=e.split("?");return{url:`${i}?${n.token}`}}catch(r){return _.error("Failed to append SAS token to image request. Requests for private images may fail.",r),{url:e}}};async toJSONBundle({downloadLanguagePacks:e=!0}={}){let t=[];if(e&&this.enterpriseMode){let r=new AbortController;for(let n of this.venue?.languages||[])try{if(this.localePacksUrls[n.code]){let i=await Os(this.localePacksUrls[n.code],{signal:r.signal}),a=await wr(i);a&&t.push({language:{code:n.code,name:n.name},localePack:a})}}catch(i){_.warn("failed downloading language pack",i)}}if(this.mvf==null){if(this.#t==null)throw new re("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){_.error("binary bundle not found");return}let t=[];if(e&&this.enterpriseMode){let r=new AbortController;for(let n of this.venue?.languages||[])try{if(this.localePacksUrls[n.code]){let i=await Os(this.localePacksUrls[n.code],{signal:r.signal});i&&t.push({language:{code:n.code,name:n.name},localePack:i})}}catch(i){_.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 Df=(o,e)=>{let t=!o,r=e?.smoothing,i=r!=null?typeof r=="object"?r.enabled??t:r:t,a=typeof r=="object"?r.radius:void 0,s=typeof r=="object"?r.method??r.__EXPERIMENTAL_METHOD??"greedy-los":"greedy-los",l=typeof r=="object"?r.includeDoorBufferNodes??(s==="rdp"?r.__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES:s==="dp-optimal"?r.__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:void 0)??s==="rdp":s==="rdp";return s==="dp-optimal"?{enabled:i,radius:a??kl,method:"dp-optimal",includeDoorBufferNodes:l}:s==="rdp"?{enabled:i,radius:a??kl,method:"rdp",includeDoorBufferNodes:l}:{enabled:i,radius:a??kl,method:s}};f();f();f();f();f();var To=class o{id;text;target;static __type="label";__type=o.__type;static is(e){return e.__type===o.__type}get focusTarget(){return this.target.anchorTarget}constructor(e,t,r){this.id=e,this.text=t,this.target=r}get navigationTarget(){return this.target.anchorTarget}};f();var po=class o{id;static __type="marker";#e;get target(){return this.#e}get coordinate(){return this.#e.anchorTarget}get navigationTarget(){return this.target.anchorTarget}toJSON(){return{id:this.id,__type:o.__type,target:this.target,coordinate:this.coordinate}}__type=o.__type;contentEl;static is(e){return e.__type===o.__type}constructor(e,t,r){this.id=e,this.contentEl=t,this.#e=r}get focusTarget(){return this.target.anchorTarget}updateTarget(e){this.#e=e}};f();var dr=class o{id;groupId;static __type="model";__type=o.__type;#e;get target(){return this.#e}static is(e){return e.__type===o.__type}constructor(e,t,r){this.id=e,this.groupId=t,this.#e=r}updateTarget(e){this.#e=e}toJSON(){return{id:this.id,__type:o.__type,groupId:this.groupId,target:this.#e}}get navigationTarget(){return this.#e.anchorTarget}};f();var jo=class o{id;coordinates;#e;static __type="path-segment";__type=o.__type;static is(e){return e.__type===o.__type}constructor(e,t){this.id=e,this.coordinates=t}get isConnectionSegment(){return this.coordinates.length===2&&this.coordinates[0].floorId!==this.coordinates[1].floorId}get distance(){return this.#e?this.#e:(this.#e=Hs(this.coordinates),this.#e)}get focusTarget(){return this.coordinates}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,isConnectionSegment:this.isConnectionSegment,distance:this.distance}}},Lt=class o{id;animation;coordinates;segments;#e;static __type="path";__type=o.__type;static is(e){return e.__type===o.__type}get focusTarget(){return this.coordinates}constructor(e,t,r,n){this.id=e,this.animation=t,this.coordinates=r,this.segments=n.map(({id:i,coordinates:a})=>new jo(i.toString(),a))}get distance(){return this.#e?this.#e:(this.#e=Hs(this.coordinates),this.#e)}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};f();var O1=7,jn=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t?.precision??O1}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){let e=this.#e.center;if(this.#t===-1)return e;let t=Ci(e.latitude,this.#t),r=Ci(e.longitude,this.#t);return new X({latitude:t,longitude:r,floorId:e.floorId,verticalOffset:e.verticalOffset})}get bearing(){return this.#e.bearing}get pitch(){return this.#e.pitch}get zoomLevel(){return Ci(this.#e.zoomLevel,5)}};f();var vo=class o{id;static __type="shape";__type=o.__type;static is(e){return e.__type===o.__type}get focusTarget(){return this}constructor(e){this.id=e}};f();var So=class o{id;constructor(e,t){this.id=e,this.target=t}target;static __type="text-3d";__type=o.__type;static is(e){return e.__type===o.__type}};f();f();f();var P1=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
|
|
7
|
-
<path
|
|
8
|
-
fillRule="evenodd"
|
|
9
|
-
clipRule="evenodd"
|
|
10
|
-
d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"
|
|
11
|
-
stroke="none"
|
|
12
|
-
/>
|
|
13
|
-
</svg>`],["close-16x16",`<svg viewBox="0 0 16 16">
|
|
14
|
-
<path
|
|
15
|
-
d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"
|
|
16
|
-
stroke="none"
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"
|
|
20
|
-
stroke="none"
|
|
21
|
-
/>
|
|
22
|
-
</svg>`],["empty-64x40",`<svg viewBox="0 0 64 40">
|
|
23
|
-
<g>
|
|
24
|
-
<g clipPath="url(#clip0_499_175492)">
|
|
25
|
-
<path
|
|
26
|
-
d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"
|
|
27
|
-
stroke="none"
|
|
28
|
-
fill="#F5F5F5"
|
|
29
|
-
/>
|
|
30
|
-
<path
|
|
31
|
-
d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"
|
|
32
|
-
fill="none"
|
|
33
|
-
/>
|
|
34
|
-
<path
|
|
35
|
-
d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"
|
|
36
|
-
fill="#FAFAFA"
|
|
37
|
-
/>
|
|
38
|
-
</g>
|
|
39
|
-
<defs>
|
|
40
|
-
<clipPath id="clip0_499_175492">
|
|
41
|
-
<rect width="64" height="40" fill="white" />
|
|
42
|
-
</clipPath>
|
|
43
|
-
</defs>
|
|
44
|
-
</g>
|
|
45
|
-
</svg>`],["caret-12x12",`<svg viewBox="0 0 12 12">
|
|
46
|
-
<path
|
|
47
|
-
stroke="none"
|
|
48
|
-
d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"
|
|
49
|
-
/>
|
|
50
|
-
</svg>`],["plus-16x16",`<svg viewBox="0 0 16 16">
|
|
51
|
-
<path
|
|
52
|
-
d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"
|
|
53
|
-
stroke="none"
|
|
54
|
-
/>
|
|
55
|
-
</svg>`],["recenter-16x16",`<svg viewBox="0 0 16 16">
|
|
56
|
-
<g stroke="none">
|
|
57
|
-
<path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />
|
|
58
|
-
<path
|
|
59
|
-
fillRule="evenodd"
|
|
60
|
-
clipRule="evenodd"
|
|
61
|
-
d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"
|
|
62
|
-
/>
|
|
63
|
-
<path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />
|
|
64
|
-
</g>
|
|
65
|
-
</svg>`],["minus-16x16",`<svg viewBox="0 0 16 16">
|
|
66
|
-
<path
|
|
67
|
-
d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"
|
|
68
|
-
stroke="none"
|
|
69
|
-
/>
|
|
70
|
-
</svg>`],["logo-horizontal-206x48",`<svg viewBox="0 0 206 48">
|
|
71
|
-
<path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />
|
|
72
|
-
<path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />
|
|
73
|
-
<path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />
|
|
74
|
-
<path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />
|
|
75
|
-
</svg>`],["share-16x16",`<svg viewBox="0 0 16 16">
|
|
76
|
-
<path
|
|
77
|
-
fillRule="evenodd"
|
|
78
|
-
clipRule="evenodd"
|
|
79
|
-
d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"
|
|
80
|
-
stroke="none"
|
|
81
|
-
/>
|
|
82
|
-
</svg>`],["checkmark-16x16",`<svg viewBox="0 0 16 16">
|
|
83
|
-
<path
|
|
84
|
-
fillRule="evenodd"
|
|
85
|
-
clipRule="evenodd"
|
|
86
|
-
d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"
|
|
87
|
-
stroke="none"
|
|
88
|
-
/>
|
|
89
|
-
</svg>`],["arrow-right-16x16",`<svg viewBox="0 0 16 16">
|
|
90
|
-
<path
|
|
91
|
-
fillRule="evenodd"
|
|
92
|
-
clipRule="evenodd"
|
|
93
|
-
d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"
|
|
94
|
-
stroke="none"
|
|
95
|
-
/>
|
|
96
|
-
</svg>`],["arrow-up-16x16",`<svg viewBox="0 0 16 16">
|
|
97
|
-
<path
|
|
98
|
-
fillRule="evenodd"
|
|
99
|
-
clipRule="evenodd"
|
|
100
|
-
d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"
|
|
101
|
-
stroke="none"
|
|
102
|
-
/>
|
|
103
|
-
</svg>`],["connection-stairs-16x16",`<svg viewBox="0 0 16 16">
|
|
104
|
-
<g stroke="none">
|
|
105
|
-
<path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />
|
|
106
|
-
<path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />
|
|
107
|
-
<path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />
|
|
108
|
-
<path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />
|
|
109
|
-
</g>
|
|
110
|
-
</svg>`],["connection-stairs-14x14",`<svg viewBox="0 0 14 14">
|
|
111
|
-
<path
|
|
112
|
-
d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"
|
|
113
|
-
stroke="none"
|
|
114
|
-
/>
|
|
115
|
-
</svg>`],["connection-stairs-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
116
|
-
<path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />
|
|
117
|
-
<path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />
|
|
118
|
-
<path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />
|
|
119
|
-
<path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />
|
|
120
|
-
</svg>`],["connection-escalator-16x16",`<svg viewBox="0 0 16 16">
|
|
121
|
-
<g stroke="none">
|
|
122
|
-
<path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />
|
|
123
|
-
<path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />
|
|
124
|
-
<path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />
|
|
125
|
-
</g>
|
|
126
|
-
</svg>`],["connection-escalator-14x14",`<svg viewBox="0 0 14 14">
|
|
127
|
-
<path
|
|
128
|
-
d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"
|
|
129
|
-
stroke="none"
|
|
130
|
-
/>
|
|
131
|
-
<path
|
|
132
|
-
d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"
|
|
133
|
-
stroke="none"
|
|
134
|
-
/>
|
|
135
|
-
</svg>`],["connection-elevator-16x16",`<svg viewBox="0 0 16 16">
|
|
136
|
-
<g stroke="none">
|
|
137
|
-
<path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />
|
|
138
|
-
<path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />
|
|
139
|
-
<path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />
|
|
140
|
-
<path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />
|
|
141
|
-
</g>
|
|
142
|
-
</svg>`],["connection-elevator-14x14",`<svg viewBox="0 0 14 14">
|
|
143
|
-
<path
|
|
144
|
-
d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"
|
|
145
|
-
stroke="none"
|
|
146
|
-
/>
|
|
147
|
-
<path
|
|
148
|
-
d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"
|
|
149
|
-
stroke="none"
|
|
150
|
-
/>
|
|
151
|
-
<path
|
|
152
|
-
d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"
|
|
153
|
-
stroke="none"
|
|
154
|
-
/>
|
|
155
|
-
</svg>`],["connection-elevator-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
156
|
-
<circle cx="1.9375" cy="4.4375" r="0.9375" />
|
|
157
|
-
<circle cx="1.9375" cy="7.5625" r="0.9375" />
|
|
158
|
-
<path
|
|
159
|
-
fillRule="evenodd"
|
|
160
|
-
clipRule="evenodd"
|
|
161
|
-
d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"
|
|
162
|
-
/>
|
|
163
|
-
</svg>`],["new-tab-14x14",`<svg viewBox="0 0 14 14">
|
|
164
|
-
<g stroke="none">
|
|
165
|
-
<path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />
|
|
166
|
-
<path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />
|
|
167
|
-
</g>
|
|
168
|
-
</svg>`],["compress-16x16",`<svg viewBox="0 0 16 16">
|
|
169
|
-
<g stroke="none">
|
|
170
|
-
<path
|
|
171
|
-
id="Vector"
|
|
172
|
-
d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"
|
|
173
|
-
/>
|
|
174
|
-
</g>
|
|
175
|
-
</svg>`],["washroom-14x14",`<svg viewBox="0 0 14 14" stroke="none">
|
|
176
|
-
<path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />
|
|
177
|
-
<path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />
|
|
178
|
-
<path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />
|
|
179
|
-
<path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />
|
|
180
|
-
<path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />
|
|
181
|
-
</svg>`],["point-of-interest-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
182
|
-
<path
|
|
183
|
-
stroke="none"
|
|
184
|
-
id="Subtract"
|
|
185
|
-
// Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs
|
|
186
|
-
fill-rule="evenodd"
|
|
187
|
-
clip-rule="evenodd"
|
|
188
|
-
d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"
|
|
189
|
-
/>
|
|
190
|
-
</svg>`],["flag-20x20",`<svg viewBox="0 0 20 20" stroke="none">
|
|
191
|
-
<path
|
|
192
|
-
d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"
|
|
193
|
-
stroke="none"
|
|
194
|
-
/>
|
|
195
|
-
</svg>`],["link-16x16",`<svg viewBox="0 0 16 16" stroke="none">
|
|
196
|
-
<path
|
|
197
|
-
d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"
|
|
198
|
-
stroke="none"
|
|
199
|
-
/>
|
|
200
|
-
</svg>`]]),w1=/<svg([^>]*)>/g;function kf(o,e,t){let r=P1.get(o);return r?r.replace(w1,`<svg$1 style="fill:${e}; width:${t}px; height:${t}px">`):""}var A1=o=>`
|
|
201
|
-
<div class="pin-shadow" style="background: ${o}"></div>
|
|
202
|
-
<svg width="${20*.9}px" height="${48*.9}px" viewBox="0 0 20 48">
|
|
203
|
-
<path
|
|
204
|
-
d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"
|
|
205
|
-
fill="${o}"
|
|
206
|
-
stroke="white"
|
|
207
|
-
strokeWidth="2"
|
|
208
|
-
/>
|
|
209
|
-
</svg>
|
|
210
|
-
`,R1=o=>`
|
|
211
|
-
<div class="pin-shadow" style="background: ${o}"></div>
|
|
212
|
-
<svg width="36" height="42" viewBox="-2 -2 40 46">
|
|
213
|
-
<path
|
|
214
|
-
d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"
|
|
215
|
-
fill="none"
|
|
216
|
-
stroke="white"
|
|
217
|
-
strokeWidth="4"
|
|
218
|
-
/>
|
|
219
|
-
<path
|
|
220
|
-
d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"
|
|
221
|
-
fill="${o}"
|
|
222
|
-
/>
|
|
223
|
-
</svg>
|
|
224
|
-
`,Ll="#722ED1",Bl="#1890FF",Nf=({type:o="departure",color:e=Bl,animated:t})=>`<div class="${t===!1?"":"dropped-pin-wrapper"}">
|
|
225
|
-
${o==="departure"?A1(e):R1(e)}
|
|
226
|
-
</div>`,D1=o=>{switch(o){case"default":return 28;case"selection":return 28;case"navigation":return 32}},Lf=({type:o="stairs",color:e=Ll,direction:t="up",animated:r})=>{let n=D1("default"),i=n/2+2,a=t&&t!=="none";return`<div class="mappedin-connection-marker">
|
|
227
|
-
<div class="connection-circle"
|
|
228
|
-
role="button"
|
|
229
|
-
style="background:${e}; width:${n}px; height:${n}px;"
|
|
230
|
-
>
|
|
231
|
-
${kf("connection-"+o+"-16x16","white",i)||""}
|
|
232
|
-
</div>
|
|
233
|
-
${a?`<div style="margin-left: -${n*.2}px;">
|
|
234
|
-
<div class="${r===!1?"":"bouncey"}">
|
|
235
|
-
<div class="connection-circle"
|
|
236
|
-
role="button"
|
|
237
|
-
style="width: ${n}px; height: ${n}px;">
|
|
238
|
-
<div class="${t==="up"?"":"arrow--down"}">
|
|
239
|
-
<svg viewBox="0 0 16 16" style="fill: white; width: ${i}px; height: ${i}px">
|
|
240
|
-
<path
|
|
241
|
-
fillRule="evenodd"
|
|
242
|
-
clipRule="evenodd"
|
|
243
|
-
d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"
|
|
244
|
-
stroke="none"
|
|
245
|
-
/>
|
|
246
|
-
</svg>
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
</div>
|
|
250
|
-
</div>`:""}
|
|
251
|
-
</div>`};f();var Bf=63710088e-1,ua=new WeakMap,Vf=async o=>new Promise(e=>setTimeout(e,o));function Yr(o,e,t){let r=o.distance;if(r===0)return 0;let n=L1(o,e,t);return n?(r-n.distance)/r:0}function fa(o,e){if(o.coordinates.length===0)return[];if(ua.has(o)&&ua.get(o).has(e))return ua.get(o).get(e);let t=o.coordinates.map(r=>Zr(r,e));return ua.set(o,new Map([[e,t]])),t}function Zr(o,e){let t=e.latitude,r=e.longitude,n=o.latitude-t,i=o.longitude-r,a=Math.PI*Bf/180,s=a*Math.cos(t*Math.PI/180),l=i*s,c=n*a;return{x:l,y:c}}function k1(o,e,t){if(o.length===0)return;let r=t??e,n,i=1/0,a=Zr(e,r);for(let s=0;s<o.length;s++){let l=o[s],c=fa(l,r);for(let d=0;d<c.length-1;d++){let p=c[d],g=c[d+1],m=Gn(p,g,a),I=tr(a,m);I<i&&(i=I,n=m)}}if(n)return N1(n,r)}function Gn(o,e,t){let r=e.x-o.x,n=e.y-o.y,i=t.x-o.x,a=t.y-o.y,s=r*r+n*n;if(s===0)return{x:o.x,y:o.y};let l=(i*r+a*n)/s,c=Math.max(0,Math.min(1,l));return{x:o.x+c*r,y:o.y+c*n}}function N1(o,e){let r=Math.PI*Bf/180,n=r*Math.cos(e.latitude*Math.PI/180),i=o.y/r,a=o.x/n,s=e.latitude+i,l=e.longitude+a;return new X({latitude:s,longitude:l,floorId:e.floorId,verticalOffset:e.verticalOffset})}function L1(o,e,t){let r=k1([o],e,t);if(!r)return;let n=fa(o,t),i=Zr(r,t),a=-1,s=1/0;for(let c=0;c<n.length-1;c++){let d=n[c],p=n[c+1],g=Gn(d,p,i),m=tr(g,i);m<1&&m<s&&(s=m,a=c)}if(a===-1){let c=0,d=1/0;for(let p=0;p<n.length;p++){let g=n[p],m=tr(g,i);m<d&&(d=m,c=p)}a=Math.max(0,c-1)}let l=[r];for(let c=a+1;c<o.coordinates.length;c++)l.push(o.coordinates[c]);return new jo(`${o.id}_remaining`,l)}function jf(o,e,t){if(o.length===0)return;let r,n=1/0,i=Zr(e,t);for(let a of o){let s=fa(a,t),l=1/0;for(let c=0;c<s.length-1;c++){let d=s[c],p=s[c+1],g=Gn(d,p,i),m=tr(g,i);m<l&&(l=m),m<n&&(n=m,r=a)}}return r}function Gf(o,e){let t=o.getState(e);return t?.type==="path"?t.displayArrowsOnPath:!1}function Un(o,e,t,r){return{highlightStartFraction:t.startHighlightFraction,highlightEndFraction:t.endHighlightFraction,highlightColor:r?.color??"red",highlightWidthMultiplier:r?.widthMultiplier??1,highlightDisplayArrowsOnPath:r?.displayArrowsOnPath??Gf(o,e)}}function Hn(o,e){return{highlightStartFraction:0,highlightEndFraction:0,highlightCompleteFraction:0,highlightDisplayArrowsOnPath:Gf(o,e)}}function Wn(o,e,t,r){let n,i,a=1/0,s=1/0,l=Zr(e,r),c=Zr(t,r);for(let D of o)for(let j of D.segments){if(j.isConnectionSegment)continue;let G=j.coordinates[0]?.floorId,W=G===e.floorId,N=G===t.floorId;if(!W&&!N)continue;let q=fa(j,r);if(W){let oe=1/0;for(let ie=0;ie<q.length-1;ie++){let be=q[ie],De=q[ie+1],ke=Gn(be,De,l),ue=tr(ke,l);ue<oe&&(oe=ue)}oe<a&&(a=oe,n=j)}if(N){let oe=1/0;for(let ie=0;ie<q.length-1;ie++){let be=q[ie],De=q[ie+1],ke=Gn(be,De,c),ue=tr(ke,c);ue<oe&&(oe=ue)}oe<s&&(s=oe,i=j)}}if(!n||!i)return;let d=[];if(n.id===i.id){let D=Yr(n,e,r),j=Yr(i,t,r);return d.push({segment:n,startHighlightFraction:Math.min(D,j),endHighlightFraction:Math.max(D,j)}),d}let p=o.flatMap(D=>D.segments),g=p.findIndex(D=>D.id===n.id),m=p.findIndex(D=>D.id===i.id),I=g>m,v=I?m:g,y=I?g:m,E=I?i.id:n.id,k=I?n.id:i.id,w=I?t:e,B=I?e:t;for(let D=v;D<=y;D++){let j=p[D];j.id===E?d.push({segment:j,startHighlightFraction:Yr(j,w,r),endHighlightFraction:1}):j.id===k?d.push({segment:j,startHighlightFraction:0,endHighlightFraction:Yr(j,B,r)}):d.push({segment:j,startHighlightFraction:0,endHighlightFraction:1})}return d}function Uf([o,e],[t,r],[n,i],a=!1){let s=t-o,l=r-e,c=s**2+l**2;if(c===0)return;let d,p;if(a){let I=(e+r+i)/3,v=Math.cos(I*Math.PI/180),y=o*v,E=e,k=t*v,w=r,B=n*v,D=i,j=k-y,G=w-E,W=j*j+G*G;if(W===0)return;if(d=((B-y)*j+(D-E)*G)/W,d<=0)p=[o,e];else if(d>=1)p=[t,r];else{let N=y+d*j,q=E+d*G;p=[N/v,q]}}else d=((n-o)*s+(i-e)*l)/c,d<=0?p=[o,e]:d>=1?p=[t,r]:p=[o+d*s,e+d*l];let g=Dt([n,i],p),m;if(a){let I=n-p[0],v=i-p[1],y=Math.sqrt(I*I+v*v),E=Math.sqrt(s*s+l*l);if(y>0&&E>0){let w=(I*s+v*l)/(y*E);m=Math.acos(Math.abs(w))*(180/Math.PI)}}return{proportion:a?d:Math.max(0,Math.min(1,d)),intersection:p,distance:g,angle:m}}function Hf(o,e,t){let r=t/111e3,n=e.findIndex(i=>{let a=(o.latitude+i.latitude)/2,s=Math.cos(a*Math.PI/180),l=(o.longitude-i.longitude)*s,c=o.latitude-i.latitude;return Math.sqrt(l**2+c**2)>r});return n===-1?[]:e.slice(n)}f();var B1=10;function V1(o){switch(o){case"solid":return{dashed:!1,displayArrowsOnPath:!1};case"dashed-stripes":return{dashed:!0,displayArrowsOnPath:!1,dash:{mode:"absolute",meters:2,gapMeters:.2}};case"dashed-sparse":return{dashed:!0,displayArrowsOnPath:!1,dash:{mode:"absolute",meters:1,gapMeters:2}};case"bordered":return{dashed:!1,displayArrowsOnPath:!1,geometry:"ribbon",border:{enabled:!0,color:"darken",width:.15}};case"dashed-boxes":default:return{dashed:!0,displayArrowsOnPath:!1,dash:{mode:"absolute",meters:1,gapMeters:.5}}}}var ha=class{#e;#t;#o;#r=new Set;#i=new Set;#n;#s=-1;constructor(e){this.#e=e}get isActive(){return this.#t!==void 0||this.#r.size>0}#l(){return this.#t!==void 0||this.#o!==void 0||this.#r.size>0||this.#i.size>0||this.#n!==void 0}get isShowingOutsideThresholdPath(){return this.#o!==void 0}tetherToCoordinate(e,t={}){let r=this.#e.activePath;if(!r)return null;let n=t?.tetherThresholdDistance??B1,i;for(let B of r.segments){if(B.isConnectionSegment)continue;let D=B.coordinates;for(let j=0;j<D.length-1;j++){let G=D[j],W=D[j+1];if(e.floorId&&!(G.floorId===e.floorId&&W.floorId===e.floorId))continue;let N=Uf([G.longitude,G.latitude],[W.longitude,W.latitude],[e.longitude,e.latitude],!0);N&&(!i||N.distance<i.distance)&&(i={path:r,segment:B,edgeIndex:j,distance:N.distance,intersection:N.intersection})}}if(!i)return this.#a(),null;let a=i.distance<n,s=t.coordinateOutsideThresholdMode??"tether-and-dash";if(!a&&s==="untether")return this.#l()&&this.clear(),null;this.#o&&(this.#e.removeTetheredPath(this.#o),this.#o=void 0);let{path:l,segment:c,edgeIndex:d,intersection:p}=i,g=l.segments,m=g.findIndex(B=>B.id===c.id);if(this.#n?.id!==c.id){this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let B=this.#s;if(m>B)for(let D=Math.max(0,B+1);D<=m;D++){let j=g[D];this.#r.has(j)||(this.#e.updateState(j,{visible:!1}),this.#r.add(j))}else if(m<B)for(let D=m+1;D<=B&&D<g.length;D++){let j=g[D];this.#r.has(j)&&(this.#e.updateState(j,{visible:!0}),this.#r.delete(j))}this.#n=c,this.#s=m}else this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let v=c.coordinates,y=v.slice(d+1,v.length),E=new X({latitude:p[1],longitude:p[0],floorId:e.floorId}),k=Hf(E,y,2.5);k.length===0&&y.length>0&&(k=[y[y.length-1]]);let w;if(a)w=[e,E,...k],this.#t=this.#e.createTetheredPath(w,{...this.#e.options.pathOptions,animateDrawing:!1,smoothing:{tension:.15,cornerRadius:1.5},...t.tetherPathOptions});else{let B=this.#u(E,e,n);if(w=[B,E,...k],this.#t=this.#e.createTetheredPath(w,{...this.#e.options.pathOptions,animateDrawing:!1,smoothing:{tension:.15,cornerRadius:1.5},...t.tetherPathOptions}),s==="tether-and-dash"){let D=V1(t.outsideThresholdPathStyle??"dashed-boxes");this.#o=this.#e.createTetheredPath([e,B],{...this.#e.options.pathOptions,animateDrawing:!1,...D,...t?.outsideThresholdPathOptions})}}return t.hideMarkersOutsideThreshold?this.#e.markers.forEach(B=>{let D=B?.marker;if(!D)return;let j=this.#d(D.coordinate,y,g,m);this.#e.updateState(D,{enabled:j}),j?this.#i.delete(D):this.#i.add(D)}):this.#i.size>0&&this.#c(),w}clear(){this.#a(),this.#e.markers.forEach(e=>{let t=e?.marker;t&&this.#e.updateState(t,{enabled:!0})})}#a(){this.#o&&(this.#e.removeTetheredPath(this.#o),this.#o=void 0),this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);for(let e of this.#r)this.#e.updateState(e,{visible:!0});this.#r.clear(),this.#n=void 0,this.#s=-1,this.#c()}#c(){for(let e of this.#i)this.#e.updateState(e,{enabled:!0});this.#i.clear()}#d(e,t,r,n){for(let i=0;i<t.length;i++)if(t[i].isEqual(e))return!0;for(let i=n+1;i<r.length;i++){let a=r[i].coordinates;for(let s=0;s<a.length;s++)if(a[s].isEqual(e))return!0}return!1}#u(e,t,r){let n=Dt([e.longitude,e.latitude],[t.longitude,t.latitude]);if(r>=n)return new X({latitude:t.latitude,longitude:t.longitude,floorId:e.floorId});let i=r/n,a=e.latitude+i*(t.latitude-e.latitude),s=e.longitude+i*(t.longitude-e.longitude);return new X({latitude:a,longitude:s,floorId:e.floorId})}};f();var ga=class{#e;#t=new Set;#o;#r=-1;#i=0;#n;constructor(e){this.#e=e}get isActive(){return this.#t.size>0||this.#o!==void 0}get travelledFraction(){let e=this.#e.activePath;if(!e)return 0;let t=0,r=0;for(let n of e.segments){let i=n.distance;t+=i,this.#t.has(n)?r+=i:n===this.#o&&(r+=i*this.#i)}return t===0?0:Math.min(1,r/t)}travelledUptoCoordinate(e,t){let r=this.#e.activePath;if(!r)return null;let n=t?.color??"#999";this.#n&&this.#n!==r.id&&this.#s(this.#n),this.#n=r.id;let i=this.#e.getMapCenter(),a=r.segments.filter(g=>{if(g.isConnectionSegment)return!1;let m=g.coordinates[0]?.floorId;return!e.floorId||m===e.floorId}),s=jf(a,e,i);if(!s)return null;let l=r.segments,c=l.findIndex(g=>g.id===s.id);if(this.#o?.id!==s.id){let g=this.#r;if(c>g){for(let m=Math.max(0,g+1);m<c;m++){let I=l[m];this.#t.has(I)||(this.#e.updateState(I,{travelledEndFraction:1,travelledColor:n}),this.#t.add(I))}if(g>=0&&g<c){let m=l[g];this.#t.has(m)||(this.#e.updateState(m,{travelledEndFraction:1,travelledColor:n}),this.#t.add(m))}}else if(c<g){for(let m=c+1;m<=g&&m<l.length;m++){let I=l[m];this.#t.has(I)?(this.#e.updateState(I,{travelledEndFraction:0}),this.#t.delete(I)):I===this.#o&&this.#e.updateState(I,{travelledEndFraction:0})}this.#t.delete(l[c])}this.#o=s,this.#r=c}let p=Yr(s,e,i);return this.#i=p,this.#e.updateState(s,{travelledEndFraction:p,travelledColor:n}),p}#s(e){let t=this.#e.allPaths.find(r=>r.id===e);if(t){this.#o&&t.segments.some(n=>n.id===this.#o.id)&&(this.#e.updateState(this.#o,{travelledEndFraction:0}),this.#o=void 0,this.#r=-1,this.#i=0);for(let r of t.segments)this.#t.has(r)&&(this.#e.updateState(r,{travelledEndFraction:0}),this.#t.delete(r))}}resetTravelledOnOtherPaths(){let e=this.#e.activePath;if(!e)return;this.#o&&(e.segments.some(n=>n.id===this.#o.id)||(this.#e.updateState(this.#o,{travelledEndFraction:0}),this.#o=void 0,this.#r=-1,this.#i=0));for(let r of this.#e.allPaths)if(r.id!==e.id)for(let n of r.segments)this.#e.updateState(n,{travelledEndFraction:0});let t=[];for(let r of this.#t)e.segments.some(i=>i.id===r.id)||t.push(r);for(let r of t)this.#t.delete(r)}clear(){for(let e of this.#t)this.#e.updateState(e,{travelledEndFraction:0});this.#t.clear(),this.#o&&this.#e.updateState(this.#o,{travelledEndFraction:0}),this.#o=void 0,this.#r=-1,this.#i=0,this.#n=void 0}};var Wf=.01,zf=.02,ma=0,j1={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},G1={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},Go={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:j1,inactivePathOptions:G1,markerOptions:{departureColor:Bl,destinationColor:Ll},animatePathDrawing:!0};function ya(o){let{connection:e,...t}=o,r=t;return o.__EXPERIMENTAL__CONNECTION_COLOR!==void 0&&(r.color=o.__EXPERIMENTAL__CONNECTION_COLOR),o.__EXPERIMENTAL__CONNECTION_WIDTH!==void 0&&(r.width=o.__EXPERIMENTAL__CONNECTION_WIDTH),o.__EXPERIMENTAL__CONNECTION_JUNCTION_INSET!==void 0&&(r.__EXPERIMENTAL_JUNCTION_INSET=o.__EXPERIMENTAL__CONNECTION_JUNCTION_INSET),o.__EXPERIMENTAL__CONNECTION_DASHED!==void 0&&(r.dashed=o.__EXPERIMENTAL__CONNECTION_DASHED),o.__EXPERIMENTAL__CONNECTION_DASH_STYLE!==void 0&&(r.dash={mode:"width-scaling",...r.dash},r.geometry=o.__EXPERIMENTAL__CONNECTION_DASH_STYLE==="discrete"?"ribbon":"tube"),o.__EXPERIMENTAL__CONNECTION_ANIMATE_ARROWS_ON_PATH!==void 0&&(r.animateArrowsOnPath=o.__EXPERIMENTAL__CONNECTION_ANIMATE_ARROWS_ON_PATH),o.__EXPERIMENTAL__CONNECTION_DISPLAY_ARROWS_ON_PATH!==void 0&&(r.displayArrowsOnPath=o.__EXPERIMENTAL__CONNECTION_DISPLAY_ARROWS_ON_PATH),o.__EXPERIMENTAL__CONNECTION_GEOMETRY!==void 0&&(r.geometry=o.__EXPERIMENTAL__CONNECTION_GEOMETRY),e?.endcapExtension===void 0&&e?.__EXPERIMENTAL_ENDCAP_EXTENSION===void 0&&(r.endcapExtension=[0,0]),Object.assign(r,e)}var U1={...Go},zn=class{#e=new Map;#t=new Map;#o=new Map;#r;#i;#n=U1;#s;#l;#a=[];#c;#d=new Map;#u=new Map;#f;#h;#p=null;get isMultiFloor(){if(!this.#a.length)return!1;let e=new Set;for(let t of this.#a)for(let r of t.coordinates)if(r.floorId&&(e.add(r.floorId),e.size>1))return!0;return!1}constructor(e){this.#r=e;let t=this;this.#f=new ha({get activePath(){return t.#c},get options(){return t.#n},get markers(){return t.#e},updateState:(r,n)=>this.#r.updateState(r,n),createTetheredPath:(r,n)=>this.#_(r,n),removeTetheredPath:r=>this.#S(r)}),this.#h=new ga({get activePath(){return t.#c},get allPaths(){return t.paths},getMapCenter:()=>this.#r.getMapData().mapCenter,updateState:(r,n)=>this.#r.updateState(r,n)})}#m(e){return e!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(e.type)}getPathById(e){return this.#t.get(e)}getMarkerById(e){return this.#e.get(e)}get paths(){let e=new Set;return this.#t.forEach(t=>e.add(t)),Array.from(e)}get markers(){let e=[];return this.#e.forEach(t=>{t&&e.push({marker:t.marker,type:t.type})}),e}get activeDirections(){return this.#u.get(this.#c)}get activePath(){if(this.#c)return this.#t.get(this.#c.id)}get floorStacks(){let e=this.#r.getMapData();if(!this.#a.length||!e)return[];let t=new Set;for(let r of this.#a)for(let n of r.coordinates)if(n.floorId){let i=e.getById("floor",n.floorId);i&&t.add(i.floorStack)}return Array.from(t)}get floors(){let e=this.#r.getMapData();if(!this.#a.length||!e)return[];let t=new Set;for(let r of this.#a)for(let n of r.coordinates)if(n.floorId){let i=e.getById("floor",n.floorId);i&&t.add(i)}return Array.from(t)}setActivePathByIndex(e){let t=this.#a[e];if(!this.#a.length){_.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#a[e]){_.warn(`Direction #${e} does not exist`);return}let r=this.#d.get(t);if(!r){_.warn("The direction is not a part of muli-direcional path");return}this.#T(r)}setActivePath(e){if(!this.#a.length){_.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#u.get(e)){_.warn(`Path "${e.id}" is not a part of muli-direcional path`);return}this.#T(e)}#y(){if(!this.#c)return;let e=this.#t.get(this.#c.id);if(e){for(let t of this.#t.values())if(t.id.includes("internal-"))if(t.id===this.#c.id)for(let r of e.segments)this.#r.updateState(r,{verticalOffset:zf});else this.#r.updateState(t,{verticalOffset:Wf})}}setActivePathByDirections(e){if(!this.#a.length){_.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let t=this.#d.get(e);if(!t){let r=this.#a.find(n=>n.id===e.id);if(!r){_.warn("[setActivePathByDirections] Cannot find directions for id");return}t=this.#d.get(r)}if(!t){_.warn("[setActivePathByDirections] Cannot find path for directions");return}this.#T(t)}clearHighlightedPathSection(){this.#i=void 0;for(let e of this.paths)for(let t of e.segments)this.#r.updateState(t,Hn(this.#r.core,t.id));for(let e of this.#o.values())for(let t of e.segments)this.#r.updateState(t,Hn(this.#r.core,t.id))}trackCoordinate(e,t){return this.#a.length?(this.#p&&this.#p!==t.mode&&this.stopTracking(),this.#p=t.mode,t.mode==="tethered"?this.#f.tetherToCoordinate(e,t):this.#h.travelledUptoCoordinate(e,t)):null}stopTracking(){this.#p==="tethered"?this.#f.clear():this.#p==="travelled"&&this.#h.clear(),this.#p=null}get currentTrackingMode(){return this.#p}get isTracking(){return this.#p==="tethered"?this.#f.isActive:this.#p==="travelled"?this.#h.isActive:!1}get isShowingOutsideThresholdPath(){return this.#f.isShowingOutsideThresholdPath}get travelledFraction(){return this.#p!=="travelled"?null:this.#h.travelledFraction}highlightPathSection(e,t,r){let n=r?.animationDuration??1500,i=this.#r.getMapData().mapCenter,a=this.activePath;if(!a)return;let s=Wn([a],e,t,i);if(!s)return;this.clearHighlightedPathSection(),this.#i={from:e,to:t,options:r};for(let d of s)this.#r.updateState(d.segment,Un(this.#r.core,d.segment.id,d,r));let l=()=>{},c=new Promise(d=>{l=d});if(s.length>0){let d=new mo({fraction:0}).to({fraction:1},n).onUpdate(p=>{for(let g of s)this.#r.updateState(g.segment,{highlightCompleteFraction:p.fraction})}).onComplete(()=>{this.#r.tweenGroup().remove(d),l()});this.#r.tweenGroup().add(d),d.start()}return{animation:c}}#S(e){this.#o.delete(e.id),this.#r.currentMap.Paths.remove(e.segments.map(t=>t.id.toString()))}drawSync(e,t={}){this.#l&&this.clear(),this.#l=!0,this.#E(t);let r=Array.isArray(e)?e:[e],n=r[0],i=r[r.length-1],a=n.coordinates[0];if(this.#a=r,a?.floorId&&this.#n.setMapToDeparture&&this.#r.setFloor(a.floorId),n.coordinates.length<2){_.warn("Directions must have at least 2 coordinates");return}this.#n.createMarkers?.departure&&this.#g("departure",n.instructions[0]);for(let s=0;s<r.length;s++){let l=r[s];if(l.coordinates.length<2){_.warn("Directions must have at least 2 coordinates");return}let c=s===ma,d=c?this.#n.pathOptions:this.#n.inactivePathOptions,p=this.#b(c?"active":"inactive"),g={...ya(d),animateDrawing:this.#n.animatePathDrawing,verticalOffset:p},{connection:m,...I}=d,v=this.#x(l.coordinates,{...I,animateDrawing:this.#n.animatePathDrawing,verticalOffset:p},g);this.#d.set(l,v),this.#u.set(v,l),this.#n.createMarkers?.connection&&this.#C(l.instructions,"connection"),c&&(this.#c=this.#d.get(this.#a[ma]),this.#r.externalPubSub.on("click",this.#v))}this.#n.createMarkers?.destination&&this.#g("destination",i.instructions[i.instructions.length-1]),this.#r.mapObjects.forEach(s=>{s.processFloorChange(s.currentFloorId,s.currentFloorStackId)}),this.#I()}#x(e,t,r){let n=t.id?.toString()??ae(),i=this.#r.currentMap.Paths.add(e,t,r),a=new Lt(n,i.animation,e,i.paths);this.#t.set(n,a);for(let s of i.paths)this.#t.set(s.id.toString(),a);return a}#_(e,t){let r=t.id?.toString()??ae(),n=this.#r.currentMap.Paths.add(e,t),i=new Lt(r,n.animation,e,n.paths);return this.#o.set(r,i),this.#F(i),i}#F(e){if(!this.#i)return;let{from:t,to:r,options:n}=this.#i,i=this.#r.getMapData().mapCenter,a=Wn([e],t,r,i);if(a)for(let s of a)this.#r.updateState(s.segment,{...Un(this.#r.core,s.segment.id,s,n),highlightCompleteFraction:1})}#O(e){this.#t.delete(e.id),this.#r.currentMap.Paths.remove(e.segments.map(t=>t.id.toString()))}#M(e,t,r=!1){let n=this.#n.markerOptions.animated,i=this.#r.currentMap.Markers.add(e.coordinate,t,{interactive:r,placement:"top",rank:"always-visible",animated:n}),a=this.#r.currentMap.Markers.getContentEl(i.id.toString());if(!a)throw new Error("marker component should exist");return new po(i.id.toString(),a,e.coordinate)}#b(e){return e==="active"?zf+(this.#n.pathOptions?.verticalOffset??0):Wf+(this.#n.inactivePathOptions?.verticalOffset??0)}#P(e){let t=e[0],r=e[e.length-1],n=!1;return this.#s={promise:new Promise(async i=>{if(x.env.NODE_ENV!=="test"&&!fs()&&await Vf(500),n||!e.length){i();return}if(t.coordinates.length<2){_.warn("Directions must have at least 2 coordinates"),i();return}this.#n.createMarkers?.departure&&this.#g("departure",t.instructions[0]);for(let a=0;a<e.length;a++){let s=e[a];if(s.coordinates.length<2){_.warn("Directions must have at least 2 coordinates"),i();return}let l=a===ma,c=l?this.#n.pathOptions:this.#n.inactivePathOptions,d=this.#b(l?"active":"inactive"),p={...ya(c),animateDrawing:this.#n.animatePathDrawing,verticalOffset:d},{connection:g,...m}=c,I=this.#x(s.coordinates,{...m,animateDrawing:this.#n.animatePathDrawing,verticalOffset:d},p);if(this.#d.set(s,I),this.#u.set(I,s),l&&(this.#c=this.#d.get(this.#a[ma]),this.#r.externalPubSub.on("click",this.#v)),x.env.NODE_ENV!=="test"&&!fs()&&await I.animation,n){i();return}this.#n.createMarkers?.connection&&this.#C(s.instructions,"connection")}if(this.#n.createMarkers?.destination&&this.#g("destination",r.instructions[r.instructions.length-1]),n){i();return}this.#r.mapObjects.forEach(a=>{a.processFloorChange(a.currentFloorId,a.currentFloorStackId)}),this.#I(),i()}),cancel:()=>{n=!0}},this.#s.promise}#E(e){let t={...Go.pathOptions,...e.pathOptions};this.#n={setMapOnConnectionClick:e.setMapOnConnectionClick??Go.setMapOnConnectionClick,setMapToDeparture:e.setMapToDeparture??Go.setMapToDeparture,pathOptions:t,inactivePathOptions:{...Go.inactivePathOptions,...e.inactivePathOptions},createMarkers:{...Go.createMarkers,...e.createMarkers},markerOptions:{...Go.markerOptions,...e.markerOptions},animatePathDrawing:e.animatePathDrawing??Go.animatePathDrawing}}#I(){this.#r.publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths,markers:this.markers})}async draw(e,t={}){this.#s&&this.clear(),this.#E(t);let r=Array.isArray(e)?e:[e],i=r[0].coordinates[0];return this.#a=r,i?.floorId&&this.#n.setMapToDeparture&&this.#r.setFloor(i.floorId),this.#P(r)}#T(e){this.#c=e,this.#p==="tethered"?this.#f.clear():this.#p==="travelled"&&this.#h.resetTravelledOnOtherPaths();let t=ya(this.#n.pathOptions),r=ya(this.#n.inactivePathOptions);this.#a.forEach(n=>{let i=this.#d.get(n);if(i){let a=i.id===this.#c.id,s=a?this.#n.pathOptions:this.#n.inactivePathOptions,{connection:l,...c}=s,d={...c,verticalOffset:this.#b(a?"active":"inactive")},p={...a?t:r,verticalOffset:this.#b(a?"active":"inactive")};for(let g of i.segments){let m=g.isConnectionSegment?p:d;this.#r.updateState(g,m)}}}),this.#r.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),this.#y(),this.#I()}#g(e,t){if(e==="connection"&&t){let r=t.action.type==="ExitConnection"?this.#n.markerOptions.departureColor:this.#n.markerOptions.destinationColor,n;typeof this.#n.createMarkers?.connection=="function"?(n=this.#n.createMarkers.connection(t),this.#r.updateState(n,{interactive:!0})):n=this.#M(t,Lf({type:t.action.connection?.type??t.action.connectionType,color:r,direction:t.action.direction,animated:this.#n.markerOptions.animated}),!0),this.#e.set(n.id,{instruction:t,marker:n,type:e})}else{let r=e==="departure"?this.#n.markerOptions.departureColor:this.#n.markerOptions.destinationColor,n;typeof this.#n.createMarkers?.departure=="function"&&e==="departure"?n=this.#n.createMarkers.departure(t):typeof this.#n.createMarkers?.destination=="function"&&e==="destination"?n=this.#n.createMarkers.destination(t):n=this.#M(t,Nf({type:e,color:r,animated:this.#n.markerOptions.animated})),this.#e.set(n.id,{instruction:t,marker:n,type:e})}}#C(e,t){e.filter(n=>this.#m(n.action)).forEach(n=>{this.#g(t,n)})}#v=e=>{if(this.#n.createMarkers?.connection&&e.markers!=null&&e.markers.length>0){let{instruction:t}=this.#e.get(e.markers[0].id);t?.action.toFloor&&(this.#n.setMapOnConnectionClick&&this.#r.setFloor(t.action.toFloor.id,"navigation-connection-click"),this.#r.publish("navigation-connection-click",{instruction:t,fromFloor:t.action.fromFloor,toFloor:t.action.toFloor}))}};clear(){this.stopTracking(),this.#e.forEach(e=>{e?.marker&&this.#r.currentMap.Markers.remove(e.marker.id.toString())}),this.#e.clear(),this.#t.forEach(e=>{this.#O(e)}),this.#t.clear(),this.#o.forEach(e=>{this.#S(e)}),this.#o.clear(),this.#i=void 0,this.#s&&(this.#s.cancel(),this.#s=void 0),this.#l&&(this.#l=!1),this.#a=[],this.#d.clear(),this.#u.clear(),this.#c=void 0,this.#r.externalPubSub.off("click",this.#v),this.#r.mapObjects.forEach(e=>{e.processFloorChange(e.currentFloorId,e.currentFloorStackId)}),this.#I()}};f();var $n=class{#e;#t;constructor(e){this.#t=e,this.#e=e.core}interactions={set:e=>{let t=this.#e.getSystems().cameraSystem;if(e?.pan!=null&&(t.enablePan=e.pan),e?.zoom!=null&&(t.enableZoom=e.zoom),e?.bearingAndPitch!=null&&(t.enableRotate=e.bearingAndPitch),this.#e.cameraMode==="external"){let r=this.#e.map;e?.pan!=null&&(e.pan?r?.dragPan.enable():r?.dragPan.disable()),e?.zoom!=null&&(e.zoom?r?.scrollZoom.enable():r?.scrollZoom.disable()),e?.bearingAndPitch!=null&&(e.bearingAndPitch?(r?.dragRotate.enable(),r?.touchZoomRotate.enableRotation()):(r?.dragRotate.disable(),r?.touchZoomRotate.disableRotation()))}},enable:()=>{let e=this.#e.getSystems().cameraSystem;if(e.enablePan=!0,e.enableZoom=!0,e.enableRotate=!0,this.#e.cameraMode==="external"){let t=this.#e.map;t?.dragPan.enable(),t?.scrollZoom.enable(),t?.dragRotate.enable(),t?.touchZoomRotate.enable(),t?.keyboard.enable()}},disable:()=>{let e=this.#e.getSystems().cameraSystem;if(e.enablePan=!1,e.enableZoom=!1,e.enableRotate=!1,this.#e.cameraMode==="external"){let t=this.#e.map;t?.dragPan.disable(),t?.scrollZoom.disable(),t?.dragRotate.disable(),t?.touchZoomRotate.disable(),t?.keyboard.disable()}}};setScreenOffsets(e){this.#e.camera.setInsetPadding(e)}get screenOffsets(){return this.#e.camera.insetsPadding}get panMode(){return this.#e.camera.panMode}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&this.#e.camera.setPanMode(e)}getFocusOnTransform(e,t){let r=this.#e.camera.getCameraFrameForCoordinates(this.#r(e),{pitch:t?.pitch,bearing:t?.bearing,padding:t?.screenOffsets||this.screenOffsets,maxZoomLevel:t?.maxZoomLevel,verticalPadding:t?.axisAlignedPadding?.vertical,minZoomLevel:t?.minZoomLevel,duration:t?.duration,easing:t?.easing,debugKey:e,debugColor:t?.debugColor});return{center:new X(r.center[1],r.center[0]),zoomLevel:r.zoomLevel,bearing:t?.bearing??this.bearing,pitch:t?.pitch??this.pitch}}#o(e){let t=this.#e.camera.elevation;return X.is(e)&&e.floorId!=null?this.#e.getState(e.floorId)?.altitude??t:Xe.is(e)?this.#e.getState(e.id)?.altitude??t:"floor"in e&&Xe.is(e.floor)?this.#e.getState(e.floor.id)?.altitude??t:t}#r(e){let t=[],n=(Array.isArray(e)?e:[e]).flatMap(i=>i?.focusTarget??[i]);for(let i of n)if(i!=null)if(X.is(i)){let a=this.#o(i);t.push([i.longitude,i.latitude,a])}else if(i?.id!=null){if(Lo.is(i)){let l=this.#t.getFloorStackAltitudeData(i.id);for(let c of i.floors){let d=l.get(c.elevation),p=d?.altitude??this.#e.camera.elevation,g=d!=null?d.altitude+d.visualHeight:p;is(c.geoJSON,m=>{t.push([m[0],m[1],p]),g!==p&&t.push([m[0],m[1],g])})}continue}let a=this.#o(i);if(Xe.is(i)&&this.#t.getMapDataInternal()?.enterpriseMode){t.push(i.id);continue}else if("geoJSON"in i&&i.geoJSON.geometry.coordinates.length>0){is(i.geoJSON,l=>{t.push([l[0],l[1],a])});continue}let s=this.#e.getBoundingArea(i.id);if(s)t.push(...s.map(l=>[l[0],l[1],a]));else if("geoJSONBoundingBox"in i){let l=this.#o(i);if(i.geoJSONBoundingBox!=null){let c=[[i.geoJSONBoundingBox[0],i.geoJSONBoundingBox[1],l],[i.geoJSONBoundingBox[2],i.geoJSONBoundingBox[3],l]];t.push(...c)}}}else Cp(i)&&t.push(i);return t}focusOn(e,t){return this.#e.camera.focusOn(this.#r(e),{pitch:t?.pitch,bearing:t?.bearing,padding:t?.screenOffsets||this.screenOffsets,maxZoomLevel:t?.maxZoomLevel,minZoomLevel:t?.minZoomLevel,duration:t?.duration,verticalPadding:t?.axisAlignedPadding?.vertical,easing:t?.easing})}animateTo(e,t){let{center:r,zoomLevel:n,bearing:i,pitch:a}=e,s=r??this.center;return this.#e.camera.animateTo({center:r!=null?[s.longitude,s.latitude,this.#e.camera.elevation]:void 0,zoomLevel:n,bearing:i,pitch:a,duration:t?.duration??600,easing:t?.easing})}set(e){let{center:t=this.center,zoomLevel:r=this.zoomLevel,bearing:n=this.bearing,pitch:i=this.pitch}=e,a=[t.longitude,t.latitude];this.#e.camera.setCenter(a),this.#e.camera.setZoomLevel(r),this.#e.camera.setBearing(n),this.#e.camera.setPitch(i)}get center(){let e=this.#e.camera.center;return new X(e[1],e[0],void 0)}setAutoMinZoomLevel(e){this.#e.camera.setAutoMinZoomLevel(e)}get autoMinZoomLevel(){return this.#e.camera.autoMinZoomLevel}get zoomLevel(){return this.#e.camera.zoomLevel}get pitch(){return this.#e.camera.pitch}get minPitch(){return this.#e.camera.minPitch}get maxPitch(){return this.#e.camera.maxPitch}setMinPitch=e=>{this.#e.camera.setMinPitch(e)};setMaxPitch=e=>{this.#e.camera.setMaxPitch(e)};get bearing(){let e=this.#e.camera.bearing;return(e<0?e+360:e)%360}get minZoomLevel(){return this.#e.camera.minZoomLevel}setMinZoomLevel=e=>{this.#e.camera.setMinZoomLevel(e,!0)};get maxZoomLevel(){return this.#e.camera.maxZoomLevel}setMaxZoomLevel=e=>{this.#e.camera.setMaxZoomLevel(e)};setElevation(e){this.#e.camera.setElevation(e)}get elevation(){return this.#e.camera.elevation}get maxElevation(){return this.#e.camera.maxElevation}setMaxElevation(e){this.#e.camera.setMaxElevation(e)}animateElevation(e,t){return this.#e.camera.animateElevation(e,t)}get bounds(){return Yi(this.#e.getSystems().cameraSystem.panBounds,this.#e.convert3DMapPositionToCoordinate)}get isAnimating(){return this.#e.camera.isAnimating}cancelAnimation(){this.#e.camera.cancelAnimation()}updateFacadesInView(){this.#e.getSystems().geometryInFocusSystem.compute()}};f();var Xn=class{#e;get currentMap(){return this.#e()}constructor({currentMapGetter:e}){this.#e=e}async getCurrentSceneGLTF(e){let t=this.#e();return t?t?.Exporter.getCurrentSceneGLTF(e):(_.error("There is no map to export. Please load a map first."),new Blob)}};f();var Yn=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getAll(){return Array.from(this.#e.values()).map(e=>e.label)}getById(e){return this.#e.get(e)}add(e,t,r){let n=e.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Labels.add(n,t,{...r,attachTo:Wr(e),rank:r?.rank==null||r?.rank==="initial"?"medium":r.rank}),s=new To(a.id.toString(),t,e);return this.#e.set(s.id,{label:s,entityId:s.id}),s}__EXPERIMENTAL__all(e){let t=[];return this.currentMap?.Labels.all({onCreate:(r,n,i)=>{let a=new To(r.toString(),n,i);this.#e.set(a.id,{label:a,entityId:a.id}),t.push(a)},labelOptions:e}),t}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Labels.remove(t),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(({label:t})=>{this.remove(t),e.push(t),this.#e.delete(t.id.toString())}),e}};f();f();f();function Jr(o,e,t){let r=t==="exterior",n=o?.find(i=>i.exterior===r);return n==null?void 0:e[n.id]}var Vl=o=>({type:"Feature",geometry:o.geometry,properties:{id:o.id,externalId:o.externalId??"",details:o.details??{}}});function $f(o,e){let t={};if(o==null||o.length===0)return t;for(let r of[!1,!0]){let n=o.filter(a=>a.exterior===r);if(n.length===0)continue;if(n.some(a=>a.doorIds!=null)){let a=n.map(d=>({type:"Feature",geometry:d.geometry,properties:{id:d.id,entrances:d.doorIds??[]}})),s=n.flatMap(d=>d.doorIds??[]).map(d=>e.lookup(d)).filter(d=>d!=null),{walls:l,entrances:c}=Pu(a,s);t[r?"exterior":"interior"]={walls:l,doors:c}}else t[r?"exterior":"interior"]={walls:{type:"Feature",properties:{id:n[0].id},geometry:{type:"MultiLineString",coordinates:n.map(a=>a.geometry.coordinates)}},doors:{type:"FeatureCollection",features:e.onFloor.filter(a=>a.isExterior===r&&a.geometry.type==="LineString").map(a=>e.lookup(a.id)??Vl(a))}}}return t}f();f();var ba=o=>"anchorId"in o.properties?o.properties.anchorId:void 0;function jl(o){let e=new Map;for(let t of o??[]){let r=ba(t);r!=null&&e.set(r,t)}return e}function Xf(o,e,t){let r={id:o.id};return o.kind!==void 0&&(r.kind=o.kind),e!=null&&"anchorId"in e.properties&&(r.image={...e.properties,position:e.coordinates}),t?.textArea!==void 0&&(r.textArea=t.textArea),t?.style!==void 0&&(r.style=t.style),t?.textures!==void 0&&(r.textures=t.textures),t?.bevel!==void 0&&(r.bevel=t.bevel),{type:"Feature",geometry:o.geometry,properties:r}}f();var H1=new Set(["object","unknown"]);function Yf(o){return o.geometry.type==="Polygon"&&H1.has(o.kind??"")}function Zf(o,e,t){let r={id:o.id};return o.kind!==void 0&&(r.kind=o.kind),e!=null&&"anchorId"in e.properties&&(r.image={...e.properties,position:e.coordinates}),t?.textArea!==void 0&&(r.textArea=t.textArea),t?.textures!==void 0&&(r.textures=t.textures),t?.bevel!==void 0&&(r.bevel=t.bevel),{type:"Feature",geometry:o.geometry,properties:r}}function Jf(o){return{type:"Feature",geometry:o.geometry,properties:{id:o.id}}}f();f();var qf=dn(il(),1);function W1(o,e){var t=Mr(o),r=Mr(e),n=o.properties||{},i=qf.default.difference(t.coordinates,r.coordinates);return i.length===0?null:i.length===1?xi(i[0],n):Mi(i,n)}var Qf=W1;var Kf=.2,eh=.1,pr=wd.UNDERGROUND_MASK,z1=!1;function th(o){if(!o||o.length<3)return null;let e=[],t=0;for(let s=0;s<o.length;s++){let l=o[s],c=`${l[0]},${l[1]}`,d=!1;for(let p=0;p<e.length;p++)if(e[p]===c){d=!0;break}d||(e.push(c),t++)}if(t<3)return null;let r=o[0],n=o[o.length-1];if(r[0]===n[0]&&r[1]===n[1])return o;let a=[];for(let s=0;s<o.length;s++)a.push(o[s]);return a.push(r),a}function oh(o,e){let t=[];if(o.type==="Polygon"){let r=th(o.coordinates[0]);r&&t.push(r)}else if(o.type==="MultiPolygon")for(let r of o.coordinates){let n=th(r[0]);n&&t.push(n)}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:t},properties:e||{}}}var Zn=class{renderer;mapObject;config;wallsId;maskedWallsId;voidWallsId;maskedVoidWallsId;ceilingId;ceilingMaskId;basementMaskId;extrudedPolygonId;footprintColor;layer;groupContainer;constructor(e,t,r,n){this.renderer=e,this.mapObject=t,this.config=n;let i=Jr(n.walls,n.styleMap,"exterior")??uo;this.footprintColor=i.color,this.groupContainer=this.renderer.addGroupContainer(`Footprint-${n.floorId}`,{visible:!1},r),this.layer=this.renderer.addGroupContainer(`${Pn}-${n.floorId}`,{visible:!1},this.groupContainer.id.toString())}getFloorAltitudes(){return this.mapObject.getFloorStackAltitudeData(this.config.floorStackId)}getVisualHeight(){return this.config.fixedHeight!=null?this.config.fixedHeight:(this.getFloorAltitudes()??new Map).get(this.config.elevation)?.visualHeight??0}get footprintGeometry(){return this.config.footprintGeometry}buildWalls(){let r=oh(this.config.footprintGeometry.geometry,{id:`Footprint-Floor-${this.config.floorId}`}).geometry.coordinates.map((s,l)=>({type:"Feature",geometry:{type:"LineString",coordinates:s},properties:{id:`Footprint-Floor-Section-${this.config.floorId}-${l}`}})),n=this.getVisualHeight(),i="front";this.wallsId=`Footprint-Walls-${this.config.floorId}`;let a={color:this.footprintColor,height:n,altitude:0,width:eh,outline:!1,visible:!0,opacity:1,side:i,renderOrder:2};this.config.elevation<0&&(a.__EXPERIMENTAL_maskMode="masked-object",a.__EXPERIMENTAL_maskEffect="reveal",a.__EXPERIMENTAL_maskEnabled=!0,a.__EXPERIMENTAL_maskId=pr),this.renderer.addFeatureCollection(this.wallsId,{features:r},a,void 0,this.groupContainer)}buildVoidWalls(e){if(!e||e.length===0)return;let t=[],r=0;for(let s of e){let l=oh(s.geometry,{id:`Void-Wall-${this.config.floorId}-${r}`});for(let c of l.geometry.coordinates)t.push({type:"Feature",geometry:{type:"LineString",coordinates:c},properties:{id:`Void-Wall-Section-${this.config.floorId}-${r}`}}),r++}if(t.length===0)return;let n=this.getVisualHeight(),i="front";this.voidWallsId=`Void-Walls-${this.config.floorId}`;let a={color:this.footprintColor,height:n,altitude:0,width:eh,outline:!1,visible:!0,opacity:1,side:i,renderOrder:2};this.config.elevation<0&&(a.__EXPERIMENTAL_maskMode="masked-object",a.__EXPERIMENTAL_maskEffect="reveal",a.__EXPERIMENTAL_maskEnabled=!0,a.__EXPERIMENTAL_maskId=pr),this.renderer.addFeatureCollection(this.voidWallsId,{features:t},a,void 0,this.groupContainer)}buildExtrudedPolygon(){this.extrudedPolygonId=`Footprint-Extruded-${this.config.floorId}`;let e=this.getVisualHeight(),t={color:this.footprintColor,height:e,altitude:0,visible:!0,outline:!1,opacity:1,side:"front",renderOrder:2};this.config.elevation<0&&(t.__EXPERIMENTAL_maskMode="masked-object",t.__EXPERIMENTAL_maskEffect="reveal",t.__EXPERIMENTAL_maskEnabled=!0,t.side="back",t.__EXPERIMENTAL_maskId=pr);let r=Gl(this.config.footprintGeometry);this.renderer.addFeatureCollection(this.extrudedPolygonId,{features:[{...r,properties:{id:`Footprint-Extruded-Geometry-${this.config.floorId}`,externalId:this.config.externalId,elevation:this.config.elevation}}]},t,void 0,this.groupContainer)}buildCeiling(e){let t={...this.config.footprintGeometry};t=Gl(t),e?.length>0&&(t=$1(t,e));let r="front";this.ceilingId=`Ceiling-${this.config.floorId}`;let n={color:this.footprintColor,height:-Kf,altitude:0,visible:!0,outline:!1,opacity:1,side:r};this.config.elevation<0&&(n.__EXPERIMENTAL_maskMode="masked-object",n.__EXPERIMENTAL_maskEffect="reveal",n.__EXPERIMENTAL_maskEnabled=!0,n.__EXPERIMENTAL_maskId=pr),this.renderer.addFeatureCollection(this.ceilingId,{features:[{...t,properties:{id:`Footprint-Ceiling-${this.config.floorId}`,externalId:this.config.externalId,elevation:this.config.elevation}}]},n,{altitude:this.getVisualHeight()},this.groupContainer)}buildBasementMask(e=[]){let t=this.config.footprintGeometry;for(let n of e)try{let i=Vi(t,n);i&&(t=i)}catch{}t=Gl(t),this.basementMaskId=`Footprint-Basement-Mask-${this.config.floorId}`;let r={color:rh(-1),altitude:0,visible:!0,height:.01,outline:!1,__EXPERIMENTAL_maskEnabled:!0,__EXPERIMENTAL_maskMode:"mask",__EXPERIMENTAL_maskId:pr};if(this.renderer.addFeatureCollection(this.basementMaskId,{features:[{...t,properties:{id:`Footprint-Basement-Mask-Geometry-${this.config.floorId}`}}]},r,void 0,"outdoors-container"),z1){let n={color:rh(-1),altitude:0,opacity:.5,visible:!1,height:.01,outline:!1};this.renderer.addFeatureCollection(this.basementMaskId+"debug",{features:[{...t,properties:{id:`Footprint-Basement-Mask-Geometry-${this.config.floorId}-debug`}}]},n,void 0,"outdoors-container")}}update(e){if(e.basementMaskEnabled!==void 0&&this.basementMaskId&&(this.renderer.setState(this.basementMaskId,{visible:e.basementMaskEnabled}),this.renderer.setState(this.basementMaskId+"debug",{visible:e.basementMaskEnabled})),this.config.multiFloorView?.footprintsHidden)return;let t={};if(e.altitude!==void 0&&(t.altitude=e.altitude),e.visible!==void 0&&(t.visible=e.visible),Object.keys(t).length>0&&this.renderer.setState(this.groupContainer.id,t),this.extrudedPolygonId){let i={};e.opacity!==void 0&&(i.opacity=e.opacity),e.side!==void 0&&(i.side=e.side),e.color!==void 0&&(i.color=e.color),e.outline!==void 0&&(i.outline=e.outline),e.height!==void 0&&(i.height=e.height),Object.keys(i).length>0&&this.renderer.setState(this.extrudedPolygonId,i);return}let r={};e.opacity!==void 0&&(r.opacity=e.opacity),e.side!==void 0&&(r.side=e.side),e.color!==void 0&&(r.color=e.color),e.outline!==void 0&&(r.outline=e.outline);let n={};if(e.height!==void 0&&(r.height=e.height,n.altitude=e.height),this.wallsId&&Object.keys(r).length>0&&this.renderer.setState(this.wallsId,r),this.voidWallsId&&Object.keys(r).length>0&&this.renderer.setState(this.voidWallsId,r),this.maskedWallsId&&Object.keys(r).length>0){let{outline:i,...a}=r;Object.keys(a).length>0&&this.renderer.setState(this.maskedWallsId,a)}if(this.maskedVoidWallsId&&Object.keys(r).length>0){let{outline:i,...a}=r;Object.keys(a).length>0&&this.renderer.setState(this.maskedVoidWallsId,a)}if(e.opacity!==void 0&&(n.opacity=e.opacity),e.color!==void 0&&(n.color=e.color),e.ceilingVisible!==void 0&&(n.visible=e.ceilingVisible),e.outline!==void 0&&(n.outline=e.outline),this.ceilingId&&Object.keys(n).length>0&&this.renderer.setState(this.ceilingId,n),this.ceilingMaskId&&Object.keys(n).length>0){let{outline:i,...a}=n;Object.keys(a).length>0&&this.renderer.setState(this.ceilingMaskId,a)}}getState(){let e=this.renderer.getState(this.groupContainer.id),t=e.altitude,r=e.visible,n=this.ceilingId?this.renderer.getState(this.ceilingId):void 0,i=n?.visible,a=n?.height??Kf,s=this.basementMaskId?this.renderer.getState(this.basementMaskId)?.visible:void 0;if(this.extrudedPolygonId){let l=this.renderer.getState(this.extrudedPolygonId);return{altitude:t,visible:r,opacity:l.opacity,side:l.side,color:l.color,height:l.height,outline:l.outline,basementMaskEnabled:s,ceilingVisible:!0,ceilingThickness:0}}if(this.wallsId){let l=this.renderer.getState(this.wallsId),c=l.height;return{altitude:t,visible:r,opacity:l.opacity,side:l.side,color:l.color,height:c,ceilingVisible:i,basementMaskEnabled:s,outline:l.outline,ceilingThickness:a}}return{altitude:t,visible:r,ceilingVisible:i,basementMaskEnabled:s,ceilingThickness:a}}};function Gl(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}}function $1(o,e){let t;if(Array.isArray(e))if(e.length>0&&"geometry"in e[0])t=e;else{t=[];for(let n of e)for(let i of n.coordinates)t.push({type:"Feature",geometry:{type:"Polygon",coordinates:i},properties:{}})}else{t=[];for(let n of e.coordinates)t.push({type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}})}if(t.length===0)return o;let r=o;for(let n=0;n<t.length;n++){let i=t[n];if(r===null)break;try{r=Qf(r,i)}catch(a){_.warn(`Polygon difference failed for hole ${i.properties?.id??"unknown"} (index ${n}/${t.length}), skipping. Error: ${a instanceof Error?a.message:a}`)}}return r===null?{type:"Feature",geometry:{type:"MultiPolygon",coordinates:[]},properties:o.properties}:{...r,properties:o.properties}}var rh=o=>o===0?"red":o===-1?"blue":o===-2?"green":"black";var X1={color:"#ffffff",opacity:1},uo={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},nh={opacity:.25,color:"#a7d1ec",height:.8,width:.05,cap:"square"},ih=.1,Ul={color:"red",opacity:.2,height:uo.height+.1,visible:!0,borderVisible:!1},ah=.5,lt=class{containerId;layers;renderer;constructor(e,t,r=new Map){this.containerId=t,this.layers=r,this.renderer=e}get visible(){return this.renderer.getState(this.containerId)?.visible===!0}setVisible(e){this.visible!==e&&this.renderer.setState(this.containerId,{visible:e})}},sh=0,Jn=class{id;name;elevation;maxHeight;containerId;externalId;metadata;shortName;subtitle;occluderId;geometryContainer;loaded=!1;styleMap={};renderer;mapObject;options;layers=new Map;footprint;ceiling;floorStackId;multiFloorView;mapDataInternal;_computedMaxHeight;get geometryMaxHeight(){return this._computedMaxHeight}get spacesOpenToBelowEnabled(){return this.multiFloorView?.spacesOpenToBelowEnabled??!1}get voids(){return this.mapDataInternal?.voidsByFloorId[this.id]?.voids?.features??[]}get spacesOpenToBelow(){return Ef(this.mapDataInternal?.spaceRecordsByFloorId[this.id])}facadesByStyleId=new Map;footprintObject;gapFootprintObject;#e;get geoJSONBoundingBox(){if(this.#e)return this.#e;if(!this.footprint){_.warn(`Attempting to get bounding box with no footprint for floor ${this.id}`);return}return this.#e=Du(this.footprint),this.#e}constructor(e,t,r,n,i,a,s){this.mapObject=r,this.renderer=r.renderer,this.id=t.id,this.options=i;let l=this.renderer.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:i.preloadFloors?.map(c=>c.id).includes(t.id)},e);this.containerId=l.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.maxHeight=t.maxHeight,this.elevation=t.elevation,a!=null&&(this.styleMap=a),this.footprint=Mf(s?.floorRecordsById[t.id]),this.floorStackId=e,this.multiFloorView=n,this.mapDataInternal=s}#t(){let e=this.mapDataInternal?.wallRecordsByFloorId[this.id],t=new Map((this.mapDataInternal?.doorRecordsByFloorId[this.id]??[]).map(r=>[r.id,r]));return $f(e,{lookup:r=>{let n=t.get(r);return n==null?void 0:Vl(n)},onFloor:this.mapDataInternal?.doorRecordsByFloorId[this.id]??[]})}load=(e=!1)=>{if(this.loaded)return this;this.footprint?.geometry==null&&(this.mapDataInternal?.objectRecordsByFloorId[this.id]??[]).length===0&&(this.mapDataInternal?.wallRecordsByFloorId[this.id]??[]).length===0&&(this.mapDataInternal?.spaceRecordsByFloorId[this.id]??[]).length===0&&_.warn(`Floor ${this.id} exists in the data but contains no geometry.`),this.loaded=!0;let t=this.renderer.addGroupContainer(`${so}-${this.id}`,{},this.id);this.layers.set(so,new lt(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer(`${$t}-${this.id}`,{},this.id);this.layers.set($t,new lt(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer(`${Pe}-${this.id}`,{},this.id);this.geometryContainer=n,this.layers.set(Pe,new lt(this.renderer,n.id.toString()));let i=this.renderer.addGroupContainer(`${lo}-${this.id}`,{},this.id);this.layers.set(lo,new lt(this.renderer,i.id.toString()));let a=this.renderer.addGroupContainer(`${Xt}-${this.id}`,{},this.id);this.layers.set(Xt,new lt(this.renderer,a.id.toString()));let s=this.renderer.addGroupContainer(Op(this.id),{},this.id);if(this.layers.set(sr,new lt(this.renderer,s.id.toString())),this.renderer.addGroupContainer(No(this.id),{},s.id.toString()),this.renderer.addGroupContainer(Vr(this.id),{},s.id.toString()),this.multiFloorView?.__EXPERIMENTAL_DEBUG_showVoids){let v=0;for(let y of this.voids)this.renderer.addFeatureCollection(`Void-${this.id}-${v}`,{features:[y]},{color:"red"},void 0,n),v++}if(this.multiFloorView?.__EXPERIMENTAL_DEBUG_showOpenToBelow){let v=0;for(let y of this.spacesOpenToBelow)this.renderer.addFeatureCollection(`SpacesOpenToBelow-${this.id}-${v}`,{features:[y]},{color:"blue"},void 0,n),v++}let l=this.mapDataInternal?.spaceRecordsByFloorId[this.id];if(l!=null&&l.length>0){let v=[],y=new Map,E=this.multiFloorView?.__EXPERIMENTAL_excludeSpaceIdsInAutoHeightCalculation,k=E!=null&&E.length>0?new Set(E):void 0,w=jl(this.mapDataInternal?.floorImageRecordsByFloorId[this.id]);for(let j of l){if(j.geometry.type!=="Polygon")continue;let G=j.kind?.toLowerCase();if(G==="void"||G==="otb")continue;let W=Xf(j,w.get(j.id),this.mapDataInternal?.decorationsById[j.id]),N=this.styleMap[W.properties.id];if(N!=null&&"height"in N&&N?.height!=null&&(k==null||!k.has(W.properties.id))){let oe=(N.altitude??0)+N.height;(this._computedMaxHeight==null||oe>this._computedMaxHeight)&&(this._computedMaxHeight=oe)}let q=this.mapDataInternal?.facadesBySpaceId[W.properties.id];if(q){let oe=y.get(q.id);oe==null&&(oe=[],y.set(q.id,oe)),oe.push(W)}else v.push(W)}let B=this.renderer.addGroupContainer(`spaces-${this.id}`,{},n),D=this.renderer.addFeatureCollection(`Spaces-${this.id}-0`,{features:v},j=>j?.properties?.id!=null&&this.styleMap[j.properties.id]!=null?Ur(this.styleMap[j.properties.id],this.options):X1,void 0,B);if(this.layers.get(Pe).layers.set("Spaces",D.id.toString()),y.size>0){let j=this.renderer.addGroupContainer(`${ar}-${this.id}`,{},this.id);this.layers.set(ar,new lt(this.renderer,j.id.toString()));for(let[G,W]of y){let N=this.renderer.addGroupContainer(G,{focusable:!0},j),q=this.renderer.addGroupContainer(`${G}-geometry`,{},N),oe=Ru(W,this.styleMap),ie=0;for(let[be,De]of oe){let ke={...Ur(be,this.options),focusable:e,renderOrder:3},ue=this.renderer.addFeatureCollection(`Facades-${this.id}-${G}-${ie}`,{features:De},()=>ke,void 0,q);ie++;let Ke=be.id||ue.id.toString();this.layers.get(ar).layers.set(`${G}-${Ke}`,ue.id.toString()),this.facadesByStyleId.has(Ke)?this.facadesByStyleId.get(Ke)?.push(G):this.facadesByStyleId.set(Ke,[G])}}}}this.footprint?.geometry!=null&&this.footprint.geometry.coordinates.length>0&&this.styleMap!=null&&(this.footprintObject=new Zn(this.renderer,this.mapObject,this.id,{floorId:this.id,externalId:this.externalId,elevation:this.elevation,floorStackId:this.floorStackId,footprintGeometry:this.footprint,walls:this.mapDataInternal?.wallRecordsByFloorId[this.id],styleMap:this.styleMap,multiFloorView:this.multiFloorView}),this.layers.set(Pn,new lt(this.renderer,this.footprintObject.layer.id.toString())),this.footprint=Vu(this.footprint));let c=this.mapDataInternal?.objectRecordsByFloorId[this.id]??[],d=this.mapDataInternal?.wallRecordsByFloorId[this.id]??[];if(c.length>0||d.length>0){let v=jl(this.mapDataInternal?.floorImageRecordsByFloorId[this.id]),y=c.filter(Yf).map(D=>Zf(D,v.get(D.id),this.mapDataInternal?.decorationsById[D.id])),E=this.renderer.addGroupContainer(`objects-${this.id}`,{},n),k=0,w=this.renderer.addFeatureCollection(`Objects-${this.id}-${k}`,{features:y},({properties:D})=>D.id!=null&&this.styleMap[D.id]!=null?Ur(this.styleMap[D.id],this.options):uo,void 0,E);k++;let B=E.id.toString();this.layers.get(Pe).layers.set(B,w.id.toString())}let p=this.mapDataInternal?.wallRecordsByFloorId[this.id];if(p?.length){let v=this.#t(),y=uo,E=uo;if(v.interior!=null){let k=Jr(p,this.styleMap,"interior");k!=null&&(y={...k}),E=y;let{walls:w,doors:B}=v.interior,D=Math.max(y.height-.11,ah),j={...nh,height:D},G=this.renderer.addGroupContainer(`${Nr}-${this.id}`,{visible:!1,altitude:ih},n);this.layers.set(Nr,new lt(this.renderer,G.id.toString()));let W=this.renderer.addFeatureCollection(`InteriorDoors-${this.id}`,B,()=>j,void 0,G);this.layers.get(Pe).layers.set(Dr,W.id.toString());let N=Ur(y,this.options),q=this.renderer.addFeatureCollection(`Walls-${this.id}`,{features:[w]},N,void 0,n);this.layers.get(Pe).layers.set(ko,q.id.toString())}if(v.exterior!=null){let k=Jr(p,this.styleMap,"exterior");k!=null&&(E={...k,id:ao});let{walls:w,doors:B}=v.exterior,D=Math.max(E.height-.11,ah),j={...nh,height:D},G=this.renderer.addGroupContainer(`${Lr}-${this.id}`,{visible:!1,altitude:ih},n);this.layers.set(Lr,new lt(this.renderer,G.id.toString()));let W=this.renderer.addFeatureCollection(`ExteriorDoors-${this.id}`,B,()=>j,void 0,G);this.layers.get(Pe).layers.set(kr,W.id.toString());let N=Ur(E,this.options),q=this.renderer.addFeatureCollection(`ExteriorWalls-${this.id}`,{features:[w]},N,void 0,n);this.layers.get(Pe).layers.set(ao,q.id.toString())}}let g=this.mapDataInternal?.floorImageRecordsByFloorId[this.id];if(g!=null){let v=this.renderer.addGroupContainer(`images-${this.id}`,{},this.id);for(let y of g){let E={geometry:{coordinates:y.coordinates},properties:y.properties},k=ba(y)??null,w=k==null,B=k!=null&&this.mapDataInternal!=null&&this.mapDataInternal.pointsOfInterestById[k]!=null;if(w||B){let D=Nu(E,sh),G=((E.properties.rotation??0)%360+360)%360;if(B){let W=new X({latitude:E.geometry.coordinates[1],longitude:E.geometry.coordinates[0],floorId:this.id});this.mapDataInternal.Query.at(W).then(N=>{let q=0;for(let oe of N)if(Te.is(oe)){let ie=this.renderer.getState(oe.id)?.height??0;ie>q&&(q=ie)}this.mapObject.api.Image3D.add(new X({latitude:E.geometry.coordinates[1],longitude:E.geometry.coordinates[0],floorId:this.id,verticalOffset:q}),E.properties.path,{id:D,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...E.properties,rotation:G})})}else this.mapObject.api.Image3D.add(new X({latitude:E.geometry.coordinates[1],longitude:E.geometry.coordinates[0],floorId:this.id}),E.properties.path,{id:D,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...E.properties,rotation:G});sh++}}this.layers.set(Br,new lt(this.renderer,v.id.toString()))}let m=this.mapDataInternal?.floorTextRecordsByFloorId[this.id];if(m!=null){let v=Vr(this.id);for(let y of m){let E=0;"geometryId"in y.properties?E=this.renderer.getState(y.properties.geometryId)?.height??0:E=y.properties.verticalOffset??0,this.renderer.addText3D(ae(),{type:"Feature",geometry:y.geometry,properties:{...y.properties,verticalOffset:E}},{appearance:{flipToFaceCamera:!1}},v)}}let I=(this.mapDataInternal?.areaRecordsByFloorId[this.id]??[]).map(Jf);{let v=this.renderer.addGroupContainer(`areas-${this.id}`,{},this.id);this.layers.set(ir,new lt(this.renderer,v.id.toString()));let y=this.renderer.addFeatureCollection(`Areas-${this.id}`,{features:I},()=>({color:Ul.color,height:Ul.height}),void 0,v);for(let E of I)this.renderer.setState(E.properties.id,{...Ul,visible:!1});this.layers.get(ir).layers.set(y.id.toString(),y.id.toString())}return e&&!this.hasFacadeGeometry&&this.addFocusFootprint(),this.renderer.render(),this};addOccluder(){if(this.footprint?.geometry==null)return;let e=this.renderer.addGroupContainer(`${nr}-${this.id}`,{},this.id),t=new lt(this.renderer,e.id.toString());this.layers.set(nr,t),this.occluderId=this.renderer.addOccluder(this.footprint,t.containerId)}addFocusFootprint(){let e=this.footprint?.geometry;if(e==null)return;let t={type:"FeatureCollection",features:[{type:"Feature",geometry:e,properties:{}}]},r=this.renderer.addFeatureCollection(`${On}${this.id}`,t,{opacity:0,height:1,color:"white",focusable:!0},void 0,this.geometryContainer),n=this.renderer.getState(r.id);for(let i of n.children)this.renderer.setState(i,{interactive:"pass-through"})}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(e){this.renderer.setState(this.containerId,{visible:e})}buildCeiling(e){this.footprintObject&&this.footprintObject.buildCeiling(e)}buildExtrudedPolygon(){this.footprintObject&&this.footprintObject.buildExtrudedPolygon()}buildBasementMask(){this.footprintObject&&this.footprintObject.buildBasementMask(this.spacesOpenToBelow)}buildGapFootprint(e,t){this.footprint?.geometry!=null&&(this.gapFootprintObject=new Zn(this.renderer,this.mapObject,this.id,{floorId:`gap-below-${this.id}`,externalId:this.externalId,elevation:this.elevation,floorStackId:this.floorStackId,footprintGeometry:this.footprint,styleMap:{},multiFloorView:this.multiFloorView,fixedHeight:e}),this.gapFootprintObject.buildWalls(),this.gapFootprintObject.buildCeiling(t),this.gapFootprintObject.update({altitude:-e,visible:!1}))}getFootprintStyle(){let e=this.mapDataInternal?.wallRecordsByFloorId[this.id];return e?.some(t=>t.exterior)?Jr(e,this.styleMap,"exterior"):uo}buildFootprint(){if(!this.footprintObject)return;this.footprintObject.buildWalls(),this.footprintObject.buildVoidWalls(this.voids);let e=new lt(this.renderer,this.footprintObject.layer.id.toString());this.layers.set(Pn,e)}setGeometryTextBatchVisible(e){this.#o(No(this.id),e)}setFloorTextBatchVisible(e){this.#o(Vr(this.id),e)}#o(e,t){let r=this.renderer.getInternalState().geometry3DMap.get(e);r&&r instanceof Ad&&this.renderer.getSystems().text3DSystem.setBatchVisible(r,t)}};f();var Y1={polygon:"polygons",lineString:"lineStrings",point:"points"};function lh(o){let e=Object.create(null);for(let t of Object.values(o)){let{id:r,type:n,geometryIds:i,...a}=t,s={...a,[Y1[n]]:i,id:r};for(let l of i)e[l]=s}return e}f();f();var Z1=5,J1="#ffffff";function q1(o,e){return typeof o=="string"?o:o[e]??J1}function Q1(o){return o.spacesOpenToBelow.length>0}function Hl(o,e,t){return t?o.find(r=>r.elevation>e):o.find(r=>r.elevation===e+1)}function Wl(o,e,t,r,n,i=!1){let a={outdoorOpacity:"initial",floorStates:[]},{spacesOpenToBelowEnabled:s}=n,l=n.spacesOpenToBelowVisualEffectEnabled??!0,c=r.get(e.elevation)?.altitude??0,d=c;for(let[I,v]of r)I<e.elevation&&v.altitude<d&&(d=v.altitude);let p=c-d+Z1,g=o.sort((I,v)=>I.elevation-v.elevation),m=new Set(t);for(let I of g){let v=r.get(I.elevation),y=v?.visualHeight??0,E=v?.altitude??0,k=n.opacity??(I.elevation<0?1:.4),w=!1;if(s){let q=I.elevation<e.elevation?Hl(o,I.elevation,n.disableGapFilling):void 0;w=q?Q1(q):!1}let B={maskEnabled:I.elevation<0,maskId:pr,maskEffect:"reveal",maskMode:"masked-object"},D=s?I.elevation===e.elevation||w:!1,j=s?I.elevation<e.elevation:I.elevation===e.elevation&&I.elevation<0,G=((e.elevation>=0?I.elevation===0:I.elevation===e.elevation)||i&&m.has(I.id)&&I.elevation<e.elevation&&I.elevation<0)&&I.floorStack?.type?.toLowerCase()!=="outdoor",W={color:q1(n.color,I.id),ceilingVisible:I.elevation<e.elevation,visible:j,basementMaskEnabled:G,outline:n.outline,ceilingThickness:.5,height:y,opacity:k},N={floor:I,state:{type:"floor",altitude:E,visible:D,geometry:s?{visible:D,heightScale:1,...B,effectStart:I.elevation<e.elevation&&l?c:0,effectDistance:I.elevation<e.elevation&&l?p:0,darkenAmount:l?n.spacesOpenToBelowVisualEffectDarkenAmount??.2:0,darkenUseDepth:n.spacesOpenToBelowVisualEffectDarkenUseDepth??!0,desaturateAmount:l?n.spacesOpenToBelowVisualEffectDesaturateAmount??0:0,desaturateUseDepth:n.spacesOpenToBelowVisualEffectDesaturateUseDepth??!0,washOutAmount:l?n.spacesOpenToBelowVisualEffectWashOutAmount??0:0,washOutUseDepth:n.spacesOpenToBelowVisualEffectWashOutUseDepth??!1}:{...B,visible:!1,heightScale:1},labels:{enabled:!1},markers:{enabled:!1},footprint:W,occlusion:{enabled:!1},areas:{visible:!1},text3d:{visible:!0,geometryText:{visible:!1},floorText:{visible:D}},images:{visible:!1,collisionsEnabled:I.id===e.id},paths:{visible:!1},models:{visible:!1}}};a.floorStates.push(N),i?I.id===e.id?(N.state.visible=!0,N.state.images.visible=!0,N.state.paths.visible=!0,N.state.geometry.visible=!0,N.state.geometry.opacity=1,N.state.geometry.heightScale=1,N.state.models.visible=!0,N.state.labels.enabled=!0,N.state.markers.enabled=!0,N.state.occlusion.enabled=!0,N.state.areas.visible=!0,N.state.text3d.geometryText.visible=!0,N.state.text3d.floorText.visible=!0,I.elevation<0&&(N.state.footprint.height=-E,N.state.footprint.visible=!0,a.outdoorOpacity=.2)):m.has(I.id)?(N.state.visible=!0,N.state.paths.visible=!0,N.state.markers.enabled=!0,I.elevation<e.elevation?(N.state.footprint.visible=!0,N.state.footprint.height=y,N.state.occlusion.enabled=!0,N.state.geometry.visible=w||k<1,N.state.geometry.opacity=1,N.state.geometry.heightScale=1,N.state.models.visible=!0,I.elevation<0&&(N.state.geometry.visible=!0,e.elevation<0?N.state.footprint.visible=!1:(N.state.footprint.height=-E,N.state.footprint.ceilingVisible=!1),a.outdoorOpacity=.2)):(N.state.geometry.visible=!0,N.state.geometry.opacity=.2,N.state.geometry.heightScale=.1,N.state.geometry.maskEnabled=!1)):I.elevation<e.elevation&&I.elevation>=0&&(N.state.visible=!0,N.state.footprint.visible=!0,N.state.footprint.height=y):I.id===e.id?(N.state.visible=!0,N.state.images.visible=!0,N.state.paths.visible=!0,N.state.geometry.visible=!0,N.state.models.visible=!0,N.state.labels.enabled=!0,N.state.markers.enabled=!0,N.state.occlusion.enabled=!0,N.state.areas.visible=!0,N.state.text3d.geometryText.visible=!0,N.state.text3d.floorText.visible=!0,I.elevation<0&&(N.state.footprint.height=-E,N.state.footprint.visible=!0,a.outdoorOpacity=.2)):m.has(I.id)&&I.elevation<e.elevation?(N.state.visible=!0,N.state.paths.visible=!0,N.state.footprint.visible=!0,N.state.footprint.height=y,N.state.geometry.visible=w||k<1,N.state.models.visible=!0,N.state.occlusion.enabled=!0,N.state.markers.enabled=!0,I.elevation<0&&(a.outdoorOpacity=.2)):e.elevation>0&&I.elevation<e.elevation&&I.elevation>=0&&(N.state.visible=!0,N.state.footprint.visible=!0,N.state.footprint.height=y)}return a}var qn=class{id;externalId;name;type;floorIds;defaultFloorId;floorObjects=[];floorObjectsByElevation=new Map;metadata;containerId;hasFacade;renderer;altitudeMap=new Map;constructor(e,t,r,n=!1){this.id=e.id,this.externalId=e.externalId,this.name=e.name,this.type=e.type,this.metadata=e.metadata,this.floorIds=e.floors??e.maps,this.defaultFloorId=e.defaultFloor;let i=r.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=i.id.toString(),this.hasFacade=n,this.renderer=r}#e;get defaultFloor(){if(this.#e==null){if(this.floorObjects.length===0)throw new re(`No floors in floor stack (${this.id}). Could not get default floor.`);let e;this.defaultFloorId&&(e=this.floorObjects.find(t=>t.id===this.defaultFloorId)),e||(e=this.floorObjects.reduce((t,r)=>Math.abs(r.elevation)<Math.abs(t.elevation)?r:t)),this.#e=e}return this.#e}get isOutdoors(){return this.type?.toLowerCase()==="outdoor"?!0:this.hasFacade?!1:this.floorObjects.some(t=>t.hasFacadeGeometry)}addFloor(e){if(this.floorObjectsByElevation.has(e.elevation)){_.error(`Floor with same elevation ${e.elevation} already exists in Stack (${this.id}). Floor (${e.id}) will not be added.`);return}this.floorObjects.push(e),this.floorObjectsByElevation.set(e.elevation,e)}loadAllFloors(e){this.floorObjects.sort((r,n)=>r.elevation-n.elevation);for(let r of this.floorObjects)r.load(this.hasFacade),!this.isOutdoors&&!r.hasFacadeGeometry&&r.footprint!=null&&r.addOccluder();if(this.altitudeMap=Lu(this.floorObjects,e?.floorGap,e?.floorGapMultiplier,e?.floorGapFallback,e?.__EXPERIMENTAL_disableGapFilling),e?.enabled)for(let r of this.floorObjects){let n=this.altitudeMap.get(r.elevation);n&&this.renderer.setState(r.id,{altitude:n.altitude})}if(this.isOutdoors||!e?.enabled)return;let t=e?.__EXPERIMENTAL_disableGapFilling===!0;for(let r of this.floorObjects){let n=Hl(this.floorObjects,r.elevation,t),i=[];if(r.spacesOpenToBelowEnabled){for(let s of r.voids)i.push(s);if(n)for(let s of n.spacesOpenToBelow)i.push(s)}let a=r.elevation<0;r.spacesOpenToBelowEnabled&&i.length>0||a?(r.buildCeiling(i),r.buildFootprint()):r.buildExtrudedPolygon(),r.elevation<=0&&r.buildBasementMask()}if(!e.__EXPERIMENTAL_disableGapFilling){let r=Bu(this.floorObjects,this.altitudeMap,e.floorGap,e.floorGapMultiplier,e.floorGapFallback);for(let n of r){let i=this.floorObjectsByElevation.get(n.floorAboveElevation);if(!i)continue;let a=i.spacesOpenToBelow;i.buildGapFootprint(n.height,a)}}}};f();import H from"zod";f();import{z as ch}from"zod";function dh(o){try{let e=o.shape;if("type"in e){let t=e.type;if(t instanceof ch.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof ch.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function ph(o){if(o.success)return{};let e={};for(let t of o.error.issues)if(t.path.length>0){let r=String(t.path[0]);e[r]||(e[r]=[]),e[r].push(t.message)}return e}function uh(o,e){let t=Object.entries(o);if(t.length>0){let r=t.map(([n,i])=>`${n}: ${i.join(", ")}`).join("; ");_.warn(`${t.length} invalid field(s) in ${e??"unknown"} state: [${r}]`)}}function me(o,e,t){if(t?.disableValidation)return e;if(e==null||typeof e!="object")return{};let r=o.safeParse(e);if(r.success){let a={};for(let s of Object.keys(e))s in r.data&&(a[s]=e[s]);return a}let n=ph(r);t?.warn&&uh(n,dh(o));let i={};for(let a of Object.keys(e))!(a in n)&&a in o.shape&&(i[a]=e[a]);return i}function Ze(o,e,t){if(t?.disableValidation)return e;let r=o.safeParse(e);if(r.success)return r.data;if(t?.warn===!0){let n=ph(r);uh(n,dh(o))}return e}var fh="path",ct={color:"#4b90e2",width:1,completeFraction:0,visible:!0,interactive:!1,verticalOffset:.1,xrayOpacity:.25,smoothingTension:ls.tension,smoothingCornerRadius:ls.cornerRadius,dashed:!1,dashDiscrete:!1,dashCornerRadius:0,endcapExtension:[.5,.5],billboarding:80},zl={enabled:H.boolean().optional(),cornerRadius:H.number().min(0).max(1).default(ct.dashCornerRadius)},hh=H.union([H.object({mode:H.literal("length-scaling").optional(),length:H.number().min(0).max(1).default(.1),gap:H.number().min(0).max(1).default(.1),...zl}),H.object({mode:H.literal("width-scaling").optional(),size:H.number().min(0).default(hn.size),gapSize:H.number().min(0).default(hn.gapSize),...zl}),H.object({mode:H.literal("absolute"),meters:H.number().min(0).default(1),gapMeters:H.number().min(0).default(.5),...zl})]),$l={__EXPERIMENTAL_DASH_CORNER_RADIUS:H.number().min(0).max(1).optional()},K1=H.discriminatedUnion("__EXPERIMENTAL_DASH_MODE",[H.object({__EXPERIMENTAL_DASH_MODE:H.literal("length-scaling"),__EXPERIMENTAL_DASH_LENGTH:H.number().min(0).max(1).optional(),__EXPERIMENTAL_DASH_GAP:H.number().min(0).max(1).optional(),...$l}),H.object({__EXPERIMENTAL_DASH_MODE:H.literal("width-scaling"),__EXPERIMENTAL_DASH_SIZE:H.number().min(0).optional(),__EXPERIMENTAL_GAP_SIZE:H.number().min(0).optional(),...$l}),H.object({__EXPERIMENTAL_DASH_MODE:H.literal("absolute"),__EXPERIMENTAL_DASH_METERS:H.number().min(0).optional(),__EXPERIMENTAL_GAP_METERS:H.number().min(0).optional(),...$l})]),Xl=H.object({type:H.literal(fh).default(fh),color:H.string().default(ct.color),width:H.union([H.number(),H.string().regex(ss),H.object({on:H.literal("zoom-level"),input:H.array(H.number()).nonempty(),output:H.union([H.array(H.number()).nonempty(),H.array(H.string().regex(ss)).nonempty()]),easing:H.string().optional()})]),completeFraction:H.number().default(ct.completeFraction),visible:H.boolean().default(ct.visible),interactive:H.boolean().default(ct.interactive),verticalOffset:H.number().default(ct.verticalOffset),highlightStartFraction:H.number().default(0),highlightEndFraction:H.number().default(0),highlightColor:H.string().default("red"),highlightWidthMultiplier:H.number().default(1.1),highlightCompleteFraction:H.number().default(1),highlightDisplayArrowsOnPath:H.boolean().default(!1),xrayOpacity:H.number().min(0).max(1).default(ct.xrayOpacity),travelledEndFraction:H.number().default(0),travelledColor:H.string().default("#999"),smoothing:H.object({tension:H.number().default(ct.smoothingTension),cornerRadius:H.number().default(ct.smoothingCornerRadius)}).optional(),dashed:H.boolean().default(ct.dashed),dashDiscrete:H.boolean().default(ct.dashDiscrete),dashCornerRadius:H.number().min(0).max(1).default(ct.dashCornerRadius),dash:hh.optional(),geometry:H.enum(["tube","ribbon"]).default("tube"),endcapExtension:H.tuple([H.number(),H.number()]).default(ct.endcapExtension),billboarding:H.union([H.boolean(),H.number().min(0).max(90)]).default(ct.billboarding),border:H.object({enabled:H.boolean(),color:H.custom(o=>typeof o=="string"),width:H.number().optional()}).optional(),xray:H.object({opacity:H.number().min(0).max(1).optional(),color:H.string().optional(),tint:H.number().min(0).max(1).optional(),dithering:H.number().min(0).optional()}).optional()}),eI={__EXPERIMENTAL_GEOMETRY:H.enum(["tube","ribbon"]).optional(),__EXPERIMENTAL_ENDCAP_EXTENSION:H.tuple([H.number(),H.number()]).optional(),__EXPERIMENTAL_BILLBOARDING:H.union([H.boolean(),H.number().min(0).max(90)]).optional(),__EXPERIMENTAL_BORDER:H.object({enabled:H.boolean(),color:H.custom(o=>typeof o=="string"),width:H.number().optional()}).optional(),__EXPERIMENTAL_SMOOTHING_TENSION:H.number().optional(),__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:H.number().optional(),__EXPERIMENTAL_XRAY_STYLE:H.object({opacity:H.number().min(0).max(1).optional(),color:H.string().optional(),tint:H.number().min(0).max(1).optional(),dithering:H.number().min(0).optional()}).optional(),__EXPERIMENTAL_DASH_OPTIONS:H.union([hh,K1]).optional()},Yl=Xl.omit({dashDiscrete:!0}).partial().extend(eI),iw=H.strictObject(Xl.shape);function gh(o){let{color:e,visible:t,interactive:r,width:n,verticalOffset:i,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:d,highlightCompleteFraction:p,highlightDisplayArrowsOnPath:g,travelledEndFraction:m,travelledColor:I,xrayOpacity:v,xrayStyle:y,smoothingTension:E,smoothingCornerRadius:k,dashed:w,dashDiscrete:B,dashCornerRadius:D,dashLength:j,dashGap:G,dashRelativeToWidth:W,dashSize:N,gapSize:q,dashAbsolute:oe,dashMeters:ie,gapMeters:be,geometryType:De,endcapExtension:ke,billboarding:ue,border:Ke}=o,rt={};v!==void 0&&(rt.opacity=v),y?.color!==void 0&&(rt.color=y.color),y?.tint!==void 0&&(rt.tint=y.tint),y?.dithering!==void 0&&(rt.dithering=y.dithering);let Pt=Object.keys(rt).length>0?rt:void 0,ve={enabled:w,cornerRadius:D,...oe?{mode:"absolute",meters:ie,gapMeters:be}:W?{mode:"width-scaling",size:N,gapSize:q}:{mode:"length-scaling",length:j,gap:G}};return Ze(Xl,{color:e,visible:t,interactive:r,width:n,verticalOffset:i,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:d,highlightCompleteFraction:p,highlightDisplayArrowsOnPath:g,travelledEndFraction:m,travelledColor:I,xrayOpacity:v,xray:Pt,smoothing:{tension:E,cornerRadius:k},dashed:w,dashDiscrete:B,dashCornerRadius:D,dash:ve,geometry:De,endcapExtension:ke,billboarding:ue,border:Ke})}function tI(o,e){x.env.NODE_ENV!=="production"&&_.warn(`${o} takes precedence over deprecated ${e}`)}function qr(o){let e=o.geometry??o.__EXPERIMENTAL_GEOMETRY,t=o.endcapExtension??o.__EXPERIMENTAL_ENDCAP_EXTENSION,r=o.billboarding??o.__EXPERIMENTAL_BILLBOARDING,n=o.border??o.__EXPERIMENTAL_BORDER,i=o.smoothing,a=i?.tension??o.__EXPERIMENTAL_SMOOTHING_TENSION,s=i?.cornerRadius??o.__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS,l=o.xray,c=o.__EXPERIMENTAL_XRAY_STYLE,d=l??c,p=o.dash??o.__EXPERIMENTAL_DASH_OPTIONS,g=p?{enabled:p.enabled,mode:p.mode??p.__EXPERIMENTAL_DASH_MODE,length:p.length??p.__EXPERIMENTAL_DASH_LENGTH,gap:p.gap??p.__EXPERIMENTAL_DASH_GAP,size:p.size??p.__EXPERIMENTAL_DASH_SIZE,gapSize:p.gapSize??p.__EXPERIMENTAL_GAP_SIZE,meters:p.meters??p.__EXPERIMENTAL_DASH_METERS,gapMeters:p.gapMeters??p.__EXPERIMENTAL_GAP_METERS,cornerRadius:p.cornerRadius??p.__EXPERIMENTAL_DASH_CORNER_RADIUS}:void 0,m=typeof o.dashed=="boolean"?o.dashed:void 0,I=g?.enabled??m;g?.enabled!==void 0&&m!==void 0&&tI("dash.enabled","dashed");let v=e==="ribbon",y=t!==void 0&&(t[0]!==0||t[1]!==0)&&(t[0]!==ct.endcapExtension[0]||t[1]!==ct.endcapExtension[1]),E=r!==void 0&&r!==!1,k=n?.enabled===!0;!v&&(y||E||k)&&x.env.NODE_ENV!=="production"&&_.warn('Ribbon-only path options (endcapExtension, billboarding, border) have no effect with tube geometry. Set geometry: "ribbon" to apply them.'),g?.cornerRadius!==void 0&&!v&&x.env.NODE_ENV!=="production"&&_.warn("dash.cornerRadius has no effect on tube geometry");let w={};for(let B in o)if(B==="geometry"||B==="__EXPERIMENTAL_GEOMETRY")e!==void 0&&(w.geometryType=e);else if(B==="endcapExtension"||B==="__EXPERIMENTAL_ENDCAP_EXTENSION")t!==void 0&&(w.endcapExtension=t);else if(B==="billboarding"||B==="__EXPERIMENTAL_BILLBOARDING")r!==void 0&&(w.billboarding=r);else if(B==="border"||B==="__EXPERIMENTAL_BORDER")n!==void 0&&(w.border=n);else if(B==="smoothing"||B==="__EXPERIMENTAL_SMOOTHING_TENSION"||B==="__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS")a!==void 0&&(w.smoothingTension=a),s!==void 0&&(w.smoothingCornerRadius=s);else if(B==="dash"||B==="__EXPERIMENTAL_DASH_OPTIONS"){if(g){let D=I===!0?g.mode??"width-scaling":g.mode;D==="length-scaling"?(w.dashRelativeToWidth=!1,w.dashAbsolute=!1,g.length!==void 0&&(w.dashLength=g.length),g.gap!==void 0&&(w.dashGap=g.gap)):D==="width-scaling"?(w.dashRelativeToWidth=!0,w.dashAbsolute=!1,w.dashSize=g.size??hn.size,w.gapSize=g.gapSize??hn.gapSize):D==="absolute"&&(w.dashAbsolute=!0,w.dashRelativeToWidth=!1,g.meters!==void 0&&(w.dashMeters=g.meters),g.gapMeters!==void 0&&(w.gapMeters=g.gapMeters)),g.cornerRadius!==void 0&&(w.dashCornerRadius=g.cornerRadius)}}else if(B==="xray"||B==="__EXPERIMENTAL_XRAY_STYLE"){if(d){d.opacity!==void 0&&(w.xrayOpacity=d.opacity);let D={};d.color!==void 0&&(D.color=d.color),d.tint!==void 0&&(D.tint=d.tint),d.dithering!==void 0&&(D.dithering=d.dithering),Object.keys(D).length>0&&(w.xrayStyle=D)}}else B==="xrayOpacity"?d?.opacity===void 0&&(w[B]=o[B]):w[B]=o[B];return I!==void 0&&(w.dashed=I),w}var Qn=class extends St{floorStacksById=new Map;floorsById=new Map;startingFloorId="";currentFloorId="";currentFloorStackId="";outdoorFloorStacks=new Set;id;renderer;api;options={};styleMap;animations=new Map;get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);if(!e)throw new re(`Current floor stack with id "${this.currentFloorStackId}" not found`);return e}setFloorStack(e,t){if(this.currentFloorStackId===e)return;let r=this.floorStacksById.get(e);if(r==null){_.error(`Invalid floor stack passed to setFloorStack (${e}), the floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}if(r.floorObjects.length===0){_.error(`Floor stack (${e}) has no floors. The floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}this.setFloor(r.defaultFloor.id,t)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);if(!e)throw new re(`Floor with id "${this.currentFloorId}" not found`);return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e,t){if(this.api.manualFloorVisibility===!0)return;let r=this.api.getMapDataInternal()?.getById("floor",e),n=this.api.getMapDataInternal()?.getById("floor-stack",t);if(r&&n){let i=r.floorStack.id===n?.id,a=this.api.getMapDataInternal()?.getById("floor-stack",r.floorStack.id);if(this.#i?.enabled&&a){if(!i)for(let l of this.floorStacksById.values())l.id!==a.id&&l.floorObjects.forEach(c=>{c.setVisible(!1)});let s=Wl(a.floors,r,this.api.Navigation?.floors?.map(l=>l.id)||[],this.getFloorStackAltitudeData(a.id),{color:this.#i.footprintColor??uo.color,opacity:this.#i.footprintOpacity,outline:this.#i.footprintOutline??!0,disableGapFilling:this.#i.__EXPERIMENTAL_disableGapFilling===!0,spacesOpenToBelowEnabled:this.#i.spacesOpenToBelowEnabled??!1,spacesOpenToBelowVisualEffectEnabled:this.#i.spacesOpenToBelowVisualEffectEnabled,spacesOpenToBelowVisualEffectDarkenAmount:this.#i.spacesOpenToBelowVisualEffectDarkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#i.spacesOpenToBelowVisualEffectDarkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:this.#i.spacesOpenToBelowVisualEffectDesaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#i.spacesOpenToBelowVisualEffectDesaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:this.#i.spacesOpenToBelowVisualEffectWashOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#i.spacesOpenToBelowVisualEffectWashOutUseDepth},this.#i.showAllFloorsIncludedInNavigation??!1);if(this.api?.Outdoor?.setOpacity(s.outdoorOpacity),s.floorStates.forEach(l=>{if(l.floor){let c=this.api.getMapData()?.getById("floor",l.floor.id);c&&this.api.updateState(c,l.state)}}),this.#i.updateCameraElevationOnFloorChange){let l=this.getFloorStackAltitudeData(a.id);this.api.Camera.setElevation(l.get(r.elevation)?.altitude??0)}}else for(let s of this.floorStacksById.values())s.floorObjects.forEach(l=>{l.id!==e&&l.setVisible(!1)})}}updateMultiFloorViewEffects(e){this.#i={...this.#i,...e},this.processFloorChange(this.currentFloorId,this.currentFloorStackId)}getMultiFloorViewEffects(){return{spacesOpenToBelowVisualEffectEnabled:this.#i.spacesOpenToBelowVisualEffectEnabled??!0,spacesOpenToBelowVisualEffectDarkenAmount:this.#i.spacesOpenToBelowVisualEffectDarkenAmount??.2,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#i.spacesOpenToBelowVisualEffectDarkenUseDepth??!0,spacesOpenToBelowVisualEffectDesaturateAmount:this.#i.spacesOpenToBelowVisualEffectDesaturateAmount??0,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#i.spacesOpenToBelowVisualEffectDesaturateUseDepth??!0,spacesOpenToBelowVisualEffectWashOutAmount:this.#i.spacesOpenToBelowVisualEffectWashOutAmount??0,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#i.spacesOpenToBelowVisualEffectWashOutUseDepth??!1}}#e;setFloor(e,t){if(this.currentFloorId===e)return;let r=this.floorsById.get(e);if(!r){_.error(`Invalid floor passed to setFloor (${e}), the floor was not changed. Current floor is still ${this.currentFloor.id}`);return}let n=this.currentFloorId,i=this.currentFloorStackId;this.currentFloorId=e,this.currentFloorStackId=r.floorStackId,this.publish("floor-change-start",{previousFloorId:n,floorId:e,reason:t}),this.#e&&(_.warn(`setFloor(${e}) called while a previous setFloor handler is in-flight; the earlier change will be discarded`),this.#e.abort(),this.#e=void 0);let a=this.api.__EXPERIMENTAL__floorHandler;if(typeof a=="function"){let s=this.api.getMapDataInternal(),l=s?.getById("floor",e);if(!l){_.error("setFloor: unable to resolve public Floor; bypassing override handler and committing synchronously"),this.#o(e,r,i,n,t);return}let c=s?.getById("floor",n);r.setVisible(!0);let d=new AbortController,p=a(l,{reason:t,previousFloor:c,signal:d.signal}),g=p!=null&&typeof p.then=="function"?p:void 0;if(!g){this.#r(e,n,t);return}this.#e=d,this.#t(g,d,e,n,t)}else this.#o(e,r,i,n,t)}#t(e,t,r,n,i){e.catch(a=>{_.error("setFloor override handler threw \u2014 completing floor change anyway",a)}).finally(()=>{if(t.signal.aborted){_.warn(`setFloor(${r}) discarded \u2014 superseded by a newer floor change`);return}this.#e===t&&(this.#e=void 0),this.#r(r,n,i)})}#o(e,t,r,n,i){this.currentFloorStack&&this.processFloorChange(e,r),t.setVisible(!0),this.#r(e,n,i)}#r(e,t,r){this.updateOutdoorPathLayerVisibility(),this.publish("floor-change",{reason:r,floorId:e,previousFloorId:t})}updateOutdoorPathLayerVisibility(){let e=this.api.hidePathsNotOnCurrentFloor===!0&&!this.options.multiFloorView?.enabled;for(let t of this.floorsById.values()){if(!this.floorStacksById.get(t.floorStackId)?.isOutdoors)continue;let n=t.layers.get(lo);if(!n)continue;let i=!e||t.id===this.currentFloor.id;n.setVisible(i)}}getFloorStackAltitudeData(e){return this.floorStacksById.get(e)?.altitudeMap??new Map}cancelAnimation(e){let t=this.animations.get(e);t&&(t.stop(),this.animations.delete(e),this.renderer.getInternalTweenGroup().remove(t))}Models={add:(e,t,r)=>{let{floorId:n,scale:i,...a}=r,s=n?this.floorsById.get(n):void 0,l=s?.layers.get(Xt),c={...a};i!=null&&(c.scale=Array.isArray(r.scale)?r.scale:[r.scale,r.scale,r.scale]);let d=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:t.map(p=>({type:"Feature",properties:{id:ae(),rotation:r.rotation,scale:c.scale,interactive:r.interactive},geometry:{type:"Point",coordinates:_t(p)}}))},c,{parent:l?.containerId??s?.id});if(d==null)throw new re("error creating model");return this.renderer.getState(d).children},remove:(e,t)=>{this.renderer.remove(e)}};Image3D={add:(e,t,r)=>{let{floorId:n,flipImageToFaceCamera:i,maxImageSize:a,interactive:s,...l}=r,c=n?this.floorsById.get(n):this.currentFloor,d={type:"Feature",properties:l,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(r.id??ae(),d,{url:t,flipImageToFaceCamera:i??!1,maxImageSize:a,interactive:s},c.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}};Markers={add:(e,t,r)=>{let n=Hr(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:i,...a}=r,s=a;a.rank==="initial"&&(s.rank="medium");let l=n.layers.get($t),c=this.renderer.addMarker2D(_t(e),t,{...s,occluderId:n?.occluderId,attachTo:i},l?.containerId);if(!c)throw new re("Failed to create Marker");return c},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let t=this.renderer.getState(e);if(t?.type==="marker")return t.element},removeAll:()=>{},setPosition:(e,t,r)=>{let n=this.renderer.getState(e),i=r?this.floorsById.get(r):this.currentFloor;if(!n){_.error(`Failed to retrieve state for Marker with id "${e}".`);return}if(n.type!=="marker"){_.error(`Geometry with id "${e}" is not of type "marker".`);return}this.renderer.setState(n,{position:t,parent:i?.layers.get($t)?.containerId})},animateTo:(e,t,r,n)=>{let i=this.renderer.getState(e),a=r?this.floorsById.get(r):this.currentFloor;if(!i)return _.error(`Failed to retrieve state for Marker with id "${e}".`),Promise.resolve();if(i.type!=="marker")return _.error(`Geometry with id "${e}" is not of type "marker".`),Promise.resolve();let s={duration:1e3,easing:"ease-in-out",...n};this.cancelAnimation(e);let l=new mo({lon:i.position[0],lat:i.position[1]}).to({lon:t[0],lat:t[1]},s.duration).easing(Cr[s.easing]).onUpdate(({lon:c,lat:d})=>{if(!this.renderer.getState(e))this.cancelAnimation(e);else{let g=a?.layers.get($t)?.containerId;g&&this.Markers.setPosition(e,[c,d],g)}}).start();return this.renderer.getInternalTweenGroup().add(l),this.renderer.render(),this.animations.set(e,l),Sl(l).then(()=>{this.animations.delete(e)})}};Exporter={getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)};Shapes={add:(e,t,r)=>{let n=r?.floorId?this.floorsById.get(r?.floorId):this.currentFloor,i="shape-"+ae(),{visible:a,altitude:s,...l}=t;return this.renderer.addFeatureCollection(i,e,l,{visible:a,altitude:s},n.id),i},remove:e=>(this.renderer.remove(e.id),e.id)};Text3D={label:(e,t,r)=>{if(!this.api.getMapDataInternal()?.enterpriseMode){_.warn("Enterprise mode is not enabled, skipping label creation");return}let n=mh(this.renderer,e,t,r);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{if(!this.api.getMapDataInternal()?.enterpriseMode)return _.warn("Enterprise mode is not enabled, skipping label creation"),[];let t=this.api.getMapData();if(!t)return[];let r=[];return t.getByType("space").forEach(n=>{if(n.enterpriseLocations[0]){let i=mh(this.renderer,n,n.enterpriseLocations[0]?.name??n.name,e);i&&r.push({textInfo:i,target:n})}}),r},add:(e,t,r)=>{let{rotation:n=0,appearance:i}=r,{fontSize:a=12,color:s="black",font:l=""}=i??{},c=Hr(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),p={type:"Feature",properties:{text:t,rotation:n,verticalOffset:e.verticalOffset??0,fontSize:a,color:s,align:"center",visible:!0,fontFamily:l},geometry:{type:"Point",coordinates:_t(e)}},g=ae();return this.renderer.addText3D(g,p,{appearance:{...i,fontSize:a,color:s,font:l||void 0}},No(c.id))},remove:e=>(this.renderer.remove(e),e)};Labels={all:({onCreate:e,labelOptions:t={}})=>{let r=this.api.getMapDataInternal()?.spaceRecordsByFloorId??{};for(let[n,i]of Object.entries(r))i.forEach(a=>{let s={properties:a},l=this.api.getMapData()?.getById("space",s.properties.id);if(!l)return;let c=this.styleMap[s.properties.id]?.showImage,d=s.properties.details?.images,g={icon:(c&&d?.[0]?.url?{icon:d[0].url}:{}).icon,...t.appearance},I=(n?this.floorsById.get(n):this.currentFloor).layers.get(so);if(s.properties.center&&l.name!==""){let v=this.renderer.addLabel2D(s.properties.center,l.name,{id:s.properties.id+"-label",...t,appearance:g,rank:t.rank,attachTo:Wr(l)},Te.is(l)?l.id:I?.containerId);v&&e(v.id,l.name,l)}})},add:(e,t,r={})=>{let{attachTo:n,...i}=r,a=Hr(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),s=a.layers.get(so),l=this.renderer.addLabel2D(_t(e),t,{...i,occluderId:a.occluderId,attachTo:n},s?.containerId);if(!l)throw new re("label creating failed");return l},remove:({entityId:e})=>{this.renderer.remove(e)},removeAll:()=>{}};Paths={add:(e,t,r)=>{let n=t?qr(t):void 0,i=t?.animateDrawing??!0,a=[],s=e[0].floorId||"root",l=0;for(let d of e){let p=d.floorId??s,{latitude:g,longitude:m}=d;p!==s&&(l++,s=p),a[l]==null&&a.push({floorId:p,coordinates:[]});let I=d.floorId===p?d:new X({longitude:m,latitude:g,floorId:p});a[l].coordinates.push(I)}let c=a.reduce((d,{floorId:p,coordinates:g},m)=>{if(m!==0){let y=a[m-1],E=y.coordinates[y.coordinates.length-1],k=g[0],w=_t(E),B=_t(k),D=this.floorsById.get(y.floorId),j=this.floorsById.get(p),G=D?.floorStackId,W=j?.floorStackId,N=G?this.getFloorStackAltitudeData(G):void 0,q=W?this.getFloorStackAltitudeData(W):void 0,oe=N?.get(D?.elevation??0)?.altitude??0,ie=q?.get(j?.elevation??0)?.altitude??0,be=r?.__EXPERIMENTAL_JUNCTION_INSET??0;bl(w,B,be,oe,ie);let De=r?qr(r):n,ke=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:y.floorId},geometry:{type:"Point",coordinates:w}},{type:"Feature",properties:{parentId:p},geometry:{type:"Point",coordinates:B}}]},De,this.id);ke&&(i&&this.renderer.setState(ke.id,{completeFraction:0}),d.push({...ke,coordinates:[E,k]}))}if(g.length<2)return d;let I=this.floorsById.get(p)?.layers.get(lo)?.containerId,v=this.renderer.addPath({type:"FeatureCollection",features:g.map(y=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:_t(y)}}))},n,I??p);return v&&(i&&this.renderer.setState(v.id,{completeFraction:0}),d.push({...v,coordinates:g})),d},[]);if(i){let d=[],p=this.api.getMapData();return c.forEach(g=>{let m=ku(g,p,this.api);d.push(new mo({fraction:0}).to({fraction:1},m?t?.drawDuration??1500:0).onUpdate(I=>{this.renderer.setState(g.id,{completeFraction:I.fraction})}))}),d.forEach((g,m)=>{m<d.length-1&&g.chain(d[m+1]),this.renderer.getInternalTweenGroup().add(g)}),d[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),d[0]),{paths:c,animation:Sl(d[d.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},remove:e=>{e.forEach(t=>{this.cancelAnimation(t),this.renderer.remove(t)})}};#i={enabled:!1,floorGap:"auto",updateCameraElevationOnFloorChange:!0,footprintColor:uo.color,footprintOpacity:void 0,footprintOutline:!0,spacesOpenToBelowEnabled:!1};constructor(e,t,r,n){super(),this.renderer=n.core,this.api=n,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=r??{};let i=lh(t?.styleRecordsById??{});if(this.styleMap=i,this.#i={...this.#i,...r?.multiFloorView},!t){this.id!=="outdoors-container"&&_.warn(`Map (${this.id}) created with no data.`);let c=new qn({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(c.id,c),this.currentFloorStackId=c.id;let d=new Jn(c.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,this.#i,r??{});this.floorsById.set(d.id,d),c.addFloor(d),this.setFloor(d.id);return}let a=Object.values(t.floorStackRecordsById);if(a.length===0)throw new re("MVF does not contain any Floor Stacks.");let s=new Set(Object.values(t.facadeRecordsById).map(c=>c.floorStackId));for(let c of a){let d=new qn(_f(c),this.id,this.renderer,s.has(c.id));for(let p of d.floorIds){let g=t.floorRecordsById[p];if(g!=null){let m=new Jn(d.id,Cf(g),this,this.#i,r??{},i,t);this.floorsById.set(m.id,m),d.addFloor(m)}}if(d.floorObjects.length<1){_.warn(`Floor stack ${c.id} has no floors. It will not be loaded.`);continue}this.floorStacksById.set(c.id,d),this.currentFloorStackId||(this.currentFloorStackId=c.id)}for(let[c]of Object.entries(t.facadesBySpaceId)){let d=t.getById("space",c);d&&(this.outdoorFloorStacks.add(d.floor.floorStack.id),this.floorsById.get(d.floor.id)?.setVisible(!0))}let l=t.manifestRecord.defaultFloorId;if(r?.initialFloor){let c=_n(r.initialFloor);c&&this.floorsById.has(c)?l=c:_.error(`Invalid initial floor specified (${r.initialFloor}), using default behavior instead`)}l||(l=this.currentFloorStack.defaultFloor.id),this.startingFloorId=l}loadAllFloors(){for(let e of this.floorStacksById.values())e.loadAllFloors(this.#i)}};function mh(o,e,t,r){return o.labelText3D(e.id,t??e.name,{...r,parentId:No(e.floor.id)})}f();var Kn=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getAll(){return Array.from(this.#e.values()).map(({marker:e})=>e)}getById(e){return this.#e.get(e)}add(e,t,r){let n=e.anchorTarget;if(!n)throw new Error("get coordinate failed");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Markers.add(n,t,{...r,rank:r?.rank||"medium",dynamicResize:r?.dynamicResize??!0,attachTo:Wr(e)});if(a==null)throw new Error("error creating marker");let s=i.Markers.getContentEl(a.id.toString());if(!s)throw new Error("marker component should exist");let l=new po(a.id.toString(),s,e);return this.#e.set(l.id,{marker:l,entityId:a.id.toString()}),l}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Markers.remove(t.entityId),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(({marker:t})=>{this.remove(t),e.push(t),this.#e.delete(t.id.toString())}),e}setPosition(e,t){let r=t.anchorTarget;if(!r){_.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){_.error("Cannot determine the current map.");return}let i=this.#e.get(e.id);if(!i){_.error(`Cannot find the Marker with id "${e.id}".`);return}n.Markers.setPosition(i.entityId,_t(r),r.floorId??n.currentFloorId),i.marker.updateTarget(t)}animateTo(e,t,r){let n=t.anchorTarget;if(!n)return _.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return _.error("Cannot determine the current map."),Promise.resolve();let a=this.#e.get(e.id);return a?(a.marker.updateTarget(t),i.Markers.animateTo(a.entityId,_t(n),n.floorId??i.currentFloorId,r)):(_.error(`Cannot find the Marker with id "${e.id}".`),Promise.resolve())}};f();var ei=class{#e=new Map;#t;#o;get currentMap(){return this.#t()}constructor({currentMapGetter:e,mapDataInternalGetter:t}){this.#t=e,this.#o=t}getById(e){return this.#e.get(e)}add(e,t,r){let n=e.anchorTarget;if(!n)throw new Error("Target does not implement IAnchorable.");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Image3D.add(_t(n),t,{...r,floorId:n.floorId,verticalOffset:n.verticalOffset+(r.verticalOffset??0)});if(!a)throw new Error("image component should exist");let s=this.#o?.(),l=new Ct(a.id.toString(),t,e,s?.tokenManager);if(this.#e.set(l.id,{image:l,entityId:a.id.toString(),anchorId:r.anchorId}),r.anchorId!=null&&s!=null){let c=s.floorImagesByAnchorId.get(r.anchorId)??[];c.push(l),s.floorImagesByAnchorId.set(r.anchorId,c)}return l}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Image3D.remove(t.entityId),this.#e.delete(e.id),this.#r(t.anchorId,e))}#r(e,t){if(e==null)return;let r=this.#o?.()?.floorImagesByAnchorId;if(r==null)return;let n=r.get(e);if(n==null)return;let i=n.filter(a=>a!==t);i.length===0?r.delete(e):r.set(e,i)}removeAll(){let e=[];return this.#e.forEach(({image:t})=>{this.remove(t),e.push(t),this.#e.delete(t.id.toString())}),e}};f();var ti=class{#e=new Map;#t;#o;get currentMap(){return this.#t()}constructor({currentMapGetter:e,mapDataInternalGetter:t}){this.#t=e,this.#o=t}getById(e){return this.#e.get(e)}add(e,t,r){let n=[e],i=n.reduce((l,c)=>{if(!c)return _.error("Cannot determine coordinate from options."),l;let d=Hr(c,this.currentMap.floorsById,this.currentMap.floorsById.get("default-floor"))?.id;return l.has(d)||l.set(d,[]),l.get(d)?.push(c),l},new Map);if(!n.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let s=[];return i.forEach((l,c)=>{let d=ae();a.Models.add(d,l,{...r,url:t,floorId:c,verticalOffset:l[0].verticalOffset+(r?.verticalOffset??0)}).forEach(g=>{let m=new dr(g.toString(),d,l[0]);this.#e.set(m.id,{model:m,entityId:g.toString(),groupId:d}),s.push(m)})}),s[0]}all(){let e=this.#o?.();if(!e)return[];let t=e.getByType("enterprise-venue");if(!t)return[];let r=t.extra?.models;if(!r?.models?.length)return[];let n=[];for(let i of r.models){if(!i?.url||!i.coordinate||!e.getById("floor",i.coordinate.floorId))continue;let s=new X({latitude:i.coordinate.latitude,longitude:i.coordinate.longitude,floorId:i.coordinate.floorId,verticalOffset:i.coordinate.verticalOffset}),l=this.add(s,i.url,{visible:!0,rotation:i.rotation,scale:i.scale,material:{Default:{color:i.color},Fabric:{color:i.color}},EXPERIMENTAL_clippingEnabled:!!i.manifolded});n.push(l)}return n}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Models.remove(t.entityId,t.groupId),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(({model:t})=>{let r=this.#e.get(t.id);r&&(e.push(t),this.currentMap?.Models.remove(r.entityId,r.groupId),this.#e.delete(t.id.toString()))}),e}};f();var oi=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getById(e){return this.#e.get(e)?.path}add(e,t){let r=this.currentMap;if(!r)throw new Error("currentMap should exist");let n=r.Paths.add(e,t),i=n.paths.map(s=>s.id.toString()),a=new Lt(t?.id||ae(),n.animation,e,n.paths);for(let s of i)this.#e.set(s,{path:a,entityIds:i});return this.#e.set(a.id,{path:a,entityIds:i}),a}highlightPathSection(e,t,r,n){let i=this.currentMap?.api.getMapData()?.mapCenter;if(!i)return;let a=Wn([e],t,r,i);if(!a)return;let s=n?.animationDuration??1500,l=()=>{},c=new Promise(p=>{l=p}),d=new mo({fraction:0}).to({fraction:1},s).onUpdate(p=>{for(let g of a)this.currentMap?.api.updateState(g.segment,{highlightCompleteFraction:p.fraction})}).onStart(()=>{let p=this.currentMap?.api.core;if(p)for(let g of a)this.currentMap?.api.updateState(g.segment,Un(p,g.segment.id,g,n))}).onComplete(()=>{l(),this.currentMap?.api.removeTween(d)});return this.currentMap?.api.tweenGroup().add(d),d.start(),{animation:c}}clearHighlightedPathSection(e){let t=this.currentMap?.api.core;if(t)for(let r of e.segments)this.currentMap?.api.updateState(r,Hn(t,r.id))}clearAllHighlightedPathSections(){for(let e of this.#e.values())this.clearHighlightedPathSection(e.path)}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Paths.remove(t.entityIds),this.#e.delete(e.id),t.entityIds.forEach(r=>this.#e.delete(r)))}removeAll(){let e=[];return this.#e.forEach(({path:t})=>{this.remove(t),e.push(t)}),e}};f();var ri=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getById(e){return this.#e.get(e)}add(e,t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Shapes.add(e,t||{},{floorId:r?.id}),a=new vo(i);return this.#e.set(a.id,a),a}remove(e){this.#e.get(e.id)&&(this.currentMap?.Shapes.remove(e),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(t=>{this.remove(t),e.push(t.id),this.#e.delete(t.id.toString())}),e}};f();var ni=class{#e;get currentMap(){return this.#e()}constructor({currentMapGetter:e}){this.#e=e}setFromStyleCollection(e){for(let t in e)for(let r of this.currentMap?.floors||[]){if(e[t]==null||!r.layers.has(Pe))continue;let n=r.layers.get(Pe);for(let s of Object.values(e))if(s&&"polygons"in s&&"color"in s)for(let l of s.polygons)this.currentMap?.renderer.setState(l,{color:s.color});if(n?.layers.has(t)&&"color"in e[t]){let s=n.layers.get(t);s&&this.currentMap?.renderer.setState(s,{color:e[t].color})}if(n&&t===ko&&!(ao in e)){let s=n.layers.get(ao);s&&"color"in e[t]&&this.currentMap?.renderer.setState(s,{color:e[t].color})}if(!r.layers.has(ar))continue;let i=r.layers.get(ar),a=r.facadesByStyleId.get(t);if(a&&a.length>0)for(let s of a){let l=i.layers.get(`${s}-${t}`);l&&"color"in e[t]&&this.currentMap?.renderer.setState(l,{color:e[t].color})}}}};f();var Zl={opacity:1},oI=["flyTo","jumpTo","easeTo","panTo","panBy","zoomTo","zoomIn","zoomOut","setZoom","setCenter","setCenterClampedToGround","setCenterElevation","setBearing","setPitch","setRoll","rotateTo","resetNorth","resetNorthPitch","snapToNorth","setPadding","fitBounds","fitScreenCoordinates"],rI=new Set(oI),Qr=class{#e;#t=[];#o={opacity:"initial"};#r={opacity:new Map};#i=new Set;#n=new WeakMap;constructor(e,t){this.#e=e,this.#t=t||[];let r=this.#e.map;r&&r.on("idle",()=>{this.#r.opacity.size||this.#s(r)})}#s(e){let t=e.getStyle().layers;t&&t.forEach(r=>{e.getLayoutProperty(r.id,"visibility")!=="none"&&(r.id==="background"||(r.type==="symbol"?this.#r.opacity.set(r.id,[e.getPaintProperty(r.id,"icon-opacity")??Zl.opacity,e.getPaintProperty(r.id,"text-opacity")??Zl.opacity]):this.#r.opacity.set(r.id,[e.getPaintProperty(r.id,`${r.type}-opacity`)??Zl.opacity,void 0])))})}#l(){Object.values(this.#r).forEach(e=>e.clear())}setStyle(e){if(this.#e.map){this.#e.map?.setStyle(e),this.#i.size&&(this.#i.clear(),this.hide()),this.#l(),this.#s(this.#e.map),this.setOpacity(this.#o.opacity),this.#e.map?.moveLayer(Md),this.#t.length>1&&_.error(`Outdoor.setStyle: ${this.#t.length} hiddenOutdoorGeometry entries; multi-map covering is not supported yet (only the last map's footprints will be reapplied).`);for(let[t,r]of this.#t||[])this.#e.hideOutdoorLayersIntersectingPolygons(t,r)}}get map(){let e=this.#e.map;if(e)return this.#a(e)}#a(e){let t=this.#n.get(e);if(t)return t;let r=Object.create(e),n=new Set,i=new Set;for(let a=e;a&&a!==Object.prototype;a=Object.getPrototypeOf(a))for(let s of Object.getOwnPropertyNames(a)){if(i.has(s)||s==="constructor")continue;i.add(s);let l=Object.getOwnPropertyDescriptor(a,s);!l||l.get||l.set||typeof e[s]=="function"&&(rI.has(s)?r[s]=(...c)=>(n.has(s)||(n.add(s),_.warn(`\`mapView.Outdoor.map.${s}()\` is not supported \u2014 Mappedin JS controls the outdoor camera, so this call may be overridden. Use \`mapView.Camera.animateTo()\`, \`Camera.set()\`, or \`Camera.focusOn()\` instead.`)),e[s](...c)):r[s]=e[s].bind(e))}return this.#n.set(e,r),r}get enabled(){return!!this.#e.map}get visible(){return this.#i.size===0}show(){let e=this.#e.map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(r=>{this.#i.has(r.id)&&e.setLayoutProperty(r.id,"visibility","visible")}),this.#i.clear())}hide(e=[]){let t=this.#e.map;if(!t)return;let r=t.getStyle().layers;r&&r.forEach(n=>{let i=t.getLayoutProperty(n.id,"visibility");!e.includes(n.id)&&i!=="none"&&(t.setLayoutProperty(n.id,"visibility","none"),this.#i.add(n.id))})}setOpacity(e,t=[]){let r=this.#e.map;if(!r)return;let n=this.#e.map?.getStyle?.()?.layers;n&&r.once("idle",()=>{n.forEach(i=>{let a=r.getLayoutProperty(i.id,"visibility");if(!t.includes(i.id)&&a!=="none")try{let s=this.#r.opacity.get(i.id);s!==void 0&&(i.id==="background"||(i.type==="symbol"?(r.setPaintProperty(i.id,"icon-opacity",e==="initial"?s[0]:e),r.setPaintProperty(i.id,"text-opacity",e==="initial"?s[1]:e)):r.setPaintProperty(i.id,`${i.type}-opacity`,e==="initial"?s[0]:e)),this.#o.opacity=e)}catch(s){_.warn("Error setting opacity:",s)}})})}};f();function nI(){Fd(!1)}var ii=class{#e;#t=new Map;#o=new Map;constructor({currentMapGetter:e}){this.#e=e}labelAll(e={}){let t=[],r=new Set;return this.#e()?.Text3D.labelAll(e)?.forEach(({textInfo:n,target:i})=>{let a=n.id.toString(),s=this.#o.get(a);if(s){r.has(a)||t.push(s.text3DView),r.add(a);return}r.add(a);let l=new So(a,i);this.#t.set(l.id,{targetId:i.id,text3d:a,text3DView:l}),this.#o.set(a,{text3DView:l}),t.push(l)}),t}label(e,t,r={}){if(this.#e())if(Te.is(e)){let i=this.#e()?.Text3D.label(e,t,r);if(!i)return;let a=i.textInfo.id.toString(),s=this.#o.get(a);if(s)return s.text3DView;let l=new So(a,i.target);return this.#t.set(l.id,{targetId:i.target.id,text3d:a,text3DView:l}),this.#o.set(a,{text3DView:l}),l}else throw new Error("Non-space target is not supported")}add(e,t,r={}){let n=this.#e();if(!n)throw new Error("Current map not found.");if(!X.is(e))throw new Error("Target must be a Coordinate");let i=e.anchorTarget,a=n.Text3D.add(i,t,r);if(!a)throw new Error("Failed to add Text3D.");let s=a.id.toString(),l=this.#o.get(s);if(l)return _.warn(`Text3DView with ID ${s} already exists. A new Text3DView will not be created. Returning existing. `),l.text3DView;let c=new So(s,e);return this.#t.set(c.id,{targetId:e.id,text3d:s,text3DView:c}),this.#o.set(s,{text3DView:c}),c}remove(e){let t=typeof e=="string"?e:e.id,r=this.#t.get(t);r&&(this.#e()?.Text3D.remove(r.text3d),this.#t.delete(t),this.#o.delete(r.text3d))}removeAll(){this.#t.forEach(e=>{this.#e()?.Text3D.remove(e.text3d)}),this.#t.clear(),this.#o.clear()}};f();f();import Yt from"zod";var yh="doors",Jl=Yt.object({type:Yt.literal(yh).default(yh),color:Yt.string().default("#ffffff"),topColor:Yt.string().optional(),texture:Yt.object({url:Yt.string().optional()}).optional(),topTexture:Yt.object({url:Yt.string().optional()}).optional(),visible:Yt.boolean().default(!1),opacity:Yt.number().default(1)}),Ia=Jl.partial(),pA=Yt.strictObject(Jl.shape);function bh(o,e){let{color:t,topColor:r,texture:n,topTexture:i,opacity:a}=o,s=e?.visible??!1;return Ze(Jl,{visible:s,color:t,topColor:r,opacity:a,texture:n?{url:n}:void 0,topTexture:i?{url:i}:void 0})}function ql(o,e){let t={featureCollection:{},container:{}};return o.visible!==void 0&&(t.container.visible=o.visible),o.color&&(o.color==="initial"?t.featureCollection.color=e?.initialColor:t.featureCollection.color=o.color),o.topColor&&(o.topColor==="initial"?t.featureCollection.topColor=e?.initialTopColor:t.featureCollection.topColor=o.topColor),o.texture?.url!==void 0&&(t.featureCollection.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.featureCollection.topTexture=o.topTexture.url),o.opacity!==void 0&&(t.featureCollection.opacity=o.opacity),t}function Ih(o,e){let t={};return e==null||(o.color&&(o.color==="initial"?t.color=e.initialColor:t.color=o.color),o.topColor&&(o.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=o.topColor),o.visible!==void 0&&(t.visible=o.visible),o.texture?.url!==void 0&&(t.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.topTexture=o.topTexture.url),o.opacity!==void 0&&(t.opacity=o.opacity)),t}f();import{z as ai}from"zod";var Th="facade",Ql=ai.object({type:ai.literal(Th).default(Th),opacity:ai.number().default(1),visible:ai.boolean().default(!0)}),vh=Ql.partial(),mA=ai.strictObject(Ql.shape);function Sh(o){return Ze(Ql,{opacity:o.opacity,visible:o.visible})}f();import{z as Z}from"zod";var Zt="floor",xh=`${Zt}.footprint`,Mh=`${Zt}.geometry`,Eh=`${Zt}.labels`,Ch=`${Zt}.markers`,_h=`${Zt}.images`,Fh=`${Zt}.occlusion`,Oh=`${Zt}.paths`,Ph=`${Zt}.areas`,wh=`${Zt}.models`,ur=Z.object({type:Z.literal(xh).default(xh),altitude:Z.number().default(0),visible:Z.boolean().default(!1),height:Z.number().default(0),opacity:Z.number().default(1),side:Z.enum(["double","front","back"]).default("double"),color:Z.string().default("#ffffff"),ceilingVisible:Z.boolean().default(!0),basementMaskEnabled:Z.boolean().default(!1),outline:Z.boolean().default(!0),ceilingThickness:Z.number().default(.2)}),xA=ur.partial(),Ta=Z.object({type:Z.literal(Mh).default(Mh),opacity:Z.number().default(1),visible:Z.boolean().default(!0),heightScale:Z.number().default(1),maskId:Z.number().nullable().default(null),maskEffect:Z.enum(["hide","reveal"]).default("hide"),maskMode:Z.enum(["mask","masked-object"]).default("mask"),maskEnabled:Z.boolean().default(!1),effectStart:Z.number().default(0),effectDistance:Z.number().default(0),darkenAmount:Z.number().default(0),darkenUseDepth:Z.boolean().default(!0),desaturateAmount:Z.number().default(0),desaturateUseDepth:Z.boolean().default(!0),washOutAmount:Z.number().default(0),washOutUseDepth:Z.boolean().default(!1)}),Rh=Ta.partial(),va=Z.object({type:Z.literal(Eh).default(Eh),enabled:Z.boolean().default(!0)}),Dh=va.partial(),Sa=Z.object({type:Z.literal(Ch).default(Ch),enabled:Z.boolean().default(!0)}),kh=Sa.partial(),xa=Z.object({type:Z.literal(_h).default(_h),visible:Z.boolean().default(!0),collisionsEnabled:Z.boolean().default(!1)}),Nh=xa.partial(),Ma=Z.object({type:Z.literal(Fh).default(Fh),enabled:Z.boolean().default(!0)}),Lh=Ma.partial(),Ea=Z.object({type:Z.literal(Oh).default(Oh),visible:Z.boolean().default(!0)}),Bh=Ea.partial(),Ca=Z.object({type:Z.literal(Zt).default(Zt),visible:Z.boolean().default(!1),altitude:Z.number().default(0)}),_a=Z.object({type:Z.literal(Ph).default(Ph),visible:Z.boolean().default(!0)}),Vh=_a.partial(),iI=Z.object({visible:Z.boolean().default(!0)}),aI=Z.object({visible:Z.boolean().default(!0)}),Fa=Z.object({visible:Z.boolean().default(!0),geometryText:iI.default({visible:!0}),floorText:aI.default({visible:!0})}),jh=Fa.partial(),Oa=Z.object({type:Z.literal(wh).default(wh),visible:Z.boolean().default(!0)}),Gh=Oa.partial(),sI=Z.object({...Ca.shape,geometry:Ta,labels:va,markers:Sa,images:xa,footprint:ur,occlusion:Ma,paths:Ea,areas:_a,text3d:Fa,models:Oa}),Uh=Ca.partial(),MA=Z.object({...Ca.shape,geometry:Ta.partial(),labels:va.partial(),markers:Sa.partial(),images:xa.partial(),footprint:ur.partial(),occlusion:Ma.partial(),paths:Ea.partial(),areas:_a.partial(),text3d:Fa.partial(),models:Oa.partial()}).partial(),EA=Z.strictObject({...Ca.shape,geometry:Z.strictObject(Ta.shape),labels:Z.strictObject(va.shape),markers:Z.strictObject(Sa.shape),images:Z.strictObject(xa.shape),footprint:Z.strictObject(ur.shape),occlusion:Z.strictObject(Ma.shape),paths:Z.strictObject(Ea.shape),areas:Z.strictObject(_a.shape),text3d:Z.strictObject(Fa.shape),models:Z.strictObject(Oa.shape)});function Ah(o,e){let t=o?.getInternalState().geometry3DMap.get(e);if(t?.type!=="group-container")return!0;let r=t,n=o?.getSystems().text3DSystem;return n?.getBatchedText(r)?.visible??n?.getBatchVisible(r)??!0}function Hh(o,e,t){if(!e){_.error("Floor is not defined. Cannot get floor state.");return}let r=e.layers.get(Pe),n=r?t?.getState(r.containerId):void 0,i=e.layers.get(so),a=e.layers.get($t),s=e.footprintObject?.getState(),l=e.layers.get(nr),c=l?t?.getState(l.containerId):void 0,d=e.layers.get(Br),p=d?t?.getState(d.containerId):void 0,g=!1;if(r?.layers)for(let oe of r.layers.values()){let ie=t?.getState(oe);if(ie?.children?.[0]){g=t?.getState(ie.children[0])?.enableImageCollisions??!1;break}}let m=e.layers.get(lo),I=m?t?.getState(m.containerId):void 0,v=e.layers.get(ir),y=v?t?.getState(v.containerId):void 0,E=e.layers.get(Xt),k=E?t?.getState(E.containerId):void 0,w=!0,B=!0,D=!0,j=!0;for(let[,oe]of r.layers){let ie=t?.getState(oe);ie?.maskId||(w=!1),ie?.maskEffect||(B=!1),ie?.maskMode||(D=!1),ie?.maskEnabled||(j=!1)}let G=e.layers.get(sr),W=G?t?.getState(G.containerId):void 0,N=Ah(t,No(e.id)),q=Ah(t,Vr(e.id));return Ze(sI,{geometry:{opacity:n?.opacity,visible:n?.visible,maskId:w,maskEffect:B,maskMode:D,maskEnabled:j},labels:{enabled:i?.visible},markers:{enabled:a?.visible},footprint:{altitude:s?.altitude,visible:s?.visible,height:s?.height,opacity:s?.opacity,side:s?.side,color:s?.color,ceilingVisible:s?.ceilingVisible,basementMaskEnabled:s?.basementMaskEnabled,outline:s?.outline,ceilingThickness:s?.ceilingThickness},images:{visible:p?.visible,collisionsEnabled:g},occlusion:{enabled:c?.visible},paths:{visible:I?.visible},areas:{visible:y?.visible},text3d:{visible:W?.visible,geometryText:{visible:N},floorText:{visible:q}},models:{visible:k?.visible},visible:o.visible,altitude:o.altitude})}f();import{z as ye}from"zod";var Wh="geometry",Kl=ye.object({type:ye.literal(Wh).default(Wh),visible:ye.boolean().default(!0),color:ye.union([ye.string(),ye.literal("initial")]).default("#ffffff"),topColor:ye.union([ye.string(),ye.literal("initial")]).optional(),hoverColor:ye.union([ye.string(),ye.literal("initial")]).optional(),interactive:ye.union([ye.boolean(),ye.literal("pass-through")]).default(!1),opacity:ye.number().default(1),height:ye.number().default(0),slopeBearing:ye.number().min(0).max(360).default(0),slopeFactor:ye.number().min(-1).max(1).default(0),slopeEnabled:ye.boolean().default(!1),altitude:ye.number().default(0),texture:ye.object({url:ye.string()}).optional(),topTexture:ye.object({url:ye.string()}).optional(),flipImageToFaceCamera:ye.boolean().default(!1),enableImageCollisions:ye.boolean().default(!1),borderVisible:ye.boolean().default(!1),borderColor:ye.string().optional(),borderWidth:ye.number().optional()}),ec=Kl.partial(),PA=ye.strictObject(Kl.shape);function zh(o){let{altitude:e,interactive:t,hoverColor:r,color:n,visible:i,opacity:a,height:s,slope:l,slopeEnabled:c,texture:d,topTexture:p,flipImageToFaceCamera:g,enableImageCollisions:m,topColor:I,borderVisible:v,borderColor:y,borderWidth:E}=o;return Ze(Kl,{interactive:t,hoverColor:r,color:n,visible:i,opacity:a,height:s,slopeBearing:l?.bearing??0,slopeFactor:l?.factor??0,slopeEnabled:c??!1,texture:d?{url:o.texture}:void 0,topTexture:p?{url:p}:void 0,flipImageToFaceCamera:g,enableImageCollisions:m,topColor:I,altitude:e,borderVisible:v,borderColor:y,borderWidth:E})}function $h(o,e){let t={};return e==null||(o.color&&(o.color==="initial"?t.color=e.initialColor:t.color=o.color),o.topColor&&(o.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=o.topColor),o.visible!==void 0&&(t.visible=o.visible),o.texture?.url!==void 0&&(t.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.topTexture=o.topTexture.url),o.hoverColor!==void 0&&(t.hoverColor=o.hoverColor),o.interactive!==void 0&&(t.interactive=o.interactive),o.height!==void 0&&(t.height=o.height),(o.slopeBearing!==void 0||o.slopeFactor!==void 0)&&(t.slope={bearing:o.slopeBearing??e.slope?.bearing??0,factor:o.slopeFactor??e.slope?.factor??0}),o.slopeEnabled!==void 0&&(t.slopeEnabled=o.slopeEnabled),o.opacity!==void 0&&(t.opacity=o.opacity),o.flipImageToFaceCamera!==void 0&&(t.flipImageToFaceCamera=o.flipImageToFaceCamera),o.enableImageCollisions!==void 0&&(t.enableImageCollisions=o.enableImageCollisions),o.altitude!==void 0&&(t.altitude=o.altitude),o.borderVisible!==void 0&&(t.borderVisible=o.borderVisible),o.borderColor!==void 0&&(t.borderColor=o.borderColor),o.borderWidth!==void 0&&(t.borderWidth=o.borderWidth)),t}f();import Bt from"zod";var tc="label",lI=Bt.object({type:Bt.literal(tc).default(tc),text:Bt.string(),rank:Bt.custom(o=>Pi.safeParse(o).success||o==="initial"),appearance:Bt.custom(o=>Od.safeParse(o).success),interactive:Bt.boolean().default(!1),enabled:Bt.boolean().default(!0),textPlacement:Bt.union([Bt.enum(gs),Bt.array(Bt.enum(gs))]).default(ms),occlude:Bt.boolean().default(!0)}),Xh=lI.partial();function Yh(o){let{text:e,enabled:t,options:r}=o;return{type:tc,text:e??"",appearance:Pd(r?.appearance??{}),rank:r?.rank??"medium",enabled:t??!0,interactive:r?.interactive??!1,textPlacement:r?.textPlacement??ms,occlude:r?.occlude??!0}}function Zh(o,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return o.text&&(t.text=o.text),o.appearance&&(t.options.appearance=o.appearance),o.textPlacement&&(t.options.textPlacement=o.textPlacement),o.rank!=null&&(o.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=o.rank),o.enabled!==void 0&&(t.enabled=o.enabled),o.interactive!==void 0&&(t.options.interactive=o.interactive),o.occlude!==void 0&&(t.options.occlude=o.occlude),o.enabled!==void 0&&(t.enabled=o.enabled),t}f();import Re from"zod";var oc="marker",cI=Re.object({type:Re.literal(oc).default(oc),rank:Re.custom(o=>Pi.safeParse(o).success||o==="initial"),placement:Re.union([Re.enum(ys),Re.array(Re.enum(ys))]).optional(),interactive:Re.union([Re.boolean(),Re.literal("pointer-events-auto")]).default(!1),dynamicResize:Re.boolean().default(!0),enabled:Re.boolean().default(!0),zIndex:Re.number().optional(),lowPriorityPin:Re.object({enabled:Re.boolean().optional(),size:Re.number().positive().optional(),color:Re.string().optional()}).optional(),element:Re.custom(o=>o instanceof HTMLElement,{error:"Must be an HTMLElement instance"}),contentHTML:Re.string(),occlude:Re.boolean().default(!0),animated:Re.boolean().default(!0)}),Jh=cI.omit({element:!0}).partial();function qh(o,e){let t=e?.target?e.target.anchorTarget:void 0,{enabled:r,placement:n,element:i,dynamicResize:a,contentHTML:s,options:l,position:c,parent:d}=o,p=typeof d=="object"?d.id:d;return t==null&&(t=new X({latitude:c?.[1]??0,longitude:c?.[0]??0,floorId:p?.toString()})),{type:oc,rank:l?.rank??"medium",interactive:l?.interactive??!1,enabled:r??!0,element:i,placement:n??[],zIndex:l?.zIndex,dynamicResize:a??!0,lowPriorityPin:l?.lowPriorityPin,contentHTML:s??"",occlude:l?.occlude??!0,animated:l?.animated??!0}}function Qh(o,e){let t={};return t.options={},o.rank!=null&&(o.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=o.rank),o.dynamicResize!=null&&(t.options.dynamicResize=o.dynamicResize),o.enabled!=null&&(t.enabled=o.enabled),o.interactive!=null&&(t.options.interactive=o.interactive),o.enabled!=null&&(t.enabled=o.enabled),o.contentHTML!=null&&(t.contentHTML=o.contentHTML),o.placement!=null&&(t.placement=o.placement),o.occlude!=null&&(t.options.occlude=o.occlude),"zIndex"in o&&(t.options.zIndex=o.zIndex),o.animated!=null&&(t.options.animated=o.animated),t}f();import{z as He}from"zod";var Kh="shape",rc=He.object({type:He.literal(Kh).default(Kh),visible:He.boolean().default(!0),altitude:He.number().default(0),color:He.string().default("#ffffff"),hoverColor:He.string().optional(),height:He.number().default(0),opacity:He.number().default(1),interactive:He.union([He.boolean(),He.literal("pass-through")]).default(!1),bevel:He.object({enabled:He.boolean().optional(),thickness:He.number().optional(),size:He.number().optional(),offset:He.number().optional(),segments:He.number().optional()}).optional(),position:He.custom(o=>X.is(o))}),nc=rc.partial(),$A=He.strictObject(rc.shape);function eg(o){let{children:e,bevel:t,position:r}=o;if(e==null||e.length<1){_.error(`Expected at least one child for Shape (${o.id}). Cannot get shape state.`);return}let{color:n,hoverColor:i,opacity:a,interactive:s,height:l,visible:c,altitude:d}=o;return Ze(rc,{altitude:d,visible:c,color:n,hoverColor:i,height:l,opacity:a,interactive:s,bevel:t,position:new X({latitude:r[1],longitude:r[0],verticalOffset:d??0})})}function tg(o){let e=me(nc,o,{warn:!0}),t={};return e.visible!==void 0&&(t.visible=e.visible),e.altitude!==void 0&&(t.altitude=e.altitude),e.color!==void 0&&(t.color=e.color),e.hoverColor!==void 0&&(t.hoverColor=e.hoverColor),e.opacity!==void 0&&(t.opacity=e.opacity),e.height!==void 0&&(t.height=e.height),e.interactive!==void 0&&(t.interactive=e.interactive),e.bevel!==void 0&&(t.bevel={enabled:e.bevel.enabled||!1,thickness:e.bevel.thickness,size:e.bevel.size,offset:e.bevel.offset,segments:e.bevel.segments}),e.position!==void 0&&(t.position=[e.position.longitude,e.position.latitude],t.altitude=e.position.verticalOffset),{mergedShapeState:t}}f();import Pa from"zod";var og="text3d",rg=Pa.object({type:Pa.literal(og).default(og),position:Pa.custom(o=>o instanceof X,{error:"Must be a Coordinate instance"})}),ng=vd.extend({...rg.shape}),ig=Sd.extend({...rg.shape}).partial(),KA=Pa.strictObject(ng.shape);function ag(o){let{position:e,visible:t,color:r,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:s,outlineOpacity:l,outlineBlur:c,outlineWidth:d,outlineOffsetX:p,outlineOffsetY:g,strokeWidth:m,strokeOpacity:I,strokeColor:v,fillOpacity:y,hoverColor:E,rotation:k,content:w}=o;return Ze(ng,{position:new X({latitude:e?.[1]??0,longitude:e?.[0]??0}),visible:t,color:r,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:s,outlineOpacity:l,outlineBlur:c,outlineWidth:d,outlineOffsetX:p,outlineOffsetY:g,strokeWidth:m,strokeOpacity:I,strokeColor:v,fillOpacity:y,hoverColor:E,rotation:k,content:w})}f();import bt from"zod";var sg="walls",ic=bt.object({type:bt.literal(sg).default(sg),color:bt.string().default("#ffffff"),topColor:bt.string().optional(),texture:bt.object({url:bt.string()}).or(bt.undefined()),topTexture:bt.object({url:bt.string()}).or(bt.undefined()),visible:bt.boolean().default(!0),height:bt.number().default(0),opacity:bt.number().default(1)}),ac=ic.partial(),n7=bt.strictObject(ic.shape);function lg(o){let{color:e,topColor:t,texture:r,topTexture:n,visible:i,height:a,opacity:s}=o;return Ze(ic,{visible:i,color:e,topColor:t,texture:r?{url:r}:void 0,topTexture:n?{url:n}:void 0,height:a,opacity:s})}function sc(o,e){let t={};return e==null||(o.color&&(o.color==="initial"?t.color=e.initialColor:t.color=o.color),o.topColor&&(o.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=o.topColor),o.visible!==void 0&&(t.visible=o.visible),o.texture?.url!==void 0&&(t.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.topTexture=o.topTexture.url),o.height!==void 0&&(t.height=o.height),o.opacity!==void 0&&(t.opacity=o.opacity)),t}f();import{z as Jt}from"zod";var lc="image3d",dI=Jt.object({type:Jt.literal(lc).default(lc),visible:Jt.boolean().default(!0),opacity:Jt.number().min(0).max(1).default(1),position:Jt.custom(o=>o instanceof X,{error:"Must be a Coordinate instance"}),width:Jt.number().default(1),height:Jt.number().default(1),rotation:Jt.number().default(0),verticalOffset:Jt.number().default(0),flipImagesToFaceCamera:Jt.boolean().default(!1),interactive:Jt.boolean().default(!1)}),cg=dI.partial();function dg(o){let{position:e}=o;return{type:lc,visible:o.visible??!0,opacity:o.opacity??1,position:new X({latitude:e?.[1]??0,longitude:e?.[0]??0,verticalOffset:e?.[2]}),width:o.width??1,height:o.height??1,rotation:o.rotation??0,verticalOffset:o.verticalOffset??0,flipImagesToFaceCamera:o.flipImageToFaceCamera??!1,interactive:o.interactive??!1}}f();import{z as fe}from"zod";var pg="model",cc=Id.extend({type:fe.literal(pg).default(pg),color:fe.string().optional(),position:fe.custom(o=>X.is(o),{error:"Expected a Coordinate"}),visible:fe.boolean().default(!0),rotation:fe.tuple([fe.number(),fe.number(),fe.number()]).default([0,0,0]),scale:fe.tuple([fe.number(),fe.number(),fe.number()]).default([1,1,1]),verticalOffset:fe.number().default(0),opacity:fe.number().default(1),material:fe.record(fe.string(),Td).optional(),interactive:fe.boolean().default(!1),clippingPlaneZOffset:fe.custom(o=>typeof o=="number"&&!Number.isNaN(o),{message:"Must be a valid number (including Infinity)"}).default(1/0),clippingPlaneTopColor:fe.string().default("#E67B5B"),clippingPlaneTopVisible:fe.boolean().default(!0)}),ug=cc.extend({scale:fe.union([fe.number(),fe.tuple([fe.number(),fe.number(),fe.number()])]),rotation:fe.union([fe.number(),fe.tuple([fe.number(),fe.number(),fe.number()])])}).partial(),m7=fe.strictObject(cc.shape);function fg(o){let{color:e,position:t,rotation:r,scale:n,visible:i,interactive:a,opacity:s,material:l,verticalOffset:c,parent:d,clippingPlaneZOffset:p,clippingPlaneTopColor:g,clippingPlaneTopVisible:m}=o,I=typeof d=="object"?d?.id?.toString():d?.toString(),v=`${Xt}-`,y=I?.startsWith(v)?I.slice(v.length):I;return Ze(cc,{color:e,position:new X({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:y}),rotation:r,scale:n,visible:i,interactive:a,opacity:s,material:l,verticalOffset:c,clippingPlaneZOffset:p,clippingPlaneTopColor:g,clippingPlaneTopVisible:m})}f();f();f();var tn=dn(rm());tn.registerHelper({});tn.registerPartial({});var nm=tn.template({compiler:[8,">= 4.3.0"],main:function(o,e,t,r,n){var i=o.lambda,a=o.escapeExpression,s=o.lookupProperty||function(l,c){if(Object.prototype.hasOwnProperty.call(l,c))return l[c]};return`<div class='mappedin-annotation-marker'>
|
|
252
|
-
<div style='width: `+a(i(e!=null?s(e,"size"):e,e))+"px; height: "+a(i(e!=null?s(e,"size"):e,e))+`px'>
|
|
253
|
-
<img src='`+a(i(e!=null?s(e,"icon"):e,e))+"' alt='"+a(i(e!=null?s(e,"name"):e,e))+"' width='"+a(i(e!=null?s(e,"size"):e,e))+"' height='"+a(i(e!=null?s(e,"size"):e,e))+`' />
|
|
254
|
-
</div>
|
|
255
|
-
</div>`},useData:!0});var BT=30,im=new Set(["annotation"]);function VT(o){return nm({size:BT,icon:o.icon?.url??"",name:o.name})}function jT(o={}){return{rank:"high",placement:["center"],interactive:!0,...o}}function GT(o,e){return e.Markers.add(o.coordinate,VT(o),jT())}function am(o,e){let t=[];for(let r of e)bo(r)&&ht.is(r)&&r.icon!=null&&typeof r.icon.url=="string"&&r.icon.url.length>0&&t.push(GT(r,o));return t}f();var Fc=new Set(["space","object"]);function Oc(o,e){e.forEach(t=>{_p(t)&&o.updateState(t,{interactive:!0})})}f();f();function sm(o){return bo(o)?"anchorTarget"in o&&o.anchorTarget!=null:!1}f();f();function lm(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,r=Array(e);t<e;t++)r[t]=o[t];return r}function UT(o){if(Array.isArray(o))return o}function HT(o,e){var t=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(t!=null){var r,n,i,a,s=[],l=!0,c=!1;try{if(i=(t=t.call(o)).next,e!==0)for(;!(l=(r=i.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){c=!0,n=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}function WT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
256
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zT(o,e){return UT(o)||HT(o,e)||$T(o,e)||WT()}function $T(o,e){if(o){if(typeof o=="string")return lm(o,e);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lm(o,e):void 0}}var xm=Object.entries,cm=Object.setPrototypeOf,XT=Object.isFrozen,YT=Object.getPrototypeOf,ZT=Object.getOwnPropertyDescriptor,tt=Object.freeze,ot=Object.seal,nn=Object.create,Mm=typeof Reflect<"u"&&Reflect,kc=Mm.apply,Nc=Mm.construct;tt||(tt=function(e){return e});ot||(ot=function(e){return e});kc||(kc=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return e.apply(t,n)});Nc||(Nc=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});var on=Be(Array.prototype.forEach),JT=Be(Array.prototype.lastIndexOf),dm=Be(Array.prototype.pop),rn=Be(Array.prototype.push),qT=Be(Array.prototype.splice),zo=Array.isArray,fi=Be(String.prototype.toLowerCase),Pc=Be(String.prototype.toString),pm=Be(String.prototype.match),pi=Be(String.prototype.replace),um=Be(String.prototype.indexOf),QT=Be(String.prototype.trim),KT=Be(Number.prototype.toString),ev=Be(Boolean.prototype.toString),fm=typeof BigInt>"u"?null:Be(BigInt.prototype.toString),hm=typeof Symbol>"u"?null:Be(Symbol.prototype.toString),qe=Be(Object.prototype.hasOwnProperty),ui=Be(Object.prototype.toString),Je=Be(RegExp.prototype.test),gr=tv(TypeError);function Be(o){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return kc(o,e,r)}}function tv(o){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Nc(o,t)}}function pe(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fi;if(cm&&cm(o,null),!zo(e))return o;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let i=t(n);i!==n&&(XT(e)||(e[r]=i),n=i)}o[n]=!0}return o}function ov(o){for(let e=0;e<o.length;e++)qe(o,e)||(o[e]=null);return o}function dt(o){let e=nn(null);for(let r of xm(o)){var t=zT(r,2);let n=t[0],i=t[1];qe(o,n)&&(zo(i)?e[n]=ov(i):i&&typeof i=="object"&&i.constructor===Object?e[n]=dt(i):e[n]=i)}return e}function rv(o){switch(typeof o){case"string":return o;case"number":return KT(o);case"boolean":return ev(o);case"bigint":return fm?fm(o):"0";case"symbol":return hm?hm(o):"Symbol()";case"undefined":return ui(o);case"function":case"object":{if(o===null)return ui(o);let e=o,t=Qt(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:ui(r)}return ui(o)}default:return ui(o)}}function Qt(o,e){for(;o!==null;){let r=ZT(o,e);if(r){if(r.get)return Be(r.get);if(typeof r.value=="function")return Be(r.value)}o=YT(o)}function t(){return null}return t}function nv(o){try{return Je(o,""),!0}catch{return!1}}var gm=tt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),wc=tt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ac=tt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),iv=tt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rc=tt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),av=tt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mm=tt(["#text"]),ym=tt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Dc=tt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),bm=tt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Za=tt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sv=ot(/{{[\w\W]*|^[\w\W]*}}/g),lv=ot(/<%[\w\W]*|^[\w\W]*%>/g),cv=ot(/\${[\w\W]*/g),dv=ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),pv=ot(/^aria-[\-\w]+$/),Im=ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uv=ot(/^(?:\w+script|data):/i),fv=ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hv=ot(/^html$/i),gv=ot(/^[a-z][.\w]*(-[.\w]+)+$/i),Tm=ot(/<[/\w!]/g),vm=ot(/<[/\w]/g),mv=ot(/<\/no(script|embed|frames)/i),yv=ot(/\/>/i),Ot={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bv=function(){return typeof window>"u"?null:window},Iv=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Sm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Wo=function(e,t,r,n){return qe(e,t)&&zo(e[t])?pe(n.base?dt(n.base):{},e[t],n.transform):r};function Em(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bv(),e=$=>Em($);if(e.version="3.4.13",e.removed=[],!o||!o.document||o.document.nodeType!==Ot.document||!o.Element)return e.isSupported=!1,e;let t=o.document,r=t,n=r.currentScript;o.DocumentFragment;let i=o.HTMLTemplateElement,a=o.Node,s=o.Element,l=o.NodeFilter,c=o.NamedNodeMap;c===void 0&&(o.NamedNodeMap||o.MozNamedAttrMap),o.HTMLFormElement;let d=o.DOMParser,p=o.trustedTypes,g=s.prototype,m=Qt(g,"cloneNode"),I=Qt(g,"remove"),v=Qt(g,"nextSibling"),y=Qt(g,"childNodes"),E=Qt(g,"parentNode"),k=Qt(g,"shadowRoot"),w=Qt(g,"attributes"),B=a&&a.prototype?Qt(a.prototype,"nodeType"):null,D=a&&a.prototype?Qt(a.prototype,"nodeName"):null,j=a&&a.prototype?Qt(a.prototype,"ownerDocument"):null;if(typeof i=="function"){let $=t.createElement("template");$.content&&$.content.ownerDocument&&(t=$.content.ownerDocument)}let G,W="",N,q=!1,oe=0,ie=function(){if(oe>0)throw gr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},be=function(T){ie(),oe++;try{return G.createHTML(T)}finally{oe--}},De=function(T){ie(),oe++;try{return G.createScriptURL(T)}finally{oe--}},ke=function(){return q||(N=Iv(p,n),q=!0),N},ue=t,Ke=ue.implementation,rt=ue.createNodeIterator,Pt=ue.createDocumentFragment,ve=ue.getElementsByTagName,Eo=r.importNode,de=Sm();e.isSupported=typeof xm=="function"&&typeof E=="function"&&Ke&&Ke.createHTMLDocument!==void 0;let wt=sv,Kt=lv,ho=cv,Vt=dv,Co=pv,_o=uv,$o=fv,yr=gv,Xo=Im,se=null,Yo=pe({},[...gm,...wc,...Ac,...Rc,...mm]),ce=null,At=pe({},[...ym,...Dc,...bm,...Za]),xe=Object.seal(nn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eo=null,go=null,It=Object.seal(nn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),br=!0,Zo=!0,Jo=!1,Ir=!0,Rt=!1,Fe=!0,to=!1,Tr=!1,qo=null,Qo=null,Ko=!1,C=!1,u=!1,h=!1,b=!0,M=!1,S="user-content-",A=!0,O=!1,L={},R=null,Y=pe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),P=null,V=pe({},["audio","video","img","source","image","track"]),z=null,te=pe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Q="http://www.w3.org/1998/Math/MathML",le="http://www.w3.org/2000/svg",ee="http://www.w3.org/1999/xhtml",he=ee,Ne=!1,Me=null,We=pe({},[Q,le,ee],Pc),Ve=tt(["mi","mo","mn","ms","mtext"]),nt=pe({},Ve),je=tt(["annotation-xml"]),pt=pe({},je),Tt=pe({},["title","style","font","a","script"]),et=null,vt=["application/xhtml+xml","text/html"],jt="text/html",Ie=null,Fo=null,Qa=t.createElement("form"),yi=function(T){return T instanceof RegExp||T instanceof Function},Ka=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fo&&Fo===T)return;(!T||typeof T!="object")&&(T={}),T=dt(T),et=vt.indexOf(T.PARSER_MEDIA_TYPE)===-1?jt:T.PARSER_MEDIA_TYPE,Ie=et==="application/xhtml+xml"?Pc:fi,se=Wo(T,"ALLOWED_TAGS",Yo,{transform:Ie}),ce=Wo(T,"ALLOWED_ATTR",At,{transform:Ie}),Me=Wo(T,"ALLOWED_NAMESPACES",We,{transform:Pc}),z=Wo(T,"ADD_URI_SAFE_ATTR",te,{transform:Ie,base:te}),P=Wo(T,"ADD_DATA_URI_TAGS",V,{transform:Ie,base:V}),R=Wo(T,"FORBID_CONTENTS",Y,{transform:Ie}),eo=Wo(T,"FORBID_TAGS",dt({}),{transform:Ie}),go=Wo(T,"FORBID_ATTR",dt({}),{transform:Ie}),L=qe(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?dt(T.USE_PROFILES):T.USE_PROFILES:!1,br=T.ALLOW_ARIA_ATTR!==!1,Zo=T.ALLOW_DATA_ATTR!==!1,Jo=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Ir=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Rt=T.SAFE_FOR_TEMPLATES||!1,Fe=T.SAFE_FOR_XML!==!1,to=T.WHOLE_DOCUMENT||!1,C=T.RETURN_DOM||!1,u=T.RETURN_DOM_FRAGMENT||!1,h=T.RETURN_TRUSTED_TYPE||!1,Ko=T.FORCE_BODY||!1,b=T.SANITIZE_DOM!==!1,M=T.SANITIZE_NAMED_PROPS||!1,A=T.KEEP_CONTENT!==!1,O=T.IN_PLACE||!1,Xo=nv(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:Im,he=typeof T.NAMESPACE=="string"?T.NAMESPACE:ee,nt=qe(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?dt(T.MATHML_TEXT_INTEGRATION_POINTS):pe({},Ve),pt=qe(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?dt(T.HTML_INTEGRATION_POINTS):pe({},je);let F=qe(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?dt(T.CUSTOM_ELEMENT_HANDLING):nn(null);if(xe=nn(null),qe(F,"tagNameCheck")&&yi(F.tagNameCheck)&&(xe.tagNameCheck=F.tagNameCheck),qe(F,"attributeNameCheck")&&yi(F.attributeNameCheck)&&(xe.attributeNameCheck=F.attributeNameCheck),qe(F,"allowCustomizedBuiltInElements")&&typeof F.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=F.allowCustomizedBuiltInElements),ot(xe),Rt&&(Zo=!1),u&&(C=!0),L&&(se=pe({},mm),ce=nn(null),L.html===!0&&(pe(se,gm),pe(ce,ym)),L.svg===!0&&(pe(se,wc),pe(ce,Dc),pe(ce,Za)),L.svgFilters===!0&&(pe(se,Ac),pe(ce,Dc),pe(ce,Za)),L.mathMl===!0&&(pe(se,Rc),pe(ce,bm),pe(ce,Za))),It.tagCheck=null,It.attributeCheck=null,qe(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?It.tagCheck=T.ADD_TAGS:zo(T.ADD_TAGS)&&(se===Yo&&(se=dt(se)),pe(se,T.ADD_TAGS,Ie))),qe(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?It.attributeCheck=T.ADD_ATTR:zo(T.ADD_ATTR)&&(ce===At&&(ce=dt(ce)),pe(ce,T.ADD_ATTR,Ie))),qe(T,"ADD_URI_SAFE_ATTR")&&zo(T.ADD_URI_SAFE_ATTR)&&pe(z,T.ADD_URI_SAFE_ATTR,Ie),qe(T,"FORBID_CONTENTS")&&zo(T.FORBID_CONTENTS)&&(R===Y&&(R=dt(R)),pe(R,T.FORBID_CONTENTS,Ie)),qe(T,"ADD_FORBID_CONTENTS")&&zo(T.ADD_FORBID_CONTENTS)&&(R===Y&&(R=dt(R)),pe(R,T.ADD_FORBID_CONTENTS,Ie)),A&&(se["#text"]=!0),to&&pe(se,["html","head","body"]),se.table&&(pe(se,["tbody"]),delete eo.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let U=G;G=T.TRUSTED_TYPES_POLICY;try{W=be("")}catch(J){throw G=U,J}}else T.TRUSTED_TYPES_POLICY===null?(G=void 0,W=""):(G===void 0&&(G=ke()),G&&typeof W=="string"&&(W=be("")));tt&&tt(T),Fo=T},Qc=pe({},[...wc,...Ac,...iv]),Kc=pe({},[...Rc,...av]),ny=function(T,F,U){return F.namespaceURI===ee?T==="svg":F.namespaceURI===Q?T==="svg"&&(U==="annotation-xml"||nt[U]):!!Qc[T]},iy=function(T,F,U){return F.namespaceURI===ee?T==="math":F.namespaceURI===le?T==="math"&&pt[U]:!!Kc[T]},ay=function(T,F,U){return F.namespaceURI===le&&!pt[U]||F.namespaceURI===Q&&!nt[U]?!1:!Kc[T]&&(Tt[T]||!Qc[T])},sy=function(T){let F=E(T);(!F||!F.tagName)&&(F={namespaceURI:he,tagName:"template"});let U=fi(T.tagName),J=fi(F.tagName);return Me[T.namespaceURI]?T.namespaceURI===le?ny(U,F,J):T.namespaceURI===Q?iy(U,F,J):T.namespaceURI===ee?ay(U,F,J):!!(et==="application/xhtml+xml"&&Me[T.namespaceURI]):!1},Oo=function(T){rn(e.removed,{element:T});try{E(T).removeChild(T)}catch{if(I(T),!E(T))throw gr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},bi=function(T){ln(T);let F=y(T);if(F){let J=[];on(F,K=>{rn(J,K)}),on(J,K=>{try{I(K)}catch{}})}let U=w(T);if(U)for(let J=U.length-1;J>=0;--J){let K=U[J],ne=K&&K.name;if(typeof ne=="string")try{T.removeAttribute(ne)}catch{}}},er=function(T,F){try{rn(e.removed,{attribute:F.getAttributeNode(T),from:F})}catch{rn(e.removed,{attribute:null,from:F})}if(F.removeAttribute(T),T==="is")if(C||u)try{Oo(F)}catch{}else try{F.setAttribute(T,"")}catch{}},ly=function(T){let F=w(T);if(F)for(let U=F.length-1;U>=0;--U){let J=F[U],K=J&&J.name;if(!(typeof K!="string"||ce[Ie(K)]))try{T.removeAttribute(K)}catch{}}},ln=function(T){let F=[T];for(;F.length>0;){let U=F.pop();(B?B(U):U.nodeType)===Ot.element&&ly(U);let K=y(U);if(K)for(let ne=K.length-1;ne>=0;--ne)F.push(K[ne])}},cy=function(T){if(!Fe)return;let F=[T];for(;F.length>0;){let U=F.pop(),J=B?B(U):U.nodeType;if(J===Ot.processingInstruction||J===Ot.comment&&Je(vm,U.data)){try{I(U)}catch{}continue}if(J===Ot.element){let ne=U,Se=Ie(D?D(U):U.nodeName);try{ne.hasAttribute&&ne.hasAttribute("patchsrc")&&ne.removeAttribute("patchsrc"),ne.hasAttribute&&ne.hasAttribute("for")&&Se!=="label"&&Se!=="output"&&ne.removeAttribute("for")}catch{}}let K=y(U);if(K)for(let ne=K.length-1;ne>=0;--ne)F.push(K[ne])}},ed=function(T){let F=null,U=null;if(Ko)T="<remove></remove>"+T;else{let ne=pm(T,/^[\r\n\t ]+/);U=ne&&ne[0]}et==="application/xhtml+xml"&&he===ee&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");let J=G?be(T):T;if(he===ee)try{F=new d().parseFromString(J,et)}catch{}if(!F||!F.documentElement){F=Ke.createDocument(he,"template",null);try{F.documentElement.innerHTML=Ne?W:J}catch{}}let K=F.body||F.documentElement;return T&&U&&K.insertBefore(t.createTextNode(U),K.childNodes[0]||null),he===ee?ve.call(F,to?"html":"body")[0]:to?F.documentElement:K},td=function(T){let F=j?j(T):T.ownerDocument;return rt.call(F||T,T,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Ii=function(T){return T=pi(T,wt," "),T=pi(T,Kt," "),T=pi(T,ho," "),T},es=function(T){var F;T.normalize();let U=j?j(T):T.ownerDocument,J=rt.call(U||T,T,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),K=J.nextNode();for(;K;)K.data=Ii(K.data),K=J.nextNode();let ne=(F=T.querySelectorAll)===null||F===void 0?void 0:F.call(T,"template");ne&&on(ne,Se=>{vr(Se.content)&&es(Se.content)})},Ti=function(T){let F=D?D(T):null;return typeof F!="string"||Ie(F)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==w(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==B(T)||T.childNodes!==y(T)},vr=function(T){if(!B||typeof T!="object"||T===null)return!1;try{return B(T)===Ot.documentFragment}catch{return!1}},cn=function(T){if(!B||typeof T!="object"||T===null)return!1;try{return typeof B(T)=="number"}catch{return!1}};function oo($,T,F){$.length!==0&&on($,U=>{U.call(e,T,F,Fo)})}let dy=function(T,F){return!!(Fe&&T.hasChildNodes()&&!cn(T.firstElementChild)&&Je(Tm,T.textContent)&&Je(Tm,T.innerHTML)||Fe&&T.namespaceURI===ee&&F==="style"&&cn(T.firstElementChild)||T.nodeType===Ot.processingInstruction||Fe&&T.nodeType===Ot.comment&&Je(vm,T.data))},py=function(T,F,U){if(!eo[F]&&id(F)&&(xe.tagNameCheck instanceof RegExp&&Je(xe.tagNameCheck,F)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(F)))return!1;if(A&&!R[F]){let J=E(T),K=y(T);if(K&&J){let ne=K.length;for(let Se=ne-1;Se>=0;--Se){let _e=T===U?m(K[Se],!0):K[Se];J.insertBefore(_e,v(T))}}}return Oo(T),!0},od=function(T,F,U,J){return T.length===0?F:F===U||F===J?dt(F):F},rd=function(T,F){if(oo(de.beforeSanitizeElements,T,null),T!==F&&E(T)===null)return O&&ln(T),!0;if(Ti(T))return Oo(T),!0;let U=Ie(D?D(T):T.nodeName);if(se=od(de.uponSanitizeElement,se,Yo,qo),oo(de.uponSanitizeElement,T,{tagName:U,allowedTags:se}),T!==F&&E(T)===null)return O&&ln(T),!0;if(dy(T,U))return Oo(T),!0;if(eo[U]||!(It.tagCheck instanceof Function&&It.tagCheck(U))&&!se[U]){let K=py(T,U,F);return K===!1&&oo(de.afterSanitizeElements,T,null),K}if((B?B(T):T.nodeType)===Ot.element&&!sy(T)||(U==="noscript"||U==="noembed"||U==="noframes")&&Je(mv,T.innerHTML))return Oo(T),!0;if(Rt&&T.nodeType===Ot.text){let K=Ii(T.textContent);T.textContent!==K&&(rn(e.removed,{element:T.cloneNode()}),T.textContent=K)}return oo(de.afterSanitizeElements,T,null),!1},nd=function(T,F,U){if(go[F]||Fe&&F==="patchsrc"||Fe&&F==="for"&&T!=="label"&&T!=="output"||b&&(F==="id"||F==="name")&&(U in t||U in Qa))return!1;let J=ce[F]||It.attributeCheck instanceof Function&&It.attributeCheck(F,T);if(!(Zo&&Je(Vt,F))){if(!(br&&Je(Co,F))){if(J){if(!z[F]){if(!Je(Xo,pi(U,$o,""))){if(!((F==="src"||F==="xlink:href"||F==="href")&&T!=="script"&&um(U,"data:")===0&&P[T])){if(!(Jo&&!Je(_o,pi(U,$o,"")))){if(U)return!1}}}}}else if(!(id(T)&&(xe.tagNameCheck instanceof RegExp&&Je(xe.tagNameCheck,T)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(T))&&(xe.attributeNameCheck instanceof RegExp&&Je(xe.attributeNameCheck,F)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(F,T))||F==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&Je(xe.tagNameCheck,U)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(U))))return!1}}return!0},uy=pe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),id=function(T){return!uy[fi(T)]&&Je(yr,T)},fy=function(T,F,U,J){if(G&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!U)switch(p.getAttributeType(T,F)){case"TrustedHTML":return be(J);case"TrustedScriptURL":return De(J)}return J},hy=function(T,F,U,J){try{U?T.setAttributeNS(U,F,J):T.setAttribute(F,J),Ti(T)?Oo(T):dm(e.removed)}catch{er(F,T)}},ad=function(T){oo(de.beforeSanitizeAttributes,T,null);let F=T.attributes;if(!F||Ti(T))return;ce=od(de.uponSanitizeAttribute,ce,At,Qo);let U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0},J=F.length,K=Ie(T.nodeName);for(;J--;){let ne=F[J],Se=ne.name,_e=ne.namespaceURI,mt=ne.value,yt=Ie(Se),os=mt,ut=Se==="value"?os:QT(os);if(U.attrName=yt,U.attrValue=ut,U.keepAttr=!0,U.forceKeepAttr=void 0,oo(de.uponSanitizeAttribute,T,U),ut=U.attrValue,M&&(yt==="id"||yt==="name")&&um(ut,S)!==0&&(er(Se,T),ut=S+ut),Fe&&Je(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ut)){er(Se,T);continue}if(yt==="attributename"&&pm(ut,"href")){er(Se,T);continue}if(!U.forceKeepAttr){if(!U.keepAttr){er(Se,T);continue}if(!Ir&&Je(yv,ut)){er(Se,T);continue}if(Rt&&(ut=Ii(ut)),!nd(K,yt,ut)){er(Se,T);continue}ut=fy(K,yt,_e,ut),ut!==os&&hy(T,Se,_e,ut)}}oo(de.afterSanitizeAttributes,T,null)},vi=function(T){let F=null,U=td(T);for(oo(de.beforeSanitizeShadowDOM,T,null);F=U.nextNode();)if(oo(de.uponSanitizeShadowNode,F,null),rd(F,T),ad(F),vr(F.content)&&vi(F.content),(B?B(F):F.nodeType)===Ot.element){let K=k(F);vr(K)&&(ts(K),vi(K))}oo(de.afterSanitizeShadowDOM,T,null)},ts=function(T){let F=[{node:T,shadow:null}];for(;F.length>0;){let U=F.pop();if(U.shadow){vi(U.shadow);continue}let J=U.node,ne=(B?B(J):J.nodeType)===Ot.element,Se=y(J);if(Se)for(let _e=Se.length-1;_e>=0;--_e)F.push({node:Se[_e],shadow:null});if(ne){let _e=D?D(J):null;if(typeof _e=="string"&&Ie(_e)==="template"){let mt=J.content;vr(mt)&&F.push({node:mt,shadow:null})}}if(ne){let _e=k(J);vr(_e)&&F.push({node:null,shadow:_e},{node:_e,shadow:null})}}};return e.sanitize=function($){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,U=null,J=null,K=null;if(Ne=!$,Ne&&($="<!-->"),typeof $!="string"&&!cn($)&&($=rv($),typeof $!="string"))throw gr("dirty is not a string, aborting");if(!e.isSupported)return $;Tr?(se=qo,ce=Qo):Ka(T),(de.uponSanitizeElement.length>0||de.uponSanitizeAttribute.length>0)&&(se=dt(se)),de.uponSanitizeAttribute.length>0&&(ce=dt(ce)),e.removed=[];let ne=O&&typeof $!="string"&&cn($);if(ne){cy($);let mt=D?D($):$.nodeName;if(typeof mt=="string"){let yt=Ie(mt);if(!se[yt]||eo[yt])throw bi($),gr("root node is forbidden and cannot be sanitized in-place")}if(Ti($))throw bi($),gr("root node is clobbered and cannot be sanitized in-place");try{ts($)}catch(yt){throw bi($),yt}}else if(cn($))F=ed("<!---->"),U=F.ownerDocument.importNode($,!0),U.nodeType===Ot.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?F=U:F.appendChild(U),ts(U);else{if(!C&&!Rt&&!to&&$.indexOf("<")===-1)return G&&h?be($):$;if(F=ed($),!F)return C?null:h?W:""}F&&Ko&&Oo(F.firstChild);let Se=ne?$:F;try{let mt=td(Se);for(;J=mt.nextNode();)rd(J,Se),ad(J),vr(J.content)&&vi(J.content)}catch(mt){throw ne&&(bi($),on(e.removed,yt=>{yt.element&&ln(yt.element)})),mt}if(ne)return on(e.removed,mt=>{mt.element&&ln(mt.element)}),Rt&&es($),$;if(C){if(Rt&&es(F),u)for(K=Pt.call(F.ownerDocument);F.firstChild;)K.appendChild(F.firstChild);else K=F;return(ce.shadowroot||ce.shadowrootmode)&&(K=Eo.call(r,K,!0)),K}let _e=to?F.outerHTML:F.innerHTML;return to&&se["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Je(hv,F.ownerDocument.doctype.name)&&(_e="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
|
|
257
|
-
`+_e),Rt&&(_e=Ii(_e)),G&&h?be(_e):_e},e.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ka($),Tr=!0,qo=se,Qo=ce},e.clearConfig=function(){Fo=null,Tr=!1,qo=null,Qo=null,G=N,W=""},e.isValidAttribute=function($,T,F){Fo||Ka({});let U=Ie($),J=Ie(T);return nd(U,J,F)},e.addHook=function($,T){typeof T=="function"&&qe(de,$)&&rn(de[$],T)},e.removeHook=function($,T){if(qe(de,$)){if(T!==void 0){let F=JT(de[$],T);return F===-1?void 0:qT(de[$],F,1)[0]}return dm(de[$])}},e.removeHooks=function($){qe(de,$)&&(de[$]=[])},e.removeAllHooks=function(){de=Sm()},e}var Cm=Em();var Tv={"connection-stairs-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
258
|
-
<path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />
|
|
259
|
-
<path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />
|
|
260
|
-
<path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />
|
|
261
|
-
<path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />
|
|
262
|
-
</svg>`,"connection-elevator-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
263
|
-
<circle cx="1.9375" cy="4.4375" r="0.9375" />
|
|
264
|
-
<circle cx="1.9375" cy="7.5625" r="0.9375" />
|
|
265
|
-
<path
|
|
266
|
-
fillRule="evenodd"
|
|
267
|
-
clipRule="evenodd"
|
|
268
|
-
d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"
|
|
269
|
-
/>
|
|
270
|
-
</svg>`,"point-of-interest-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
271
|
-
<path
|
|
272
|
-
stroke="none"
|
|
273
|
-
id="Subtract"
|
|
274
|
-
fill-rule="evenodd"
|
|
275
|
-
clip-rule="evenodd"
|
|
276
|
-
d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"
|
|
277
|
-
/>
|
|
278
|
-
</svg>`,"door-12x12":`<svg viewBox="0 0 13 12">
|
|
279
|
-
<path
|
|
280
|
-
stroke="none"
|
|
281
|
-
d="M4.02533 0.662341H9.61421C9.95171 0.662341 10.2264 0.937033 10.2264 1.27453V10.726C10.2264 11.0639 9.95218 11.3382 9.61421 11.3382H4.02533C3.69721 11.3382 3.42674 11.078 3.41408 10.7504V1.24696C3.4272 0.919297 3.69721 0.659149 4.02533 0.659149V0.662341ZM5.96969 5.22798H6.64563V6.7725H5.96969V5.22798ZM4.94219 1.39218L7.31267 2.6541C7.43501 2.71973 7.50533 2.84488 7.50533 2.97473C7.50721 4.99181 7.50674 7.00877 7.50674 9.02585C7.50674 9.17679 7.41487 9.30663 7.28361 9.36195L4.94217 10.6084H9.49653V1.39227L4.94219 1.39218Z"
|
|
282
|
-
/>
|
|
283
|
-
</svg>`,"building-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
284
|
-
<path
|
|
285
|
-
d="M11.2374 9.75H10.5V4.5C10.5 4.30109 10.421 4.11032 10.2804 3.96967C10.1397 3.82902 9.94894 3.75 9.75003 3.75H7.68753C7.6378 3.75 7.59011 3.76976 7.55495 3.80492C7.51978 3.84008 7.50003 3.88777 7.50003 3.9375V9.75H6.75003V1.51922C6.75127 1.4024 6.72592 1.28683 6.67589 1.18125C6.62587 1.07567 6.55248 0.982864 6.46128 0.909845C6.33697 0.812924 6.18528 0.757635 6.02776 0.751829C5.87024 0.746023 5.71489 0.789995 5.58378 0.877501L1.83378 3.375C1.73091 3.44364 1.6466 3.53664 1.58837 3.64574C1.53014 3.75484 1.4998 3.87665 1.50003 4.00031V9.75H0.762687C0.66578 9.74857 0.571927 9.78389 0.500006 9.84885C0.428085 9.91382 0.383432 10.0036 0.37503 10.1002C0.371625 10.1515 0.378802 10.2029 0.396116 10.2513C0.413431 10.2997 0.440513 10.344 0.47568 10.3815C0.510847 10.419 0.553349 10.4489 0.600545 10.4693C0.647741 10.4897 0.698623 10.5001 0.75003 10.5H11.25C11.3014 10.5001 11.3523 10.4897 11.3995 10.4693C11.4467 10.4489 11.4892 10.419 11.5244 10.3815C11.5595 10.344 11.5866 10.2997 11.6039 10.2513C11.6213 10.2029 11.6284 10.1515 11.625 10.1002C11.6166 10.0036 11.572 9.91382 11.5001 9.84885C11.4281 9.78389 11.3343 9.74857 11.2374 9.75ZM3.56253 8.625C3.56264 8.67641 3.55219 8.72729 3.53181 8.77449C3.51143 8.82168 3.48156 8.86418 3.44406 8.89935C3.40657 8.93452 3.36224 8.9616 3.31383 8.97892C3.26543 8.99623 3.21398 9.00341 3.16269 9C3.06605 8.99159 2.9762 8.94688 2.91122 8.87485C2.84624 8.80283 2.81098 8.70886 2.81253 8.61188V7.88766C2.81121 7.79078 2.84657 7.69699 2.91151 7.62509C2.97645 7.55319 3.06618 7.50851 3.16269 7.5C3.21398 7.4966 3.26543 7.50377 3.31383 7.52109C3.36224 7.5384 3.40657 7.56548 3.44406 7.60065C3.48156 7.63582 3.51143 7.67832 3.53181 7.72552C3.55219 7.77271 3.56264 7.82359 3.56253 7.875V8.625ZM3.56253 6C3.56264 6.05141 3.55219 6.10229 3.53181 6.14949C3.51143 6.19668 3.48156 6.23918 3.44406 6.27435C3.40657 6.30952 3.36224 6.3366 3.31383 6.35392C3.26543 6.37123 3.21398 6.37841 3.16269 6.375C3.06609 6.36649 2.9763 6.32174 2.91135 6.24974C2.84639 6.17774 2.81109 6.08383 2.81253 5.98688V5.26266C2.81121 5.16578 2.84657 5.07199 2.91151 5.00009C2.97645 4.92819 3.06618 4.88351 3.16269 4.875C3.21398 4.8716 3.26543 4.87877 3.31383 4.89609C3.36224 4.9134 3.40657 4.94048 3.44406 4.97565C3.48156 5.01082 3.51143 5.05332 3.53181 5.10052C3.55219 5.14771 3.56264 5.19859 3.56253 5.25V6ZM5.43753 8.625C5.43764 8.67641 5.42719 8.72729 5.40681 8.77449C5.38643 8.82168 5.35656 8.86418 5.31906 8.89935C5.28157 8.93452 5.23724 8.9616 5.18883 8.97892C5.14043 8.99623 5.08898 9.00341 5.03769 9C4.94122 8.9916 4.8515 8.94702 4.78654 8.8752C4.72159 8.80338 4.68622 8.70964 4.68753 8.61281V7.88766C4.68633 7.79086 4.72174 7.69718 4.78667 7.62539C4.8516 7.55359 4.94126 7.50897 5.03769 7.50047C5.08898 7.49706 5.14043 7.50424 5.18883 7.52156C5.23724 7.53887 5.28157 7.56595 5.31906 7.60112C5.35656 7.63629 5.38643 7.67879 5.40681 7.72598C5.42719 7.77318 5.43764 7.82406 5.43753 7.87547V8.625ZM5.43753 6C5.43764 6.05141 5.42719 6.10229 5.40681 6.14949C5.38643 6.19668 5.35656 6.23918 5.31906 6.27435C5.28157 6.30952 5.23724 6.3366 5.18883 6.35392C5.14043 6.37123 5.08898 6.37841 5.03769 6.375C4.94126 6.3665 4.8516 6.32188 4.78667 6.25008C4.72174 6.17829 4.68633 6.08461 4.68753 5.98781V5.26266C4.68633 5.16586 4.72174 5.07218 4.78667 5.00039C4.8516 4.92859 4.94126 4.88397 5.03769 4.87547C5.08898 4.87206 5.14043 4.87924 5.18883 4.89656C5.23724 4.91387 5.28157 4.94095 5.31906 4.97612C5.35656 5.01129 5.38643 5.05379 5.40681 5.10098C5.42719 5.14818 5.43764 5.19906 5.43753 5.25047V6Z"
|
|
286
|
-
stroke="none"
|
|
287
|
-
/>
|
|
288
|
-
</svg>`,"ladder-12x12":`<svg viewBox="0 0 12 12">
|
|
289
|
-
<g id="surface1">
|
|
290
|
-
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.34375 0.375 L 2.53125 0.375 L 2.625 11.53125 L 2.34375 11.625 L 2.25 0.46875 Z M 2.34375 0.375 "/>
|
|
291
|
-
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 9.46875 0.375 L 9.65625 0.375 L 9.75 11.53125 L 9.46875 11.625 L 9.375 0.46875 Z M 9.46875 0.375 "/>
|
|
292
|
-
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 2.25 L 2.25 1.875 L 9.75 1.875 L 9.75 2.25 Z M 2.25 2.25 "/>
|
|
293
|
-
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 4.875 L 2.25 4.5 L 9.75 4.5 L 9.75 4.875 Z M 2.25 4.875 "/>
|
|
294
|
-
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 7.5 L 2.25 7.125 L 9.75 7.125 L 9.75 7.5 Z M 2.25 7.5 "/>
|
|
295
|
-
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 10.125 L 2.25 9.75 L 9.75 9.75 L 9.75 10.125 Z M 2.25 10.125 "/>
|
|
296
|
-
</g>
|
|
297
|
-
</svg>`},vv=/<svg([^>]*)>/g;function _m(o,e,t){let r=Tv[o];return r?r.replace(vv,`<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:${e}; width:${t}px; height:${t}px">`):null}function Sv(o){return Cm.sanitize(o,{USE_PROFILES:{svg:!0}})}function xv(o,e){let n=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;return n==null||n.tagName==="parsererror"||n.tagName.toLowerCase()!=="svg"?(_.error("Failed to parse SVG",{svg:o,tagName:n?.tagName}),o):(e!=null&&(n.setAttribute("color",e),n.querySelectorAll("*").forEach(s=>{(s.getAttribute("fill")!=null||s.tagName==="path")&&s.getAttribute("fill")!=="none"&&s.setAttribute("fill","currentColor"),s.getAttribute("stroke")!=null&&s.getAttribute("stroke")!=="none"&&s.setAttribute("stroke","currentColor")})),new XMLSerializer().serializeToString(n))}var Lc=new Map;function Bc(o,e){e?.style==="fill"&&(o=o.replace(".svg","-fill.svg"));let t=`${o}|${e?.color??""}`,r=Lc.get(t);return r==null&&(r=Mv(o,e).then(n=>(n==null&&Lc.delete(t),n)),Lc.set(t,r)),r}async function Mv(o,e){let t="";try{if(o.trim()==="")throw new Error("URL is empty!");let r=await Mt()(o),n=r.headers.get("content-type");if(n?.includes("image/svg+xml")){let i=await r.text();return t=Sv(i),e?.color!=null&&(t=xv(t,e.color)),{icon:t,type:"svg"}}else{if(n?.includes("image"))return{icon:o,type:"image"};throw new Error(`Expected SVG or Image content, but received: ${n}`)}}catch(r){return _.error(`Failed to fetch icon from ${o}.`,r),null}}f();var Ev=.3333333333333333,Fm=2,Om=2.5,Cv=4,_v=6,Fv=30*.7;function Pm(o){let e=typeof window>"u"?1:window.devicePixelRatio||1;return Math.ceil(o+Om/e)}function Ov(o){let e=Pm(o)-o,t=o/30,n=Fm*t-Om/2;return Math.max(0,e+n*2)}function Pv(o){let t=15+Fm+Cv-Pm(o)/2;return Math.max(_v,t)}function wm(o){let e=Fv;return{icon:o,iconSize:e,margin:Pv(e),iconPadding:Ov(e),iconBorderRadiusFactor:Ev,iconFit:"cover",iconVisible:!0,pinColor:"#FFFFFF",pinOutlineColor:"#FFFFFF",pinOutlineColorInactive:"#FFFFFF"}}f();function Am(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Restroom")))}function Rm(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Parking")))}var Vc=new Set(["connection","point-of-interest","space","object","door","facade"]),mr={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F",parking:"#418425",door:"#A0552C"},an={elevator:"connection-elevator-12x12",escalator:"connection-stairs-12x12",stairs:"connection-stairs-12x12",point:"point-of-interest-12x12",door:"door-12x12",building:"building-12x12",ladder:"ladder-12x12"};function wv(o){let e=null;if(Ee.is(o))switch(o.type){case"elevator":e=an.elevator;break;case"ladder":e=an.ladder;break;case"escalator":case"stairs":default:e=an.stairs}else ft.is(o)?e=an.point:Ae.is(o)?e=an.door:Ce.is(o)&&(e=an.building);return e!=null?_m(e,"#FFFFFF",12):null}function Dm(o){return Ee.is(o)?mr.connection:Ce.is(o)?mr.default:Am(o)?mr.washroom:Rm(o)?mr.parking:ft.is(o)?mr.point:Ae.is(o)?mr.door:mr.default}async function Av(o,e){let t=null,r="locationProfiles"in o?o.locationProfiles.find(n=>n.icon!=null)?.icon:null;if(r?.url!=null&&(t=await Bc(r.url,{color:e.color,style:"fill"})),t==null){let n=wv(o);n!=null&&(t={icon:n,type:"svg"})}return t}function Rv(o){return Ee.is(o)||Ae.is(o)?"low":ft.is(o)||Ce.is(o)?"high":"medium"}async function Dv(o){let e=o.icon?.url?await Bc(o.icon.url):null;return{rank:"medium",interactive:!0,appearance:wm(e?.icon)}}async function kv(o){let e={appearance:{color:Dm(o),pinOutlineColor:Dm(o),iconPadding:8,iconSize:24,textSize:12.5,iconScale:{on:"zoom-level",input:[18,20],output:[.7,1]}},rank:Rv(o),interactive:!0},t=await Av(o,{color:"#FFFFFF"});return t!=null&&(e.appearance.icon=t.icon,t.type==="svg"?Ce.is(o)&&(e.appearance.iconSize=30,e.appearance.iconPadding=10):t.type==="image"&&(e.appearance.iconSize=48,e.appearance.iconPadding=2,e.appearance.pinOutlineColor="#FFFFFF",e.rank="high")),e}async function jc(o,e){return(await Promise.all(e.map(async r=>{let n=[];if(!bo(r))return n;if(ht.is(r)){if(r.icon!=null&&typeof r.icon.url=="string"&&r.icon.url.length>0){let a=await Dv(r);a.appearance?.icon!=null&&n.push(o.Labels.add(r,"",a))}return n}let i=await kv(r);return Ee.is(r)?n=r.coordinates.map(a=>o.Labels.add(a,r.name,i)):Ce.is(r)?r.spaces.length>0&&r.floorStack.name!=null&&r.floorStack.name!==""&&n.push(o.Labels.add(r.spaces[0],r.floorStack.name,i)):sm(r)&&Ws(r)&&n.push(o.Labels.add(r,r.name,i)),n}))).flat()}var Nv=new Set([...Vc,"annotation"]);async function km(o,e){let t=o.getMapDataInternal();if(!t)throw new Error("Map data not found");let r=t.getAllOfTypes(Nv,e),n=t.getAllOfTypes(Fc,e),[i]=await Promise.all([r.length>0?jc(o,r):[],n.length>0?Oc(o,n):[]]);return{labels:i,markers:[]}}async function Nm(o,e){let t=o.getMapDataInternal();if(!t)throw new Error("Map data not found");let r=t.getAllOfTypes(Vc,e),n=t.getAllOfTypes(im,e),i=t.getAllOfTypes(Fc,e),[a,s]=await Promise.all([r.length>0?jc(o,r):[],n.length>0?am(o,n):[],i.length>0?Oc(o,i):[]]);return{labels:a,markers:s}}f();f();var Gc=(o,{id:e}={})=>{let t=Array.isArray(o)?o:[o];if(!t.every(i=>typeof i=="string"))return;let r=t.join(""),n=null;if(e){let i=document.getElementById(e);i instanceof HTMLStyleElement&&(n=i)}n==null&&(n=document.createElement("style")),e&&e!==""&&(n.id=e),n.textContent=r,document.head.appendChild(n)};var Ja=.05,hi=class extends St{core;mapObjects=[];id;mapDataExternal={};mapsByFloorId={};mapData;currentMap;hiddenOutdoorGeometries=[];lastFacadeIntersected;#e;#t=!1;mapView;externalPubSub;get __EXPERIMENTAL__floorHandler(){return this.#e}__EXPERIMENTAL__overrideSetFloorHandler(e){e&&this.#e&&this.#e!==_i&&_.warn("overwriting an existing setFloor override handler"),this.#o(e)}get manualFloorVisibility(){return this.#e!==void 0}set manualFloorVisibility(e){let t=this.#e;t&&t!==_i&&e&&_.warn("manualFloorVisibility true overwriting an existing setFloor handler to noop"),this.#o(e?_i:void 0)}#o(e){let t=this.manualFloorVisibility;this.#e=e,this.manualFloorVisibility!==t&&this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:this.manualFloorVisibility})}get hidePathsNotOnCurrentFloor(){return this.#t}set hidePathsNotOnCurrentFloor(e){this.#t=e,this.currentMap?.updateOutdoorPathLayerVisibility()}Camera;Labels;Text3D;Markers;Models;Paths;Exporter;Navigation;Outdoor;Shapes;Style;Image3D;constructor(e,t,r){super(),this.core=e,this.mapView=t,this.externalPubSub=r,this.Camera=new $n(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new Qn("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{r.publish("pre-render")},{signal:this.signal}),this.core.on("post-render",()=>{r.publish("post-render")},{signal:this.signal}),this.core.on("resize",()=>{r.publish("resize")},{signal:this.signal}),this.core.on("render-error",({error:c})=>{r.publish("render-error",{error:new ld(c instanceof Error?c.message:"Unknown error")})},{signal:this.signal});let i=c=>{let d=c;c.startsWith(On)&&c.endsWith("-merged")&&(d=c.slice(On.length,-7));let p=this.getMapDataObject(d);switch(p?.__type){case"facade":return p;case"floor":return p.floorStack.facade;default:return null}};this.core.on("geometry-in-focus",c=>{let d=new Set;for(let p of c){let g=i(p);g&&d.add(g)}r.publish("facades-in-view-change",{facades:Array.from(d)})},{signal:this.signal}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{r.publish("state-change-internal",{Camera:this.getCameraState()})},{signal:this.signal});let a=new jn(this.Camera,{precision:7});this.core.on("camera-change",()=>{r.publish("camera-change",a)},{signal:this.signal}),this.core.on("pan-bounds-change",c=>{r.publish("camera-bounds-change",Yi(c,this.core.convert3DMapPositionToCoordinate))},{signal:this.signal}),this.core.camera.on("padding-change",({padding:c})=>{r.publish("camera-screen-offsets-change",c)},{signal:this.signal});let s=c=>d=>{let p=[],g=[],m=[],I=[],v=[];d.labels.forEach(G=>{let W=this.Labels.getById(G.toString());W&&p.push(W.label)}),d.markers.forEach(G=>{let W=this.Markers.getById(G.toString())||this.Navigation.getMarkerById(G.toString());W&&g.push(W.marker)}),d.models.forEach(G=>{let W=this.Models.getById(G.toString());W&&m.push(W.model)}),d.images.forEach(G=>{let W=this.Image3D.getById(G.toString());W&&I.push(W.image)}),d.paths.forEach(G=>{let W=this.Paths.getById(G.toString())||this.Navigation.getPathById(G.toString());W&&!v.includes(W)&&v.push(W)});let y=d.geometry,E;y.length>0&&(E=y.map(G=>this.getMapDataInternal()?.getById("space",G)).filter(Boolean)[0],E||(E=y.map(G=>this.getMapDataInternal()?.getById("object",G)).filter(Boolean)[0]),E||(E=y.map(G=>this.getMapDataInternal()?.getById("area",G)).filter(Boolean)[0]),E||(E=y.map(G=>this.Shapes.getById(G)).filter(Boolean)[0]));let k=d.containers.reduce((G,W)=>{let N=this.getMapDataInternal()?.getById("floor",W);return N&&Xe.is(N)&&G.push(N),G},[]),w,B=0;if(k.length>0){w=k[0].id;let G=this.core.getState(w);B=d.coordinate[2]?d.coordinate[2]-G.altitude:B}let D;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(G=>{this.core.setState(G.id,{hovered:!1})}),E&&Te.is(E)&&(D=y.map(G=>this.getMapDataInternal()?.facadesBySpaceId[G]).filter(Boolean)[0],D&&D.spaces.forEach(G=>{this.core.setState(G.id,{hovered:!0})})),this.lastFacadeIntersected=D;let j={coordinate:new X({latitude:d.coordinate[1],longitude:d.coordinate[0],floorId:w,verticalOffset:B}),spaces:E&&Te.is(E)?[E]:[],objects:E&&Le.is(E)?[E]:[],areas:E&&$e.is(E)?[E]:[],shapes:E&&vo.is(E)?[E]:[],markers:g,labels:p,models:m,images:I,paths:v,floors:k,facades:D?[D]:[]};"pointerEvent"in d&&(j.pointerEvent=d.pointerEvent),r.publish(c,j)};this.core.on("hover",s("hover"),{signal:this.signal}),this.core.on("click",s("click"),{signal:this.signal}),this.core.on("long-press",s("long-press"),{signal:this.signal}),this.core.on("user-interaction-start",()=>{r.publish("user-interaction-start")},{signal:this.signal}),this.core.on("user-interaction-end",()=>{r.publish("user-interaction-end")},{signal:this.signal});let l={currentMapGetter:()=>this.currentMap,mapDataInternalGetter:()=>this.mapData?.internal};this.Markers=new Kn(l),this.Models=new ti(l),this.Labels=new Yn(l),this.Text3D=new ii(l),this.Exporter=new Xn(l),this.Paths=new oi(l),this.Navigation=new zn(this),this.on("navigation-state-change",c=>{this.externalPubSub.publish("state-change-internal",{Navigation:c})}),this.on("navigation-connection-click",c=>{this.externalPubSub.publish("navigation-connection-click",c)}),this.on("navigation-active-path-change",c=>{this.externalPubSub.publish("navigation-active-path-change",c)}),this.Outdoor=new Qr(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{r.publish("outdoor-view-loaded")},{signal:this.signal}),this.core.on("outdoor-style-loaded",()=>{r.publish("outdoor-style-loaded")},{signal:this.signal})),this.Image3D=new ei(l),this.Shapes=new ri(l),this.Style=new ni(l)}preloadFloors(e){e.forEach(t=>{t instanceof Xe&&this.core.setState(t.id,{preloadGeometry:!0})})}updateState(e,t){if(t==null||typeof t!="object")return;let r=this.currentMap.options?.disableUpdateStateValidation??!1;if(e==="interior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Pe);if(a){let s=a.layers.get(ko);s&&this.core.hasState(s)&&this.core.setState(s,sc(me(ac,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Pe);if(a){let s=a.layers.get(ao);s&&this.core.hasState(s)&&this.core.setState(s,sc(me(ac,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Pe),s=i.layers.get(Nr);if(!a)return;let l=a.layers.get(Dr);if(!l||!this.core.hasState(l))return;let c=ql(me(Ia,t,{warn:!0,disableValidation:r}),this.core.getState(l));Object.keys(c.featureCollection).length>0&&this.core.setState(l,c.featureCollection),s&&Object.keys(c.container).length>0&&this.core.setState(s.containerId,c.container)});return}if(e==="exterior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Pe),s=i.layers.get(Lr);if(!a)return;let l=a.layers.get(kr);if(!l||!this.core.hasState(l))return;let c=ql(me(Ia,t,{warn:!0,disableValidation:r}),this.core.getState(l));Object.keys(c.featureCollection).length>0&&this.core.setState(l,c.featureCollection),s&&Object.keys(c.container).length>0&&this.core.setState(s.containerId,c.container)});return}let n=typeof e=="string"?this.getMapDataObject(e):e;if(n){if(n.__type!==Lt.__type&&!this.core.hasState(n.id)){_.warn(`Failed to update state for "${n.id}". No ${n.__type} found with that ID.`);return}if(To.is(n))return this.core.setState(n.id,Zh(me(Xh,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(po.is(n))return this.core.setState(n.id,Qh(me(Jh,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(Te.is(n)||Le.is(n)){let i=this.core.getState(n.id);i!=null&&this.core.setState(n.id,$h(me(ec,t,{warn:!0,disableValidation:r}),i))}if($e.is(n)&&this.core.setState(n.id,me(ec,t,{warn:!0,disableValidation:r})),Ct.is(n)&&this.core.setState(n.id,me(cg,t,{warn:!0,disableValidation:r})),Ae.is(n)&&this.core.setState(n.id,Ih(me(Ia,t,{warn:!0,disableValidation:r}),this.core.getState(n.id))),vo.is(n)){let i=tg(me(nc,t,{warn:!0,disableValidation:r}));i.mergedShapeState&&this.core.setState(n.id,i.mergedShapeState)}if(dr.is(n)){let{position:i,scale:a,rotation:s,...l}=me(ug,t,{warn:!0,disableValidation:r}),c=l;i&&(c.position=[i.longitude,i.latitude,i.verticalOffset]),a!=null&&(Array.isArray(a)?c.scale=a:c.scale=[a,a,a]),s!=null&&(Array.isArray(s)?c.rotation=s:c.rotation=[s,s,s]),i&&n.updateTarget(i),this.core.setState(n.id,c)}if(Xe.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;let a=me(Uh,t,{warn:!0,disableValidation:r});this.core.setState(n.id,a);let s=i.layers.get(Pe);if(s!=null&&"geometry"in t&&t.geometry){this.core.setState(s.containerId,me(Rh,t.geometry,{warn:!0,disableValidation:r}));for(let v of s.layers.keys())this.core.setState(s.layers.get(v),{heightScale:t.geometry.heightScale??void 0,maskId:t.geometry.maskId??void 0,maskEffect:t.geometry.maskEffect??void 0,maskMode:t.geometry.maskMode??void 0,maskEnabled:t.geometry.maskEnabled??void 0,effectStart:t.geometry.effectStart??void 0,effectDistance:t.geometry.effectDistance??void 0,darkenAmount:t.geometry.darkenAmount??void 0,darkenUseDepth:t.geometry.darkenUseDepth??void 0,desaturateAmount:t.geometry.desaturateAmount??void 0,desaturateUseDepth:t.geometry.desaturateUseDepth??void 0,washOutAmount:t.geometry.washOutAmount??void 0,washOutUseDepth:t.geometry.washOutUseDepth??void 0})}let l=i.layers.get(so);if(l!=null&&"labels"in t&&t.labels){let v=me(Dh,t.labels,{warn:!0,disableValidation:r});"enabled"in v&&typeof v.enabled=="boolean"&&l.setVisible(v.enabled)}let c=i.layers.get($t);if(c!=null&&"markers"in t&&t.markers){let v=me(kh,t.markers,{warn:!0,disableValidation:r});"enabled"in v&&typeof v.enabled=="boolean"&&c.setVisible(v.enabled)}if(i.footprintObject&&"footprint"in t&&t.footprint){let v=me(ur,t.footprint,{warn:!0,disableValidation:r});i.footprintObject.update({altitude:v.altitude,visible:v.visible,height:v.height,opacity:v.opacity,side:v.side,color:v.color,ceilingVisible:v.ceilingVisible,ceilingThickness:v.ceilingThickness,basementMaskEnabled:v.basementMaskEnabled,outline:v.outline})}if(i.gapFootprintObject&&"visible"in t){let v={visible:t.visible};if("footprint"in t&&t.footprint){let y=me(ur,t.footprint,{warn:!0,disableValidation:r});y.color!==void 0&&(v.color=y.color),y.opacity!==void 0&&(v.opacity=y.opacity),y.outline!==void 0&&(v.outline=y.outline)}i.gapFootprintObject.update(v)}let d=i.layers.get(nr);if(d!=null&&"occlusion"in t&&t.occlusion){let v=me(Lh,t.occlusion,{warn:!0,disableValidation:r});"enabled"in v&&typeof v.enabled=="boolean"&&d.setVisible(v.enabled)}let p=i.layers.get(Br);if(p!=null&&"images"in t&&t.images){let v=me(Nh,t.images,{warn:!0,disableValidation:r});if("visible"in v&&typeof v.visible=="boolean"&&p.setVisible(v.visible),"collisionsEnabled"in v&&typeof v.collisionsEnabled=="boolean"&&s!=null)for(let y of s.layers.values()){let E=this.core.getState(y);if(E?.children)for(let k of E.children)this.core.setState(k,{enableImageCollisions:v.collisionsEnabled})}}let g=i.layers.get(lo);if(g!=null&&"paths"in t&&t.paths!=null){let v=me(Bh,t.paths,{warn:!0,disableValidation:r});v.visible!=null&&typeof v.visible=="boolean"&&g.setVisible(v.visible)}let m=i.layers.get(ir);if(m!=null&&"areas"in t&&t.areas!=null){let v=me(Vh,t.areas,{warn:!0,disableValidation:r});v.visible!=null&&typeof v.visible=="boolean"&&m.setVisible(v.visible)}let I=i.layers.get(Xt);if(I!=null&&"models"in t&&t.models!=null){let v=me(Gh,t.models,{warn:!0,disableValidation:r});v.visible!=null&&typeof v.visible=="boolean"&&I.setVisible(v.visible)}if("text3d"in t&&t.text3d!=null){let v=me(jh,t.text3d,{warn:!0,disableValidation:r}),y=i.layers.get(sr);y!=null&&v.visible!=null&&y.setVisible(v.visible),v.geometryText?.visible!=null&&i.setGeometryTextBatchVisible(v.geometryText.visible),v.floorText?.visible!=null&&i.setFloorTextBatchVisible(v.floorText.visible)}}if(Ce.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,me(vh,t,{warn:!0,disableValidation:r}))}if(So.is(n)&&this.core.setState(n.id,me(ig,t,{warn:!0,disableValidation:r})),Lt.is(n)){let i=me(Yl,t,{warn:!0,disableValidation:r}),a=qr(i);for(let s of n.segments)this.core.setState(s.id,a)}if(jo.is(n)){let i=me(Yl,t,{warn:!0,disableValidation:r}),a=qr(i);this.core.setState(n.id,a)}}}getMapDataObject(e){return this.getMapDataInternal()?.getMapDataById(e)}update=()=>{this.core.render()};getMapDataInternal(){if(this.mapData)return Cn(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(r=>{let n;try{n=Cn(e)}catch(l){_.error("Error adding map",l),r(e);return}this.mapDataExternal[e.mapName]=e,this.mapData=e,this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:n.mapCenter});let i=n.manifestRecord.name,a=new Qn(`mapObject-${i}`,n,t,this);this.currentMap=a,this.currentMap.loadAllFloors(),this.currentMap.setFloor(this.currentMap.startingFloorId),this.core.renderSync();let s=t?.outdoorView?.layersHiddenByGeometry??[];if(s.length>0){let l=[];for(let c of a.floorStacksById.values())c.isOutdoors===!1&&c.defaultFloor.footprint&&c.defaultFloor.footprint.geometry!=null&&c.defaultFloor.footprint.geometry?.coordinates.length>0&&l.push(c.defaultFloor.footprint);l.length>0&&(this.core.hideOutdoorLayersIntersectingPolygons(l,s),this.hiddenOutdoorGeometries.push([l,s]))}this.mapObjects.push(a);for(let l of Object.keys(n.floorRecordsById))this.mapsByFloorId[l]=a;if(a.on("floor-change-start",l=>{let c=Lm(this.getMapDataInternal(),l.floorId,l.previousFloorId);c&&this.externalPubSub.publish("floor-change-start",{reason:l.reason,...c})},{signal:this.signal}),a.on("floor-change",l=>{let c=Lm(this.getMapDataInternal(),l.floorId,l.previousFloorId);c&&this.externalPubSub.publish("floor-change",{reason:l.reason,...c}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})},{signal:this.signal}),t?.zoomLevel!=null)this.core.camera.setZoomLevel(t.zoomLevel),r(e);else if(this.core.mode!=="outdoors-overlay"&&this.currentFloor){let l=t?.screenOffsets??{top:Ja*this.core.canvasHeight,left:Ja*this.core.canvasWidth,right:Ja*this.core.canvasWidth,bottom:Ja*this.core.canvasHeight};this.Camera.focusOn(this.currentFloor,{duration:Fp,screenOffsets:l}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),r(e)})}else r(e)})}setFloor(e,t){return this.currentMap.setFloor(_n(e),t)}setFloorStack(e,t){return this.currentMap.setFloorStack(_n(e),t)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){let e=this.currentMap.currentFloorStack.id;if(!e)throw new re("Missing currentFloorStack.");let t=this.mapData?.getById("floor-stack",e);if(!t)throw new re("FloorStack was not found in map data.");return t}get currentFloor(){let e=this.currentMap.currentFloor.id;if(!e)throw new re("Missing currentFloor object from GeoJsonApi");let t=this.mapData?.getById("floor",e);if(!t)throw new re("Missing currentFloor");return t}getState(e){typeof e=="object"&&Lt.is(e)&&_.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let t=vl(e,this),r=this.core.getState(t);if(r){if(["interior-walls","exterior-walls"].includes(e)&&r.type==="feature-collection")return lg(r);if(["interior-doors","exterior-doors"].includes(e)&&r.type==="feature-collection"){let n=e==="interior-doors"?Nr:Lr,i;for(let a of this.currentMap.floors){let s=a.layers.get(n);if(!s)continue;let l=this.core.getState(s.containerId);if(l){i=l;break}}return bh(r,i)}else{if(r.type==="geometry")return zh(r);if(r.type==="label"&&r.options.appearance&&r.options.rank!==void 0&&r.options.interactive!==void 0)return Yh(r);if(r.type==="marker"&&r.options?.rank!==void 0&&r.options.interactive!==void 0)return qh(r,this.Markers.getById(r.id.toString())?.marker);if(r.type==="model")return fg(r);if(r.type==="image")return dg(r);if(r.type==="text3d")return ag(r);if(r.type==="feature-collection"&&e&&typeof e!="string"&&vo.is(e))return eg(r);if(r.type==="path")return gh(r);if(r.type==="group-container"&&typeof e!="string"&&Xe.is(e))return Hh(r,this.currentMap.floorsById.get(e.id),this.core);if(r.type==="group-container"&&r.children.length>0&&typeof e!="string"&&Ce.is(e)){let n=this.core.getState(r.children[0].id);return Sh(n)}}}}__EXPERIMENTAL__getRenderedState(e){let t=vl(e,this);if(t)return this.core.getRenderedState(t)}setHoverColor(e){this.core.setState({hoverColor:e})}getHoverColor(){let e=this.core.getState();return e?.type==="map-view"?e.hoverColor:void 0}getFloorStackAltitudeData(e){return this.currentMap.getFloorStackAltitudeData(e)}createCoordinateFromScreenCoordinate(e,t,r){if(r!=null){let l=this.core.projectScreenXYToCoordinate(e,t,!0);return l?new X(l.coordinate[1],l.coordinate[0],r.id):void 0}let n=this.core.projectScreenXYToCoordinate(e,t);if(n==null||n.coordinate==null)return;let{coordinate:i,groupContainers:a}=n,s=a?.find(l=>{let c=l.userData.entityId.toString();return c.includes("f_")||c.includes("m_")})?.userData.entityId.toString();return new X(i[1],i[0],s)}getScreenCoordinateFromCoordinate(e){let t=0;if(e.floorId!=null){let r=this.mapData?.getById("floor",e.floorId);r!=null&&(t=this.getState(r)?.altitude??0)}return t+=e.verticalOffset,this.core.projectCoordinateToScreenXY([e.longitude,e.latitude,t])}isInView(e){return this.core.isInView(typeof e=="string"?e:e.id)}getInView(e,t){let r=this.core.queryGeometry2DInView({screenOffsets:t?.screenOffsets,fullyContains:t?.fullyContains});if(r.length===0)return[];let n=[];switch(e){case To.__type:n=r.map(i=>this.Labels.getById(i)).filter(i=>i!=null).map(i=>i.label);break;case po.__type:n=r.map(i=>this.Markers.getById(i)).filter(i=>i!=null).map(i=>i.marker)}return n}async auto(e){return await km(this,e)}async __EXPERIMENTAL__auto(e){return await Nm(this,e)}tween(e){let t=new mo(e);return this.core.getExternalTweenGroup().add(t),this.core.render(),t}removeTween(e){this.core.getExternalTweenGroup().remove(e)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths,markers:this.Navigation.markers}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.externalPubSub.publish("state-change-internal",this.getAllState())}clear(){this.Navigation.clear(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Image3D.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),super.destroy(),this.core.destroy()}getOptimalVisualDistanceBetweenFloors(e,t=!1){let r=this.currentMap;if(!r){_.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){_.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let n=r.renderer.getInternalState().geometry3DMap.get(e[0].id),i=r.renderer.getInternalState().geometry3DMap.get(e[1].id);if(!n||!i){_.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}hs(n,"group-container"),hs(i,"group-container"),t&&typeof r.renderer.debugVisualizeBoundingBoxes=="function"&&r.renderer.debugVisualizeBoundingBoxes(n,i);let a=r.renderer.computeMinZOffsetBetweenContainers(n,i);if(a!==-1)return a}};function Lv(o){if(o===""){ds(""),us("");return}us(`${o}/${Cd}`),ds(`${o}/${Ed}`)}function Lm(o,e,t){let r=o?.getById("floor",t),n=o?.getById("floor",e);return!r||!n?null:{floor:n,previousFloor:r}}f();var qa=class{state;#e;constructor(e){this.#e=e,this.update=e.Debug.update.bind(e.Debug),this.state=e.Debug.state}update;getCameraState(){let e=this.#e.camera.center,t=this.#e.camera.bearing;return{center:new X({longitude:e[0],latitude:e[1]}),zoomLevel:this.#e.camera.zoomLevel,bearing:t,pitch:this.#e.camera.pitch}}};f();import Qe from"zod";var Bm=Qe.strictObject({environment:Qe.union([Qe.literal("basic"),Qe.literal(!1)]).optional(),text3d:Qe.object({hoverColor:Qe.string().optional()}).optional(),geometry:Qe.object({hoverColor:Qe.string().optional()}).optional(),backgroundColor:Qe.string().optional(),backgroundAlpha:Qe.number().optional(),multiFloorView:Qe.object({spacesOpenToBelowVisualEffectEnabled:Qe.boolean().optional(),spacesOpenToBelowVisualEffectDarkenAmount:Qe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDarkenUseDepth:Qe.boolean().optional(),spacesOpenToBelowVisualEffectDesaturateAmount:Qe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDesaturateUseDepth:Qe.boolean().optional(),spacesOpenToBelowVisualEffectWashOutAmount:Qe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectWashOutUseDepth:Qe.boolean().optional()}).optional()});f();var $c=dn(my(),1);f();var gi=null;function Vm(){if(Fi())return null;if(gi)return gi;if(typeof OffscreenCanvas<"u")gi=new OffscreenCanvas(1,1).getContext("2d");else if(typeof document<"u"){let o=document.createElement("canvas");o.width=1,o.height=1,gi=xd(o)}return gi}function Uc(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function Hc(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}var jm=/^#([0-9a-f]{4}|[0-9a-f]{8})$/i;function Bv(o){if(o.toLowerCase()==="transparent")return[0,0,0];let e=jm.test(o)?Vv(o):o;if(!jv(e))return[0,0,0];let t=new Oi(e);return[t.r,t.g,t.b]}function Vv(o){return o.length===5?o.slice(0,4):o.slice(0,7)}function jv(o){return Um.test(o)||Hm.test(o)||Wm.test(o)||Object.hasOwn(Oi.NAMES,o.toLowerCase())}function Wc(o){let e=Vm();if(!e)return Fi()?Bv(o):[0,0,0];e.fillStyle=o,e.fillRect(0,0,1,1);let[t,r,n]=e.getImageData(0,0,1,1).data;return[Uc(t/255),Uc(r/255),Uc(n/255)]}function Gm(o){let e=Math.round(Math.min(1,Math.max(0,Hc(o[0])))*255),t=Math.round(Math.min(1,Math.max(0,Hc(o[1])))*255),r=Math.round(Math.min(1,Math.max(0,Hc(o[2])))*255);return"#"+(1<<24|e<<16|t<<8|r).toString(16).slice(1)}var Um=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,Hm=/^rgba?\(\s*\d+/,Wm=/^hsla?\(\s*[\d.]+/;function zc(o){if(o==null||typeof o!="string")return!1;if(Um.test(o)||Hm.test(o)||Wm.test(o))return!0;let e=Vm();return e?(e.fillStyle="#000",e.fillStyle=o,e.fillStyle!=="#000000"||o.toLowerCase()==="black"||o==="#000"||o==="#000000"):Fi()?o.toLowerCase()==="transparent"||jm.test(o)||Object.hasOwn(Oi.NAMES,o.toLowerCase()):!1}var Gv=(o,e)=>{let t={},r=(n,i,a)=>{for(let s in i){let l=n[s],c=i[s];typeof c=="object"&&!Array.isArray(c)&&c!==null&&typeof l=="object"&&!Array.isArray(l)&&l!==null?(a[s]={},r(l,c,a[s])):a[s]=l}};return r(o,e,t),t},zm=(o,e)=>{let t=Gv(o,e),r=(0,$c.default)({},t,e),n=(0,$c.default)({},t),i=(a,s,l,c=n)=>{for(let d in s){let p=a[d],g=s[d];if(typeof g=="number"&&typeof p=="number")c[d]=p+(g-p)*l;else if(typeof g=="string"&&typeof p=="string"){if(zc(p)&&zc(g)){let m=Wc(p),I=Wc(g);m&&I?c[d]=Gm([m[0]+(I[0]-m[0])*l,m[1]+(I[1]-m[1])*l,m[2]+(I[2]-m[2])*l]):_.warn(`Color "${d}" could not be animated!`)}}else typeof g=="object"&&g!==null&&typeof p=="object"&&p!==null?i(p,g,l,c[d]):_.warn(`Value "${d}" could not be animated!`)}};return a=>(a=Math.min(Math.max(a,0),1),a===0?o:a===1?r:(i(t,e,a),n))};f();function Uv(o){return o.getContext("webgl2")||o.getContext("webgl")}function Xc(o){let e=Uv(o);if(!e||o.width===0||o.height===0)return null;let t=e;t.PIXEL_PACK_BUFFER!==void 0&&t.bindBuffer(t.PIXEL_PACK_BUFFER,null);let r=new Uint8Array(o.width*o.height*4);e.readPixels(0,0,o.width,o.height,e.RGBA,e.UNSIGNED_BYTE,r);let n=document.createElement("canvas");n.width=o.width,n.height=o.height;let i=n.getContext("2d");if(!i)return null;let a=new ImageData(o.width,o.height);for(let s=0;s<o.height;s++)for(let l=0;l<o.width;l++){let c=((o.height-s-1)*o.width+l)*4,d=(s*o.width+l)*4;a.data[d]=r[c],a.data[d+1]=r[c+1],a.data[d+2]=r[c+2],a.data[d+3]=r[c+3]}return i.putImageData(a,0,0),n}async function $m(o,e=1e3){let t=null,r=new Promise(a=>{t=()=>{let s=o.getCanvas();a(s?Xc(s):null)},o.once("render",t),o.triggerRepaint()}),n=new Promise(a=>setTimeout(()=>a(null),e)),i=await Promise.race([r,n]);return i===null&&t&&o.off("render",t),i}function Yc(o,e="labels"){let t=o.getContext("2d");if(!t)return null;try{let r=t.getImageData(0,0,o.width,o.height),n=document.createElement("canvas");n.width=o.width,n.height=o.height;let i=n.getContext("2d");return i?(i.putImageData(r,0,0),n):null}catch{let n=e==="overlay"?"HTML overlay canvas is tainted and cannot be included in screenshot. This may occur if overlay content contains cross-origin images without proper CORS headers.":"Labels canvas is tainted and cannot be included in screenshot. This may occur if labels contain cross-origin images without proper CORS headers.";return _.warn(n),null}}var mi=class{#e;#t;#o;Camera;Labels;Text3D;Markers;Image3D;Models;Paths;Exporter;Navigation;Style;Shapes;Outdoor;constructor(e){this.#e=new St,this.#o=e;let t=new hi(e,this,this.#e);this.#t=t,this.Camera=this.#t.Camera,this.Markers=this.#t.Markers,this.Models=this.#t.Models,this.Labels=this.#t.Labels,this.Text3D=this.#t.Text3D,this.Exporter=this.#t.Exporter,this.Paths=this.#t.Paths,this.Navigation=this.#t.Navigation,this.Shapes=this.#t.Shapes,this.Style=this.#t.Style,this.Outdoor=this.#t.Outdoor,this.Image3D=this.#t.Image3D,this.#o.container.dataset.version=x.env.npm_package_version,this.Debug=new qa(this.#t.core)}updateState(e,t){return this.#t.updateState(e,t)}animateState(e,t,r){let n=this.#t.getState(e);if(n==null)return _.warn(`Cannot animate state of ${e}.`),new Promise(c=>c({result:"completed"}));let i=zm(n,t),a=this.#t.tween({percent:0}).to({percent:1},r?.duration??1e3).onUpdate(({percent:l})=>{this.#t.updateState(e,i(l))});r?.easing&&r.easing in Cr&&a.easing(Cr[r.easing]);let s=new Promise(l=>{a.onComplete(()=>{this.#t.removeTween(a),l({result:"completed"})}).onStop(()=>{this.#t.removeTween(a),l({result:"cancelled"})}),a.start()});return s.cancel=()=>{a.stop(),this.#t.updateState(e,i(0))},s}updateGlobalState(e){try{Bm.parse(e)}catch(t){_.error("updateGlobalState",t);return}if(typeof e=="object"){let t={};if(e.text3d?.hoverColor&&(t.text3dHoverColor=e.text3d.hoverColor),e.geometry?.hoverColor&&(t.hoverColor=e.geometry.hoverColor),e.backgroundColor||e.backgroundAlpha!==void 0){let r=e.backgroundColor??this.#t.core.backgroundColor,n=e.backgroundAlpha??this.#t.core.backgroundAlpha;this.#t.core.setBackgroundColor(r,n)}e.environment!=null&&this.#t.core.setEnvironment(e.environment),e.multiFloorView!=null&&this.#t.currentMap.updateMultiFloorViewEffects(e.multiFloorView),this.#t.core.setState(t),this.#e.publish("global-state-change")}}get options(){return Ap(this.#t.currentMap.options)}getGlobalState(){let e=this.#t.core.getState();return{backgroundColor:this.#t.core.backgroundColor,backgroundAlpha:this.#t.core.backgroundAlpha,environment:this.#t.core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor},multiFloorView:this.#t.currentMap.getMultiFloorViewEffects()}}update=()=>{this.#t.core.render()};getMapData(){if(this.#t.mapData==null)throw new re("MapData not found.");return this.#t.mapData}getDimensions(){return{width:this.#o.canvasWidth,height:this.#o.canvasHeight}}addMap(e,t){return this.#t.addMap(e,t)}setFloor(e,t){return this.#t.setFloor(e,t?.context)}setFloorStack(e,t){return this.#t.setFloorStack(e,t?.context)}preloadFloors(e){this.#t.preloadFloors(e)}tween(e){return this.#t.tween(e)}removeTween(e){this.#t.removeTween(e)}get tweenGroup(){return this.#t.tweenGroup()}get currentFloorStack(){return this.#t.currentFloorStack}get currentFloor(){return this.#t.currentFloor}updateWatermark(e){this.#t.updateWatermark(e)}getState(e){return this.#t.getState(e)}getFloorStackAltitudeData(e){let t=typeof e=="string"?e:e.id;return this.#t.getFloorStackAltitudeData(t)}__EXPERIMENTAL__getRenderedState(e){return this.#t.__EXPERIMENTAL__getRenderedState(e)}setHoverColor(e){this.#t.setHoverColor(e)}getHoverColor(){return this.#t.getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return this.#t.core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return this.#t.core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return this.#t.isInView(e)}getInView(e,t){return this.#t.getInView(e,t)}getMetersPerPixel(){return this.#t.core.getMetersPerPixel()}__LEGACY_GET_DIRECTIONS_SYNC=(e,t,r)=>this.#t.getMapData()?.__LEGACY_GET_DIRECTIONS_SYNC(e,t,r)??void 0;getDirections=(e,t,r)=>this.#t.getMapData()?.getDirections(e,t,r)??Promise.resolve(void 0);__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,r)=>this.#t.getMapData()?.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,r)??void 0;getDirectionsMultiDestination=(e,t,r)=>this.#t.getMapData()?.getDirectionsMultiDestination(e,t,r)??Promise.resolve(void 0);getDistance(e,t){return this.#t.getMapData()?.getDistance(e,t)}createCoordinate(e,t,r){return typeof e=="object"?new X(e):new X(e,t,r?.id)}createCoordinateFromScreenCoordinate(e,t,r){return this.#t.createCoordinateFromScreenCoordinate(e,t,r)}getScreenCoordinateFromCoordinate(e){return this.#t.getScreenCoordinateFromCoordinate(e)}auto(e){return this.#t.auto(e)}__EXPERIMENTAL__auto(e){return _.warn("__EXPERIMENTAL__auto() is deprecated \u2014 use auto() instead."),this.#t.__EXPERIMENTAL__auto(e)}on=(e,t)=>{this.#e.on(e,t)};off=(e,t)=>{this.#e.off(e,t)};get __core(){if(x.env.INTERNAL==="true")return this.#t.core;throw new Error("__core is not available.")}get container(){return this.#o.container}publishAllState(){this.#t.publishAllState()}clear(){this.#t.clear()}destroy(){this.#e.publish("destroy"),this.#e.destroy(),this.#t.destroy()}async enableDebug(e={}){let{Inspector:t}=await import("./inspector-6TN57EHG.js");await new t(this,this.#t).enable(e)}Debug;async takeScreenshot(e){let t={withOutdoorContext:e?.withOutdoorContext??!1,withLabels:e?.withLabels??!1,captureMarkers:e?.captureMarkers},r=this.#o.rendererDomElement,n=this.#o.map,i=!1,a=!1,s=[];if(this.Outdoor.enabled&&this.Outdoor.visible&&!t.withOutdoorContext&&(this.Outdoor.hide(),i=!0,n)){let l=null;n.triggerRepaint(),await Promise.race([new Promise(d=>{l=()=>d(),n.once("render",l)}),new Promise(d=>setTimeout(d,1e3))])===void 0&&l&&n.off("render",l)}if(this.Outdoor.enabled&&t.withOutdoorContext&&!this.Outdoor.visible){if(n){let l=n.getStyle()?.layers;l&&(s=l.filter(c=>n.getLayoutProperty(c.id,"visibility")!=="none").map(c=>c.id))}if(this.Outdoor.show(),a=!0,n){let l=null;n.triggerRepaint(),await Promise.race([new Promise(d=>{l=()=>d(),n.once("render",l)}),new Promise(d=>setTimeout(d,1e3))])===void 0&&l&&n.off("render",l)}}try{let l=document.createElement("canvas"),c=l.getContext("2d",{willReadFrequently:!0});if(l.width=r.width,l.height=r.height,!c)throw new Error("Failed to get 2D context");if(t.withOutdoorContext&&n){if(!n.loaded()){let g=null;await Promise.race([new Promise(I=>{g=()=>I(),n.once("idle",g)}),new Promise(I=>setTimeout(I,5e3))])===void 0&&g&&n.off("idle",g)}let p=await $m(n);p&&c.drawImage(p,0,0,l.width,l.height)}await this.#o.renderSync();let d=Xc(r);if(d&&c.drawImage(d,0,0,l.width,l.height),t.withLabels){let p=this.#o.labelsCanvas;if(p){let g=Yc(p);g&&c.drawImage(g,0,0,l.width,l.height)}}if(t.withLabels&&t.captureMarkers){let p=this.#o.container;if(p)for(let g=0;g<p.children.length;g++){let m=p.children[g],I=m.classList.contains("mappedin-2d-entities");if(!(m.tagName==="CANVAS"||m.offsetWidth===0||m.offsetHeight===0||!I))try{let v=await t.captureMarkers(m),y=Yc(v,"overlay");y&&y.width>0&&y.height>0&&c.drawImage(y,0,0,l.width,l.height)}catch(v){_.warn(`Overlay layer capture failed: ${v instanceof Error?v.message:String(v)}. Continuing with other layers.`)}}}try{return l.toDataURL("image/png")}catch(p){if((p instanceof Error?p.name:p?.name)==="SecurityError"||p?.message?.includes("tainted")||p?.message?.includes("security")){let v=p instanceof Error?`Screenshot failed due to security restrictions: ${p.message}`:"Screenshot failed due to security restrictions. Ensure all images have proper CORS headers.";throw new re(v)}let I=p instanceof Error?`Screenshot failed: ${p.message}`:"Screenshot failed due to an unknown error.";throw new re(I)}}finally{i&&this.Outdoor.show(),a&&this.Outdoor.hide(s)}}get manualFloorVisibility(){return this.#t.manualFloorVisibility}set manualFloorVisibility(e){this.#t.manualFloorVisibility=e}__EXPERIMENTAL__overrideSetFloorHandler(e){this.#t.__EXPERIMENTAL__overrideSetFloorHandler(e)}getOptimalVisualDistanceBetweenFloors(e){return this.#t.getOptimalVisualDistanceBetweenFloors(e)}get __INTERNAL__hidePathsNotOnCurrentFloor(){return this.#t.hidePathsNotOnCurrentFloor}set __INTERNAL__hidePathsNotOnCurrentFloor(e){this.#t.hidePathsNotOnCurrentFloor=!!e}registerPlugin(e){_.warn("registerPlugin is super experimental and may change or be removed without notice."),this.#o.registerPlugin(e)}unregisterPlugin(e){this.#o.unregisterPlugin(e)}};f();var Hv=1e3*60*60*2,sn=class{#e=new St;#t;#o;#r;#i;#n;#s;#l;#a;constructor(e,t){this.#t=e,this.#o=t}#c=()=>{"key"in this.#o&&"secret"in this.#o&&this.#f(),this.#h()};#d(e){let t=e.token!==this.#n?.token;this.#n=e,t&&this.#e.publish("access-token-refreshed",{accessToken:e})}#u(e){let t=JSON.stringify(e.tokens)!==JSON.stringify(this.#s?.tokens);this.#s=e,t&&this.#e.publish("sas-tokens-refreshed",{sasTokens:e.tokens})}async#f(e=!1){if("accessToken"in this.#o&&typeof this.#o.accessToken=="string"){let t={token:this.#o.accessToken,expires:Date.now()+72e5};return this.#n=t,t}if(!("key"in this.#o)||!("secret"in this.#o)||typeof this.#o.key!="string"||typeof this.#o.secret!="string")throw new Error("No API keys or access token provided!");return this.#r!=null?this.#r:this.#n!=null&&this.#n.expires!=null&&this.#n.expires>Date.now()&&!e?this.#n:(this.#r=bn({...this.#o,key:this.#o.key,secret:this.#o.secret},this.#o.enterprise??!1,e).then(t=>{let r={token:t.accessToken,expires:t.expiresTimestamp*1e3};return this.#d(r),r}).catch(t=>{throw t}).finally(()=>{this.#r=void 0}),this.#r)}async#h(e=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:this.#i!=null?this.#i:this.#s!=null&&this.#s.expires>Date.now()&&!e?this.#s:(this.#i=new Promise((t,r)=>{this.#f().then(n=>{let i={},a=this.#t.map(s=>Is({...this.#o,mapId:s},n.token).then(l=>{i[s]={token:l.token,expires:l.expires}}).catch(l=>{_.error(`Error getting SAS token for map ${s}:`,l)}));Promise.all(a).then(()=>{let s={tokens:i,expires:Math.min(...Object.values(i).map(l=>l.expires??1/0))};this.#u(s),t(s)})}).catch(n=>{r(n)})}),this.#i.catch(t=>{throw t}).finally(()=>{this.#i=void 0}),this.#i)}#p(e){if(!("key"in this.#o)||!("secret"in this.#o))return;let t=e.expires!=null?e.expires-Date.now():Hv;isFinite(t)&&(this.#l=setTimeout(()=>{this.#f(!0).then(r=>{this.#p(r)})},t-tp))}#m(e){let t=e.expires-Date.now();isFinite(t)&&(this.#a=setTimeout(()=>{this.#h(!0).then(r=>{this.#m(r)})},t-ip))}#y(){this.#l!=null&&clearTimeout(this.#l),this.#a!=null&&clearTimeout(this.#a)}setMapIds(e){this.#t=e}setEnterprise(e){this.#o.enterprise=e}async readySync(){if((!("key"in this.#o)||!("secret"in this.#o))&&!("accessToken"in this.#o)){_.error("No API keys or access token provided! Cannot preload tokens.");return}let e=[this.#f(),null];this.#o.enterprise||(e[1]=this.getSasTokensAsync());let[t,r]=await Promise.all(e);this.#y(),this.#p(t),r!=null&&this.#m(r),un()&&globalThis.addEventListener?.("focus",this.#c)}async refreshing(){let e=[];return this.#r!=null&&e.push(this.#r),this.#i!=null&&e.push(this.#i),Promise.all(e)}getAccessTokenAsync(e=!1){return this.#f(e)}getSasTokensAsync(){return this.#h()}getAccessToken(){return this.#n==null?(_.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):this.#n}getSasToken(e){return this.isEnterpriseMode()?(_.error("SAS tokens are not available in the enterprise mode!"),{token:""}):this.#s==null?(_.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):e in this.#s.tokens?this.#s.tokens[e]:(_.error(`SAS token for map ${e} not found!`),{token:""})}isEnterpriseMode(){return this.#o.enterprise??!1}on=(e,t)=>this.#e.on(e,t);off=(e,t)=>this.#e.off(e,t);destroy(){this.#y(),this.#e.destroy(),un()&&globalThis.removeEventListener("focus",this.#c)}};f();function Zc(o,e){if(typeof o=="function"){if(e==null){_.warn("onMVFParsed is not called for mvfVersion '3.0.0-native': a native MVFv3 load produces no MVFv2. Use mvfVersion '3.0.0' if you need it.");return}o(e)}}var Xm=o=>o.options!=null&&"enterprise"in o.options?o.options.enterprise:void 0;function Jc(o,e,t){if(o!=null)return o;if(e==null)throw new re("No MVF data to build the map from.");if(t||Sn(e))throw new re("mvfVersion '3.0.0-native' supports Maker venues only; load Enterprise venues with mvfVersion '3.0.0'.");return{kind:"v3-native",mvf3:e}}var Wv=async(o,e)=>{let t=("mvfVersion"in(e??{})?e?.mvfVersion:void 0)??("options"in o&&"version"in(o.options??{})?o.options?.version:void 0),r={prefetchTokens:!0,...e||{},mvfVersion:t},n,i,a=Ao();a.updateByUserOption(r);let s={};if("type"in o&&typeof o.type=="string"){if(o.type==="binary"&&o.main instanceof Uint8Array){let k=await ki(o.main,r.mvfVersion);k.kind==="v3-native"||(n=k.mvf2),i=k.mvf3,s.languagePacks=[];for(let w of o.languagePacks??[])w.localePack instanceof Uint8Array&&s.languagePacks.push({language:w.language,localePack:await wr(w.localePack)})}else if(o.type==="json"){i=o.options?.mvf3;let k=r.mvfVersion==="3.0.0-native";if(!k&&o.main==null)throw new re("This JSON bundle has no MVFv2; hydrate it with mvfVersion '3.0.0-native'.");n=k?void 0:o.main,s.languagePacks=o.languagePacks??[]}else throw new Error("Invalid backup type");o.type==="binary"&&o.main instanceof Uint8Array&&(s.binaryBundle=o.main);let E=i!=null?Sn(i):n?.enterprise!=null;Xm(o)!==void 0&&(E?_.warn('The "enterprise" option in hydrateMapData is deprecated and ignored. Enterprise mode is now automatically detected from the MVF data.'):_.warn('The "enterprise" option in hydrateMapData is deprecated and will be removed in a future release. Please ensure your MVF bundle includes enterprise data for automatic detection.')),s.enterprise=E||(Xm(o)??!1),s.updatedAt=o.updatedAt}else n=o,s.enterprise=n.enterprise!=null;s.mvf3=i,Zc(e?.onMVFParsed,n);let l="key"in r&&"secret"in r,c="accessToken"in r&&r.accessToken;l&&op(r.key)&&(s.enterprise=!1),a.setEnterprise(s.enterprise??!1);let d=n!=null?Ri(n):i!=null?Di(i):[],p=d.length>0?d:[r.mapId];r.baseAuthUri=a.getBaseAuthUri(),r.baseUri=a.getBaseUri();let g=new sn(p,{...r,enterprise:s.enterprise}),m;if(c)m=r.accessToken;else if(l){let E;try{E=await g.getAccessTokenAsync()}catch(k){_.error("Failed getting token during hydrateMapData",k)}m=E?.token||""}if(s.outdoorViewToken=m,s.env=a,s.getMapDataOptions=r,s.tokenManager=g,r.prefetchTokens&&(l||c))try{await g.readySync()}catch(E){_.error("Failed to ready token manager!",E)}Vn()&&(s.enterprise&&_.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),r.mvfVersion!=="3.0.0"&&_.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let I=new cr(Jc(n,i,s.enterprise),s);m&&I.Analytics.init({accessToken:m,mapId:r.mapId,key:"key"in r?r.key:void 0,secret:"secret"in r?r.secret:void 0,enterprise:s.enterprise??!1,...r.analytics,baseUri:a.getAnalyticsBaseUri(),context:r.analytics?.context});let v=new En(I),y=I.findPreferredLanguage({languageCode:r.language,fallbackToNavigatorLanguage:!1});if(y)try{await v.changeLanguage(y.code)}catch{}return v};var Ym=`:root {
|
|
298
|
-
--pin-shadow-hover-scale: 0.9;
|
|
299
|
-
--pin-shadow-width: 12px;
|
|
300
|
-
--pin-shadow-height: 5px;
|
|
301
|
-
--pin-shadow-opacity: 0.35;
|
|
302
|
-
--pin-drop-animation-duration-ms: 250ms;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
@keyframes drop-pin {
|
|
306
|
-
0% {
|
|
307
|
-
transform: translateY(-200%);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
100% {
|
|
311
|
-
transform: translateY(0);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
@keyframes pin-shadow {
|
|
316
|
-
0% {
|
|
317
|
-
transform: scale(var(--pin-shadow-hover-scale));
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
100% {
|
|
321
|
-
transform: scale(1);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.mappedin-dropped-pin-wrapper {
|
|
326
|
-
position: relative;
|
|
327
|
-
|
|
328
|
-
width: fit-content;
|
|
329
|
-
height: fit-content;
|
|
330
|
-
width: 36px;
|
|
331
|
-
height: 42px;
|
|
332
|
-
|
|
333
|
-
& svg {
|
|
334
|
-
position: absolute;
|
|
335
|
-
left: calc(50% - var(--pin-shadow-width));
|
|
336
|
-
animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
& > .pin-shadow {
|
|
340
|
-
position: absolute;
|
|
341
|
-
left: calc(50% - (var(--pin-shadow-width) / 2));
|
|
342
|
-
bottom: 0;
|
|
343
|
-
|
|
344
|
-
height: var(--pin-shadow-height);
|
|
345
|
-
width: var(--pin-shadow-width);
|
|
346
|
-
border-radius: 100%;
|
|
347
|
-
|
|
348
|
-
opacity: var(--pin-shadow-opacity);
|
|
349
|
-
|
|
350
|
-
animation: pin-shadow 250ms ease-in;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@keyframes bounce {
|
|
355
|
-
0% {
|
|
356
|
-
transform: translateY(-10px);
|
|
357
|
-
opacity: 0;
|
|
358
|
-
}
|
|
359
|
-
12.5% {
|
|
360
|
-
transform: translateY(0);
|
|
361
|
-
opacity: 1;
|
|
362
|
-
}
|
|
363
|
-
25% {
|
|
364
|
-
transform: translateY(0);
|
|
365
|
-
}
|
|
366
|
-
37.5% {
|
|
367
|
-
transform: translateY(-10px);
|
|
368
|
-
}
|
|
369
|
-
50% {
|
|
370
|
-
transform: translateY(0);
|
|
371
|
-
}
|
|
372
|
-
62.5% {
|
|
373
|
-
transform: translateY(-10px);
|
|
374
|
-
}
|
|
375
|
-
75% {
|
|
376
|
-
transform: translateY(0);
|
|
377
|
-
}
|
|
378
|
-
87.5% {
|
|
379
|
-
transform: translateY(-10px);
|
|
380
|
-
}
|
|
381
|
-
100% {
|
|
382
|
-
transform: translateY(0);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.mappedin-connection-marker {
|
|
387
|
-
position: relative;
|
|
388
|
-
display: flex;
|
|
389
|
-
|
|
390
|
-
.bouncey {
|
|
391
|
-
animation: bounce 2.5s linear;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.arrow--down {
|
|
395
|
-
transform: rotate(180deg);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.connection-circle {
|
|
399
|
-
display: flex;
|
|
400
|
-
box-sizing: border-box;
|
|
401
|
-
justify-content: center;
|
|
402
|
-
align-items: center;
|
|
403
|
-
border-radius: 50%;
|
|
404
|
-
border: 2px solid white;
|
|
405
|
-
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
|
|
406
|
-
background: #595959;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
`;var Zm=`.mappedin-marker {
|
|
410
|
-
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
411
|
-
font-weight: normal;
|
|
412
|
-
top: 0;
|
|
413
|
-
position: absolute;
|
|
414
|
-
font-weight: bold;
|
|
415
|
-
color: black;
|
|
416
|
-
display: flex;
|
|
417
|
-
flex-direction: row;
|
|
418
|
-
will-change: transform, opacity;
|
|
419
|
-
transition: opacity 150ms ease-in-out;
|
|
420
|
-
justify-content: center;
|
|
421
|
-
opacity: 0;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/* Opt out of CSS opacity transitions when the marker has animated: false.
|
|
425
|
-
* Without this, direct style.opacity assignments (from DOMDrawSystem's snap
|
|
426
|
-
* path and from onStrategySelected) still fade over the CSS transition
|
|
427
|
-
* duration, and during that fade \`marker.animation\` is null so the transform
|
|
428
|
-
* update path is skipped \u2014 causing markers to drift if the camera is moving.
|
|
429
|
-
*/
|
|
430
|
-
.mappedin-marker[data-animated='false'] {
|
|
431
|
-
transition: none;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/* Low priority pin strategy styles */
|
|
435
|
-
|
|
436
|
-
/* Hide child elements as well */
|
|
437
|
-
.mappedin-marker[data-placement='hidden'] > .mappedin-marker-content {
|
|
438
|
-
visibility: hidden;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/* Create the pin using ::before pseudo-element */
|
|
442
|
-
.mappedin-marker::before {
|
|
443
|
-
content: '';
|
|
444
|
-
display: none;
|
|
445
|
-
border-radius: 50%;
|
|
446
|
-
position: relative;
|
|
447
|
-
/* Default values - will be overridden by inline styles */
|
|
448
|
-
width: var(--mappedin-pin-size, 2px);
|
|
449
|
-
height: var(--mappedin-pin-size, 2px);
|
|
450
|
-
background-color: var(--pin-color, #666);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.mappedin-marker[data-placement='hidden']::before {
|
|
454
|
-
display: block;
|
|
455
|
-
}
|
|
456
|
-
`;var Jm=`.mappedin__smart-collision-engine__container {
|
|
457
|
-
position: absolute;
|
|
458
|
-
left: 0px;
|
|
459
|
-
top: 0px;
|
|
460
|
-
bottom: 0px;
|
|
461
|
-
right: 0px;
|
|
462
|
-
pointer-events: none;
|
|
463
|
-
/* Establishes a stacking context so inner z-indexed canvases stay scoped
|
|
464
|
-
* here, and lifts the wrapper above the WebGL canvas (which carries
|
|
465
|
-
* \`z-index: 1\` as a webkit compositing workaround). */
|
|
466
|
-
z-index: 1;
|
|
467
|
-
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.mappedin__smart-collision-engine-debug__container {
|
|
471
|
-
position: absolute;
|
|
472
|
-
left: 0px;
|
|
473
|
-
top: 0px;
|
|
474
|
-
bottom: 0px;
|
|
475
|
-
right: 0px;
|
|
476
|
-
transition: opacity 300ms ease-in-out;
|
|
477
|
-
pointer-events: none;
|
|
478
|
-
will-change: opacity;
|
|
479
|
-
&.interacting {
|
|
480
|
-
opacity: 0.2;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
`;var qm=`.mappedin-map {
|
|
484
|
-
.mappedin-interactive {
|
|
485
|
-
cursor: grab;
|
|
486
|
-
|
|
487
|
-
&:active {
|
|
488
|
-
cursor: grabbing;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
&.mappedin-interaction-hover {
|
|
492
|
-
cursor: pointer;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
`;var Qm=`.mappedin-map {
|
|
497
|
-
.mappedin-control-container {
|
|
498
|
-
position: absolute;
|
|
499
|
-
left: 0px;
|
|
500
|
-
top: 0px;
|
|
501
|
-
bottom: 0px;
|
|
502
|
-
right: 0px;
|
|
503
|
-
pointer-events: none;
|
|
504
|
-
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
505
|
-
|
|
506
|
-
.mappedin-ctrl-top-left,
|
|
507
|
-
.mappedin-ctrl-top-right,
|
|
508
|
-
.mappedin-ctrl-bottom-left,
|
|
509
|
-
.mappedin-ctrl-bottom-right {
|
|
510
|
-
position: absolute;
|
|
511
|
-
pointer-events: none;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.mappedin-ctrl-top-left {
|
|
515
|
-
top: 0;
|
|
516
|
-
left: 0;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
.mappedin-ctrl-top-right {
|
|
520
|
-
top: 0;
|
|
521
|
-
right: 0;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
.mappedin-ctrl-bottom-left {
|
|
525
|
-
bottom: 0;
|
|
526
|
-
left: 0;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
.mappedin-ctrl-bottom-right {
|
|
530
|
-
bottom: 0;
|
|
531
|
-
right: 0;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.mappedin-ctrl-attrib {
|
|
535
|
-
display: block;
|
|
536
|
-
position: relative;
|
|
537
|
-
pointer-events: auto;
|
|
538
|
-
font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
539
|
-
padding: 3px 5px 1px 5px;
|
|
540
|
-
background-color: rgba(255, 255, 255, 0.5);
|
|
541
|
-
margin: 0;
|
|
542
|
-
min-width: 11px;
|
|
543
|
-
min-height: 11px;
|
|
544
|
-
user-select: none;
|
|
545
|
-
|
|
546
|
-
summary.mappedin-ctrl-attrib-button {
|
|
547
|
-
appearance: none;
|
|
548
|
-
list-style: none;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
summary.mappedin-ctrl-attrib-button::-webkit-details-marker {
|
|
552
|
-
display: none;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
&.mappedin-compact .mappedin-ctrl-attrib-button,
|
|
556
|
-
&.mappedin-compact-show .mappedin-ctrl-attrib-inner {
|
|
557
|
-
display: inline-block;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
&.mappedin-compact {
|
|
561
|
-
background-color: transparent;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
&.mappedin-compact-show {
|
|
565
|
-
min-width: 15px;
|
|
566
|
-
min-height: 15px;
|
|
567
|
-
box-sizing: border-box;
|
|
568
|
-
background-color: rgba(255, 255, 255, 0.5);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
.mappedin-ctrl-attrib-top-left {
|
|
573
|
-
float: left;
|
|
574
|
-
border-bottom-right-radius: 4px;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
.mappedin-ctrl-attrib-top-right {
|
|
578
|
-
float: right;
|
|
579
|
-
border-bottom-left-radius: 4px;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
.mappedin-ctrl-attrib-bottom-left {
|
|
583
|
-
float: left;
|
|
584
|
-
border-top-right-radius: 4px;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
.mappedin-ctrl-attrib-bottom-right {
|
|
588
|
-
float: right;
|
|
589
|
-
border-top-left-radius: 4px;
|
|
590
|
-
}
|
|
591
|
-
.mappedin-ctrl-attrib-top-left,
|
|
592
|
-
.mappedin-ctrl-attrib-bottom-left {
|
|
593
|
-
padding: 3px 5px 1px 20px;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
.mappedin-ctrl-attrib-inner {
|
|
597
|
-
display: inline-block;
|
|
598
|
-
margin-right: 12px;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.mappedin-ctrl-attrib-inner,
|
|
602
|
-
.mappedin-ctrl-attrib-inner a {
|
|
603
|
-
color: rgba(0, 0, 0, 0.75);
|
|
604
|
-
text-decoration: none;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.mappedin-ctrl-attrib-inner-bold,
|
|
608
|
-
.mappedin-ctrl-attrib-inner-bold a {
|
|
609
|
-
font-weight: bold;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
.mappedin-ctrl-attrib-inner a:hover {
|
|
613
|
-
color: #017ef1;
|
|
614
|
-
text-decoration: underline;
|
|
615
|
-
cursor: pointer;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
.mappedin-ctrl-attrib-button {
|
|
619
|
-
display: none;
|
|
620
|
-
cursor: pointer;
|
|
621
|
-
position: absolute;
|
|
622
|
-
width: 15px;
|
|
623
|
-
height: 15px;
|
|
624
|
-
box-sizing: border-box;
|
|
625
|
-
border-radius: 50%;
|
|
626
|
-
top: 0;
|
|
627
|
-
right: 2px;
|
|
628
|
-
border: 1px;
|
|
629
|
-
}
|
|
630
|
-
.mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,
|
|
631
|
-
.mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {
|
|
632
|
-
left: 2px;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
`;var Km='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}';var ey=`.mappedin-annotation-marker {
|
|
637
|
-
--mappedin-annotation-border-radius: 5px;
|
|
638
|
-
--mappedin-annotation-border-width: 2px;
|
|
639
|
-
--mappedin-annotation-background-color: #ffffff;
|
|
640
|
-
--mappedin-annotation-scale: 0.7;
|
|
641
|
-
|
|
642
|
-
position: relative;
|
|
643
|
-
box-sizing: border-box;
|
|
644
|
-
border-radius: var(--mappedin-annotation-border-radius);
|
|
645
|
-
border: var(--mappedin-annotation-border-width) solid var(--mappedin-annotation-background-color);
|
|
646
|
-
|
|
647
|
-
transform: scale(var(--mappedin-annotation-scale)) translateY(0rem);
|
|
648
|
-
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
|
|
649
|
-
|
|
650
|
-
img {
|
|
651
|
-
position: absolute;
|
|
652
|
-
image-rendering: crisp-edges;
|
|
653
|
-
top: 0px;
|
|
654
|
-
|
|
655
|
-
object-fit: contain;
|
|
656
|
-
border-radius: calc(var(--mappedin-annotation-border-radius) - var(--mappedin-annotation-border-width));
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
`;f();function Qv(o){if(!o)return;let{outdoorView:e,__EXPERIMENTAL_shadows:t,...r}=o,n=e?{headers:e.token?{"x-mappedin-tiles-key":e.token}:void 0,style:e.style,enabled:e.enabled??!!e.token,lowDpi:e.lowDpi,__EXPERIMENTAL_CameraControlsMode:e.__EXPERIMENTAL_CameraControlsMode}:void 0;return{...r,outdoorView:n,shadows:Xs(o)}}f();function Kv(o){if(!(!o.languages||!un()||!globalThis.navigator?.languages?.length))for(let e=0;e<globalThis.navigator.languages.length;e++){let t=o.languages.find(r=>r.code.toLowerCase()===globalThis.navigator.languages[e].toLowerCase());if(t)return{code:t.code,name:t.name}}}function Nl(o,e){let t=e?.languageCode??"",r=e?.fallbackToNavigatorLanguage??!0,n=o?.languages?.find(a=>a.code.toLowerCase()===t.toLowerCase()),i;if(n)i=n;else if(r??!0)try{let a=Kv(o);a&&(i=a)}catch(a){_.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",a)}return i??o.defaultLanguage}var e0=[Ym,Zm,Jm,qm,Qm,Km,ey],ty;function Zk(o){ty=o}var Jk=async(o,e)=>{let t,r=Ao();e&&r.updateByUserOption(e);try{e&&(t=(await bn({...e,baseAuthUri:r.getBaseAuthUri()})).accessToken)}catch(a){_.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new cr(o,{outdoorViewToken:t,languagePacks:e?.languagePacks,env:r});return new En(n)},oy=!1;function qk(o){oy=o}var ry=!1;function Qk(o){ry=o}function Vn(){return ry}var t0=async o=>{let e=oy,t,r=Ao();r.updateByUserOption(o);let n={prefetchTokens:!0,...o,fallbackToNavigatorLanguage:o.fallbackToNavigatorLanguage??!0},i=n.bundleUri!=null,a="accessToken"in n&&typeof n.accessToken=="string"?n.accessToken:void 0,s="key"in n&&typeof n.key=="string"?n.key:void 0,l="secret"in n&&typeof n.secret=="string"?n.secret:void 0,c=a!=null,d=s!=null&&l!=null;i&&(n.viewId!=null||n.mvfVersion!=null)&&_.warn("bundleUri already names a specific export; viewId and mvfVersion are ignored.");let p=new sn([n.mapId],n);if(c){t=a;let{aud:N,sub:q}=Ei(t);(Pp.some(oe=>N.includes(oe))||q&&q.startsWith("client"))&&(e=!0,r.setEnterprise(e),p.setEnterprise(e))}else if(d){if(s.startsWith("mipk_"))throw new Error(`Partner API keys detected!
|
|
660
|
-
|
|
661
|
-
Partner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.`);s.startsWith("mik_")||(e=!0,r.setEnterprise(e),p.setEnterprise(e)),n.baseAuthUri=r.getBaseAuthUri();let N;try{N=await p.getAccessTokenAsync(),t=N?.token}catch(q){if(_.warn("Get access token failed",q.message),!i)throw new Error("Get access token failed: "+q.message)}}else if(!i)throw new Error("Missing key or secret.");i&&e&&_.warn("bundleUri takes precedence over the enterprise bundle resolver. The supplied URL is downloaded as-is, so layoutId and API gateway locale packs are not applied."),n.layoutId!=null&&(e?n.layoutId!=="draft"&&_.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):_.warn("layoutId is currently unsupported!")),n.baseUri=r.getBaseUri();let g=performance.now(),m,I,v="";if(i||!e){let{compressed:N,updated_at:q}=await As(n,t);m=N,v=q??""}else{let N=vn(n),q=await ws(N);m=q.compressed,I=q.localePacks,v=q.updated_at??""}let y=performance.now(),E=await ki(m,i?void 0:n.mvfVersion),k=E.kind==="v2"?E.mvf2:void 0,w=E.mvf3,B=performance.now();Zc(o.onMVFParsed,k),i&&!d&&!c&&(w!=null?Sn(w):k?.enterprise!=null)&&(e=!0,r.setEnterprise(e),p.setEnterprise(e));let D=k!=null?Ri(k):w!=null?Di(w):[];if(D.length>0?p.setMapIds(D):p.setMapIds([n.mapId]),n.prefetchTokens&&(d||c))try{await p.readySync()}catch(N){_.error("Failed to ready token manager!",N)}Vn()&&(e&&_.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),n.mvfVersion!=="3.0.0"&&_.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let j=new cr(Jc(k,w,e),{env:r,outdoorViewToken:t,tokenManager:p,enterprise:e,localePacksUrls:I,binaryBundle:m,getMapDataOptions:n,mvf3:w,updatedAt:v}),G=new En(j,{search:o.search});t&&(j.Analytics.init({accessToken:t,mapId:n.mapId,key:s,secret:l,enterprise:e,...n.analytics,baseUri:r.getAnalyticsBaseUri(),context:n.analytics?.context}),j.Analytics.sendGetMapDataEvent({parseDurationMs:B-y,downloadDurationMs:y-g,viewId:n.viewId}));let W=j.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:n.fallbackToNavigatorLanguage});if(W)try{await G.changeLanguage(W.code)}catch{}return G},Kk=t0,o0=async()=>{if(cs===""||ps==="")return!1;let o=[fetch(cs,{mode:"same-origin"}),fetch(ps,{mode:"same-origin"})],[e,t]=[{ok:!1},{ok:!1}];try{[e,t]=await Promise.all(o)}catch{}return{collision:e.ok,maplibre:t.ok}},qc=new WeakSet,r0=async(o,e,t)=>{let r=performance.now();qc.has(o)&&_.warn("show3dMap was called on a container that already has an active MapView. Call destroy() on the existing MapView before creating a new one to avoid resource leaks.");let n=Ys(t,e);n&&$s(n),(n.injectStyles??!0)&&Gc(e0,{id:"mappedin__styles"});let i=wp(e.outdoorViewToken??""),a=Cn(e);n.outdoorView?.style&&a.envControl.updateTileServerBaseUrl(n.outdoorView?.style);let s=a.tokenManager,l=s?async()=>{try{return(await s.getAccessTokenAsync(!0))?.token}catch(I){_.warn("Failed to refresh outdoor tiles token:",I);return}}:void 0,c=!1,d=!1,p=_d()?!1:await o0();p&&(p.collision||(c=!0),p.maplibre||(d=!0));let g=await Dd(o,{center:[e.mapCenter.longitude,e.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:n.style?.backgroundAlpha,backgroundColor:n.style?.backgroundColor,outdoorView:!d&&n.outdoorView?.token?{headers:{"x-mappedin-tiles-key":n.outdoorView?.token},style:e.getEnv().tileServerUri,enabled:!!n.outdoorView?.enabled,lowDpi:n.outdoorView?.lowDpi,refreshToken:l,__EXPERIMENTAL_CameraControlsMode:n.outdoorView?.__EXPERIMENTAL_CameraControlsMode}:void 0,watermark:{...n.watermark,visible:n.watermark?.visible??(!a.enterpriseMode&&!i.remove_watermark),onClick:ty||void 0},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!n.antialiasing?.enabled,accessToken:e.outdoorViewToken,occlusionEnabled:!0,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:e.naturalBearing,imagePlacementOptions:n.imagePlacementOptions,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:n.onWebGLContextRestored,onWebGLRendererError:n.onWebGLRendererError,useStandaloneCamera:n.useStandaloneCamera??!1,useWorkers:!(n.disableWorkers??!1),useCollisionWorker:!c,disableUpdateStateValidation:n.disableUpdateStateValidation??!1,shadows:n.shadows,__TEST_synchronousIdleWork:n.__TEST_synchronousIdleWork??(Rd()?{enabled:!0,maxDelay:100}:void 0),outlines:typeof n.style?.outlines=="object"?n.style.outlines:void 0}),m=new mi(g);return await m.addMap(e,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDurationMs:performance.now()-r,dimension:m.getDimensions(),collisionWorkerDisabled:c,outdoorsWorkerDisabled:d}),qc.add(o),m.on("destroy",()=>qc.delete(o)),m},e8=()=>x.env.npm_package_version,t8=r0;export{Ip as a,Ds as b,ki as c,X as d,it as e,rr as f,io as g,Ue as h,Tb as i,$e as j,Ae as k,Te as l,Xe as m,Ee as n,Le as o,ft as p,ht as q,Lo as r,Ce as s,at as t,zi as u,gl as v,Cu as w,yl as x,_u as y,$i as z,Xi as A,co as B,zt as C,Gr as D,Wl as E,nI as F,tc as G,oc as H,Lv as I,mi as J,Wv as K,Qv as L,Nl as M,Zk as N,Jk as O,qk as P,Qk as Q,Vn as R,t0 as S,Kk as T,o0 as U,r0 as V,e8 as W,t8 as X};
|