@mappedin/mappedin-js 6.0.0-rc.4 → 6.0.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/README.md +10 -6
- package/THIRD_PARTY_LICENSES.txt +17 -17
- package/lib/esm/{GLTFExporter-22SRWSNV.js → GLTFExporter-KUER62PN.js} +2 -2
- package/lib/esm/{GLTFLoader-SWPNQTFP.js → GLTFLoader-57WSAB45.js} +2 -2
- package/lib/esm/{browser-GGPMSNFY.js → browser-UGYWVBRR.js} +2 -2
- package/lib/esm/{chunk-I32KNH7E.js → chunk-5DZ5ZUCE.js} +2 -2
- package/lib/esm/chunk-AYCAEKWF.js +2 -0
- package/lib/esm/{chunk-3GOFR3M6.js.map → chunk-AYCAEKWF.js.map} +2 -2
- package/lib/esm/{chunk-MDSV6XJR.js → chunk-KDUATTJY.js} +2 -2
- package/lib/esm/chunk-LZEM3W53.js +1992 -0
- package/lib/esm/chunk-LZEM3W53.js.map +7 -0
- package/lib/esm/{chunk-AFELLAS6.js → chunk-PPU5YL3P.js} +4 -4
- package/lib/esm/{chunk-AFELLAS6.js.map → chunk-PPU5YL3P.js.map} +3 -3
- package/lib/esm/{chunk-VWOFYLSM.js → chunk-QT66THSW.js} +2 -2
- package/lib/esm/index.d.ts +3881 -3792
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-HQV23IML.js → inspector-YYGLNTAO.js} +9 -9
- package/lib/esm/inspector-YYGLNTAO.js.map +7 -0
- package/lib/esm/{internal-MAULC22C.js → internal-HAIAUKR7.js} +2 -2
- package/lib/esm/{outdoor-context-v5-5KBHPW76.js → outdoor-context-v5-2BM4DXHN.js} +2 -2
- package/lib/esm/{text3d-HT6TS3WO.js → text3d-DDCRVC2T.js} +2 -2
- package/lib/index-rn.js +191 -191
- package/package.json +1 -4
- package/lib/esm/chunk-3GOFR3M6.js +0 -2
- package/lib/esm/chunk-GAHPB2XK.js +0 -1992
- package/lib/esm/chunk-GAHPB2XK.js.map +0 -7
- package/lib/esm/inspector-HQV23IML.js.map +0 -7
- /package/lib/esm/{GLTFExporter-22SRWSNV.js.map → GLTFExporter-KUER62PN.js.map} +0 -0
- /package/lib/esm/{GLTFLoader-SWPNQTFP.js.map → GLTFLoader-57WSAB45.js.map} +0 -0
- /package/lib/esm/{browser-GGPMSNFY.js.map → browser-UGYWVBRR.js.map} +0 -0
- /package/lib/esm/{chunk-I32KNH7E.js.map → chunk-5DZ5ZUCE.js.map} +0 -0
- /package/lib/esm/{chunk-MDSV6XJR.js.map → chunk-KDUATTJY.js.map} +0 -0
- /package/lib/esm/{chunk-VWOFYLSM.js.map → chunk-QT66THSW.js.map} +0 -0
- /package/lib/esm/{internal-MAULC22C.js.map → internal-HAIAUKR7.js.map} +0 -0
- /package/lib/esm/{outdoor-context-v5-5KBHPW76.js.map → outdoor-context-v5-2BM4DXHN.js.map} +0 -0
- /package/lib/esm/{text3d-HT6TS3WO.js.map → text3d-DDCRVC2T.js.map} +0 -0
|
@@ -0,0 +1,1992 @@
|
|
|
1
|
+
import{$ as P0,$a as gy,A as FC,Aa as uy,Ab as Pp,B as Nl,Ba as my,Bb as H0,C as DC,Ca as KC,Cb as xy,D as kC,Da as QC,Db as EM,E as w0,Ea as qC,Eb as z0,F as ki,Fa as eM,Fb as PM,G as ly,Ga as tM,Gb as FM,H as Fs,Ha as B0,Hb as DM,I as jl,Ia as rM,Ib as kM,J as AC,Ja as oM,Jb as AM,K as LC,Ka as Mp,Kb as LM,L as _C,La as nM,Lb as Li,M as RC,Ma as iM,Mb as _M,N as fm,Na as fy,Nb as Ht,O as Po,Oa as N0,Ob as RM,P as BC,Pa as sM,Pb as BM,Q as O0,Qa as bm,Qb as Ri,R as Ai,Ra as wp,Rb as NM,S as NC,Sa as hy,Sb as fr,T as Ip,Ta as Op,Tb as Zn,U as F,Ua as Ep,Ub as hr,V as J,Va as aM,W as cy,Wa as j0,X as Sp,Y as hm,Ya as lM,Z as jC,Za as cM,_ as E0,_a as pM,aa as GC,ab as dM,ba as UC,bb as uM,c as A,ca as VC,cb as mM,d as wr,da as Ds,db as fM,e as nC,ea as $C,eb as hM,f as I0,fa as F0,fb as xm,g as Fi,ga as HC,gb as zo,h as MC,ha as ks,hb as gM,i as ny,ia as k0,ib as yM,j as wC,ja as Ga,jb as bM,k as Di,ka as Mt,kb as G0,l as iy,la as py,lb as xM,m as OC,ma as gm,mb as U0,n as sy,na as A0,nb as V0,o as Bl,oa as dy,ob as yy,p as um,pa as L0,pb as vM,q as C0,qa as _0,qb as IM,r as vp,ra as R0,rb as SM,s as ut,sa as ZC,sb as TM,t as ay,ta as Tp,tb as $0,u as ke,ua as XC,ub as CM,v as Ps,va as Cp,vb as Ua,w as mm,wa as ym,wb as by,x as M0,xa as YC,xb as MM,y as EC,ya as JC,yb as wM,z as PC,zb as OM}from"./chunk-PPU5YL3P.js";import{X as D0,ea as WC,w as zC}from"./chunk-5DZ5ZUCE.js";import{a as _i}from"./chunk-KDUATTJY.js";import{$ as Le,Aa as ty,B as Yg,Ba as bC,C as Jg,Ca as Na,D as lC,Da as ja,E as cC,Ea as Es,Fa as ry,G as pC,Ga as xC,H as Ue,Ha as vC,I as Me,Ja as Ei,M as dC,N as uC,O as mC,P as Kg,Q as ae,R as sr,S as fC,T as zn,Ta as xp,U as yp,V as Os,W as ar,Xa as oy,Y as Nr,Ya as IC,Z as po,_ as Qg,aa as Wn,ab as SC,b as Zg,c as cm,ca as _a,cb as Pi,d as S0,da as hC,e as ws,ea as T0,eb as TC,f as iC,g as pm,ga as Ra,gb as CC,oa as Ba,p as sC,pa as qg,qa as ey,r as aC,ra as gC,ta as dm,ya as yC,z as Xg,za as bp}from"./chunk-QT66THSW.js";import{a as d,b as y}from"./chunk-AYCAEKWF.js";import{b as Ms,c as La,d as gp,e as m,f as s,g as S,h as w,i as W}from"./chunk-ROCNZJLL.js";var UF=Ms((iS,sS)=>{d();(function(e,r){typeof iS=="object"&&typeof sS<"u"?sS.exports=r():typeof define=="function"&&define.amd?define(r):(e=e||self,e.TinyQueue=r())})(iS,function(){"use strict";var e=function(o,n){if(o===void 0&&(o=[]),n===void 0&&(n=r),this.data=o,this.length=this.data.length,this.compare=n,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};e.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(this.length!==0){var o=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this._down(0)),o}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(o){for(var n=this,i=n.data,a=n.compare,l=i[o];o>0;){var c=o-1>>1,p=i[c];if(a(l,p)>=0)break;i[o]=p,o=c}i[o]=l},e.prototype._down=function(o){for(var n=this,i=n.data,a=n.compare,l=this.length>>1,c=i[o];o<l;){var p=(o<<1)+1,u=i[p],f=p+1;if(f<this.length&&a(i[f],u)<0&&(p=f,u=i[f]),a(u,c)>=0)break;i[o]=u,o=p}i[o]=c};function r(t,o){return t<o?-1:t>o?1:0}return e})});var $F=Ms((_0e,aS)=>{"use strict";d();var e1=UF();e1.default&&(e1=e1.default);aS.exports=VF;aS.exports.default=VF;function VF(e,r,t){r=r||1;for(var o,n,i,a,l=0;l<e[0].length;l++){var c=e[0][l];(!l||c[0]<o)&&(o=c[0]),(!l||c[1]<n)&&(n=c[1]),(!l||c[0]>i)&&(i=c[0]),(!l||c[1]>a)&&(a=c[1])}var p=i-o,u=a-n,f=Math.min(p,u),h=f/2;if(f===0){var b=[o,n];return b.distance=0,b}for(var v=new e1(void 0,SU),T=o;T<i;T+=f)for(var x=n;x<a;x+=f)v.push(new el(T+h,x+h,h,e));var I=CU(e),M=new el(o+p/2,n+u/2,0,e);M.d>I.d&&(I=M);for(var O=v.length;v.length;){var C=v.pop();C.d>I.d&&(I=C,t&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,O)),!(C.max-I.d<=r)&&(h=C.h/2,v.push(new el(C.x-h,C.y-h,h,e)),v.push(new el(C.x+h,C.y-h,h,e)),v.push(new el(C.x-h,C.y+h,h,e)),v.push(new el(C.x+h,C.y+h,h,e)),O+=4)}t&&(console.log("num probes: "+O),console.log("best distance: "+I.d));var E=[I.x,I.y];return E.distance=I.d,E}function SU(e,r){return r.max-e.max}function el(e,r,t,o){this.x=e,this.y=r,this.h=t,this.d=TU(e,r,o),this.max=this.d+this.h*Math.SQRT2}function TU(e,r,t){for(var o=!1,n=1/0,i=0;i<t.length;i++)for(var a=t[i],l=0,c=a.length,p=c-1;l<c;p=l++){var u=a[l],f=a[p];u[1]>r!=f[1]>r&&e<(f[0]-u[0])*(r-u[1])/(f[1]-u[1])+u[0]&&(o=!o),n=Math.min(n,MU(e,r,u,f))}return n===0?0:(o?1:-1)*Math.sqrt(n)}function CU(e){for(var r=0,t=0,o=0,n=e[0],i=0,a=n.length,l=a-1;i<a;l=i++){var c=n[i],p=n[l],u=c[0]*p[1]-p[0]*c[1];t+=(c[0]+p[0])*u,o+=(c[1]+p[1])*u,r+=u*3}return r===0?new el(n[0][0],n[0][1],0,e):new el(t/r,o/r,0,e)}function MU(e,r,t,o){var n=t[0],i=t[1],a=o[0]-n,l=o[1]-i;if(a!==0||l!==0){var c=((e-n)*a+(r-i)*l)/(a*a+l*l);c>1?(n=o[0],i=o[1]):c>0&&(n+=a*c,i+=l*c)}return a=e-n,l=r-i,a*a+l*l}});var d5=Ms((bS,xS)=>{d();(function(e,r){typeof bS=="object"&&typeof xS<"u"?xS.exports=r():typeof define=="function"&&define.amd?define(r):(e=e||self).RBush=r()})(bS,function(){"use strict";function e(x,I,M,O,C){(function E(_,G,R,N,X){for(;N>R;){if(N-R>600){var z=N-R+1,ee=G-R+1,re=Math.log(z),ue=.5*Math.exp(2*re/3),Ce=.5*Math.sqrt(re*ue*(z-ue)/z)*(ee-z/2<0?-1:1),Oe=Math.max(R,Math.floor(G-ee*ue/z+Ce)),Pe=Math.min(N,Math.floor(G+(z-ee)*ue/z+Ce));E(_,G,Oe,Pe,X)}var Fe=_[G],ce=R,Ee=N;for(r(_,R,G),X(_[N],Fe)>0&&r(_,R,N);ce<Ee;){for(r(_,ce,Ee),ce++,Ee--;X(_[ce],Fe)<0;)ce++;for(;X(_[Ee],Fe)>0;)Ee--}X(_[R],Fe)===0?r(_,R,Ee):r(_,++Ee,N),Ee<=G&&(R=Ee+1),G<=Ee&&(N=Ee-1)}})(x,I,M||0,O||x.length-1,C||t)}function r(x,I,M){var O=x[I];x[I]=x[M],x[M]=O}function t(x,I){return x<I?-1:x>I?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(x,I,M){if(!M)return I.indexOf(x);for(var O=0;O<I.length;O++)if(M(x,I[O]))return O;return-1}function i(x,I){a(x,0,x.children.length,I,x)}function a(x,I,M,O,C){C||(C=v(null)),C.minX=1/0,C.minY=1/0,C.maxX=-1/0,C.maxY=-1/0;for(var E=I;E<M;E++){var _=x.children[E];l(C,x.leaf?O(_):_)}return C}function l(x,I){return x.minX=Math.min(x.minX,I.minX),x.minY=Math.min(x.minY,I.minY),x.maxX=Math.max(x.maxX,I.maxX),x.maxY=Math.max(x.maxY,I.maxY),x}function c(x,I){return x.minX-I.minX}function p(x,I){return x.minY-I.minY}function u(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function f(x){return x.maxX-x.minX+(x.maxY-x.minY)}function h(x,I){return x.minX<=I.minX&&x.minY<=I.minY&&I.maxX<=x.maxX&&I.maxY<=x.maxY}function b(x,I){return I.minX<=x.maxX&&I.minY<=x.maxY&&I.maxX>=x.minX&&I.maxY>=x.minY}function v(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(x,I,M,O,C){for(var E=[I,M];E.length;)if(!((M=E.pop())-(I=E.pop())<=O)){var _=I+Math.ceil((M-I)/O/2)*O;e(x,_,I,M,C),E.push(I,_,_,M)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var I=this.data,M=[];if(!b(x,I))return M;for(var O=this.toBBox,C=[];I;){for(var E=0;E<I.children.length;E++){var _=I.children[E],G=I.leaf?O(_):_;b(x,G)&&(I.leaf?M.push(_):h(x,G)?this._all(_,M):C.push(_))}I=C.pop()}return M},o.prototype.collides=function(x){var I=this.data;if(!b(x,I))return!1;for(var M=[];I;){for(var O=0;O<I.children.length;O++){var C=I.children[O],E=I.leaf?this.toBBox(C):C;if(b(x,E)){if(I.leaf||h(x,E))return!0;M.push(C)}}I=M.pop()}return!1},o.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var I=0;I<x.length;I++)this.insert(x[I]);return this}var M=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===M.height)this._splitRoot(this.data,M);else{if(this.data.height<M.height){var O=this.data;this.data=M,M=O}this._insert(M,this.data.height-M.height-1,!0)}else this.data=M;return this},o.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},o.prototype.clear=function(){return this.data=v([]),this},o.prototype.remove=function(x,I){if(!x)return this;for(var M,O,C,E=this.data,_=this.toBBox(x),G=[],R=[];E||G.length;){if(E||(E=G.pop(),O=G[G.length-1],M=R.pop(),C=!0),E.leaf){var N=n(x,E.children,I);if(N!==-1)return E.children.splice(N,1),G.push(E),this._condense(G),this}C||E.leaf||!h(E,_)?O?(M++,E=O.children[M],C=!1):E=null:(G.push(E),R.push(M),M=0,O=E,E=E.children[0])}return this},o.prototype.toBBox=function(x){return x},o.prototype.compareMinX=function(x,I){return x.minX-I.minX},o.prototype.compareMinY=function(x,I){return x.minY-I.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(x){return this.data=x,this},o.prototype._all=function(x,I){for(var M=[];x;)x.leaf?I.push.apply(I,x.children):M.push.apply(M,x.children),x=M.pop();return I},o.prototype._build=function(x,I,M,O){var C,E=M-I+1,_=this._maxEntries;if(E<=_)return i(C=v(x.slice(I,M+1)),this.toBBox),C;O||(O=Math.ceil(Math.log(E)/Math.log(_)),_=Math.ceil(E/Math.pow(_,O-1))),(C=v([])).leaf=!1,C.height=O;var G=Math.ceil(E/_),R=G*Math.ceil(Math.sqrt(_));T(x,I,M,R,this.compareMinX);for(var N=I;N<=M;N+=R){var X=Math.min(N+R-1,M);T(x,N,X,G,this.compareMinY);for(var z=N;z<=X;z+=G){var ee=Math.min(z+G-1,X);C.children.push(this._build(x,z,ee,O-1))}}return i(C,this.toBBox),C},o.prototype._chooseSubtree=function(x,I,M,O){for(;O.push(I),!I.leaf&&O.length-1!==M;){for(var C=1/0,E=1/0,_=void 0,G=0;G<I.children.length;G++){var R=I.children[G],N=u(R),X=(z=x,ee=R,(Math.max(ee.maxX,z.maxX)-Math.min(ee.minX,z.minX))*(Math.max(ee.maxY,z.maxY)-Math.min(ee.minY,z.minY))-N);X<E?(E=X,C=N<C?N:C,_=R):X===E&&N<C&&(C=N,_=R)}I=_||I.children[0]}var z,ee;return I},o.prototype._insert=function(x,I,M){var O=M?x:this.toBBox(x),C=[],E=this._chooseSubtree(O,this.data,I,C);for(E.children.push(x),l(E,O);I>=0&&C[I].children.length>this._maxEntries;)this._split(C,I),I--;this._adjustParentBBoxes(O,C,I)},o.prototype._split=function(x,I){var M=x[I],O=M.children.length,C=this._minEntries;this._chooseSplitAxis(M,C,O);var E=this._chooseSplitIndex(M,C,O),_=v(M.children.splice(E,M.children.length-E));_.height=M.height,_.leaf=M.leaf,i(M,this.toBBox),i(_,this.toBBox),I?x[I-1].children.push(_):this._splitRoot(M,_)},o.prototype._splitRoot=function(x,I){this.data=v([x,I]),this.data.height=x.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,I,M){for(var O,C,E,_,G,R,N,X=1/0,z=1/0,ee=I;ee<=M-I;ee++){var re=a(x,0,ee,this.toBBox),ue=a(x,ee,M,this.toBBox),Ce=(C=re,E=ue,_=void 0,G=void 0,R=void 0,N=void 0,_=Math.max(C.minX,E.minX),G=Math.max(C.minY,E.minY),R=Math.min(C.maxX,E.maxX),N=Math.min(C.maxY,E.maxY),Math.max(0,R-_)*Math.max(0,N-G)),Oe=u(re)+u(ue);Ce<X?(X=Ce,O=ee,z=Oe<z?Oe:z):Ce===X&&Oe<z&&(z=Oe,O=ee)}return O||M-I},o.prototype._chooseSplitAxis=function(x,I,M){var O=x.leaf?this.compareMinX:c,C=x.leaf?this.compareMinY:p;this._allDistMargin(x,I,M,O)<this._allDistMargin(x,I,M,C)&&x.children.sort(O)},o.prototype._allDistMargin=function(x,I,M,O){x.children.sort(O);for(var C=this.toBBox,E=a(x,0,I,C),_=a(x,M-I,M,C),G=f(E)+f(_),R=I;R<M-I;R++){var N=x.children[R];l(E,x.leaf?C(N):N),G+=f(E)}for(var X=M-I-1;X>=I;X--){var z=x.children[X];l(_,x.leaf?C(z):z),G+=f(_)}return G},o.prototype._adjustParentBBoxes=function(x,I,M){for(var O=M;O>=0;O--)l(I[O],x)},o.prototype._condense=function(x){for(var I=x.length-1,M=void 0;I>=0;I--)x[I].children.length===0?I>0?(M=x[I-1].children).splice(M.indexOf(x[I]),1):this.clear():i(x[I],this.toBBox)},o})});var CS=Ms(xe=>{"use strict";d();Object.defineProperty(xe,"__esModule",{value:!0});xe.earthRadius=63710088e-1;xe.factors={centimeters:xe.earthRadius*100,centimetres:xe.earthRadius*100,degrees:xe.earthRadius/111325,feet:xe.earthRadius*3.28084,inches:xe.earthRadius*39.37,kilometers:xe.earthRadius/1e3,kilometres:xe.earthRadius/1e3,meters:xe.earthRadius,metres:xe.earthRadius,miles:xe.earthRadius/1609.344,millimeters:xe.earthRadius*1e3,millimetres:xe.earthRadius*1e3,nauticalmiles:xe.earthRadius/1852,radians:1,yards:xe.earthRadius*1.0936};xe.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/xe.earthRadius,yards:1.0936133};xe.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function ol(e,r,t){t===void 0&&(t={});var o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=r||{},o.geometry=e,o}xe.feature=ol;function gV(e,r,t){switch(t===void 0&&(t={}),e){case"Point":return vS(r).geometry;case"LineString":return SS(r).geometry;case"Polygon":return IS(r).geometry;case"MultiPoint":return m5(r).geometry;case"MultiLineString":return u5(r).geometry;case"MultiPolygon":return f5(r).geometry;default:throw new Error(e+" is invalid")}}xe.geometry=gV;function vS(e,r,t){if(t===void 0&&(t={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!a1(e[0])||!a1(e[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:e};return ol(o,r,t)}xe.point=vS;function yV(e,r,t){return t===void 0&&(t={}),l1(e.map(function(o){return vS(o,r)}),t)}xe.points=yV;function IS(e,r,t){t===void 0&&(t={});for(var o=0,n=e;o<n.length;o++){var i=n[o];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return ol(l,r,t)}xe.polygon=IS;function bV(e,r,t){return t===void 0&&(t={}),l1(e.map(function(o){return IS(o,r)}),t)}xe.polygons=bV;function SS(e,r,t){if(t===void 0&&(t={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:e};return ol(o,r,t)}xe.lineString=SS;function xV(e,r,t){return t===void 0&&(t={}),l1(e.map(function(o){return SS(o,r)}),t)}xe.lineStrings=xV;function l1(e,r){r===void 0&&(r={});var t={type:"FeatureCollection"};return r.id&&(t.id=r.id),r.bbox&&(t.bbox=r.bbox),t.features=e,t}xe.featureCollection=l1;function u5(e,r,t){t===void 0&&(t={});var o={type:"MultiLineString",coordinates:e};return ol(o,r,t)}xe.multiLineString=u5;function m5(e,r,t){t===void 0&&(t={});var o={type:"MultiPoint",coordinates:e};return ol(o,r,t)}xe.multiPoint=m5;function f5(e,r,t){t===void 0&&(t={});var o={type:"MultiPolygon",coordinates:e};return ol(o,r,t)}xe.multiPolygon=f5;function vV(e,r,t){t===void 0&&(t={});var o={type:"GeometryCollection",geometries:e};return ol(o,r,t)}xe.geometryCollection=vV;function IV(e,r){if(r===void 0&&(r=0),r&&!(r>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,r||0);return Math.round(e*t)/t}xe.round=IV;function h5(e,r){r===void 0&&(r="kilometers");var t=xe.factors[r];if(!t)throw new Error(r+" units is invalid");return e*t}xe.radiansToLength=h5;function TS(e,r){r===void 0&&(r="kilometers");var t=xe.factors[r];if(!t)throw new Error(r+" units is invalid");return e/t}xe.lengthToRadians=TS;function SV(e,r){return g5(TS(e,r))}xe.lengthToDegrees=SV;function TV(e){var r=e%360;return r<0&&(r+=360),r}xe.bearingToAzimuth=TV;function g5(e){var r=e%(2*Math.PI);return r*180/Math.PI}xe.radiansToDegrees=g5;function CV(e){var r=e%360;return r*Math.PI/180}xe.degreesToRadians=CV;function MV(e,r,t){if(r===void 0&&(r="kilometers"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("length must be a positive number");return h5(TS(e,r),t)}xe.convertLength=MV;function wV(e,r,t){if(r===void 0&&(r="meters"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("area must be a positive number");var o=xe.areaFactors[r];if(!o)throw new Error("invalid original units");var n=xe.areaFactors[t];if(!n)throw new Error("invalid final units");return e/o*n}xe.convertArea=wV;function a1(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}xe.isNumber=a1;function OV(e){return!!e&&e.constructor===Object}xe.isObject=OV;function EV(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(r){if(!a1(r))throw new Error("bbox must only contain numbers")})}xe.validateBBox=EV;function PV(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}xe.validateId=PV});var wS=Ms(br=>{"use strict";d();Object.defineProperty(br,"__esModule",{value:!0});var so=CS();function gf(e,r,t){if(e!==null)for(var o,n,i,a,l,c,p,u=0,f=0,h,b=e.type,v=b==="FeatureCollection",T=b==="Feature",x=v?e.features.length:1,I=0;I<x;I++){p=v?e.features[I].geometry:T?e.geometry:e,h=p?p.type==="GeometryCollection":!1,l=h?p.geometries.length:1;for(var M=0;M<l;M++){var O=0,C=0;if(a=h?p.geometries[M]:p,a!==null){c=a.coordinates;var E=a.type;switch(u=t&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(r(c,f,I,O,C)===!1)return!1;f++,O++;break;case"LineString":case"MultiPoint":for(o=0;o<c.length;o++){if(r(c[o],f,I,O,C)===!1)return!1;f++,E==="MultiPoint"&&O++}E==="LineString"&&O++;break;case"Polygon":case"MultiLineString":for(o=0;o<c.length;o++){for(n=0;n<c[o].length-u;n++){if(r(c[o][n],f,I,O,C)===!1)return!1;f++}E==="MultiLineString"&&O++,E==="Polygon"&&C++}E==="Polygon"&&O++;break;case"MultiPolygon":for(o=0;o<c.length;o++){for(C=0,n=0;n<c[o].length;n++){for(i=0;i<c[o][n].length-u;i++){if(r(c[o][n][i],f,I,O,C)===!1)return!1;f++}C++}O++}break;case"GeometryCollection":for(o=0;o<a.geometries.length;o++)if(gf(a.geometries[o],r,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function FV(e,r,t,o){var n=t;return gf(e,function(i,a,l,c,p){a===0&&t===void 0?n=i:n=r(n,i,a,l,c,p)},o),n}function y5(e,r){var t;switch(e.type){case"FeatureCollection":for(t=0;t<e.features.length&&r(e.features[t].properties,t)!==!1;t++);break;case"Feature":r(e.properties,0);break}}function DV(e,r,t){var o=t;return y5(e,function(n,i){i===0&&t===void 0?o=n:o=r(o,n,i)}),o}function b5(e,r){if(e.type==="Feature")r(e,0);else if(e.type==="FeatureCollection")for(var t=0;t<e.features.length&&r(e.features[t],t)!==!1;t++);}function kV(e,r,t){var o=t;return b5(e,function(n,i){i===0&&t===void 0?o=n:o=r(o,n,i)}),o}function AV(e){var r=[];return gf(e,function(t){r.push(t)}),r}function MS(e,r){var t,o,n,i,a,l,c,p,u,f,h=0,b=e.type==="FeatureCollection",v=e.type==="Feature",T=b?e.features.length:1;for(t=0;t<T;t++){for(l=b?e.features[t].geometry:v?e.geometry:e,p=b?e.features[t].properties:v?e.properties:{},u=b?e.features[t].bbox:v?e.bbox:void 0,f=b?e.features[t].id:v?e.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(i=c?l.geometries[n]:l,i===null){if(r(null,h,p,u,f)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(r(i,h,p,u,f)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<i.geometries.length;o++)if(r(i.geometries[o],h,p,u,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function LV(e,r,t){var o=t;return MS(e,function(n,i,a,l,c){i===0&&t===void 0?o=n:o=r(o,n,i,a,l,c)}),o}function c1(e,r){MS(e,function(t,o,n,i,a){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return r(so.feature(t,n,{bbox:i,id:a}),o,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var u=t.coordinates[p],f={type:c,coordinates:u};if(r(so.feature(f,n),o,p)===!1)return!1}})}function _V(e,r,t){var o=t;return c1(e,function(n,i,a){i===0&&a===0&&t===void 0?o=n:o=r(o,n,i,a)}),o}function x5(e,r){c1(e,function(t,o,n){var i=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,u=0;if(gf(t,function(f,h,b,v,T){if(l===void 0||o>c||v>p||T>u){l=f,c=o,p=v,u=T,i=0;return}var x=so.lineString([l,f],t.properties);if(r(x,o,n,T,i)===!1)return!1;i++,l=f})===!1)return!1}}})}function RV(e,r,t){var o=t,n=!1;return x5(e,function(i,a,l,c,p){n===!1&&t===void 0?o=i:o=r(o,i,a,l,c,p),n=!0}),o}function v5(e,r){if(!e)throw new Error("geojson is required");c1(e,function(t,o,n){if(t.geometry!==null){var i=t.geometry.type,a=t.geometry.coordinates;switch(i){case"LineString":if(r(t,o,n,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(r(so.lineString(a[l],t.properties),o,n,l)===!1)return!1;break}}})}function BV(e,r,t){var o=t;return v5(e,function(n,i,a,l){i===0&&t===void 0?o=n:o=r(o,n,i,a,l)}),o}function NV(e,r){if(r=r||{},!so.isObject(r))throw new Error("options is invalid");var t=r.featureIndex||0,o=r.multiFeatureIndex||0,n=r.geometryIndex||0,i=r.segmentIndex||0,a=r.properties,l;switch(e.type){case"FeatureCollection":t<0&&(t=e.features.length+t),a=a||e.features[t].properties,l=e.features[t].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),so.lineString([c[i],c[i+1]],a,r);case"Polygon":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),so.lineString([c[n][i],c[n][i+1]],a,r);case"MultiLineString":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),so.lineString([c[o][i],c[o][i+1]],a,r);case"MultiPolygon":return o<0&&(o=c.length+o),n<0&&(n=c[o].length+n),i<0&&(i=c[o][n].length-i-1),so.lineString([c[o][n][i],c[o][n][i+1]],a,r)}throw new Error("geojson is invalid")}function jV(e,r){if(r=r||{},!so.isObject(r))throw new Error("options is invalid");var t=r.featureIndex||0,o=r.multiFeatureIndex||0,n=r.geometryIndex||0,i=r.coordIndex||0,a=r.properties,l;switch(e.type){case"FeatureCollection":t<0&&(t=e.features.length+t),a=a||e.features[t].properties,l=e.features[t].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return so.point(c,a,r);case"MultiPoint":return o<0&&(o=c.length+o),so.point(c[o],a,r);case"LineString":return i<0&&(i=c.length+i),so.point(c[i],a,r);case"Polygon":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),so.point(c[n][i],a,r);case"MultiLineString":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),so.point(c[o][i],a,r);case"MultiPolygon":return o<0&&(o=c.length+o),n<0&&(n=c[o].length+n),i<0&&(i=c[o][n].length-i),so.point(c[o][n][i],a,r)}throw new Error("geojson is invalid")}br.coordAll=AV;br.coordEach=gf;br.coordReduce=FV;br.featureEach=b5;br.featureReduce=kV;br.findPoint=jV;br.findSegment=NV;br.flattenEach=c1;br.flattenReduce=_V;br.geomEach=MS;br.geomReduce=LV;br.lineEach=v5;br.lineReduce=BV;br.propEach=y5;br.propReduce=DV;br.segmentEach=x5;br.segmentReduce=RV});var I5=Ms(ES=>{"use strict";d();Object.defineProperty(ES,"__esModule",{value:!0});var GV=wS();function OS(e){var r=[1/0,1/0,-1/0,-1/0];return GV.coordEach(e,function(t){r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r}OS.default=OS;ES.default=OS});var w5=Ms((cSe,PS)=>{d();var Qi=d5(),T5=CS(),C5=wS(),wd=I5().default,UV=C5.featureEach,aSe=C5.coordEach,lSe=T5.polygon,S5=T5.featureCollection;function M5(e){var r=new Qi(e);return r.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:wd(t),Qi.prototype.insert.call(this,t)},r.load=function(t){var o=[];return Array.isArray(t)?t.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:wd(n),o.push(n)}):UV(t,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:wd(n),o.push(n)}),Qi.prototype.load.call(this,o)},r.remove=function(t,o){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:wd(t),Qi.prototype.remove.call(this,t,o)},r.clear=function(){return Qi.prototype.clear.call(this)},r.search=function(t){var o=Qi.prototype.search.call(this,this.toBBox(t));return S5(o)},r.collides=function(t){return Qi.prototype.collides.call(this,this.toBBox(t))},r.all=function(){var t=Qi.prototype.all.call(this);return S5(t)},r.toJSON=function(){return Qi.prototype.toJSON.call(this)},r.fromJSON=function(t){return Qi.prototype.fromJSON.call(this,t)},r.toBBox=function(t){var o;if(t.bbox)o=t.bbox;else if(Array.isArray(t)&&t.length===4)o=t;else if(Array.isArray(t)&&t.length===6)o=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")o=wd(t);else if(t.type==="FeatureCollection")o=wd(t);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},r}PS.exports=M5;PS.exports.default=M5});var Lk=Ms((tg,Vu)=>{d();var wz=200,mk="__lodash_hash_undefined__",Oz=800,Ez=16,fk=9007199254740991,hk="[object Arguments]",Pz="[object Array]",Fz="[object AsyncFunction]",Dz="[object Boolean]",kz="[object Date]",Az="[object Error]",gk="[object Function]",Lz="[object GeneratorFunction]",_z="[object Map]",Rz="[object Number]",Bz="[object Null]",yk="[object Object]",Nz="[object Proxy]",jz="[object RegExp]",Gz="[object Set]",Uz="[object String]",Vz="[object Undefined]",$z="[object WeakMap]",Hz="[object ArrayBuffer]",zz="[object DataView]",Wz="[object Float32Array]",Zz="[object Float64Array]",Xz="[object Int8Array]",Yz="[object Int16Array]",Jz="[object Int32Array]",Kz="[object Uint8Array]",Qz="[object Uint8ClampedArray]",qz="[object Uint16Array]",eW="[object Uint32Array]",tW=/[\\^$.*+?()[\]{}|]/g,rW=/^\[object .+?Constructor\]$/,oW=/^(?:0|[1-9]\d*)$/,Nt={};Nt[Wz]=Nt[Zz]=Nt[Xz]=Nt[Yz]=Nt[Jz]=Nt[Kz]=Nt[Qz]=Nt[qz]=Nt[eW]=!0;Nt[hk]=Nt[Pz]=Nt[Hz]=Nt[Dz]=Nt[zz]=Nt[kz]=Nt[Az]=Nt[gk]=Nt[_z]=Nt[Rz]=Nt[yk]=Nt[jz]=Nt[Gz]=Nt[Uz]=Nt[$z]=!1;var bk=typeof global=="object"&&global&&global.Object===Object&&global,nW=typeof self=="object"&&self&&self.Object===Object&&self,ng=bk||nW||Function("return this")(),xk=typeof tg=="object"&&tg&&!tg.nodeType&&tg,rg=xk&&typeof Vu=="object"&&Vu&&!Vu.nodeType&&Vu,vk=rg&&rg.exports===xk,uT=vk&&bk.process,nk=function(){try{var e=rg&&rg.require&&rg.require("util").types;return e||uT&&uT.binding&&uT.binding("util")}catch{}}(),ik=nk&&nk.isTypedArray;function Ik(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function iW(e,r){for(var t=-1,o=Array(e);++t<e;)o[t]=r(t);return o}function sW(e){return function(r){return e(r)}}function aW(e,r){return e?.[r]}function lW(e,r){return function(t){return e(r(t))}}var cW=Array.prototype,pW=Function.prototype,Hx=Object.prototype,mT=ng["__core-js_shared__"],zx=pW.toString,Sa=Hx.hasOwnProperty,sk=function(){var e=/[^.]+$/.exec(mT&&mT.keys&&mT.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Sk=Hx.toString,dW=zx.call(Object),uW=RegExp("^"+zx.call(Sa).replace(tW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vx=vk?ng.Buffer:void 0,ak=ng.Symbol,lk=ng.Uint8Array,ck=Vx?Vx.allocUnsafe:void 0,Tk=lW(Object.getPrototypeOf,Object),pk=Object.create,mW=Hx.propertyIsEnumerable,fW=cW.splice,qc=ak?ak.toStringTag:void 0,$x=function(){try{var e=vT(Object,"defineProperty");return e({},"",{}),e}catch{}}(),hW=Vx?Vx.isBuffer:void 0,dk=Math.max,gW=Date.now,Ck=vT(ng,"Map"),og=vT(Object,"create"),yW=function(){function e(){}return function(r){if(!Ia(r))return{};if(pk)return pk(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();function ep(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function bW(){this.__data__=og?og(null):{},this.size=0}function xW(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}function vW(e){var r=this.__data__;if(og){var t=r[e];return t===mk?void 0:t}return Sa.call(r,e)?r[e]:void 0}function IW(e){var r=this.__data__;return og?r[e]!==void 0:Sa.call(r,e)}function SW(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=og&&r===void 0?mk:r,this}ep.prototype.clear=bW;ep.prototype.delete=xW;ep.prototype.get=vW;ep.prototype.has=IW;ep.prototype.set=SW;function Ta(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function TW(){this.__data__=[],this.size=0}function CW(e){var r=this.__data__,t=Wx(r,e);if(t<0)return!1;var o=r.length-1;return t==o?r.pop():fW.call(r,t,1),--this.size,!0}function MW(e){var r=this.__data__,t=Wx(r,e);return t<0?void 0:r[t][1]}function wW(e){return Wx(this.__data__,e)>-1}function OW(e,r){var t=this.__data__,o=Wx(t,e);return o<0?(++this.size,t.push([e,r])):t[o][1]=r,this}Ta.prototype.clear=TW;Ta.prototype.delete=CW;Ta.prototype.get=MW;Ta.prototype.has=wW;Ta.prototype.set=OW;function $u(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function EW(){this.size=0,this.__data__={hash:new ep,map:new(Ck||Ta),string:new ep}}function PW(e){var r=Xx(this,e).delete(e);return this.size-=r?1:0,r}function FW(e){return Xx(this,e).get(e)}function DW(e){return Xx(this,e).has(e)}function kW(e,r){var t=Xx(this,e),o=t.size;return t.set(e,r),this.size+=t.size==o?0:1,this}$u.prototype.clear=EW;$u.prototype.delete=PW;$u.prototype.get=FW;$u.prototype.has=DW;$u.prototype.set=kW;function Hu(e){var r=this.__data__=new Ta(e);this.size=r.size}function AW(){this.__data__=new Ta,this.size=0}function LW(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function _W(e){return this.__data__.get(e)}function RW(e){return this.__data__.has(e)}function BW(e,r){var t=this.__data__;if(t instanceof Ta){var o=t.__data__;if(!Ck||o.length<wz-1)return o.push([e,r]),this.size=++t.size,this;t=this.__data__=new $u(o)}return t.set(e,r),this.size=t.size,this}Hu.prototype.clear=AW;Hu.prototype.delete=LW;Hu.prototype.get=_W;Hu.prototype.has=RW;Hu.prototype.set=BW;function NW(e,r){var t=yT(e),o=!t&&gT(e),n=!t&&!o&&Pk(e),i=!t&&!o&&!n&&Dk(e),a=t||o||n||i,l=a?iW(e.length,String):[],c=l.length;for(var p in e)(r||Sa.call(e,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Ok(p,c)))&&l.push(p);return l}function fT(e,r,t){(t!==void 0&&!Yx(e[r],t)||t===void 0&&!(r in e))&&bT(e,r,t)}function jW(e,r,t){var o=e[r];(!(Sa.call(e,r)&&Yx(o,t))||t===void 0&&!(r in e))&&bT(e,r,t)}function Wx(e,r){for(var t=e.length;t--;)if(Yx(e[t][0],r))return t;return-1}function bT(e,r,t){r=="__proto__"&&$x?$x(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var GW=QW();function Zx(e){return e==null?e===void 0?Vz:Bz:qc&&qc in Object(e)?qW(e):iZ(e)}function uk(e){return ig(e)&&Zx(e)==hk}function UW(e){if(!Ia(e)||oZ(e))return!1;var r=ST(e)?uW:rW;return r.test(cZ(e))}function VW(e){return ig(e)&&Fk(e.length)&&!!Nt[Zx(e)]}function $W(e){if(!Ia(e))return nZ(e);var r=Ek(e),t=[];for(var o in e)o=="constructor"&&(r||!Sa.call(e,o))||t.push(o);return t}function xT(e,r,t,o,n){e!==r&&GW(r,function(i,a){if(n||(n=new Hu),Ia(i))HW(e,r,a,t,xT,o,n);else{var l=o?o(hT(e,a),i,a+"",e,r,n):void 0;l===void 0&&(l=i),fT(e,a,l)}},kk)}function HW(e,r,t,o,n,i,a){var l=hT(e,t),c=hT(r,t),p=a.get(c);if(p){fT(e,t,p);return}var u=i?i(l,c,t+"",e,r,a):void 0,f=u===void 0;if(f){var h=yT(c),b=!h&&Pk(c),v=!h&&!b&&Dk(c);u=c,h||b||v?yT(l)?u=l:pZ(l)?u=YW(l):b?(f=!1,u=WW(c,!0)):v?(f=!1,u=XW(c,!0)):u=[]:dZ(c)||gT(c)?(u=l,gT(l)?u=uZ(l):(!Ia(l)||ST(l))&&(u=eZ(c))):f=!1}f&&(a.set(c,u),n(u,c,o,i,a),a.delete(c)),fT(e,t,u)}function Mk(e,r){return aZ(sZ(e,r,Ak),e+"")}var zW=$x?function(e,r){return $x(e,"toString",{configurable:!0,enumerable:!1,value:hZ(r),writable:!0})}:Ak;function WW(e,r){if(r)return e.slice();var t=e.length,o=ck?ck(t):new e.constructor(t);return e.copy(o),o}function ZW(e){var r=new e.constructor(e.byteLength);return new lk(r).set(new lk(e)),r}function XW(e,r){var t=r?ZW(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function YW(e,r){var t=-1,o=e.length;for(r||(r=Array(o));++t<o;)r[t]=e[t];return r}function JW(e,r,t,o){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var l=r[i],c=o?o(t[l],e[l],l,t,e):void 0;c===void 0&&(c=e[l]),n?bT(t,l,c):jW(t,l,c)}return t}function KW(e){return Mk(function(r,t){var o=-1,n=t.length,i=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(n--,i):void 0,a&&tZ(t[0],t[1],a)&&(i=n<3?void 0:i,n=1),r=Object(r);++o<n;){var l=t[o];l&&e(r,l,o,i)}return r})}function QW(e){return function(r,t,o){for(var n=-1,i=Object(r),a=o(r),l=a.length;l--;){var c=a[e?l:++n];if(t(i[c],c,i)===!1)break}return r}}function wk(e,r,t,o,n,i){return Ia(e)&&Ia(r)&&(i.set(r,e),xT(e,r,void 0,wk,i),i.delete(r)),e}function Xx(e,r){var t=e.__data__;return rZ(r)?t[typeof r=="string"?"string":"hash"]:t.map}function vT(e,r){var t=aW(e,r);return UW(t)?t:void 0}function qW(e){var r=Sa.call(e,qc),t=e[qc];try{e[qc]=void 0;var o=!0}catch{}var n=Sk.call(e);return o&&(r?e[qc]=t:delete e[qc]),n}function eZ(e){return typeof e.constructor=="function"&&!Ek(e)?yW(Tk(e)):{}}function Ok(e,r){var t=typeof e;return r=r??fk,!!r&&(t=="number"||t!="symbol"&&oW.test(e))&&e>-1&&e%1==0&&e<r}function tZ(e,r,t){if(!Ia(t))return!1;var o=typeof r;return(o=="number"?IT(t)&&Ok(r,t.length):o=="string"&&r in t)?Yx(t[r],e):!1}function rZ(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function oZ(e){return!!sk&&sk in e}function Ek(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Hx;return e===t}function nZ(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}function iZ(e){return Sk.call(e)}function sZ(e,r,t){return r=dk(r===void 0?e.length-1:r,0),function(){for(var o=arguments,n=-1,i=dk(o.length-r,0),a=Array(i);++n<i;)a[n]=o[r+n];n=-1;for(var l=Array(r+1);++n<r;)l[n]=o[n];return l[r]=t(a),Ik(e,this,l)}}function hT(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var aZ=lZ(zW);function lZ(e){var r=0,t=0;return function(){var o=gW(),n=Ez-(o-t);if(t=o,n>0){if(++r>=Oz)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}function cZ(e){if(e!=null){try{return zx.call(e)}catch{}try{return e+""}catch{}}return""}function Yx(e,r){return e===r||e!==e&&r!==r}var gT=uk(function(){return arguments}())?uk:function(e){return ig(e)&&Sa.call(e,"callee")&&!mW.call(e,"callee")},yT=Array.isArray;function IT(e){return e!=null&&Fk(e.length)&&!ST(e)}function pZ(e){return ig(e)&&IT(e)}var Pk=hW||gZ;function ST(e){if(!Ia(e))return!1;var r=Zx(e);return r==gk||r==Lz||r==Fz||r==Nz}function Fk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fk}function Ia(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function ig(e){return e!=null&&typeof e=="object"}function dZ(e){if(!ig(e)||Zx(e)!=yk)return!1;var r=Tk(e);if(r===null)return!0;var t=Sa.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&zx.call(t)==dW}var Dk=ik?sW(ik):VW;function uZ(e){return JW(e,kk(e))}var mZ=Mk(function(e){return e.push(void 0,wk),Ik(fZ,void 0,e)});function kk(e){return IT(e)?NW(e,!0):$W(e)}var fZ=KW(function(e,r,t,o){xT(e,r,t,o)});function hZ(e){return function(){return e}}function Ak(e){return e}function gZ(){return!1}Vu.exports=mZ});var zk=Ms((Z9e,Jx)=>{d();(function(){"use strict";function e(a,l){var c=a.x-l.x,p=a.y-l.y;return c*c+p*p}function r(a,l,c){var p=l.x,u=l.y,f=c.x-p,h=c.y-u;if(f!==0||h!==0){var b=((a.x-p)*f+(a.y-u)*h)/(f*f+h*h);b>1?(p=c.x,u=c.y):b>0&&(p+=f*b,u+=h*b)}return f=a.x-p,h=a.y-u,f*f+h*h}function t(a,l){for(var c=a[0],p=[c],u,f=1,h=a.length;f<h;f++)u=a[f],e(u,c)>l&&(p.push(u),c=u);return c!==u&&p.push(u),p}function o(a,l,c,p,u){for(var f=p,h,b=l+1;b<c;b++){var v=r(a[b],a[l],a[c]);v>f&&(h=b,f=v)}f>p&&(h-l>1&&o(a,l,h,p,u),u.push(a[h]),c-h>1&&o(a,h,c,p,u))}function n(a,l){var c=a.length-1,p=[a[0]];return o(a,0,c,l,p),p.push(a[c]),p}function i(a,l,c){if(a.length<=2)return a;var p=l!==void 0?l*l:1;return a=c?a:t(a,p),a=n(a,p),a}typeof define=="function"&&define.amd?define(function(){return i}):typeof Jx<"u"?(Jx.exports=i,Jx.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});d();d();d();d();d();d();var vm=e=>e!=null;var M7=function(){let r=globalThis.fetch;return{fetch(...t){if(!vm(r))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return r?.(...t)},setFetch(t){r=t}}}(),jM=M7.fetch;var HM=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk"],GM=HM[0],zM="https://api-gateway.mappedin.com/track-analytics/a/",WM="deny-watchposition",ZM="load-mapview",XM="load-mapdata",YM="change-language",JM="query-directions";var Bi,pn,As,Z0,vy,Fp=class{constructor(){S(this,As);S(this,Bi,Object.freeze({}));S(this,pn);m(this,"oneTimeEventsSent",new Set);m(this,"sendGetDirectionsEvent",C0((r,t,o)=>{let n={start:r,end:t,type:"location_to_location"};return o!==void 0&&(n.accessible=o),this.sendAnalyticEvent(JM,n)},2500));w(this,pn,W(this,As,vy).call(this,s(this,Bi)))}init(r){this.reset(),this.updateStateWithOptions(r)}reset(){w(this,Bi,{}),w(this,pn,W(this,As,vy).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(r){return w(this,Bi,Object.freeze(Object.assign({},s(this,Bi),r))),w(this,pn,W(this,As,vy).call(this,r)),W(this,As,Z0).call(this,s(this,pn)),s(this,pn)}updateState(r){let t={...r};t.mapId&&(t.analyticsBaseUrl=W0({...s(this,pn),mapId:t.mapId})),t.context&&(t.context=$M(t.context)),t.baseUri&&(t.analyticsBaseUrl=W0({baseUri:t.baseUri,mapId:s(this,pn).mapId})),Object.assign(s(this,pn),t),this.handleStateUpdate(r),W(this,As,Z0).call(this,t)}handleStateUpdate(r){r.userPosition?.floorLevel?this.sendBlueDotEvents("found-floor"):r.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:r,secret:t,accessToken:o}=this.getState();return!!(r&&t)||!!o}getState(){return s(this,pn)}getContext(){return this.getState().context||s(this,Bi).context||GM}getSessionId(){return this.getState().sessionId||s(this,Bi).sessionId||VM()}getDeviceId(){return this.getState().deviceId||s(this,Bi).deviceId||UM()}sendAnalyticEvent(r,t={}){let o=this.getState(),n=w7(o.analyticsBaseUrl,r),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(o.logEvents&&A.log("Analytics.track",n,i),!o.sendEvents)return Promise.resolve();if(!this.authReady)return A.warn("Auth needs to be ready to send analytics.");let a={...t,g:o.geolocationMode,sdk_version:o.version};return o.userPosition&&Object.assign(a,o.userPosition),i["Content-Type"]="application/json",o.accessToken?i.Authorization=`Bearer ${o.accessToken}`:o.noAuth||o.secret&&o.key&&(i["x-mappedin-key"]=btoa(o.key),i["x-mappedin-secret"]=btoa(o.secret)),jM(n,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(r,t){if(E7.includes(r))return A.warn(`${r} event is sent internally.`),Promise.resolve();let o=O7.includes(r)?r.slice(1):r;return this.sendAnalyticEvent(o,t)}sendGetMapDataEvent(r){return this.sendAnalyticEvent(XM,r)}sendChangeLanguageEvent(r){return this.sendAnalyticEvent(YM,r)}sendWatchPositionDenied(){return this.sendAnalyticEvent(WM)}sendMapViewLoadedEvent({firstRenderDuration:r,dimension:t,collisionWorkerDisabled:o,outdoorsWorkerDisabled:n}){return this.sendAnalyticEvent(ZM,{type:"3d",firstRenderDuration:r,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:o,outdoorsWorkerDisabled:n})}sendBlueDotEvents(r){if(!((r==="found-floor"||r==="found-position")&&this.oneTimeEventsSent.has(r)))return this.oneTimeEventsSent.add(r),this.sendAnalyticEvent(r)}};Bi=new WeakMap,pn=new WeakMap,As=new WeakSet,Z0=function(r){r.sessionId&&Ps.getInstance().saveSessionData("id",r.sessionId),r.deviceId&&Ps.getInstance().saveLocalData("deviceId",r.deviceId)},vy=function(r){let t=r.baseUri??zM;return{baseUri:t,analyticsBaseUrl:W0({...r,baseUri:t}),version:y?.env?.npm_package_version||"v6",deviceId:r.deviceId||UM(),accessToken:r.accessToken,mapId:r.mapId,sessionId:r.sessionId||VM(),platformString:r.platformString||"",context:$M(r.context)||GM,geolocationMode:!1,sendEvents:r.sendEvents??!0,logEvents:r.logEvents??!1,noAuth:r.noAuth||!1,key:r.key,secret:r.secret}};function W0({mapId:e,baseUri:r=zM}){return`${r}${e}/`}function UM(){return Ps.getInstance().loadLocalData("deviceId")}function VM(){return Ps.getInstance().loadSessionData("id")}function w7(e,r){return e+r}function $M(e){return HM.find(r=>r===e)}var O7=["$select-location","$select-category","$query-suggest","$query-search"],E7=[ZM,XM,JM,WM,YM],MX=new Fp,dn,Im=class{constructor(r){S(this,dn);m(this,"capture");m(this,"updateState");w(this,dn,r),this.capture=s(this,dn).capture.bind(s(this,dn)),this.updateState=s(this,dn).updateState.bind(s(this,dn))}getState(){let{sessionId:r,deviceId:t,...o}=s(this,dn).getState();return o}getContext(){return s(this,dn).getContext()}getSessionId(){return s(this,dn).getSessionId()}getDeviceId(){return s(this,dn).getDeviceId()}};dn=new WeakMap;d();d();var Tm,Cm,Mm,Sm=class{constructor(r,t,{enabled:o=!1}={}){S(this,Tm);m(this,"searchInstance");S(this,Cm);S(this,Mm);m(this,"enabled",!1);w(this,Tm,r),w(this,Cm,t),w(this,Mm,()=>{this.searchInstance?.then(n=>n.populate())}),o&&this.enable()}async query(r,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(r,t)}catch(o){return A.error("Search.query failed due to",o),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(r,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(r,t)}catch(o){return A.error("Search.suggest failed due to",o),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-HAIAUKR7.js").then(({InternalSearch:r})=>new r(s(this,Tm)))),s(this,Cm).on("language-change",s(this,Mm)),await this.searchInstance)}};Tm=new WeakMap,Cm=new WeakMap,Mm=new WeakMap;var KM=new WeakMap,Gl,Lt,X0=class{constructor(r,{search:t}={}){S(this,Gl);S(this,Lt);m(this,"Analytics");m(this,"Search");m(this,"Query");m(this,"internal");m(this,"on",(r,t)=>{s(this,Gl).on(r,t)});m(this,"off",(r,t)=>{s(this,Gl).off(r,t)});m(this,"__LEGACY_GET_DIRECTIONS_SYNC",(r,t,o)=>s(this,Lt).__LEGACY_GET_DIRECTIONS_SYNC(r,t,o));m(this,"getDirections",(r,t,o)=>s(this,Lt).getDirections(r,t,o));m(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(r,t,o)=>s(this,Lt).__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(r,t,o));m(this,"getDirectionsMultiDestination",(r,t,o)=>s(this,Lt).getDirectionsMultiDestination(r,t,o));w(this,Gl,new ke),w(this,Lt,r),KM.set(this,r),this.Analytics=new Im(r.Analytics),this.Query=r.Query,this.internal=r,this.Search=new Sm(this,r,{enabled:t?.enabled}),s(this,Lt).on("language-change",o=>{s(this,Gl).publish("language-change",o)})}getEnv(){return s(this,Lt).getEnv()}getAccessToken(){return s(this,Lt).tokenManager?.getAccessToken().token}get mapName(){return s(this,Lt).mapName}get mapId(){return s(this,Lt).getMapDataOptions?.mapId}get mapCenter(){return s(this,Lt).mapCenter}get organizationId(){return s(this,Lt).organizationId}get outdoorViewToken(){return s(this,Lt).outdoorViewToken}getByType(r){return s(this,Lt).getByType(r)}getById(r,t){return s(this,Lt).getById(r,t)}getByExternalId(r,t){return s(this,Lt).getByExternalId(r,t)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return s(this,Lt).changeLanguage(r)}get currentLanguage(){return s(this,Lt).currentLanguage}get naturalBearing(){return s(this,Lt).naturalBearing??0}getDistance(r,t){return s(this,Lt).getDistance(r,t)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return s(this,Lt).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return s(this,Lt).toJSONBundle({downloadLanguagePacks:r})}};Gl=new WeakMap,Lt=new WeakMap;var wm=X0;function Om(e){let r=KM.get(e);if(!r)throw new Error("MapDataInternal not found");return r}d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();var Ye={};La(Ye,{HasPropertyKey:()=>P7,IsArray:()=>qr,IsAsyncIterator:()=>Y0,IsBigInt:()=>Em,IsBoolean:()=>Va,IsDate:()=>Ul,IsFunction:()=>J0,IsIterator:()=>K0,IsNull:()=>Q0,IsNumber:()=>Xn,IsObject:()=>vt,IsRegExp:()=>Pm,IsString:()=>Pt,IsSymbol:()=>q0,IsUint8Array:()=>Ls,IsUndefined:()=>zt});d();function P7(e,r){return r in e}function Y0(e){return vt(e)&&!qr(e)&&!Ls(e)&&Symbol.asyncIterator in e}function qr(e){return Array.isArray(e)}function Em(e){return typeof e=="bigint"}function Va(e){return typeof e=="boolean"}function Ul(e){return e instanceof globalThis.Date}function J0(e){return typeof e=="function"}function K0(e){return vt(e)&&!qr(e)&&!Ls(e)&&Symbol.iterator in e}function Q0(e){return e===null}function Xn(e){return typeof e=="number"}function vt(e){return typeof e=="object"&&e!==null}function Pm(e){return e instanceof globalThis.RegExp}function Pt(e){return typeof e=="string"}function q0(e){return typeof e=="symbol"}function Ls(e){return e instanceof globalThis.Uint8Array}function zt(e){return e===void 0}function F7(e){return e.map(r=>Iy(r))}function D7(e){return new Date(e.getTime())}function k7(e){return new Uint8Array(e)}function A7(e){return new RegExp(e.source,e.flags)}function L7(e){let r={};for(let t of Object.getOwnPropertyNames(e))r[t]=Iy(e[t]);for(let t of Object.getOwnPropertySymbols(e))r[t]=Iy(e[t]);return r}function Iy(e){return qr(e)?F7(e):Ul(e)?D7(e):Ls(e)?k7(e):Pm(e)?A7(e):vt(e)?L7(e):e}function _t(e){return Iy(e)}function QM(e){return e.map(r=>Fm(r))}function Fm(e,r){return r===void 0?_t(e):_t({...r,...e})}d();d();d();function Sy(e){return Ae(e)&&Symbol.asyncIterator in e}function Ty(e){return Ae(e)&&Symbol.iterator in e}function ev(e){return Ae(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function Cy(e){return e instanceof Promise}function uo(e){return e instanceof Date&&Number.isFinite(e.getTime())}function qM(e){return e instanceof globalThis.Map}function e3(e){return e instanceof globalThis.Set}function un(e){return ArrayBuffer.isView(e)}function Dp(e){return e instanceof globalThis.Uint8Array}function ve(e,r){return r in e}function Ae(e){return e!==null&&typeof e=="object"}function we(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}function Wt(e){return e===void 0}function _s(e){return e===null}function Ni(e){return typeof e=="boolean"}function me(e){return typeof e=="number"}function My(e){return Number.isInteger(e)}function jr(e){return typeof e=="bigint"}function He(e){return typeof e=="string"}function $a(e){return typeof e=="function"}function Rs(e){return typeof e=="symbol"}function Gr(e){return jr(e)||Ni(e)||_s(e)||me(e)||He(e)||Rs(e)||Wt(e)}var pt;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function r(a,l){return e.ExactOptionalPropertyTypes?l in a:a[l]!==void 0}e.IsExactOptionalProperty=r;function t(a){let l=Ae(a);return e.AllowArrayObject?l:l&&!we(a)}e.IsObjectLike=t;function o(a){return t(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}e.IsRecordLike=o;function n(a){return e.AllowNaN?me(a):Number.isFinite(a)}e.IsNumberLike=n;function i(a){let l=Wt(a);return e.AllowNullVoid?l||a===null:l}e.IsVoidLike=i})(pt||(pt={}));d();function _7(e){return globalThis.Object.freeze(e).map(r=>Dm(r))}function R7(e){let r={};for(let t of Object.getOwnPropertyNames(e))r[t]=Dm(e[t]);for(let t of Object.getOwnPropertySymbols(e))r[t]=Dm(e[t]);return globalThis.Object.freeze(r)}function Dm(e){return qr(e)?_7(e):Ul(e)?e:Ls(e)?e:Pm(e)?e:vt(e)?R7(e):e}function Z(e,r){let t=r!==void 0?{...r,...e}:e;switch(pt.InstanceMode){case"freeze":return Dm(t);case"clone":return _t(t);default:return t}}d();var be=class extends Error{constructor(r){super(r)}};d();d();d();var Rt=Symbol.for("TypeBox.Transform"),Bs=Symbol.for("TypeBox.Readonly"),mo=Symbol.for("TypeBox.Optional"),mn=Symbol.for("TypeBox.Hint"),U=Symbol.for("TypeBox.Kind");function t3(e){return vt(e)&&e[Bs]==="Readonly"}function ji(e){return vt(e)&&e[mo]==="Optional"}function tv(e){return Je(e,"Any")}function Ns(e){return Je(e,"Array")}function km(e){return Je(e,"AsyncIterator")}function rv(e){return Je(e,"BigInt")}function ov(e){return Je(e,"Boolean")}function Am(e){return Je(e,"Constructor")}function B7(e){return Je(e,"Date")}function Lm(e){return Je(e,"Function")}function Vl(e){return Je(e,"Integer")}function or(e){return Je(e,"Intersect")}function _m(e){return Je(e,"Iterator")}function Je(e,r){return vt(e)&&U in e&&e[U]===r}function js(e){return Je(e,"Literal")}function Wo(e){return Je(e,"MappedKey")}function Bt(e){return Je(e,"MappedResult")}function Ha(e){return Je(e,"Never")}function N7(e){return Je(e,"Not")}function j7(e){return Je(e,"Null")}function $l(e){return Je(e,"Number")}function gr(e){return Je(e,"Object")}function Hl(e){return Je(e,"Promise")}function nv(e){return Je(e,"Record")}function iv(e){return Je(e,"Ref")}function sv(e){return Je(e,"RegExp")}function Rm(e){return Je(e,"String")}function G7(e){return Je(e,"Symbol")}function Zo(e){return Je(e,"TemplateLiteral")}function U7(e){return Je(e,"This")}function kp(e){return vt(e)&&Rt in e}function Yn(e){return Je(e,"Tuple")}function V7(e){return Je(e,"Undefined")}function it(e){return Je(e,"Union")}function $7(e){return Je(e,"Uint8Array")}function H7(e){return Je(e,"Unknown")}function z7(e){return Je(e,"Unsafe")}function W7(e){return Je(e,"Void")}function za(e){return vt(e)&&U in e&&Pt(e[U])}function Jn(e){return tv(e)||Ns(e)||ov(e)||rv(e)||km(e)||Am(e)||B7(e)||Lm(e)||Vl(e)||or(e)||_m(e)||js(e)||Wo(e)||Bt(e)||Ha(e)||N7(e)||j7(e)||$l(e)||gr(e)||Hl(e)||nv(e)||iv(e)||sv(e)||Rm(e)||G7(e)||Zo(e)||U7(e)||Yn(e)||V7(e)||it(e)||$7(e)||H7(e)||z7(e)||W7(e)||za(e)}var D={};La(D,{IsAny:()=>i3,IsArray:()=>s3,IsAsyncIterator:()=>a3,IsBigInt:()=>l3,IsBoolean:()=>c3,IsConstructor:()=>p3,IsDate:()=>d3,IsFunction:()=>u3,IsInteger:()=>m3,IsIntersect:()=>f3,IsIterator:()=>h3,IsKind:()=>j3,IsKindOf:()=>We,IsLiteral:()=>Nm,IsLiteralBoolean:()=>q7,IsLiteralNumber:()=>y3,IsLiteralString:()=>g3,IsLiteralValue:()=>b3,IsMappedKey:()=>x3,IsMappedResult:()=>v3,IsNever:()=>I3,IsNot:()=>S3,IsNull:()=>T3,IsNumber:()=>C3,IsObject:()=>M3,IsOptional:()=>Q7,IsPromise:()=>w3,IsProperties:()=>pv,IsReadonly:()=>K7,IsRecord:()=>O3,IsRecursive:()=>e6,IsRef:()=>E3,IsRegExp:()=>P3,IsSchema:()=>ze,IsString:()=>F3,IsSymbol:()=>D3,IsTemplateLiteral:()=>k3,IsThis:()=>A3,IsTransform:()=>Ft,IsTuple:()=>L3,IsUint8Array:()=>_3,IsUndefined:()=>Ap,IsUnion:()=>dv,IsUnionLiteral:()=>t6,IsUnknown:()=>R3,IsUnsafe:()=>B3,IsVoid:()=>N3,TypeGuardUnknownTypeError:()=>av});d();var av=class extends be{},X7=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function r3(e){try{return new RegExp(e),!0}catch{return!1}}function lv(e){if(!Pt(e))return!1;for(let r=0;r<e.length;r++){let t=e.charCodeAt(r);if(t>=7&&t<=13||t===27||t===127)return!1}return!0}function o3(e){return cv(e)||ze(e)}function Bm(e){return zt(e)||Em(e)}function wt(e){return zt(e)||Xn(e)}function cv(e){return zt(e)||Va(e)}function mt(e){return zt(e)||Pt(e)}function Y7(e){return zt(e)||Pt(e)&&lv(e)&&r3(e)}function J7(e){return zt(e)||Pt(e)&&lv(e)}function n3(e){return zt(e)||ze(e)}function K7(e){return vt(e)&&e[Bs]==="Readonly"}function Q7(e){return vt(e)&&e[mo]==="Optional"}function i3(e){return We(e,"Any")&&mt(e.$id)}function s3(e){return We(e,"Array")&&e.type==="array"&&mt(e.$id)&&ze(e.items)&&wt(e.minItems)&&wt(e.maxItems)&&cv(e.uniqueItems)&&n3(e.contains)&&wt(e.minContains)&&wt(e.maxContains)}function a3(e){return We(e,"AsyncIterator")&&e.type==="AsyncIterator"&&mt(e.$id)&&ze(e.items)}function l3(e){return We(e,"BigInt")&&e.type==="bigint"&&mt(e.$id)&&Bm(e.exclusiveMaximum)&&Bm(e.exclusiveMinimum)&&Bm(e.maximum)&&Bm(e.minimum)&&Bm(e.multipleOf)}function c3(e){return We(e,"Boolean")&&e.type==="boolean"&&mt(e.$id)}function p3(e){return We(e,"Constructor")&&e.type==="Constructor"&&mt(e.$id)&&qr(e.parameters)&&e.parameters.every(r=>ze(r))&&ze(e.returns)}function d3(e){return We(e,"Date")&&e.type==="Date"&&mt(e.$id)&&wt(e.exclusiveMaximumTimestamp)&&wt(e.exclusiveMinimumTimestamp)&&wt(e.maximumTimestamp)&&wt(e.minimumTimestamp)&&wt(e.multipleOfTimestamp)}function u3(e){return We(e,"Function")&&e.type==="Function"&&mt(e.$id)&&qr(e.parameters)&&e.parameters.every(r=>ze(r))&&ze(e.returns)}function m3(e){return We(e,"Integer")&&e.type==="integer"&&mt(e.$id)&&wt(e.exclusiveMaximum)&&wt(e.exclusiveMinimum)&&wt(e.maximum)&&wt(e.minimum)&&wt(e.multipleOf)}function pv(e){return vt(e)&&Object.entries(e).every(([r,t])=>lv(r)&&ze(t))}function f3(e){return We(e,"Intersect")&&!(Pt(e.type)&&e.type!=="object")&&qr(e.allOf)&&e.allOf.every(r=>ze(r)&&!Ft(r))&&mt(e.type)&&(cv(e.unevaluatedProperties)||n3(e.unevaluatedProperties))&&mt(e.$id)}function h3(e){return We(e,"Iterator")&&e.type==="Iterator"&&mt(e.$id)&&ze(e.items)}function We(e,r){return vt(e)&&U in e&&e[U]===r}function g3(e){return Nm(e)&&Pt(e.const)}function y3(e){return Nm(e)&&Xn(e.const)}function q7(e){return Nm(e)&&Va(e.const)}function Nm(e){return We(e,"Literal")&&mt(e.$id)&&b3(e.const)}function b3(e){return Va(e)||Xn(e)||Pt(e)}function x3(e){return We(e,"MappedKey")&&qr(e.keys)&&e.keys.every(r=>Xn(r)||Pt(r))}function v3(e){return We(e,"MappedResult")&&pv(e.properties)}function I3(e){return We(e,"Never")&&vt(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function S3(e){return We(e,"Not")&&ze(e.not)}function T3(e){return We(e,"Null")&&e.type==="null"&&mt(e.$id)}function C3(e){return We(e,"Number")&&e.type==="number"&&mt(e.$id)&&wt(e.exclusiveMaximum)&&wt(e.exclusiveMinimum)&&wt(e.maximum)&&wt(e.minimum)&&wt(e.multipleOf)}function M3(e){return We(e,"Object")&&e.type==="object"&&mt(e.$id)&&pv(e.properties)&&o3(e.additionalProperties)&&wt(e.minProperties)&&wt(e.maxProperties)}function w3(e){return We(e,"Promise")&&e.type==="Promise"&&mt(e.$id)&&ze(e.item)}function O3(e){return We(e,"Record")&&e.type==="object"&&mt(e.$id)&&o3(e.additionalProperties)&&vt(e.patternProperties)&&(r=>{let t=Object.getOwnPropertyNames(r.patternProperties);return t.length===1&&r3(t[0])&&vt(r.patternProperties)&&ze(r.patternProperties[t[0]])})(e)}function e6(e){return vt(e)&&mn in e&&e[mn]==="Recursive"}function E3(e){return We(e,"Ref")&&mt(e.$id)&&Pt(e.$ref)}function P3(e){return We(e,"RegExp")&&mt(e.$id)&&Pt(e.source)&&Pt(e.flags)&&wt(e.maxLength)&&wt(e.minLength)}function F3(e){return We(e,"String")&&e.type==="string"&&mt(e.$id)&&wt(e.minLength)&&wt(e.maxLength)&&Y7(e.pattern)&&J7(e.format)}function D3(e){return We(e,"Symbol")&&e.type==="symbol"&&mt(e.$id)}function k3(e){return We(e,"TemplateLiteral")&&e.type==="string"&&Pt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function A3(e){return We(e,"This")&&mt(e.$id)&&Pt(e.$ref)}function Ft(e){return vt(e)&&Rt in e}function L3(e){return We(e,"Tuple")&&e.type==="array"&&mt(e.$id)&&Xn(e.minItems)&&Xn(e.maxItems)&&e.minItems===e.maxItems&&(zt(e.items)&&zt(e.additionalItems)&&e.minItems===0||qr(e.items)&&e.items.every(r=>ze(r)))}function Ap(e){return We(e,"Undefined")&&e.type==="undefined"&&mt(e.$id)}function t6(e){return dv(e)&&e.anyOf.every(r=>g3(r)||y3(r))}function dv(e){return We(e,"Union")&&mt(e.$id)&&vt(e)&&qr(e.anyOf)&&e.anyOf.every(r=>ze(r))}function _3(e){return We(e,"Uint8Array")&&e.type==="Uint8Array"&&mt(e.$id)&&wt(e.minByteLength)&&wt(e.maxByteLength)}function R3(e){return We(e,"Unknown")&&mt(e.$id)}function B3(e){return We(e,"Unsafe")}function N3(e){return We(e,"Void")&&e.type==="void"&&mt(e.$id)}function j3(e){return vt(e)&&U in e&&Pt(e[U])&&!X7.includes(e[U])}function ze(e){return vt(e)&&(i3(e)||s3(e)||c3(e)||l3(e)||a3(e)||p3(e)||d3(e)||u3(e)||m3(e)||f3(e)||h3(e)||Nm(e)||x3(e)||v3(e)||I3(e)||S3(e)||T3(e)||C3(e)||M3(e)||w3(e)||O3(e)||E3(e)||P3(e)||F3(e)||D3(e)||k3(e)||A3(e)||L3(e)||Ap(e)||dv(e)||_3(e)||R3(e)||B3(e)||N3(e)||j3(e))}d();var uv="(true|false)",jm="(0|[1-9][0-9]*)",mv="(.*)",r6="(?!.*)",nJ=`^${uv}$`,Gs=`^${jm}$`,Us=`^${mv}$`,G3=`^${r6}$`;d();var Fo={};La(Fo,{Clear:()=>n6,Delete:()=>i6,Entries:()=>o6,Get:()=>l6,Has:()=>s6,Set:()=>a6});d();var Lp=new Map;function o6(){return new Map(Lp)}function n6(){return Lp.clear()}function i6(e){return Lp.delete(e)}function s6(e){return Lp.has(e)}function a6(e,r){Lp.set(e,r)}function l6(e){return Lp.get(e)}var Or={};La(Or,{Clear:()=>p6,Delete:()=>d6,Entries:()=>c6,Get:()=>f6,Has:()=>u6,Set:()=>m6});d();var _p=new Map;function c6(){return new Map(_p)}function p6(){return _p.clear()}function d6(e){return _p.delete(e)}function u6(e){return _p.has(e)}function m6(e,r){_p.set(e,r)}function f6(e){return _p.get(e)}d();function U3(e,r){return e.includes(r)}function V3(e){return[...new Set(e)]}function h6(e,r){return e.filter(t=>r.includes(t))}function g6(e,r){return e.reduce((t,o)=>h6(t,o),r)}function $3(e){return e.length===1?e[0]:e.length>1?g6(e.slice(1),e[0]):[]}function H3(e){let r=[];for(let t of e)r.push(...t);return r}d();function Wa(e){return Z({[U]:"Any"},e)}d();function wy(e,r){return Z({[U]:"Array",type:"array",items:e},r)}d();function Oy(e,r){return Z({[U]:"AsyncIterator",type:"AsyncIterator",items:e},r)}d();d();d();function y6(e,r){let{[r]:t,...o}=e;return o}function Qt(e,r){return r.reduce((t,o)=>y6(t,o),e)}d();function ft(e){return Z({[U]:"Never",not:{}},e)}d();d();function Ke(e){return Z({[U]:"MappedResult",properties:e})}d();d();function Ey(e,r,t){return Z({[U]:"Constructor",type:"Constructor",parameters:e,returns:r},t)}d();function Za(e,r,t){return Z({[U]:"Function",type:"Function",parameters:e,returns:r},t)}d();d();d();d();function Gm(e,r){return Z({[U]:"Union",anyOf:e},r)}function b6(e){return e.some(r=>ji(r))}function z3(e){return e.map(r=>ji(r)?x6(r):r)}function x6(e){return Qt(e,[mo])}function v6(e,r){return b6(e)?Do(Gm(z3(e),r)):Gm(z3(e),r)}function Gi(e,r){return e.length===0?ft(r):e.length===1?Z(e[0],r):v6(e,r)}d();function ht(e,r){return e.length===0?ft(r):e.length===1?Z(e[0],r):Gm(e,r)}d();d();d();var Py=class extends be{};function I6(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function fv(e,r,t){return e[r]===t&&e.charCodeAt(r-1)!==92}function Vs(e,r){return fv(e,r,"(")}function Um(e,r){return fv(e,r,")")}function W3(e,r){return fv(e,r,"|")}function S6(e){if(!(Vs(e,0)&&Um(e,e.length-1)))return!1;let r=0;for(let t=0;t<e.length;t++)if(Vs(e,t)&&(r+=1),Um(e,t)&&(r-=1),r===0&&t!==e.length-1)return!1;return!0}function T6(e){return e.slice(1,e.length-1)}function C6(e){let r=0;for(let t=0;t<e.length;t++)if(Vs(e,t)&&(r+=1),Um(e,t)&&(r-=1),W3(e,t)&&r===0)return!0;return!1}function M6(e){for(let r=0;r<e.length;r++)if(Vs(e,r))return!0;return!1}function w6(e){let[r,t]=[0,0],o=[];for(let i=0;i<e.length;i++)if(Vs(e,i)&&(r+=1),Um(e,i)&&(r-=1),W3(e,i)&&r===0){let a=e.slice(t,i);a.length>0&&o.push(Rp(a)),t=i+1}let n=e.slice(t);return n.length>0&&o.push(Rp(n)),o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"or",expr:o}}function O6(e){function r(n,i){if(!Vs(n,i))throw new Py("TemplateLiteralParser: Index must point to open parens");let a=0;for(let l=i;l<n.length;l++)if(Vs(n,l)&&(a+=1),Um(n,l)&&(a-=1),a===0)return[i,l];throw new Py("TemplateLiteralParser: Unclosed group parens in expression")}function t(n,i){for(let a=i;a<n.length;a++)if(Vs(n,a))return[i,a];return[i,n.length]}let o=[];for(let n=0;n<e.length;n++)if(Vs(e,n)){let[i,a]=r(e,n),l=e.slice(i,a+1);o.push(Rp(l)),n=a}else{let[i,a]=t(e,n),l=e.slice(i,a);l.length>0&&o.push(Rp(l)),n=a-1}return o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"and",expr:o}}function Rp(e){return S6(e)?Rp(T6(e)):C6(e)?w6(e):M6(e)?O6(e):{type:"const",const:I6(e)}}function Bp(e){return Rp(e.slice(1,e.length-1))}var hv=class extends be{};function E6(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function P6(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function F6(e){return e.type==="const"&&e.const===".*"}function zl(e){return E6(e)||F6(e)?!1:P6(e)?!0:e.type==="and"?e.expr.every(r=>zl(r)):e.type==="or"?e.expr.every(r=>zl(r)):e.type==="const"?!0:(()=>{throw new hv("Unknown expression type")})()}function Fy(e){let r=Bp(e.pattern);return zl(r)}d();var gv=class extends be{};function*Z3(e){if(e.length===1)return yield*e[0];for(let r of e[0])for(let t of Z3(e.slice(1)))yield`${r}${t}`}function*D6(e){return yield*Z3(e.expr.map(r=>[...Vm(r)]))}function*k6(e){for(let r of e.expr)yield*Vm(r)}function*A6(e){return yield e.const}function*Vm(e){return e.type==="and"?yield*D6(e):e.type==="or"?yield*k6(e):e.type==="const"?yield*A6(e):(()=>{throw new gv("Unknown expression")})()}function Np(e){let r=Bp(e.pattern);return zl(r)?[...Vm(r)]:[]}d();d();function at(e,r){return Z({[U]:"Literal",const:e,type:typeof e},r)}d();function Dy(e){return Z({[U]:"Boolean",type:"boolean"},e)}d();function jp(e){return Z({[U]:"BigInt",type:"bigint"},e)}d();function Ui(e){return Z({[U]:"Number",type:"number"},e)}d();function fn(e){return Z({[U]:"String",type:"string"},e)}function*L6(e){let r=e.trim().replace(/"|'/g,"");return r==="boolean"?yield Dy():r==="number"?yield Ui():r==="bigint"?yield jp():r==="string"?yield fn():yield(()=>{let t=r.split("|").map(o=>at(o.trim()));return t.length===0?ft():t.length===1?t[0]:Gi(t)})()}function*_6(e){if(e[1]!=="{"){let r=at("$"),t=yv(e.slice(1));return yield*[r,...t]}for(let r=2;r<e.length;r++)if(e[r]==="}"){let t=L6(e.slice(2,r)),o=yv(e.slice(r+1));return yield*[...t,...o]}yield at(e)}function*yv(e){for(let r=0;r<e.length;r++)if(e[r]==="$"){let t=at(e.slice(0,r)),o=_6(e.slice(r));return yield*[t,...o]}yield at(e)}function X3(e){return[...yv(e)]}d();var bv=class extends be{};function R6(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y3(e,r){return Zo(e)?e.pattern.slice(1,e.pattern.length-1):it(e)?`(${e.anyOf.map(t=>Y3(t,r)).join("|")})`:$l(e)?`${r}${jm}`:Vl(e)?`${r}${jm}`:rv(e)?`${r}${jm}`:Rm(e)?`${r}${mv}`:js(e)?`${r}${R6(e.const.toString())}`:ov(e)?`${r}${uv}`:(()=>{throw new bv(`Unexpected Kind '${e[U]}'`)})()}function xv(e){return`^${e.map(r=>Y3(r,"")).join("")}$`}d();function Wl(e){let t=Np(e).map(o=>at(o));return Gi(t)}d();function ky(e,r){let t=Pt(e)?xv(X3(e)):xv(e);return Z({[U]:"TemplateLiteral",type:"string",pattern:t},r)}function B6(e){return Np(e).map(t=>t.toString())}function N6(e){let r=[];for(let t of e)r.push(...ko(t));return r}function j6(e){return[e.toString()]}function ko(e){return[...new Set(Zo(e)?B6(e):it(e)?N6(e.anyOf):js(e)?j6(e.const):$l(e)?["[number]"]:Vl(e)?["[number]"]:[])]}d();function G6(e,r,t){let o={};for(let n of Object.getOwnPropertyNames(r))o[n]=Gp(e,ko(r[n]),t);return o}function U6(e,r,t){return G6(e,r.properties,t)}function J3(e,r,t){let o=U6(e,r,t);return Ke(o)}function Q3(e,r){return e.map(t=>q3(t,r))}function V6(e){return e.filter(r=>!Ha(r))}function $6(e,r){return Ay(V6(Q3(e,r)))}function H6(e){return e.some(r=>Ha(r))?[]:e}function z6(e,r){return Gi(H6(Q3(e,r)))}function W6(e,r){return r in e?e[r]:r==="[number]"?Gi(e):ft()}function Z6(e,r){return r==="[number]"?e:ft()}function X6(e,r){return r in e?e[r]:ft()}function q3(e,r){return or(e)?$6(e.allOf,r):it(e)?z6(e.anyOf,r):Yn(e)?W6(e.items??[],r):Ns(e)?Z6(e.items,r):gr(e)?X6(e.properties,r):ft()}function $m(e,r){return r.map(t=>q3(e,t))}function K3(e,r){return Gi($m(e,r))}function Gp(e,r,t){return Bt(r)?J3(e,r,t):Wo(r)?ew(e,r,t):Z(Jn(r)?K3(e,ko(r)):K3(e,r),t)}function Y6(e,r,t){return{[r]:Gp(e,[r],_t(t))}}function J6(e,r,t){return r.reduce((o,n)=>({...o,...Y6(e,n,t)}),{})}function K6(e,r,t){return J6(e,r.keys,t)}function ew(e,r,t){let o=K6(e,r,t);return Ke(o)}d();function Ly(e,r){return Z({[U]:"Iterator",type:"Iterator",items:e},r)}d();function Q6(e){let r=[];for(let t in e)ji(e[t])||r.push(t);return r}function q6(e,r){let t=Q6(e),o=t.length>0?{[U]:"Object",type:"object",properties:e,required:t}:{[U]:"Object",type:"object",properties:e};return Z(o,r)}var It=q6;d();function _y(e,r){return Z({[U]:"Promise",type:"Promise",item:e},r)}d();d();function eL(e){return Z(Qt(e,[Bs]))}function tL(e){return Z({...e,[Bs]:"Readonly"})}function rL(e,r){return r===!1?eL(e):tL(e)}function hn(e,r){let t=r??!0;return Bt(e)?tw(e,t):rL(e,t)}function oL(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=hn(e[o],r);return t}function nL(e,r){return oL(e.properties,r)}function tw(e,r){let t=nL(e,r);return Ke(t)}d();function Vi(e,r){return Z(e.length>0?{[U]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[U]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},r)}function rw(e,r){return e in r?gn(e,r[e]):Ke(r)}function iL(e){return{[e]:at(e)}}function sL(e){let r={};for(let t of e)r[t]=at(t);return r}function aL(e,r){return U3(r,e)?iL(e):sL(r)}function lL(e,r){let t=aL(e,r);return rw(e,t)}function Hm(e,r){return r.map(t=>gn(e,t))}function cL(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(r))t[o]=gn(e,r[o]);return t}function gn(e,r){let t={...r};return ji(r)?Do(gn(e,Qt(r,[mo]))):t3(r)?hn(gn(e,Qt(r,[Bs]))):Bt(r)?rw(e,r.properties):Wo(r)?lL(e,r.keys):Am(r)?Ey(Hm(e,r.parameters),gn(e,r.returns),t):Lm(r)?Za(Hm(e,r.parameters),gn(e,r.returns),t):km(r)?Oy(gn(e,r.items),t):_m(r)?Ly(gn(e,r.items),t):or(r)?Ao(Hm(e,r.allOf),t):it(r)?ht(Hm(e,r.anyOf),t):Yn(r)?Vi(Hm(e,r.items??[]),t):gr(r)?It(cL(e,r.properties),t):Ns(r)?wy(gn(e,r.items),t):Hl(r)?_y(gn(e,r.item),t):r}function pL(e,r){let t={};for(let o of e)t[o]=gn(o,r);return t}function ow(e,r,t){let o=Jn(e)?ko(e):e,n=r({[U]:"MappedKey",keys:o}),i=pL(o,n);return It(i,t)}d();function dL(e){return Z(Qt(e,[mo]))}function uL(e){return Z({...e,[mo]:"Optional"})}function mL(e,r){return r===!1?dL(e):uL(e)}function Do(e,r){let t=r??!0;return Bt(e)?nw(e,t):mL(e,t)}function fL(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Do(e[o],r);return t}function hL(e,r){return fL(e.properties,r)}function nw(e,r){let t=hL(e,r);return Ke(t)}d();function zm(e,r={}){let t=e.every(n=>gr(n)),o=Jn(r.unevaluatedProperties)?{unevaluatedProperties:r.unevaluatedProperties}:{};return Z(r.unevaluatedProperties===!1||Jn(r.unevaluatedProperties)||t?{...o,[U]:"Intersect",type:"object",allOf:e}:{...o,[U]:"Intersect",allOf:e},r)}function gL(e){return e.every(r=>ji(r))}function yL(e){return Qt(e,[mo])}function iw(e){return e.map(r=>ji(r)?yL(r):r)}function bL(e,r){return gL(e)?Do(zm(iw(e),r)):zm(iw(e),r)}function Ay(e,r={}){if(e.length===0)return ft(r);if(e.length===1)return Z(e[0],r);if(e.some(t=>kp(t)))throw new Error("Cannot intersect transform types");return bL(e,r)}d();function Ao(e,r){if(e.length===0)return ft(r);if(e.length===1)return Z(e[0],r);if(e.some(t=>kp(t)))throw new Error("Cannot intersect transform types");return zm(e,r)}function sw(e){return e.map(r=>vv(r))}function xL(e){return Ao(sw(e))}function vL(e){return ht(sw(e))}function IL(e){return vv(e)}function vv(e){return or(e)?xL(e.allOf):it(e)?vL(e.anyOf):Hl(e)?IL(e.item):e}function aw(e,r){return Z(vv(e),r)}d();d();d();d();function lw(e){let r=[];for(let t of e)r.push(Er(t));return r}function SL(e){let r=lw(e);return H3(r)}function TL(e){let r=lw(e);return $3(r)}function CL(e){return e.map((r,t)=>t.toString())}function ML(e){return["[number]"]}function wL(e){return globalThis.Object.getOwnPropertyNames(e)}function OL(e){return Iv?globalThis.Object.getOwnPropertyNames(e).map(t=>t[0]==="^"&&t[t.length-1]==="$"?t.slice(1,t.length-1):t):[]}function Er(e){return or(e)?SL(e.allOf):it(e)?TL(e.anyOf):Yn(e)?CL(e.items??[]):Ns(e)?ML(e.items):gr(e)?wL(e.properties):nv(e)?OL(e.patternProperties):[]}var Iv=!1;function $s(e){Iv=!0;let r=Er(e);return Iv=!1,`^(${r.map(o=>`(${o})`).join("|")})$`}function EL(e){return e.map(r=>r==="[number]"?Ui():at(r))}function Ry(e,r){if(Bt(e))return cw(e,r);{let t=Er(e),o=EL(t),n=Gi(o);return Z(n,r)}}function PL(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Ry(e[o],_t(r));return t}function FL(e,r){return PL(e.properties,r)}function cw(e,r){let t=FL(e,r);return Ke(t)}d();function Xa(e){let r=Er(e),t=$m(e,r);return r.map((o,n)=>[r[n],t[n]])}function DL(e){let r=[];for(let t of e)r.push(...Er(t));return V3(r)}function kL(e){return e.filter(r=>!Ha(r))}function AL(e,r){let t=[];for(let o of e)t.push(...$m(o,[r]));return kL(t)}function LL(e,r){let t={};for(let o of r)t[o]=Ay(AL(e,o));return t}function pw(e,r){let t=DL(e),o=LL(e,t);return It(o,r)}d();d();function By(e){return Z({[U]:"Date",type:"Date"},e)}d();function Ny(e){return Z({[U]:"Null",type:"null"},e)}d();function jy(e){return Z({[U]:"Symbol",type:"symbol"},e)}d();function Gy(e){return Z({[U]:"Undefined",type:"undefined"},e)}d();function Uy(e){return Z({[U]:"Uint8Array",type:"Uint8Array"},e)}d();function Hs(e){return Z({[U]:"Unknown"},e)}function _L(e){return e.map(r=>Sv(r,!1))}function RL(e){let r={};for(let t of globalThis.Object.getOwnPropertyNames(e))r[t]=hn(Sv(e[t],!1));return r}function Vy(e,r){return r===!0?e:hn(e)}function Sv(e,r){return Y0(e)?Vy(Wa(),r):K0(e)?Vy(Wa(),r):qr(e)?hn(Vi(_L(e))):Ls(e)?Uy():Ul(e)?By():vt(e)?Vy(It(RL(e)),r):J0(e)?Vy(Za([],Hs()),r):zt(e)?Gy():Q0(e)?Ny():q0(e)?jy():Em(e)?jp():Xn(e)?at(e):Va(e)?at(e):Pt(e)?at(e):It({})}function dw(e,r){return Z(Sv(e,!0),r)}d();function uw(e,r){return Vi(e.parameters,r)}d();function Wm(e,r){return e.map(t=>Kn(t,r))}function BL(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Kn(e[o],r);return t}function NL(e,r){return e.parameters=Wm(e.parameters,r),e.returns=Kn(e.returns,r),e}function jL(e,r){return e.parameters=Wm(e.parameters,r),e.returns=Kn(e.returns,r),e}function GL(e,r){return e.allOf=Wm(e.allOf,r),e}function UL(e,r){return e.anyOf=Wm(e.anyOf,r),e}function VL(e,r){return zt(e.items)||(e.items=Wm(e.items,r)),e}function $L(e,r){return e.items=Kn(e.items,r),e}function HL(e,r){return e.properties=BL(e.properties,r),e}function zL(e,r){return e.item=Kn(e.item,r),e}function WL(e,r){return e.items=Kn(e.items,r),e}function ZL(e,r){return e.items=Kn(e.items,r),e}function XL(e,r){let t=r.find(n=>n.$id===e.$ref);if(t===void 0)throw Error(`Unable to dereference schema with $id ${e.$ref}`);let o=Qt(t,["$id"]);return Kn(o,r)}function YL(e,r){return Am(e)?NL(e,r):Lm(e)?jL(e,r):or(e)?GL(e,r):it(e)?UL(e,r):Yn(e)?VL(e,r):Ns(e)?$L(e,r):gr(e)?HL(e,r):Hl(e)?zL(e,r):km(e)?WL(e,r):_m(e)?ZL(e,r):iv(e)?XL(e,r):e}function Kn(e,r){return YL(Fm(e),QM(r))}d();function mw(e,r){if(zt(e))throw new Error("Enum undefined or empty");let t=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),n=[...new Set(t)].map(i=>at(i));return ht(n,{...r,[mn]:"Enum"})}d();d();d();var Cv=class extends be{},$;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})($||($={}));function yn(e){return e===$.False?e:$.True}function Up(e){throw new Cv(e)}function lr(e){return D.IsNever(e)||D.IsIntersect(e)||D.IsUnion(e)||D.IsUnknown(e)||D.IsAny(e)}function cr(e,r){return D.IsNever(r)?vw(e,r):D.IsIntersect(r)?$y(e,r):D.IsUnion(r)?Ev(e,r):D.IsUnknown(r)?Cw(e,r):D.IsAny(r)?Ov(e,r):Up("StructuralRight")}function Ov(e,r){return $.True}function JL(e,r){return D.IsIntersect(r)?$y(e,r):D.IsUnion(r)&&r.anyOf.some(t=>D.IsAny(t)||D.IsUnknown(t))?$.True:D.IsUnion(r)?$.Union:D.IsUnknown(r)||D.IsAny(r)?$.True:$.Union}function KL(e,r){return D.IsUnknown(e)?$.False:D.IsAny(e)?$.Union:D.IsNever(e)?$.True:$.False}function QL(e,r){return D.IsObject(r)&&Hy(r)?$.True:lr(r)?cr(e,r):D.IsArray(r)?yn(gt(e.items,r.items)):$.False}function qL(e,r){return lr(r)?cr(e,r):D.IsAsyncIterator(r)?yn(gt(e.items,r.items)):$.False}function e9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsBigInt(r)?$.True:$.False}function bw(e,r){return D.IsLiteralBoolean(e)||D.IsBoolean(e)?$.True:$.False}function t9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsBoolean(r)?$.True:$.False}function r9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsConstructor(r)?e.parameters.length>r.parameters.length?$.False:e.parameters.every((t,o)=>yn(gt(r.parameters[o],t))===$.True)?yn(gt(e.returns,r.returns)):$.False:$.False}function o9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsDate(r)?$.True:$.False}function n9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsFunction(r)?e.parameters.length>r.parameters.length?$.False:e.parameters.every((t,o)=>yn(gt(r.parameters[o],t))===$.True)?yn(gt(e.returns,r.returns)):$.False:$.False}function xw(e,r){return D.IsLiteral(e)&&Ye.IsNumber(e.const)||D.IsNumber(e)||D.IsInteger(e)?$.True:$.False}function i9(e,r){return D.IsInteger(r)||D.IsNumber(r)?$.True:lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):$.False}function $y(e,r){return r.allOf.every(t=>gt(e,t)===$.True)?$.True:$.False}function s9(e,r){return e.allOf.some(t=>gt(t,r)===$.True)?$.True:$.False}function a9(e,r){return lr(r)?cr(e,r):D.IsIterator(r)?yn(gt(e.items,r.items)):$.False}function l9(e,r){return D.IsLiteral(r)&&r.const===e.const?$.True:lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsString(r)?Tw(e,r):D.IsNumber(r)?Iw(e,r):D.IsInteger(r)?xw(e,r):D.IsBoolean(r)?bw(e,r):$.False}function vw(e,r){return $.False}function c9(e,r){return $.True}function fw(e){let[r,t]=[e,0];for(;D.IsNot(r);)r=r.not,t+=1;return t%2===0?r:Hs()}function p9(e,r){return D.IsNot(e)?gt(fw(e),r):D.IsNot(r)?gt(e,fw(r)):Up("Invalid fallthrough for Not")}function d9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsNull(r)?$.True:$.False}function Iw(e,r){return D.IsLiteralNumber(e)||D.IsNumber(e)||D.IsInteger(e)?$.True:$.False}function u9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsInteger(r)||D.IsNumber(r)?$.True:$.False}function Lo(e,r){return Object.getOwnPropertyNames(e.properties).length===r}function hw(e){return Hy(e)}function gw(e){return Lo(e,0)||Lo(e,1)&&"description"in e.properties&&D.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(D.IsString(e.properties.description.anyOf[0])&&D.IsUndefined(e.properties.description.anyOf[1])||D.IsString(e.properties.description.anyOf[1])&&D.IsUndefined(e.properties.description.anyOf[0]))}function Tv(e){return Lo(e,0)}function yw(e){return Lo(e,0)}function m9(e){return Lo(e,0)}function f9(e){return Lo(e,0)}function h9(e){return Hy(e)}function g9(e){let r=Ui();return Lo(e,0)||Lo(e,1)&&"length"in e.properties&&yn(gt(e.properties.length,r))===$.True}function y9(e){return Lo(e,0)}function Hy(e){let r=Ui();return Lo(e,0)||Lo(e,1)&&"length"in e.properties&&yn(gt(e.properties.length,r))===$.True}function b9(e){let r=Za([Wa()],Wa());return Lo(e,0)||Lo(e,1)&&"then"in e.properties&&yn(gt(e.properties.then,r))===$.True}function Sw(e,r){return gt(e,r)===$.False||D.IsOptional(e)&&!D.IsOptional(r)?$.False:$.True}function eo(e,r){return D.IsUnknown(e)?$.False:D.IsAny(e)?$.Union:D.IsNever(e)||D.IsLiteralString(e)&&hw(r)||D.IsLiteralNumber(e)&&Tv(r)||D.IsLiteralBoolean(e)&&yw(r)||D.IsSymbol(e)&&gw(r)||D.IsBigInt(e)&&m9(r)||D.IsString(e)&&hw(r)||D.IsSymbol(e)&&gw(r)||D.IsNumber(e)&&Tv(r)||D.IsInteger(e)&&Tv(r)||D.IsBoolean(e)&&yw(r)||D.IsUint8Array(e)&&h9(r)||D.IsDate(e)&&f9(r)||D.IsConstructor(e)&&y9(r)||D.IsFunction(e)&&g9(r)?$.True:D.IsRecord(e)&&D.IsString(Mv(e))?r[mn]==="Record"?$.True:$.False:D.IsRecord(e)&&D.IsNumber(Mv(e))?Lo(r,0)?$.True:$.False:$.False}function x9(e,r){return lr(r)?cr(e,r):D.IsRecord(r)?bn(e,r):D.IsObject(r)?(()=>{for(let t of Object.getOwnPropertyNames(r.properties)){if(!(t in e.properties)&&!D.IsOptional(r.properties[t]))return $.False;if(D.IsOptional(r.properties[t]))return $.True;if(Sw(e.properties[t],r.properties[t])===$.False)return $.False}return $.True})():$.False}function v9(e,r){return lr(r)?cr(e,r):D.IsObject(r)&&b9(r)?$.True:D.IsPromise(r)?yn(gt(e.item,r.item)):$.False}function Mv(e){return Gs in e.patternProperties?Ui():Us in e.patternProperties?fn():Up("Unknown record key pattern")}function wv(e){return Gs in e.patternProperties?e.patternProperties[Gs]:Us in e.patternProperties?e.patternProperties[Us]:Up("Unable to get record value schema")}function bn(e,r){let[t,o]=[Mv(r),wv(r)];return D.IsLiteralString(e)&&D.IsNumber(t)&&yn(gt(e,o))===$.True?$.True:D.IsUint8Array(e)&&D.IsNumber(t)||D.IsString(e)&&D.IsNumber(t)||D.IsArray(e)&&D.IsNumber(t)?gt(e,o):D.IsObject(e)?(()=>{for(let n of Object.getOwnPropertyNames(e.properties))if(Sw(o,e.properties[n])===$.False)return $.False;return $.True})():$.False}function I9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?gt(wv(e),wv(r)):$.False}function S9(e,r){let t=D.IsRegExp(e)?fn():e,o=D.IsRegExp(r)?fn():r;return gt(t,o)}function Tw(e,r){return D.IsLiteral(e)&&Ye.IsString(e.const)||D.IsString(e)?$.True:$.False}function T9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsString(r)?$.True:$.False}function C9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsSymbol(r)?$.True:$.False}function M9(e,r){return D.IsTemplateLiteral(e)?gt(Wl(e),r):D.IsTemplateLiteral(r)?gt(e,Wl(r)):Up("Invalid fallthrough for TemplateLiteral")}function w9(e,r){return D.IsArray(r)&&e.items!==void 0&&e.items.every(t=>gt(t,r.items)===$.True)}function O9(e,r){return D.IsNever(e)?$.True:D.IsUnknown(e)?$.False:D.IsAny(e)?$.Union:$.False}function E9(e,r){return lr(r)?cr(e,r):D.IsObject(r)&&Hy(r)||D.IsArray(r)&&w9(e,r)?$.True:D.IsTuple(r)?Ye.IsUndefined(e.items)&&!Ye.IsUndefined(r.items)||!Ye.IsUndefined(e.items)&&Ye.IsUndefined(r.items)?$.False:Ye.IsUndefined(e.items)&&!Ye.IsUndefined(r.items)||e.items.every((t,o)=>gt(t,r.items[o])===$.True)?$.True:$.False:$.False}function P9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsUint8Array(r)?$.True:$.False}function F9(e,r){return lr(r)?cr(e,r):D.IsObject(r)?eo(e,r):D.IsRecord(r)?bn(e,r):D.IsVoid(r)?A9(e,r):D.IsUndefined(r)?$.True:$.False}function Ev(e,r){return r.anyOf.some(t=>gt(e,t)===$.True)?$.True:$.False}function D9(e,r){return e.anyOf.every(t=>gt(t,r)===$.True)?$.True:$.False}function Cw(e,r){return $.True}function k9(e,r){return D.IsNever(r)?vw(e,r):D.IsIntersect(r)?$y(e,r):D.IsUnion(r)?Ev(e,r):D.IsAny(r)?Ov(e,r):D.IsString(r)?Tw(e,r):D.IsNumber(r)?Iw(e,r):D.IsInteger(r)?xw(e,r):D.IsBoolean(r)?bw(e,r):D.IsArray(r)?KL(e,r):D.IsTuple(r)?O9(e,r):D.IsObject(r)?eo(e,r):D.IsUnknown(r)?$.True:$.False}function A9(e,r){return D.IsUndefined(e)||D.IsUndefined(e)?$.True:$.False}function L9(e,r){return D.IsIntersect(r)?$y(e,r):D.IsUnion(r)?Ev(e,r):D.IsUnknown(r)?Cw(e,r):D.IsAny(r)?Ov(e,r):D.IsObject(r)?eo(e,r):D.IsVoid(r)?$.True:$.False}function gt(e,r){return D.IsTemplateLiteral(e)||D.IsTemplateLiteral(r)?M9(e,r):D.IsRegExp(e)||D.IsRegExp(r)?S9(e,r):D.IsNot(e)||D.IsNot(r)?p9(e,r):D.IsAny(e)?JL(e,r):D.IsArray(e)?QL(e,r):D.IsBigInt(e)?e9(e,r):D.IsBoolean(e)?t9(e,r):D.IsAsyncIterator(e)?qL(e,r):D.IsConstructor(e)?r9(e,r):D.IsDate(e)?o9(e,r):D.IsFunction(e)?n9(e,r):D.IsInteger(e)?i9(e,r):D.IsIntersect(e)?s9(e,r):D.IsIterator(e)?a9(e,r):D.IsLiteral(e)?l9(e,r):D.IsNever(e)?c9(e,r):D.IsNull(e)?d9(e,r):D.IsNumber(e)?u9(e,r):D.IsObject(e)?x9(e,r):D.IsRecord(e)?I9(e,r):D.IsString(e)?T9(e,r):D.IsSymbol(e)?C9(e,r):D.IsTuple(e)?E9(e,r):D.IsPromise(e)?v9(e,r):D.IsUint8Array(e)?P9(e,r):D.IsUndefined(e)?F9(e,r):D.IsUnion(e)?D9(e,r):D.IsUnknown(e)?k9(e,r):D.IsVoid(e)?L9(e,r):Up(`Unknown left type operand '${e[U]}'`)}function Ya(e,r){return gt(e,r)}d();d();d();function _9(e,r,t,o,n){let i={};for(let a of globalThis.Object.getOwnPropertyNames(e))i[a]=Vp(e[a],r,t,o,_t(n));return i}function R9(e,r,t,o,n){return _9(e.properties,r,t,o,n)}function Mw(e,r,t,o,n){let i=R9(e,r,t,o,n);return Ke(i)}function B9(e,r,t,o){let n=Ya(e,r);return n===$.Union?ht([t,o]):n===$.True?t:o}function Vp(e,r,t,o,n){return Bt(e)?Mw(e,r,t,o,n):Wo(e)?Z(ww(e,r,t,o,n)):Z(B9(e,r,t,o),n)}function N9(e,r,t,o,n){return{[e]:Vp(at(e),r,t,o,_t(n))}}function j9(e,r,t,o,n){return e.reduce((i,a)=>({...i,...N9(a,r,t,o,n)}),{})}function G9(e,r,t,o,n){return j9(e.keys,r,t,o,n)}function ww(e,r,t,o,n){let i=G9(e,r,t,o,n);return Ke(i)}d();function U9(e){return e.allOf.every(r=>zs(r))}function V9(e){return e.anyOf.some(r=>zs(r))}function $9(e){return!zs(e.not)}function zs(e){return e[U]==="Intersect"?U9(e):e[U]==="Union"?V9(e):e[U]==="Not"?$9(e):e[U]==="Undefined"}d();function Ow(e,r){return $p(Wl(e),r)}function H9(e,r){let t=e.filter(o=>Ya(o,r)===$.False);return t.length===1?t[0]:ht(t)}function $p(e,r,t={}){return Zo(e)?Z(Ow(e,r),t):Bt(e)?Z(Ew(e,r),t):Z(it(e)?H9(e.anyOf,r):Ya(e,r)!==$.False?ft():e,t)}function z9(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=$p(e[o],r);return t}function W9(e,r){return z9(e.properties,r)}function Ew(e,r){let t=W9(e,r);return Ke(t)}d();d();d();function Pw(e,r){return Hp(Wl(e),r)}function Z9(e,r){let t=e.filter(o=>Ya(o,r)!==$.False);return t.length===1?t[0]:ht(t)}function Hp(e,r,t){return Zo(e)?Z(Pw(e,r),t):Bt(e)?Z(Fw(e,r),t):Z(it(e)?Z9(e.anyOf,r):Ya(e,r)!==$.False?e:ft(),t)}function X9(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Hp(e[o],r);return t}function Y9(e,r){return X9(e.properties,r)}function Fw(e,r){let t=Y9(e,r);return Ke(t)}d();function Dw(e,r){return Z(e.returns,r)}d();function kw(e){return Z({[U]:"Integer",type:"integer"},e)}d();d();d();function J9(e,r,t){return{[e]:Qn(at(e),r,_t(t))}}function K9(e,r,t){return e.reduce((n,i)=>({...n,...J9(i,r,t)}),{})}function Q9(e,r,t){return K9(e.keys,r,t)}function Aw(e,r,t){let o=Q9(e,r,t);return Ke(o)}function q9(e){let[r,t]=[e.slice(0,1),e.slice(1)];return[r.toLowerCase(),t].join("")}function e_(e){let[r,t]=[e.slice(0,1),e.slice(1)];return[r.toUpperCase(),t].join("")}function t_(e){return e.toUpperCase()}function r_(e){return e.toLowerCase()}function o_(e,r,t){let o=Bp(e.pattern);if(!zl(o))return{...e,pattern:Lw(e.pattern,r)};let a=[...Vm(o)].map(p=>at(p)),l=_w(a,r),c=ht(l);return ky([c],t)}function Lw(e,r){return typeof e=="string"?r==="Uncapitalize"?q9(e):r==="Capitalize"?e_(e):r==="Uppercase"?t_(e):r==="Lowercase"?r_(e):e:e.toString()}function _w(e,r){return e.map(t=>Qn(t,r))}function Qn(e,r,t={}){return Wo(e)?Aw(e,r,t):Zo(e)?o_(e,r,t):it(e)?ht(_w(e.anyOf,r),t):js(e)?at(Lw(e.const,r),t):Z(e,t)}function Rw(e,r={}){return Qn(e,"Capitalize",r)}d();function Bw(e,r={}){return Qn(e,"Lowercase",r)}d();function Nw(e,r={}){return Qn(e,"Uncapitalize",r)}d();function jw(e,r={}){return Qn(e,"Uppercase",r)}d();function Gw(e,r){return Z({[U]:"Not",not:e},r)}d();d();d();function n_(e,r,t){let o={};for(let n of globalThis.Object.getOwnPropertyNames(e))o[n]=zp(e[n],r,_t(t));return o}function i_(e,r,t){return n_(e.properties,r,t)}function Uw(e,r,t){let o=i_(e,r,t);return Ke(o)}function s_(e,r){return e.map(t=>Pv(t,r))}function a_(e,r){return e.map(t=>Pv(t,r))}function l_(e,r){let{[r]:t,...o}=e;return o}function c_(e,r){return r.reduce((t,o)=>l_(t,o),e)}function p_(e,r){let t=Qt(e,[Rt,"$id","required","properties"]),o=c_(e.properties,r);return It(o,t)}function Pv(e,r){return or(e)?Ao(s_(e.allOf,r)):it(e)?ht(a_(e.anyOf,r)):gr(e)?p_(e,r):It({})}function zp(e,r,t){if(Wo(r))return Vw(e,r,t);if(Bt(e))return Uw(e,r,t);let o=Jn(r)?ko(r):r;return Z({...Pv(e,o),...t})}function d_(e,r,t){return{[r]:zp(e,[r],_t(t))}}function u_(e,r,t){return r.reduce((o,n)=>({...o,...d_(e,n,t)}),{})}function m_(e,r,t){return u_(e,r.keys,t)}function Vw(e,r,t){let o=m_(e,r,t);return Ke(o)}d();function $w(e,r){return Vi(e.parameters,r)}d();d();function Hw(e){return e.map(r=>zw(r))}function f_(e){let r={};for(let t of globalThis.Object.getOwnPropertyNames(e))r[t]=Do(e[t]);return r}function h_(e){let r=Qt(e,[Rt,"$id","required","properties"]),t=f_(e.properties);return It(t,r)}function zw(e){return or(e)?Ao(Hw(e.allOf)):it(e)?ht(Hw(e.anyOf)):gr(e)?h_(e):It({})}function zy(e,r){return Bt(e)?Ww(e,r):Z({...zw(e),...r})}function g_(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=zy(e[o],_t(r));return t}function y_(e,r){return g_(e.properties,r)}function Ww(e,r){let t=y_(e,r);return Ke(t)}d();d();d();function b_(e,r,t){let o={};for(let n of globalThis.Object.getOwnPropertyNames(e))o[n]=Wp(e[n],r,_t(t));return o}function x_(e,r,t){return b_(e.properties,r,t)}function Zw(e,r,t){let o=x_(e,r,t);return Ke(o)}function v_(e,r){return e.map(t=>Fv(t,r))}function I_(e,r){return e.map(t=>Fv(t,r))}function S_(e,r){let t={};for(let o of r)o in e&&(t[o]=e[o]);return t}function T_(e,r){let t=Qt(e,[Rt,"$id","required","properties"]),o=S_(e.properties,r);return It(o,t)}function Fv(e,r){return or(e)?Ao(v_(e.allOf,r)):it(e)?ht(I_(e.anyOf,r)):gr(e)?T_(e,r):It({})}function Wp(e,r,t){if(Wo(r))return Xw(e,r,t);if(Bt(e))return Zw(e,r,t);let o=Jn(r)?ko(r):r;return Z({...Fv(e,o),...t})}function C_(e,r,t){return{[r]:Wp(e,[r],_t(t))}}function M_(e,r,t){return r.reduce((o,n)=>({...o,...C_(e,n,t)}),{})}function w_(e,r,t){return M_(e,r.keys,t)}function Xw(e,r,t){let o=w_(e,r,t);return Ke(o)}d();function Yw(e){return hn(Do(e))}d();function Zl(e,r,t){return Z({[U]:"Record",type:"object",patternProperties:{[e]:r}},t)}function Dv(e,r,t){let o={};for(let n of e)o[n]=r;return It(o,{...t,[mn]:"Record"})}function O_(e,r,t){return Fy(e)?Dv(ko(e),r,t):Zl(e.pattern,r,t)}function E_(e,r,t){return Dv(ko(ht(e)),r,t)}function P_(e,r,t){return Dv([e.toString()],r,t)}function F_(e,r,t){return Zl(e.source,r,t)}function D_(e,r,t){let o=zt(e.pattern)?Us:e.pattern;return Zl(o,r,t)}function k_(e,r,t){return Zl(Us,r,t)}function A_(e,r,t){return Zl(G3,r,t)}function L_(e,r,t){return Zl(Gs,r,t)}function __(e,r,t){return Zl(Gs,r,t)}function Jw(e,r,t={}){return it(e)?E_(e.anyOf,r,t):Zo(e)?O_(e,r,t):js(e)?P_(e.const,r,t):Vl(e)?L_(e,r,t):$l(e)?__(e,r,t):sv(e)?F_(e,r,t):Rm(e)?D_(e,r,t):tv(e)?k_(e,r,t):Ha(e)?A_(e,r,t):ft(t)}d();var R_=0;function Kw(e,r={}){zt(r.$id)&&(r.$id=`T${R_++}`);let t=Fm(e({[U]:"This",$ref:`${r.$id}`}));return t.$id=r.$id,Z({[mn]:"Recursive",...t},r)}d();function Qw(e,r){if(Pt(e))return Z({[U]:"Ref",$ref:e},r);if(zt(e.$id))throw new Error("Reference target type must specify an $id");return Z({[U]:"Ref",$ref:e.$id},r)}d();function qw(e,r){let t=Pt(e)?new globalThis.RegExp(e):e;return Z({[U]:"RegExp",type:"RegExp",source:t.source,flags:t.flags},r)}d();d();function eO(e){return e.map(r=>tO(r))}function B_(e){let r={};for(let t of globalThis.Object.getOwnPropertyNames(e))r[t]=Qt(e[t],[mo]);return r}function N_(e){let r=Qt(e,[Rt,"$id","required","properties"]),t=B_(e.properties);return It(t,r)}function tO(e){return or(e)?Ao(eO(e.allOf)):it(e)?ht(eO(e.anyOf)):gr(e)?N_(e):It({})}function Wy(e,r){return Bt(e)?rO(e,r):Z({...tO(e),...r})}function j_(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Wy(e[o],r);return t}function G_(e,r){return j_(e.properties,r)}function rO(e,r){let t=G_(e,r);return Ke(t)}d();function U_(e){return or(e)?e.allOf:it(e)?e.anyOf:Yn(e)?e.items??[]:[]}function oO(e){return U_(e)}d();function nO(e,r){return Z(e.returns,r)}d();function iO(e){return JSON.parse(JSON.stringify(e))}d();var kv=class{constructor(r){this.schema=r}Decode(r){return new Av(this.schema,r)}},Av=class{constructor(r,t){this.schema=r,this.decode=t}EncodeTransform(r,t){let i={Encode:a=>t[Rt].Encode(r(a)),Decode:a=>this.decode(t[Rt].Decode(a))};return{...t,[Rt]:i}}EncodeSchema(r,t){let o={Decode:this.decode,Encode:r};return{...t,[Rt]:o}}Encode(r){return kp(this.schema)?this.EncodeTransform(r,this.schema):this.EncodeSchema(r,this.schema)}};function sO(e){return new kv(e)}d();function Zy(e={}){return Z({[U]:e[U]??"Unsafe"},e)}d();function aO(e){return Z({[U]:"Void",type:"void"},e)}d();var Lv={};La(Lv,{Any:()=>Wa,Array:()=>wy,AsyncIterator:()=>Oy,Awaited:()=>aw,BigInt:()=>jp,Boolean:()=>Dy,Capitalize:()=>Rw,Composite:()=>pw,Const:()=>dw,Constructor:()=>Ey,ConstructorParameters:()=>uw,Date:()=>By,Deref:()=>Kn,Enum:()=>mw,Exclude:()=>$p,Extends:()=>Vp,Extract:()=>Hp,Function:()=>Za,Index:()=>Gp,InstanceType:()=>Dw,Integer:()=>kw,Intersect:()=>Ao,Iterator:()=>Ly,KeyOf:()=>Ry,Literal:()=>at,Lowercase:()=>Bw,Mapped:()=>ow,Never:()=>ft,Not:()=>Gw,Null:()=>Ny,Number:()=>Ui,Object:()=>It,Omit:()=>zp,Optional:()=>Do,Parameters:()=>$w,Partial:()=>zy,Pick:()=>Wp,Promise:()=>_y,Readonly:()=>hn,ReadonlyOptional:()=>Yw,Record:()=>Jw,Recursive:()=>Kw,Ref:()=>Qw,RegExp:()=>qw,Required:()=>Wy,Rest:()=>oO,ReturnType:()=>nO,Strict:()=>iO,String:()=>fn,Symbol:()=>jy,TemplateLiteral:()=>ky,Transform:()=>sO,Tuple:()=>Vi,Uint8Array:()=>Uy,Uncapitalize:()=>Nw,Undefined:()=>Gy,Union:()=>ht,Unknown:()=>Hs,Unsafe:()=>Zy,Uppercase:()=>jw,Void:()=>aO});d();var g=Lv;d();var Zm=g.Object({externalId:g.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:g.String({description:"The name of the entity."}),shortName:g.String({description:"A short name for the entity."}),description:g.String({description:"A description of the entity."}),icon:g.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),_v=g.Partial(Zm,{$id:"Details",description:"Additional information about a given entity."}),Xo=g.Object({details:g.Optional(g.Ref(_v))},{$id:"WithDetails"}),Xl=e=>{let r=[...e].sort(),t=g.Pick(Zm,e),o=g.Omit(Zm,e);return g.Object({details:g.Intersect([t,g.Partial(o)])},{$id:`WithRequiredDetails_${r.join("_")}`})},Rv=[Zm,_v];d();var Zp=g.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),Xp=g.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Yl=g.Tuple([g.Ref(Zp),g.Ref(Xp)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),to=g.Object({type:g.Literal("Point"),coordinates:g.Ref(Yl)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),Xy=g.Object({type:g.Literal("MultiPoint"),coordinates:g.Array(g.Ref(Yl))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),Yy=g.Object({type:g.Literal("LineString"),coordinates:g.Array(g.Ref(Yl),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Jy=g.Object({type:g.Literal("MultiLineString"),coordinates:g.Array(g.Array(g.Ref(Yl),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),lO=g.Array(g.Ref(Yl),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),Bv=g.Array(g.Ref(lO),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Yp=g.Object({type:g.Literal("Polygon"),coordinates:g.Ref(Bv)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),Jp=g.Object({type:g.Literal("MultiPolygon"),coordinates:g.Array(g.Ref(Bv))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),Ur=(e,r,t)=>g.Object({type:g.Literal("Feature"),geometry:e,properties:r},t),fo=(e,r,t)=>g.Object({type:g.Literal("FeatureCollection"),features:g.Array(e,t)},r),Nv=[Zp,Xp,Yl,to,Xy,Yy,Jy,lO,Bv,Yp,Jp];d();var qt=(e,r)=>g.Unsafe(g.String({$id:r,pattern:`^${e}_[A-Za-z0-9-]+$`})),ro=qt("g","GeometryId"),Ve=qt("f","FloorId"),jv=[ro,Ve];d();d();d();var Ky=class{constructor(r){m(this,"_value");this._value=r}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let r=this._value;return this._value=null,{done:!1,value:r}}},Qy=class{constructor(r){m(this,"_tag","Some");m(this,"_value");this._value=r}get value(){return this._value}isSome(){return!0}isSomeAnd(r){return r(this.value)}isNone(){return!1}equals(r){return r.isSome()&&r.value===this.value}expect(r){return this.value}unwrap(){return this.value}unwrapOr(r){return this.value}unwrapOrElse(r){return this.value}inspect(r){return r(this.value),this}inspectNone(r){return this}map(r){return cO(r(this.value))}mapAsync(r){return r(this.value).then(t=>cO(t))}mapOr(r,t){return this.map(r).unwrapOr(t)}mapOrAsync(r,t){return this.mapAsync(r).then(o=>o.unwrapOr(t))}mapOrElse(r,t){return this.map(r).unwrapOrElse(t)}mapOrElseAsync(r,t){return this.mapAsync(r).then(o=>o.unwrapOrElse(t))}and(r){return r}andThen(r){return r(this.value)}andThenAsync(r){return r(this.value)}filter(r){return r(this.value)?this:Ja()}or(r){return this}orElse(r){return this}xor(r){return r.isSome()?Ja():this}toString(){return`Some(${this.value})`}okOr(r){return oe(this.value)}okOrElse(r){return oe(this.value)}iter(){return new Ky(this.value)}[Symbol.iterator](){return this.iter()}zip(r){return r.isSome()?Kp([this.value,r.value]):Ja()}zipWith(r,t){return r.isSome()?Kp(t(this.value,r.value)):Ja()}get[Symbol.toStringTag](){return"Some"}},qy=class{constructor(){m(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(r){return!1}isNone(){return!0}equals(r){return r.isNone()}expect(r){throw new Error(r)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(r){return r}unwrapOrElse(r){return r()}inspect(r){return this}inspectNone(r){return r(),this}map(r){return this}mapAsync(r){return Promise.resolve(this)}mapOr(r,t){return t}mapOrAsync(r,t){return Promise.resolve(t)}mapOrElse(r,t){return t()}mapOrElseAsync(r,t){return t()}and(r){return this}andThen(r){return this}andThenAsync(r){return Promise.resolve(this)}filter(r){return this}or(r){return r}orElse(r){return r()}xor(r){return r}toString(){return"None"}okOr(r){return ie(r)}okOrElse(r){return ie(r())}iter(){return new Ky(null)}[Symbol.iterator](){return this.iter()}zip(r){return this}zipWith(r,t){return this}get[Symbol.toStringTag](){return"None"}},Kp=e=>new Qy(e),Ja=()=>new qy,cO=e=>e instanceof Qy||e instanceof qy?e:e==null?Ja():Kp(e);var eb=class{constructor(r){m(this,"_value");this._value=r}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let r=this._value;return this._value=null,{done:!1,value:r}}},Gv=class{constructor(r){m(this,"_tag","Ok");m(this,"_value");this._value=r}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(r){return r(this.value)}isErr(){return!1}isErrAnd(r){return!1}ok(){return Kp(this.value)}err(){return Ja()}expect(r){return this.value}expectErr(r){throw new Error(r)}unwrap(){return this.value}unwrapOr(r){return this.value}unwrapOrElse(r){return this.value}inspect(r){return r(this.value),this}inspectErr(){return this}map(r){return oe(r(this.value))}async mapAsync(r){return r(this.value).then(oe)}mapOr(r,t){return r(this.value)}async mapOrAsync(r,t){return r(this.value)}mapOrElse(r,t){return r(this.value)}async mapOrElseAsync(r,t){return r(this.value)}mapErr(r){return this}iter(){return new eb(this.value)}[Symbol.iterator](){return this.iter()}and(r){return r}andThen(r){return r(this.value)}or(r){return this}orElse(r){return this}async andThenAsync(r){return r(this.value)}toString(){return`Ok(${this.value})`}get[Symbol.toStringTag](){return"Ok"}},Uv=class e{constructor(r){m(this,"_tag","Err");m(this,"_error");this._error=r}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(r){return!1}isErr(){return!0}isErrAnd(r){return r(this.error)}ok(){return Ja()}err(){return Kp(this.error)}expect(r){throw new Error(r)}expectErr(r){return this.error}unwrap(){throw this.error}unwrapOr(r){return r}unwrapOrElse(r){return r()}inspect(){return this}inspectErr(r){return r(this.error),this}map(r){return this}iter(){return new eb(null)}[Symbol.iterator](){return this.iter()}async mapAsync(r){return this}mapOr(r,t){return t}async mapOrAsync(r,t){return t}mapOrElse(r,t){return t()}async mapOrElseAsync(r,t){return t()}mapErr(r){return new e(r(this.error))}and(r){return this}andThen(r){return this}async andThenAsync(r){return this}or(r){return r}orElse(r){return r(this.error)}toString(){return`Err(${this.error})`}get[Symbol.toStringTag](){return"Err"}},oe=e=>new Gv(e),ie=e=>new Uv(e);d();var _o;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError",e.DuplicateIdError="DuplicateIdError"})(_o||(_o={}));d();d();d();d();var Vv=class extends be{constructor(r){super(`Duplicate type kind '${r}' detected`)}},Xm=class extends be{constructor(r){super(`Duplicate string format '${r}' detected`)}},tb;(function(e){function r(o,n){if(Or.Has(o))throw new Vv(o);return Or.Set(o,n),(i={})=>Zy({...i,[U]:o})}e.Type=r;function t(o,n){if(Fo.Has(o))throw new Xm(o);return Fo.Set(o,n),o}e.Format=t})(tb||(tb={}));d();function V_(e){switch(e.errorType){case V.ArrayContains:return"Expected array to contain at least one matching value";case V.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case V.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case V.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case V.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case V.ArrayUniqueItems:return"Expected array elements to be unique";case V.Array:return"Expected array";case V.AsyncIterator:return"Expected AsyncIterator";case V.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case V.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case V.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case V.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case V.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case V.BigInt:return"Expected bigint";case V.Boolean:return"Expected boolean";case V.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case V.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case V.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case V.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case V.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case V.Date:return"Expected Date";case V.Function:return"Expected function";case V.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case V.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case V.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case V.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case V.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case V.Integer:return"Expected integer";case V.IntersectUnevaluatedProperties:return"Unexpected property";case V.Intersect:return"Expected all values to match";case V.Iterator:return"Expected Iterator";case V.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case V.Never:return"Never";case V.Not:return"Value should not match";case V.Null:return"Expected null";case V.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case V.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case V.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case V.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case V.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case V.Number:return"Expected number";case V.Object:return"Expected object";case V.ObjectAdditionalProperties:return"Unexpected property";case V.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case V.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case V.ObjectRequiredProperty:return"Expected required property";case V.Promise:return"Expected Promise";case V.RegExp:return"Expected string to match regular expression";case V.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case V.StringFormat:return`Expected string to match '${e.schema.format}' format`;case V.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case V.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case V.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case V.String:return"Expected string";case V.Symbol:return"Expected symbol";case V.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case V.Tuple:return"Expected tuple";case V.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case V.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case V.Uint8Array:return"Expected Uint8Array";case V.Undefined:return"Expected undefined";case V.Union:return"Expected union value";case V.Void:return"Expected void";case V.Kind:return`Expected kind '${e.schema[U]}'`;default:return"Unknown error type"}}var $_=V_;function pO(){return $_}d();var $v=class extends be{constructor(r){super(`Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};function H_(e,r){let t=r.find(o=>o.$id===e.$ref);if(t===void 0)throw new $v(e);return Qe(t,r)}function xn(e,r){return!He(e.$id)||r.some(t=>t.$id===e.$id)||r.push(e),r}function Qe(e,r){return e[U]==="This"||e[U]==="Ref"?H_(e,r):e}d();var Hv=class extends be{constructor(r){super("Unable to hash value"),this.value=r}},Yo;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Yo||(Yo={}));var Qp=BigInt("14695981039346656037"),[z_,W_]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Z_=Array.from({length:256}).map((e,r)=>BigInt(r)),dO=new Float64Array(1),uO=new DataView(dO.buffer),mO=new Uint8Array(dO.buffer);function*X_(e){let r=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let t=0;t<r;t++)yield e>>8*(r-1-t)&255}function Y_(e){oo(Yo.Array);for(let r of e)qp(r)}function J_(e){oo(Yo.Boolean),oo(e?1:0)}function K_(e){oo(Yo.BigInt),uO.setBigInt64(0,e);for(let r of mO)oo(r)}function Q_(e){oo(Yo.Date),qp(e.getTime())}function q_(e){oo(Yo.Null)}function e8(e){oo(Yo.Number),uO.setFloat64(0,e);for(let r of mO)oo(r)}function t8(e){oo(Yo.Object);for(let r of globalThis.Object.getOwnPropertyNames(e).sort())qp(r),qp(e[r])}function r8(e){oo(Yo.String);for(let r=0;r<e.length;r++)for(let t of X_(e.charCodeAt(r)))oo(t)}function o8(e){oo(Yo.Symbol),qp(e.description)}function n8(e){oo(Yo.Uint8Array);for(let r=0;r<e.length;r++)oo(e[r])}function i8(e){return oo(Yo.Undefined)}function qp(e){if(we(e))return Y_(e);if(Ni(e))return J_(e);if(jr(e))return K_(e);if(uo(e))return Q_(e);if(_s(e))return q_(e);if(me(e))return e8(e);if(Ae(e))return t8(e);if(He(e))return r8(e);if(Rs(e))return o8(e);if(Dp(e))return n8(e);if(Wt(e))return i8(e);throw new Hv(e)}function oo(e){Qp=Qp^Z_[e],Qp=Qp*z_%W_}function Ka(e){return Qp=BigInt("14695981039346656037"),qp(e),Qp}d();var zv=class extends be{constructor(r){super("Unknown type"),this.schema=r}};function s8(e){return e[U]==="Any"||e[U]==="Unknown"}function Be(e){return e!==void 0}function a8(e,r,t){return!0}function l8(e,r,t){if(!we(t)||Be(e.minItems)&&!(t.length>=e.minItems)||Be(e.maxItems)&&!(t.length<=e.maxItems)||!t.every(i=>Vr(e.items,r,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let a of t){let l=Ka(a);if(i.has(l))return!1;i.add(l)}return!0}())return!1;if(!(Be(e.contains)||me(e.minContains)||me(e.maxContains)))return!0;let o=Be(e.contains)?e.contains:ft(),n=t.reduce((i,a)=>Vr(o,r,a)?i+1:i,0);return!(n===0||me(e.minContains)&&n<e.minContains||me(e.maxContains)&&n>e.maxContains)}function c8(e,r,t){return Sy(t)}function p8(e,r,t){return!(!jr(t)||Be(e.exclusiveMaximum)&&!(t<e.exclusiveMaximum)||Be(e.exclusiveMinimum)&&!(t>e.exclusiveMinimum)||Be(e.maximum)&&!(t<=e.maximum)||Be(e.minimum)&&!(t>=e.minimum)||Be(e.multipleOf)&&t%e.multipleOf!==BigInt(0))}function d8(e,r,t){return Ni(t)}function u8(e,r,t){return Vr(e.returns,r,t.prototype)}function m8(e,r,t){return!(!uo(t)||Be(e.exclusiveMaximumTimestamp)&&!(t.getTime()<e.exclusiveMaximumTimestamp)||Be(e.exclusiveMinimumTimestamp)&&!(t.getTime()>e.exclusiveMinimumTimestamp)||Be(e.maximumTimestamp)&&!(t.getTime()<=e.maximumTimestamp)||Be(e.minimumTimestamp)&&!(t.getTime()>=e.minimumTimestamp)||Be(e.multipleOfTimestamp)&&t.getTime()%e.multipleOfTimestamp!==0)}function f8(e,r,t){return $a(t)}function h8(e,r,t){return!(!My(t)||Be(e.exclusiveMaximum)&&!(t<e.exclusiveMaximum)||Be(e.exclusiveMinimum)&&!(t>e.exclusiveMinimum)||Be(e.maximum)&&!(t<=e.maximum)||Be(e.minimum)&&!(t>=e.minimum)||Be(e.multipleOf)&&t%e.multipleOf!==0)}function g8(e,r,t){let o=e.allOf.every(n=>Vr(n,r,t));if(e.unevaluatedProperties===!1){let n=new RegExp($s(e)),i=Object.getOwnPropertyNames(t).every(a=>n.test(a));return o&&i}else if(ze(e.unevaluatedProperties)){let n=new RegExp($s(e)),i=Object.getOwnPropertyNames(t).every(a=>n.test(a)||Vr(e.unevaluatedProperties,r,t[a]));return o&&i}else return o}function y8(e,r,t){return Ty(t)}function b8(e,r,t){return t===e.const}function x8(e,r,t){return!1}function v8(e,r,t){return!Vr(e.not,r,t)}function I8(e,r,t){return _s(t)}function S8(e,r,t){return!(!pt.IsNumberLike(t)||Be(e.exclusiveMaximum)&&!(t<e.exclusiveMaximum)||Be(e.exclusiveMinimum)&&!(t>e.exclusiveMinimum)||Be(e.minimum)&&!(t>=e.minimum)||Be(e.maximum)&&!(t<=e.maximum)||Be(e.multipleOf)&&t%e.multipleOf!==0)}function T8(e,r,t){if(!pt.IsObjectLike(t)||Be(e.minProperties)&&!(Object.getOwnPropertyNames(t).length>=e.minProperties)||Be(e.maxProperties)&&!(Object.getOwnPropertyNames(t).length<=e.maxProperties))return!1;let o=Object.getOwnPropertyNames(e.properties);for(let n of o){let i=e.properties[n];if(e.required&&e.required.includes(n)){if(!Vr(i,r,t[n])||(zs(i)||s8(i))&&!(n in t))return!1}else if(pt.IsExactOptionalProperty(t,n)&&!Vr(i,r,t[n]))return!1}if(e.additionalProperties===!1){let n=Object.getOwnPropertyNames(t);return e.required&&e.required.length===o.length&&n.length===o.length?!0:n.every(i=>o.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(t).every(i=>o.includes(i)||Vr(e.additionalProperties,r,t[i])):!0}function C8(e,r,t){return Cy(t)}function M8(e,r,t){if(!pt.IsRecordLike(t)||Be(e.minProperties)&&!(Object.getOwnPropertyNames(t).length>=e.minProperties)||Be(e.maxProperties)&&!(Object.getOwnPropertyNames(t).length<=e.maxProperties))return!1;let[o,n]=Object.entries(e.patternProperties)[0],i=new RegExp(o),a=Object.entries(t).every(([p,u])=>i.test(p)?Vr(n,r,u):!0),l=typeof e.additionalProperties=="object"?Object.entries(t).every(([p,u])=>i.test(p)?!0:Vr(e.additionalProperties,r,u)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(t).every(p=>i.test(p)):!0;return a&&l&&c}function w8(e,r,t){return Vr(Qe(e,r),r,t)}function O8(e,r,t){let o=new RegExp(e.source,e.flags);return Be(e.minLength)&&!(t.length>=e.minLength)||Be(e.maxLength)&&!(t.length<=e.maxLength)?!1:o.test(t)}function E8(e,r,t){return!He(t)||Be(e.minLength)&&!(t.length>=e.minLength)||Be(e.maxLength)&&!(t.length<=e.maxLength)||Be(e.pattern)&&!new RegExp(e.pattern).test(t)?!1:Be(e.format)?Fo.Has(e.format)?Fo.Get(e.format)(t):!1:!0}function P8(e,r,t){return Rs(t)}function F8(e,r,t){return He(t)&&new RegExp(e.pattern).test(t)}function D8(e,r,t){return Vr(Qe(e,r),r,t)}function k8(e,r,t){if(!we(t)||e.items===void 0&&t.length!==0||t.length!==e.maxItems)return!1;if(!e.items)return!0;for(let o=0;o<e.items.length;o++)if(!Vr(e.items[o],r,t[o]))return!1;return!0}function A8(e,r,t){return Wt(t)}function L8(e,r,t){return e.anyOf.some(o=>Vr(o,r,t))}function _8(e,r,t){return!(!Dp(t)||Be(e.maxByteLength)&&!(t.length<=e.maxByteLength)||Be(e.minByteLength)&&!(t.length>=e.minByteLength))}function R8(e,r,t){return!0}function B8(e,r,t){return pt.IsVoidLike(t)}function N8(e,r,t){return Or.Has(e[U])?Or.Get(e[U])(e,t):!1}function Vr(e,r,t){let o=Be(e.$id)?[...r,e]:r,n=e;switch(n[U]){case"Any":return a8(n,o,t);case"Array":return l8(n,o,t);case"AsyncIterator":return c8(n,o,t);case"BigInt":return p8(n,o,t);case"Boolean":return d8(n,o,t);case"Constructor":return u8(n,o,t);case"Date":return m8(n,o,t);case"Function":return f8(n,o,t);case"Integer":return h8(n,o,t);case"Intersect":return g8(n,o,t);case"Iterator":return y8(n,o,t);case"Literal":return b8(n,o,t);case"Never":return x8(n,o,t);case"Not":return v8(n,o,t);case"Null":return I8(n,o,t);case"Number":return S8(n,o,t);case"Object":return T8(n,o,t);case"Promise":return C8(n,o,t);case"Record":return M8(n,o,t);case"Ref":return w8(n,o,t);case"RegExp":return O8(n,o,t);case"String":return E8(n,o,t);case"Symbol":return P8(n,o,t);case"TemplateLiteral":return F8(n,o,t);case"This":return D8(n,o,t);case"Tuple":return k8(n,o,t);case"Undefined":return A8(n,o,t);case"Union":return L8(n,o,t);case"Uint8Array":return _8(n,o,t);case"Unknown":return R8(n,o,t);case"Void":return B8(n,o,t);default:if(!Or.Has(n[U]))throw new zv(n);return N8(n,o,t)}}function _e(...e){return e.length===3?Vr(e[0],e[1],e[2]):Vr(e[0],[],e[1])}var V;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(V||(V={}));var Wv=class extends be{constructor(r){super("Unknown type"),this.schema=r}};function Ws(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ne(e){return e!==void 0}var vn=class{constructor(r){this.iterator=r}[Symbol.iterator](){return this.iterator}First(){let r=this.iterator.next();return r.done?void 0:r.value}};function te(e,r,t,o,n=[]){return{type:e,schema:r,path:t,value:o,message:pO()({errorType:e,path:t,schema:r,value:o,errors:n}),errors:n}}function*j8(e,r,t,o){}function*G8(e,r,t,o){if(!we(o))return yield te(V.Array,e,t,o);Ne(e.minItems)&&!(o.length>=e.minItems)&&(yield te(V.ArrayMinItems,e,t,o)),Ne(e.maxItems)&&!(o.length<=e.maxItems)&&(yield te(V.ArrayMaxItems,e,t,o));for(let a=0;a<o.length;a++)yield*$r(e.items,r,`${t}/${a}`,o[a]);if(e.uniqueItems===!0&&!function(){let a=new Set;for(let l of o){let c=Ka(l);if(a.has(c))return!1;a.add(c)}return!0}()&&(yield te(V.ArrayUniqueItems,e,t,o)),!(Ne(e.contains)||Ne(e.minContains)||Ne(e.maxContains)))return;let n=Ne(e.contains)?e.contains:ft(),i=o.reduce((a,l,c)=>$r(n,r,`${t}${c}`,l).next().done===!0?a+1:a,0);i===0&&(yield te(V.ArrayContains,e,t,o)),me(e.minContains)&&i<e.minContains&&(yield te(V.ArrayMinContains,e,t,o)),me(e.maxContains)&&i>e.maxContains&&(yield te(V.ArrayMaxContains,e,t,o))}function*U8(e,r,t,o){Sy(o)||(yield te(V.AsyncIterator,e,t,o))}function*V8(e,r,t,o){if(!jr(o))return yield te(V.BigInt,e,t,o);Ne(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield te(V.BigIntExclusiveMaximum,e,t,o)),Ne(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield te(V.BigIntExclusiveMinimum,e,t,o)),Ne(e.maximum)&&!(o<=e.maximum)&&(yield te(V.BigIntMaximum,e,t,o)),Ne(e.minimum)&&!(o>=e.minimum)&&(yield te(V.BigIntMinimum,e,t,o)),Ne(e.multipleOf)&&o%e.multipleOf!==BigInt(0)&&(yield te(V.BigIntMultipleOf,e,t,o))}function*$8(e,r,t,o){Ni(o)||(yield te(V.Boolean,e,t,o))}function*H8(e,r,t,o){yield*$r(e.returns,r,t,o.prototype)}function*z8(e,r,t,o){if(!uo(o))return yield te(V.Date,e,t,o);Ne(e.exclusiveMaximumTimestamp)&&!(o.getTime()<e.exclusiveMaximumTimestamp)&&(yield te(V.DateExclusiveMaximumTimestamp,e,t,o)),Ne(e.exclusiveMinimumTimestamp)&&!(o.getTime()>e.exclusiveMinimumTimestamp)&&(yield te(V.DateExclusiveMinimumTimestamp,e,t,o)),Ne(e.maximumTimestamp)&&!(o.getTime()<=e.maximumTimestamp)&&(yield te(V.DateMaximumTimestamp,e,t,o)),Ne(e.minimumTimestamp)&&!(o.getTime()>=e.minimumTimestamp)&&(yield te(V.DateMinimumTimestamp,e,t,o)),Ne(e.multipleOfTimestamp)&&o.getTime()%e.multipleOfTimestamp!==0&&(yield te(V.DateMultipleOfTimestamp,e,t,o))}function*W8(e,r,t,o){$a(o)||(yield te(V.Function,e,t,o))}function*Z8(e,r,t,o){if(!My(o))return yield te(V.Integer,e,t,o);Ne(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield te(V.IntegerExclusiveMaximum,e,t,o)),Ne(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield te(V.IntegerExclusiveMinimum,e,t,o)),Ne(e.maximum)&&!(o<=e.maximum)&&(yield te(V.IntegerMaximum,e,t,o)),Ne(e.minimum)&&!(o>=e.minimum)&&(yield te(V.IntegerMinimum,e,t,o)),Ne(e.multipleOf)&&o%e.multipleOf!==0&&(yield te(V.IntegerMultipleOf,e,t,o))}function*X8(e,r,t,o){let n=!1;for(let i of e.allOf)for(let a of $r(i,r,t,o))n=!0,yield a;if(n)return yield te(V.Intersect,e,t,o);if(e.unevaluatedProperties===!1){let i=new RegExp($s(e));for(let a of Object.getOwnPropertyNames(o))i.test(a)||(yield te(V.IntersectUnevaluatedProperties,e,`${t}/${a}`,o))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp($s(e));for(let a of Object.getOwnPropertyNames(o))if(!i.test(a)){let l=$r(e.unevaluatedProperties,r,`${t}/${a}`,o[a]).next();l.done||(yield l.value)}}}function*Y8(e,r,t,o){Ty(o)||(yield te(V.Iterator,e,t,o))}function*J8(e,r,t,o){o!==e.const&&(yield te(V.Literal,e,t,o))}function*K8(e,r,t,o){yield te(V.Never,e,t,o)}function*Q8(e,r,t,o){$r(e.not,r,t,o).next().done===!0&&(yield te(V.Not,e,t,o))}function*q8(e,r,t,o){_s(o)||(yield te(V.Null,e,t,o))}function*eR(e,r,t,o){if(!pt.IsNumberLike(o))return yield te(V.Number,e,t,o);Ne(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield te(V.NumberExclusiveMaximum,e,t,o)),Ne(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield te(V.NumberExclusiveMinimum,e,t,o)),Ne(e.maximum)&&!(o<=e.maximum)&&(yield te(V.NumberMaximum,e,t,o)),Ne(e.minimum)&&!(o>=e.minimum)&&(yield te(V.NumberMinimum,e,t,o)),Ne(e.multipleOf)&&o%e.multipleOf!==0&&(yield te(V.NumberMultipleOf,e,t,o))}function*tR(e,r,t,o){if(!pt.IsObjectLike(o))return yield te(V.Object,e,t,o);Ne(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield te(V.ObjectMinProperties,e,t,o)),Ne(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield te(V.ObjectMaxProperties,e,t,o));let n=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),a=Object.getOwnPropertyNames(o);for(let l of n)a.includes(l)||(yield te(V.ObjectRequiredProperty,e.properties[l],`${t}/${Ws(l)}`,void 0));if(e.additionalProperties===!1)for(let l of a)i.includes(l)||(yield te(V.ObjectAdditionalProperties,e,`${t}/${Ws(l)}`,o[l]));if(typeof e.additionalProperties=="object")for(let l of a)i.includes(l)||(yield*$r(e.additionalProperties,r,`${t}/${Ws(l)}`,o[l]));for(let l of i){let c=e.properties[l];e.required&&e.required.includes(l)?(yield*$r(c,r,`${t}/${Ws(l)}`,o[l]),zs(e)&&!(l in o)&&(yield te(V.ObjectRequiredProperty,c,`${t}/${Ws(l)}`,void 0))):pt.IsExactOptionalProperty(o,l)&&(yield*$r(c,r,`${t}/${Ws(l)}`,o[l]))}}function*rR(e,r,t,o){Cy(o)||(yield te(V.Promise,e,t,o))}function*oR(e,r,t,o){if(!pt.IsRecordLike(o))return yield te(V.Object,e,t,o);Ne(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield te(V.ObjectMinProperties,e,t,o)),Ne(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield te(V.ObjectMaxProperties,e,t,o));let[n,i]=Object.entries(e.patternProperties)[0],a=new RegExp(n);for(let[l,c]of Object.entries(o))a.test(l)&&(yield*$r(i,r,`${t}/${Ws(l)}`,c));if(typeof e.additionalProperties=="object")for(let[l,c]of Object.entries(o))a.test(l)||(yield*$r(e.additionalProperties,r,`${t}/${Ws(l)}`,c));if(e.additionalProperties===!1){for(let[l,c]of Object.entries(o))if(!a.test(l))return yield te(V.ObjectAdditionalProperties,e,`${t}/${Ws(l)}`,c)}}function*nR(e,r,t,o){yield*$r(Qe(e,r),r,t,o)}function*iR(e,r,t,o){if(!He(o))return yield te(V.String,e,t,o);if(Ne(e.minLength)&&!(o.length>=e.minLength)&&(yield te(V.StringMinLength,e,t,o)),Ne(e.maxLength)&&!(o.length<=e.maxLength)&&(yield te(V.StringMaxLength,e,t,o)),!new RegExp(e.source,e.flags).test(o))return yield te(V.RegExp,e,t,o)}function*sR(e,r,t,o){if(!He(o))return yield te(V.String,e,t,o);Ne(e.minLength)&&!(o.length>=e.minLength)&&(yield te(V.StringMinLength,e,t,o)),Ne(e.maxLength)&&!(o.length<=e.maxLength)&&(yield te(V.StringMaxLength,e,t,o)),He(e.pattern)&&(new RegExp(e.pattern).test(o)||(yield te(V.StringPattern,e,t,o))),He(e.format)&&(Fo.Has(e.format)?Fo.Get(e.format)(o)||(yield te(V.StringFormat,e,t,o)):yield te(V.StringFormatUnknown,e,t,o))}function*aR(e,r,t,o){Rs(o)||(yield te(V.Symbol,e,t,o))}function*lR(e,r,t,o){if(!He(o))return yield te(V.String,e,t,o);new RegExp(e.pattern).test(o)||(yield te(V.StringPattern,e,t,o))}function*cR(e,r,t,o){yield*$r(Qe(e,r),r,t,o)}function*pR(e,r,t,o){if(!we(o))return yield te(V.Tuple,e,t,o);if(e.items===void 0&&o.length!==0)return yield te(V.TupleLength,e,t,o);if(o.length!==e.maxItems)return yield te(V.TupleLength,e,t,o);if(e.items)for(let n=0;n<e.items.length;n++)yield*$r(e.items[n],r,`${t}/${n}`,o[n])}function*dR(e,r,t,o){Wt(o)||(yield te(V.Undefined,e,t,o))}function*uR(e,r,t,o){if(_e(e,r,o))return;let n=e.anyOf.map(i=>new vn($r(i,r,t,o)));yield te(V.Union,e,t,o,n)}function*mR(e,r,t,o){if(!Dp(o))return yield te(V.Uint8Array,e,t,o);Ne(e.maxByteLength)&&!(o.length<=e.maxByteLength)&&(yield te(V.Uint8ArrayMaxByteLength,e,t,o)),Ne(e.minByteLength)&&!(o.length>=e.minByteLength)&&(yield te(V.Uint8ArrayMinByteLength,e,t,o))}function*fR(e,r,t,o){}function*hR(e,r,t,o){pt.IsVoidLike(o)||(yield te(V.Void,e,t,o))}function*gR(e,r,t,o){Or.Get(e[U])(e,o)||(yield te(V.Kind,e,t,o))}function*$r(e,r,t,o){let n=Ne(e.$id)?[...r,e]:r,i=e;switch(i[U]){case"Any":return yield*j8(i,n,t,o);case"Array":return yield*G8(i,n,t,o);case"AsyncIterator":return yield*U8(i,n,t,o);case"BigInt":return yield*V8(i,n,t,o);case"Boolean":return yield*$8(i,n,t,o);case"Constructor":return yield*H8(i,n,t,o);case"Date":return yield*z8(i,n,t,o);case"Function":return yield*W8(i,n,t,o);case"Integer":return yield*Z8(i,n,t,o);case"Intersect":return yield*X8(i,n,t,o);case"Iterator":return yield*Y8(i,n,t,o);case"Literal":return yield*J8(i,n,t,o);case"Never":return yield*K8(i,n,t,o);case"Not":return yield*Q8(i,n,t,o);case"Null":return yield*q8(i,n,t,o);case"Number":return yield*eR(i,n,t,o);case"Object":return yield*tR(i,n,t,o);case"Promise":return yield*rR(i,n,t,o);case"Record":return yield*oR(i,n,t,o);case"Ref":return yield*nR(i,n,t,o);case"RegExp":return yield*iR(i,n,t,o);case"String":return yield*sR(i,n,t,o);case"Symbol":return yield*aR(i,n,t,o);case"TemplateLiteral":return yield*lR(i,n,t,o);case"This":return yield*cR(i,n,t,o);case"Tuple":return yield*pR(i,n,t,o);case"Undefined":return yield*dR(i,n,t,o);case"Union":return yield*uR(i,n,t,o);case"Uint8Array":return yield*mR(i,n,t,o);case"Unknown":return yield*fR(i,n,t,o);case"Void":return yield*hR(i,n,t,o);default:if(!Or.Has(i[U]))throw new Wv(e);return yield*gR(i,n,t,o)}}function $i(...e){let r=e.length===3?$r(e[0],e[1],"",e[2]):$r(e[0],[],"",e[1]);return new vn(r)}d();d();var yR=function(e,r,t,o,n){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!n:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?n.call(e,t):n?n.value=t:r.set(e,t),t},hO=function(e,r,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!o:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(e):o?o.value:r.get(e)},Zv,rb,gO,Xv=class extends be{constructor(r){let t=r.First();super(t===void 0?"Invalid Value":t.message),Zv.add(this),rb.set(this,void 0),yR(this,rb,r,"f"),this.error=t}Errors(){return new vn(hO(this,Zv,"m",gO).call(this))}};rb=new WeakMap,Zv=new WeakSet,gO=function*(){this.error&&(yield this.error),yield*hO(this,rb,"f")};function fO(e,r,t){if(!_e(e,r,t))throw new Xv($i(e,r,t))}function ob(...e){return e.length===3?fO(e[0],e[1],e[2]):fO(e[0],[],e[1])}d();d();d();function bR(e){let r={};for(let t of Object.getOwnPropertyNames(e))r[t]=qe(e[t]);for(let t of Object.getOwnPropertySymbols(e))r[t]=qe(e[t]);return r}function xR(e){return e.map(r=>qe(r))}function vR(e){return e.slice()}function IR(e){return new Map(qe([...e.entries()]))}function SR(e){return new Set(qe([...e.entries()]))}function TR(e){return new Date(e.toISOString())}function qe(e){if(we(e))return xR(e);if(uo(e))return TR(e);if(un(e))return vR(e);if(qM(e))return IR(e);if(e3(e))return SR(e);if(Ae(e))return bR(e);if(Gr(e))return e;throw new Error("ValueClone: Unable to clone value")}var Jo=class extends be{constructor(r,t){super(t),this.schema=r}};function et(e){return $a(e)?e():qe(e)}function CR(e,r){return ve(e,"default")?et(e.default):{}}function MR(e,r){if(e.uniqueItems===!0&&!ve(e,"default"))throw new Jo(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!ve(e,"default"))throw new Jo(e,"Array with the contains constraint requires a default value");return"default"in e?et(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(t=>Ko(e.items,r)):[]}function wR(e,r){return ve(e,"default")?et(e.default):async function*(){}()}function OR(e,r){return ve(e,"default")?et(e.default):BigInt(0)}function ER(e,r){return ve(e,"default")?et(e.default):!1}function PR(e,r){if(ve(e,"default"))return et(e.default);{let t=Ko(e.returns,r);return typeof t=="object"&&!Array.isArray(t)?class{constructor(){for(let[o,n]of Object.entries(t)){let i=this;i[o]=n}}}:class{}}}function FR(e,r){return ve(e,"default")?et(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function DR(e,r){return ve(e,"default")?et(e.default):()=>Ko(e.returns,r)}function kR(e,r){return ve(e,"default")?et(e.default):e.minimum!==void 0?e.minimum:0}function AR(e,r){if(ve(e,"default"))return et(e.default);{let t=e.allOf.reduce((o,n)=>{let i=Ko(n,r);return typeof i=="object"?{...o,...i}:i},{});if(!_e(e,r,t))throw new Jo(e,"Intersect produced invalid value. Consider using a default value.");return t}}function LR(e,r){return ve(e,"default")?et(e.default):function*(){}()}function _R(e,r){return ve(e,"default")?et(e.default):e.const}function RR(e,r){if(ve(e,"default"))return et(e.default);throw new Jo(e,"Never types cannot be created. Consider using a default value.")}function BR(e,r){if(ve(e,"default"))return et(e.default);throw new Jo(e,"Not types must have a default value")}function NR(e,r){return ve(e,"default")?et(e.default):null}function jR(e,r){return ve(e,"default")?et(e.default):e.minimum!==void 0?e.minimum:0}function GR(e,r){if(ve(e,"default"))return et(e.default);{let t=new Set(e.required),o={};for(let[n,i]of Object.entries(e.properties))t.has(n)&&(o[n]=Ko(i,r));return o}}function UR(e,r){return ve(e,"default")?et(e.default):Promise.resolve(Ko(e.item,r))}function VR(e,r){let[t,o]=Object.entries(e.patternProperties)[0];if(ve(e,"default"))return et(e.default);if(t===Us||t===Gs)return{};{let n=t.slice(1,t.length-1).split("|"),i={};for(let a of n)i[a]=Ko(o,r);return i}}function $R(e,r){return ve(e,"default")?et(e.default):Ko(Qe(e,r),r)}function HR(e,r){if(ve(e,"default"))return et(e.default);throw new Jo(e,"RegExp types cannot be created. Consider using a default value.")}function zR(e,r){if(e.pattern!==void 0){if(ve(e,"default"))return et(e.default);throw new Jo(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(ve(e,"default"))return et(e.default);throw new Jo(e,"String types with formats must specify a default value")}else return ve(e,"default")?et(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function WR(e,r){return ve(e,"default")?et(e.default):"value"in e?Symbol.for(e.value):Symbol()}function ZR(e,r){if(ve(e,"default"))return et(e.default);if(!Fy(e))throw new Jo(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Np(e)[0]}function XR(e,r){if(yO++>rB)throw new Jo(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return ve(e,"default")?et(e.default):Ko(Qe(e,r),r)}function YR(e,r){return ve(e,"default")?et(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((t,o)=>Ko(e.items[o],r))}function JR(e,r){if(ve(e,"default"))return et(e.default)}function KR(e,r){if(ve(e,"default"))return et(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return Ko(e.anyOf[0],r)}function QR(e,r){return ve(e,"default")?et(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function qR(e,r){return ve(e,"default")?et(e.default):{}}function eB(e,r){if(ve(e,"default"))return et(e.default)}function tB(e,r){if(ve(e,"default"))return et(e.default);throw new Error("User defined types must specify a default value")}function Ko(e,r){let t=xn(e,r),o=e;switch(o[U]){case"Any":return CR(o,t);case"Array":return MR(o,t);case"AsyncIterator":return wR(o,t);case"BigInt":return OR(o,t);case"Boolean":return ER(o,t);case"Constructor":return PR(o,t);case"Date":return FR(o,t);case"Function":return DR(o,t);case"Integer":return kR(o,t);case"Intersect":return AR(o,t);case"Iterator":return LR(o,t);case"Literal":return _R(o,t);case"Never":return RR(o,t);case"Not":return BR(o,t);case"Null":return NR(o,t);case"Number":return jR(o,t);case"Object":return GR(o,t);case"Promise":return UR(o,t);case"Record":return VR(o,t);case"Ref":return $R(o,t);case"RegExp":return HR(o,t);case"String":return zR(o,t);case"Symbol":return WR(o,t);case"TemplateLiteral":return ZR(o,t);case"This":return XR(o,t);case"Tuple":return YR(o,t);case"Undefined":return JR(o,t);case"Union":return KR(o,t);case"Uint8Array":return QR(o,t);case"Unknown":return qR(o,t);case"Void":return eB(o,t);default:if(!Or.Has(o[U]))throw new Jo(o,"Unknown type");return tB(o,t)}}var rB=512,yO=0;function In(...e){return yO=0,e.length===2?Ko(e[0],e[1]):Ko(e[0],[])}var nb=class extends be{constructor(r,t){super(t),this.schema=r}};function oB(e,r,t){if(e[U]==="Object"&&typeof t=="object"&&!_s(t)){let o=e,n=Object.getOwnPropertyNames(t),i=Object.entries(o.properties),[a,l]=[1/i.length,i.length];return i.reduce((c,[p,u])=>{let f=u[U]==="Literal"&&u.const===t[p]?l:0,h=_e(u,r,t[p])?a:0,b=n.includes(p)?a:0;return c+(f+h+b)},0)}else return _e(e,r,t)?1:0}function nB(e,r,t){let o=e.anyOf.map(a=>Qe(a,r)),[n,i]=[o[0],0];for(let a of o){let l=oB(a,r,t);l>i&&(n=a,i=l)}return n}function iB(e,r,t){if("default"in e)return typeof t=="function"?e.default:qe(e.default);{let o=nB(e,r,t);return Yv(o,r,t)}}function sB(e,r,t){return _e(e,r,t)?qe(t):In(e,r)}function aB(e,r,t){return _e(e,r,t)?t:In(e,r)}function lB(e,r,t){if(_e(e,r,t))return qe(t);let o=we(t)?qe(t):In(e,r),n=me(e.minItems)&&o.length<e.minItems?[...o,...Array.from({length:e.minItems-o.length},()=>null)]:o,a=(me(e.maxItems)&&n.length>e.maxItems?n.slice(0,e.maxItems):n).map(c=>Hi(e.items,r,c));if(e.uniqueItems!==!0)return a;let l=[...new Set(a)];if(!_e(e,r,l))throw new nb(e,"Array cast produced invalid data due to uniqueItems constraint");return l}function cB(e,r,t){if(_e(e,r,t))return In(e,r);let o=new Set(e.returns.required||[]),n=function(){};for(let[i,a]of Object.entries(e.returns.properties))!o.has(i)&&t.prototype[i]===void 0||(n.prototype[i]=Hi(a,r,t.prototype[i]));return n}function pB(e,r,t){let o=In(e,r),n=Ae(o)&&Ae(t)?{...o,...t}:t;return _e(e,r,n)?n:In(e,r)}function dB(e,r,t){throw new nb(e,"Never types cannot be cast")}function uB(e,r,t){if(_e(e,r,t))return t;if(t===null||typeof t!="object")return In(e,r);let o=new Set(e.required||[]),n={};for(let[i,a]of Object.entries(e.properties))!o.has(i)&&t[i]===void 0||(n[i]=Hi(a,r,t[i]));if(typeof e.additionalProperties=="object"){let i=Object.getOwnPropertyNames(e.properties);for(let a of Object.getOwnPropertyNames(t))i.includes(a)||(n[a]=Hi(e.additionalProperties,r,t[a]))}return n}function mB(e,r,t){if(_e(e,r,t))return qe(t);if(t===null||typeof t!="object"||Array.isArray(t)||t instanceof Date)return In(e,r);let o=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[o],i={};for(let[a,l]of Object.entries(t))i[a]=Hi(n,r,l);return i}function fB(e,r,t){return Hi(Qe(e,r),r,t)}function hB(e,r,t){return Hi(Qe(e,r),r,t)}function gB(e,r,t){return _e(e,r,t)?qe(t):we(t)?e.items===void 0?[]:e.items.map((o,n)=>Hi(o,r,t[n])):In(e,r)}function yB(e,r,t){return _e(e,r,t)?qe(t):iB(e,r,t)}function Hi(e,r,t){let o=He(e.$id)?[...r,e]:r,n=e;switch(e[U]){case"Array":return lB(n,o,t);case"Constructor":return cB(n,o,t);case"Intersect":return pB(n,o,t);case"Never":return dB(n,o,t);case"Object":return uB(n,o,t);case"Record":return mB(n,o,t);case"Ref":return fB(n,o,t);case"This":return hB(n,o,t);case"Tuple":return gB(n,o,t);case"Union":return yB(n,o,t);case"Date":case"Symbol":case"Uint8Array":return sB(e,r,t);default:return aB(n,o,t)}}function Yv(...e){return e.length===3?Hi(e[0],e[1],e[2]):Hi(e[0],[],e[1])}d();function bB(e){return za(e)&&e[U]!=="Unsafe"}function xB(e,r,t){return we(t)?t.map(o=>Qo(e.items,r,o)):t}function vB(e,r,t){let o=e.unevaluatedProperties,i=e.allOf.map(l=>Qo(l,r,qe(t))).reduce((l,c)=>Ae(c)?{...l,...c}:c,{});if(!Ae(t)||!Ae(i)||!za(o))return i;let a=Er(e);for(let l of Object.getOwnPropertyNames(t))a.includes(l)||_e(o,r,t[l])&&(i[l]=Qo(o,r,t[l]));return i}function IB(e,r,t){if(!Ae(t)||we(t))return t;let o=e.additionalProperties;for(let n of Object.getOwnPropertyNames(t)){if(ve(e.properties,n)){t[n]=Qo(e.properties[n],r,t[n]);continue}if(za(o)&&_e(o,r,t[n])){t[n]=Qo(o,r,t[n]);continue}delete t[n]}return t}function SB(e,r,t){if(!Ae(t))return t;let o=e.additionalProperties,n=Object.getOwnPropertyNames(t),[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of n){if(l.test(c)){t[c]=Qo(a,r,t[c]);continue}if(za(o)&&_e(o,r,t[c])){t[c]=Qo(o,r,t[c]);continue}delete t[c]}return t}function TB(e,r,t){return Qo(Qe(e,r),r,t)}function CB(e,r,t){return Qo(Qe(e,r),r,t)}function MB(e,r,t){if(!we(t))return t;if(Wt(e.items))return[];let o=Math.min(t.length,e.items.length);for(let n=0;n<o;n++)t[n]=Qo(e.items[n],r,t[n]);return t.length>o?t.slice(0,o):t}function wB(e,r,t){for(let o of e.anyOf)if(bB(o)&&_e(o,r,t))return Qo(o,r,t);return t}function Qo(e,r,t){let o=He(e.$id)?[...r,e]:r,n=e;switch(n[U]){case"Array":return xB(n,o,t);case"Intersect":return vB(n,o,t);case"Object":return IB(n,o,t);case"Record":return SB(n,o,t);case"Ref":return TB(n,o,t);case"This":return CB(n,o,t);case"Tuple":return MB(n,o,t);case"Union":return wB(n,o,t);default:return t}}function ib(...e){return e.length===3?Qo(e[0],e[1],e[2]):Qo(e[0],[],e[1])}d();function sb(e){return He(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function OB(e){return jr(e)||Ni(e)||me(e)}function Ym(e){return e===!0||me(e)&&e===1||jr(e)&&e===BigInt("1")||He(e)&&(e.toLowerCase()==="true"||e==="1")}function Jm(e){return e===!1||me(e)&&(e===0||Object.is(e,-0))||jr(e)&&e===BigInt("0")||He(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function EB(e){return He(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}function PB(e){return He(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}function FB(e){return He(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}function DB(e){return He(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}function kB(e){return He(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}function AB(e,r){let t=xO(e);return t===r?t:e}function LB(e,r){let t=vO(e);return t===r?t:e}function _B(e,r){let t=bO(e);return t===r?t:e}function RB(e,r){return He(e.const)?AB(r,e.const):me(e.const)?LB(r,e.const):Ni(e.const)?_B(r,e.const):r}function bO(e){return Ym(e)?!0:Jm(e)?!1:e}function BB(e){let r=t=>t.split(".")[0];return sb(e)?BigInt(r(e)):me(e)?BigInt(Math.trunc(e)):Jm(e)?BigInt(0):Ym(e)?BigInt(1):e}function xO(e){return OB(e)?e.toString():Rs(e)&&e.description!==void 0?e.description.toString():e}function vO(e){return sb(e)?parseFloat(e):Ym(e)?1:Jm(e)?0:e}function NB(e){return sb(e)?parseInt(e):me(e)?e|0:Ym(e)?1:Jm(e)?0:e}function jB(e){return He(e)&&e.toLowerCase()==="null"?null:e}function GB(e){return He(e)&&e==="undefined"?void 0:e}function UB(e){return uo(e)?e:me(e)?new Date(e):Ym(e)?new Date(1):Jm(e)?new Date(0):sb(e)?new Date(parseInt(e)):PB(e)?new Date(`1970-01-01T${e}.000Z`):EB(e)?new Date(`1970-01-01T${e}`):DB(e)?new Date(`${e}.000Z`):FB(e)?new Date(e):kB(e)?new Date(`${e}T00:00:00.000Z`):e}function VB(e,r,t){return(we(t)?t:[t]).map(n=>zi(e.items,r,n))}function $B(e,r,t){return BB(t)}function HB(e,r,t){return bO(t)}function zB(e,r,t){return UB(t)}function WB(e,r,t){return NB(t)}function ZB(e,r,t){return e.allOf.reduce((o,n)=>zi(n,r,o),t)}function XB(e,r,t){return RB(e,t)}function YB(e,r,t){return jB(t)}function JB(e,r,t){return vO(t)}function KB(e,r,t){if(!Ae(t))return t;for(let o of Object.getOwnPropertyNames(e.properties))ve(t,o)&&(t[o]=zi(e.properties[o],r,t[o]));return t}function QB(e,r,t){if(!Ae(t))return t;let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n];for(let[a,l]of Object.entries(t))t[a]=zi(i,r,l);return t}function qB(e,r,t){return zi(Qe(e,r),r,t)}function eN(e,r,t){return xO(t)}function tN(e,r,t){return He(t)||me(t)?Symbol(t):t}function rN(e,r,t){return zi(Qe(e,r),r,t)}function oN(e,r,t){return we(t)&&!Wt(e.items)?t.map((n,i)=>i<e.items.length?zi(e.items[i],r,n):n):t}function nN(e,r,t){return GB(t)}function iN(e,r,t){for(let o of e.anyOf){let n=zi(o,r,qe(t));if(_e(o,r,n))return n}return t}function zi(e,r,t){let o=xn(e,r),n=e;switch(e[U]){case"Array":return VB(n,o,t);case"BigInt":return $B(n,o,t);case"Boolean":return HB(n,o,t);case"Date":return zB(n,o,t);case"Integer":return WB(n,o,t);case"Intersect":return ZB(n,o,t);case"Literal":return XB(n,o,t);case"Null":return YB(n,o,t);case"Number":return JB(n,o,t);case"Object":return KB(n,o,t);case"Record":return QB(n,o,t);case"Ref":return qB(n,o,t);case"String":return eN(n,o,t);case"Symbol":return tN(n,o,t);case"This":return rN(n,o,t);case"Tuple":return oN(n,o,t);case"Undefined":return nN(n,o,t);case"Union":return iN(n,o,t);default:return t}}function ab(...e){return e.length===3?zi(e[0],e[1],e[2]):zi(e[0],[],e[1])}d();d();var ed=class extends be{constructor(r,t,o){super("Unable to decode value as it does not match the expected schema"),this.schema=r,this.value=t,this.error=o}},Jl=class extends be{constructor(r,t,o,n){super(n instanceof Error?n.message:"Unknown error"),this.schema=r,this.path=t,this.value=o,this.error=n}};function Zt(e,r,t){try{return Ft(e)?e[Rt].Decode(t):t}catch(o){throw new Jl(e,r,t,o)}}function sN(e,r,t,o){return we(o)?Zt(e,t,o.map((n,i)=>Wi(e.items,r,`${t}/${i}`,n))):Zt(e,t,o)}function aN(e,r,t,o){if(!Ae(o)||Gr(o))return Zt(e,t,o);let n=Xa(e),i=n.map(u=>u[0]),a={...o};for(let[u,f]of n)u in a&&(a[u]=Wi(f,r,`${t}/${u}`,a[u]));if(!Ft(e.unevaluatedProperties))return Zt(e,t,a);let l=Object.getOwnPropertyNames(a),c=e.unevaluatedProperties,p={...a};for(let u of l)i.includes(u)||(p[u]=Zt(c,`${t}/${u}`,p[u]));return Zt(e,t,p)}function lN(e,r,t,o){return Zt(e,t,Wi(e.not,r,t,o))}function cN(e,r,t,o){if(!Ae(o))return Zt(e,t,o);let n=Er(e),i={...o};for(let p of n)ve(i,p)&&(Wt(i[p])&&(!Ap(e.properties[p])||pt.IsExactOptionalProperty(i,p))||(i[p]=Wi(e.properties[p],r,`${t}/${p}`,i[p])));if(!ze(e.additionalProperties))return Zt(e,t,i);let a=Object.getOwnPropertyNames(i),l=e.additionalProperties,c={...i};for(let p of a)n.includes(p)||(c[p]=Zt(l,`${t}/${p}`,c[p]));return Zt(e,t,c)}function pN(e,r,t,o){if(!Ae(o))return Zt(e,t,o);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(n),a={...o};for(let u of Object.getOwnPropertyNames(o))i.test(u)&&(a[u]=Wi(e.patternProperties[n],r,`${t}/${u}`,a[u]));if(!ze(e.additionalProperties))return Zt(e,t,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let u of l)i.test(u)||(p[u]=Zt(c,`${t}/${u}`,p[u]));return Zt(e,t,p)}function dN(e,r,t,o){let n=Qe(e,r);return Zt(e,t,Wi(n,r,t,o))}function uN(e,r,t,o){let n=Qe(e,r);return Zt(e,t,Wi(n,r,t,o))}function mN(e,r,t,o){return we(o)&&we(e.items)?Zt(e,t,e.items.map((n,i)=>Wi(n,r,`${t}/${i}`,o[i]))):Zt(e,t,o)}function fN(e,r,t,o){for(let n of e.anyOf){if(!_e(n,r,o))continue;let i=Wi(n,r,t,o);return Zt(e,t,i)}return Zt(e,t,o)}function Wi(e,r,t,o){let n=xn(e,r),i=e;switch(e[U]){case"Array":return sN(i,n,t,o);case"Intersect":return aN(i,n,t,o);case"Not":return lN(i,n,t,o);case"Object":return cN(i,n,t,o);case"Record":return pN(i,n,t,o);case"Ref":return dN(i,n,t,o);case"Symbol":return Zt(i,t,o);case"This":return uN(i,n,t,o);case"Tuple":return mN(i,n,t,o);case"Union":return fN(i,n,t,o);default:return Zt(i,t,o)}}function td(e,r,t){return Wi(e,r,"",t)}d();var rd=class extends be{constructor(r,t,o){super("The encoded value does not match the expected schema"),this.schema=r,this.value=t,this.error=o}},Kl=class extends be{constructor(r,t,o,n){super(`${n instanceof Error?n.message:"Unknown error"}`),this.schema=r,this.path=t,this.value=o,this.error=n}};function no(e,r,t){try{return Ft(e)?e[Rt].Encode(t):t}catch(o){throw new Kl(e,r,t,o)}}function hN(e,r,t,o){let n=no(e,t,o);return we(n)?n.map((i,a)=>Zi(e.items,r,`${t}/${a}`,i)):n}function gN(e,r,t,o){let n=no(e,t,o);if(!Ae(o)||Gr(o))return n;let i=Xa(e),a=i.map(f=>f[0]),l={...n};for(let[f,h]of i)f in l&&(l[f]=Zi(h,r,`${t}/${f}`,l[f]));if(!Ft(e.unevaluatedProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,u={...l};for(let f of c)a.includes(f)||(u[f]=no(p,`${t}/${f}`,u[f]));return u}function yN(e,r,t,o){return no(e.not,t,no(e,t,o))}function bN(e,r,t,o){let n=no(e,t,o);if(!Ae(n))return n;let i=Er(e),a={...n};for(let u of i)ve(a,u)&&(Wt(a[u])&&(!Ap(e.properties[u])||pt.IsExactOptionalProperty(a,u))||(a[u]=Zi(e.properties[u],r,`${t}/${u}`,a[u])));if(!ze(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let u of l)i.includes(u)||(p[u]=no(c,`${t}/${u}`,p[u]));return p}function xN(e,r,t,o){let n=no(e,t,o);if(!Ae(o))return n;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...n};for(let f of Object.getOwnPropertyNames(o))a.test(f)&&(l[f]=Zi(e.patternProperties[i],r,`${t}/${f}`,l[f]));if(!ze(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,u={...l};for(let f of c)a.test(f)||(u[f]=no(p,`${t}/${f}`,u[f]));return u}function vN(e,r,t,o){let n=Qe(e,r),i=Zi(n,r,t,o);return no(e,t,i)}function IN(e,r,t,o){let n=Qe(e,r),i=Zi(n,r,t,o);return no(e,t,i)}function SN(e,r,t,o){let n=no(e,t,o);return we(e.items)?e.items.map((i,a)=>Zi(i,r,`${t}/${a}`,n[a])):[]}function TN(e,r,t,o){for(let n of e.anyOf){if(!_e(n,r,o))continue;let i=Zi(n,r,t,o);return no(e,t,i)}for(let n of e.anyOf){let i=Zi(n,r,t,o);if(_e(e,r,i))return no(e,t,i)}return no(e,t,o)}function Zi(e,r,t,o){let n=xn(e,r),i=e;switch(e[U]){case"Array":return hN(i,n,t,o);case"Intersect":return gN(i,n,t,o);case"Not":return yN(i,n,t,o);case"Object":return bN(i,n,t,o);case"Record":return xN(i,n,t,o);case"Ref":return vN(i,n,t,o);case"This":return IN(i,n,t,o);case"Tuple":return SN(i,n,t,o);case"Union":return TN(i,n,t,o);default:return no(i,t,o)}}function lb(e,r,t){return Zi(e,r,"",t)}d();function CN(e,r){return Ft(e)||Pr(e.items,r)}function MN(e,r){return Ft(e)||Pr(e.items,r)}function wN(e,r){return Ft(e)||Pr(e.returns,r)||e.parameters.some(t=>Pr(t,r))}function ON(e,r){return Ft(e)||Pr(e.returns,r)||e.parameters.some(t=>Pr(t,r))}function EN(e,r){return Ft(e)||Ft(e.unevaluatedProperties)||e.allOf.some(t=>Pr(t,r))}function PN(e,r){return Ft(e)||Pr(e.items,r)}function FN(e,r){return Ft(e)||Pr(e.not,r)}function DN(e,r){return Ft(e)||Object.values(e.properties).some(t=>Pr(t,r))||ze(e.additionalProperties)&&Pr(e.additionalProperties,r)}function kN(e,r){return Ft(e)||Pr(e.item,r)}function AN(e,r){let t=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[t];return Ft(e)||Pr(o,r)||ze(e.additionalProperties)&&Ft(e.additionalProperties)}function LN(e,r){return Ft(e)?!0:Pr(Qe(e,r),r)}function _N(e,r){return Ft(e)?!0:Pr(Qe(e,r),r)}function RN(e,r){return Ft(e)||!Wt(e.items)&&e.items.some(t=>Pr(t,r))}function BN(e,r){return Ft(e)||e.anyOf.some(t=>Pr(t,r))}function Pr(e,r){let t=xn(e,r),o=e;if(e.$id&&Jv.has(e.$id))return!1;switch(e.$id&&Jv.add(e.$id),e[U]){case"Array":return CN(o,t);case"AsyncIterator":return MN(o,t);case"Constructor":return wN(o,t);case"Function":return ON(o,t);case"Intersect":return EN(o,t);case"Iterator":return PN(o,t);case"Not":return FN(o,t);case"Object":return DN(o,t);case"Promise":return kN(o,t);case"Record":return AN(o,t);case"Ref":return LN(o,t);case"This":return _N(o,t);case"Tuple":return RN(o,t);case"Union":return BN(o,t);default:return Ft(e)}}var Jv=new Set;function Xi(e,r){return Jv.clear(),Pr(e,r)}function IO(...e){let[r,t,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!_e(r,t,o))throw new ed(r,o,$i(r,t,o).First());return Xi(r,t)?td(r,t,o):o}d();function Zs(e,r){let t=ve(e,"default")?e.default:void 0,o=$a(t)?t():qe(t);return Wt(r)?o:Ae(r)&&Ae(o)?Object.assign(o,r):r}function Kv(e){return za(e)&&"default"in e}function NN(e,r,t){let o=Zs(e,t);if(!we(o))return o;for(let n=0;n<o.length;n++)o[n]=qo(e.items,r,o[n]);return o}function jN(e,r,t){return uo(t)?t:Zs(e,t)}function GN(e,r,t){let o=Zs(e,t);return e.allOf.reduce((n,i)=>{let a=qo(i,r,o);return Ae(a)?{...n,...a}:a},{})}function UN(e,r,t){let o=Zs(e,t);if(!Ae(o))return o;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let a=qo(e.properties[i],r,o[i]);Wt(a)||(o[i]=qo(e.properties[i],r,o[i]))}if(!Kv(e.additionalProperties))return o;for(let i of Object.getOwnPropertyNames(o))n.includes(i)||(o[i]=qo(e.additionalProperties,r,o[i]));return o}function VN(e,r,t){let o=Zs(e,t);if(!Ae(o))return o;let n=e.additionalProperties,[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of Object.getOwnPropertyNames(o))l.test(c)&&Kv(a)&&(o[c]=qo(a,r,o[c]));if(!Kv(n))return o;for(let c of Object.getOwnPropertyNames(o))l.test(c)||(o[c]=qo(n,r,o[c]));return o}function $N(e,r,t){return qo(Qe(e,r),r,Zs(e,t))}function HN(e,r,t){return qo(Qe(e,r),r,t)}function zN(e,r,t){let o=Zs(e,t);if(!we(o)||Wt(e.items))return o;let[n,i]=[e.items,Math.max(e.items.length,o.length)];for(let a=0;a<i;a++)a<n.length&&(o[a]=qo(n[a],r,o[a]));return o}function WN(e,r,t){let o=Zs(e,t);for(let n of e.anyOf){let i=qo(n,r,qe(o));if(_e(n,r,i))return i}return o}function qo(e,r,t){let o=xn(e,r),n=e;switch(n[U]){case"Array":return NN(n,o,t);case"Date":return jN(n,o,t);case"Intersect":return GN(n,o,t);case"Object":return UN(n,o,t);case"Record":return VN(n,o,t);case"Ref":return $N(n,o,t);case"This":return HN(n,o,t);case"Tuple":return zN(n,o,t);case"Union":return WN(n,o,t);default:return Zs(n,t)}}function cb(...e){return e.length===3?qo(e[0],e[1],e[2]):qo(e[0],[],e[1])}d();d();var qn={};La(qn,{Delete:()=>XN,Format:()=>Km,Get:()=>JN,Has:()=>YN,Set:()=>ZN,ValuePointerRootDeleteError:()=>db,ValuePointerRootSetError:()=>pb});d();var pb=class extends be{constructor(r,t,o){super("Cannot set root value"),this.value=r,this.path=t,this.update=o}},db=class extends be{constructor(r,t){super("Cannot delete root value"),this.value=r,this.path=t}};function SO(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*Km(e){if(e==="")return;let[r,t]=[0,0];for(let o=0;o<e.length;o++)e.charAt(o)==="/"?(o===0||(t=o,yield SO(e.slice(r,t))),r=o+1):t=o;yield SO(e.slice(r))}function ZN(e,r,t){if(r==="")throw new pb(e,r,t);let[o,n,i]=[null,e,""];for(let a of Km(r))n[a]===void 0&&(n[a]={}),o=n,n=n[a],i=a;o[i]=t}function XN(e,r){if(r==="")throw new db(e,r);let[t,o,n]=[null,e,""];for(let i of Km(r)){if(o[i]===void 0||o[i]===null)return;t=o,o=o[i],n=i}if(Array.isArray(t)){let i=parseInt(n);t.splice(i,1)}else delete t[n]}function YN(e,r){if(r==="")return!0;let[t,o,n]=[null,e,""];for(let i of Km(r)){if(o[i]===void 0)return!1;t=o,o=o[i],n=i}return Object.getOwnPropertyNames(t).includes(n)}function JN(e,r){if(r==="")return e;let t=e;for(let o of Km(r)){if(t[o]===void 0)return;t=t[o]}return t}d();function KN(e,r){if(!Ae(r))return!1;let t=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],o=[...Object.keys(r),...Object.getOwnPropertySymbols(r)];return t.length!==o.length?!1:t.every(n=>Ql(e[n],r[n]))}function QN(e,r){return uo(r)&&e.getTime()===r.getTime()}function qN(e,r){return!we(r)||e.length!==r.length?!1:e.every((t,o)=>Ql(t,r[o]))}function ej(e,r){return!un(r)||e.length!==r.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(r).constructor.name?!1:e.every((t,o)=>Ql(t,r[o]))}function tj(e,r){return e===r}function Ql(e,r){if(uo(e))return QN(e,r);if(un(e))return ej(e,r);if(we(e))return qN(e,r);if(Ae(e))return KN(e,r);if(Gr(e))return tj(e,r);throw new Error("ValueEquals: Unable to compare value")}var rj=It({type:at("insert"),path:fn(),value:Hs()}),oj=It({type:at("update"),path:fn(),value:Hs()}),nj=It({type:at("delete"),path:fn()}),CO=ht([rj,oj,nj]),ub=class extends be{constructor(r,t){super(t),this.value=r}};function mb(e,r){return{type:"update",path:e,value:r}}function MO(e,r){return{type:"insert",path:e,value:r}}function wO(e){return{type:"delete",path:e}}function TO(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ub(e,"Cannot diff objects with symbols")}function*ij(e,r,t){if(TO(r),TO(t),!ev(t))return yield mb(e,t);let o=globalThis.Object.getOwnPropertyNames(r),n=globalThis.Object.getOwnPropertyNames(t);for(let i of n)ve(r,i)||(yield MO(`${e}/${i}`,t[i]));for(let i of o)ve(t,i)&&(Ql(r,t)||(yield*fb(`${e}/${i}`,r[i],t[i])));for(let i of o)ve(t,i)||(yield wO(`${e}/${i}`))}function*sj(e,r,t){if(!we(t))return yield mb(e,t);for(let o=0;o<Math.min(r.length,t.length);o++)yield*fb(`${e}/${o}`,r[o],t[o]);for(let o=0;o<t.length;o++)o<r.length||(yield MO(`${e}/${o}`,t[o]));for(let o=r.length-1;o>=0;o--)o<t.length||(yield wO(`${e}/${o}`))}function*aj(e,r,t){if(!un(t)||r.length!==t.length||globalThis.Object.getPrototypeOf(r).constructor.name!==globalThis.Object.getPrototypeOf(t).constructor.name)return yield mb(e,t);for(let o=0;o<Math.min(r.length,t.length);o++)yield*fb(`${e}/${o}`,r[o],t[o])}function*lj(e,r,t){r!==t&&(yield mb(e,t))}function*fb(e,r,t){if(ev(r))return yield*ij(e,r,t);if(we(r))return yield*sj(e,r,t);if(un(r))return yield*aj(e,r,t);if(Gr(r))return yield*lj(e,r,t);throw new ub(r,"Unable to diff value")}function OO(e,r){return[...fb("",e,r)]}function cj(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function pj(e){return e.length===0}function EO(e,r){if(cj(r))return qe(r[0].value);if(pj(r))return qe(e);let t=qe(e);for(let o of r)switch(o.type){case"insert":{qn.Set(t,o.path,o.value);break}case"update":{qn.Set(t,o.path,o.value);break}case"delete":{qn.Delete(t,o.path);break}}return t}d();function PO(...e){let[r,t,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],n=Xi(r,t)?lb(r,t,o):o;if(!_e(r,t,n))throw new rd(r,n,$i(r,t,n).First());return n}d();var hb=class extends be{constructor(r){super(r)}};function dj(e,r,t,o){if(!Ae(t))qn.Set(e,r,qe(o));else{let n=Object.getOwnPropertyNames(t),i=Object.getOwnPropertyNames(o);for(let a of n)i.includes(a)||delete t[a];for(let a of i)n.includes(a)||(t[a]=null);for(let a of i)Qv(e,`${r}/${a}`,t[a],o[a])}}function uj(e,r,t,o){if(!we(t))qn.Set(e,r,qe(o));else{for(let n=0;n<o.length;n++)Qv(e,`${r}/${n}`,t[n],o[n]);t.splice(o.length)}}function mj(e,r,t,o){if(un(t)&&t.length===o.length)for(let n=0;n<t.length;n++)t[n]=o[n];else qn.Set(e,r,qe(o))}function fj(e,r,t,o){t!==o&&qn.Set(e,r,o)}function Qv(e,r,t,o){if(we(o))return uj(e,r,t,o);if(un(o))return mj(e,r,t,o);if(Ae(o))return dj(e,r,t,o);if(Gr(o))return fj(e,r,t,o)}function FO(e){return un(e)||Gr(e)}function hj(e,r){return Ae(e)&&we(r)||we(e)&&Ae(r)}function DO(e,r){if(FO(e)||FO(r))throw new hb("Only object and array types can be mutated at the root level");if(hj(e,r))throw new hb("Cannot assign due type mismatch of assignable values");Qv(e,"",e,r)}d();var gj=[(e,r,t)=>qe(t),(e,r,t)=>cb(e,r,t),(e,r,t)=>ib(e,r,t),(e,r,t)=>ab(e,r,t),(e,r,t)=>(ob(e,r,t),t),(e,r,t)=>Xi(e,r)?td(e,r,t):t];function kO(e,r,t){return gj.reduce((o,n)=>n(e,r,o),t)}function AO(...e){return e.length===3?kO(e[0],e[1],e[2]):kO(e[0],[],e[1])}d();var ei={};La(ei,{Assert:()=>ob,Cast:()=>Yv,Check:()=>_e,Clean:()=>ib,Clone:()=>qe,Convert:()=>ab,Create:()=>In,Decode:()=>IO,Default:()=>cb,Diff:()=>OO,Edit:()=>CO,Encode:()=>PO,Equal:()=>Ql,Errors:()=>$i,Hash:()=>Ka,Mutate:()=>DO,Parse:()=>AO,Patch:()=>EO,ValueErrorIterator:()=>vn});d();d();var LO={},yj=function(e,r,t,o,n){var i=new Worker(LO[r]||(LO[r]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(a){var l=a.data,c=l.$e$;if(c){var p=new Error(c[0]);p.code=c[1],p.stack=c[2],n(p,null)}else n(null,l)},i.postMessage(t,o),i},St=Uint8Array,ho=Uint16Array,tf=Int32Array,ad=new St([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]),ld=new St([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]),Qm=new St([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),BO=function(e,r){for(var t=new ho(31),o=0;o<31;++o)t[o]=r+=1<<e[o-1];for(var n=new tf(t[30]),o=1;o<30;++o)for(var i=t[o];i<t[o+1];++i)n[i]=i-t[o]<<5|o;return{b:t,r:n}},NO=BO(ad,2),nI=NO.b,vb=NO.r;nI[28]=258,vb[258]=28;var jO=BO(ld,0),GO=jO.b,eI=jO.r,qm=new ho(32768);for(lt=0;lt<32768;++lt)Xs=(lt&43690)>>1|(lt&21845)<<1,Xs=(Xs&52428)>>2|(Xs&13107)<<2,Xs=(Xs&61680)>>4|(Xs&3855)<<4,qm[lt]=((Xs&65280)>>8|(Xs&255)<<8)>>1;var Xs,lt,Tn=function(e,r,t){for(var o=e.length,n=0,i=new ho(r);n<o;++n)e[n]&&++i[e[n]-1];var a=new ho(r);for(n=1;n<r;++n)a[n]=a[n-1]+i[n-1]<<1;var l;if(t){l=new ho(1<<r);var c=15-r;for(n=0;n<o;++n)if(e[n])for(var p=n<<4|e[n],u=r-e[n],f=a[e[n]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)l[qm[f]>>c]=p}else for(l=new ho(o),n=0;n<o;++n)e[n]&&(l[n]=qm[a[e[n]-1]++]>>15-e[n]);return l},Ys=new St(288);for(lt=0;lt<144;++lt)Ys[lt]=8;var lt;for(lt=144;lt<256;++lt)Ys[lt]=9;var lt;for(lt=256;lt<280;++lt)Ys[lt]=7;var lt;for(lt=280;lt<288;++lt)Ys[lt]=8;var lt,id=new St(32);for(lt=0;lt<32;++lt)id[lt]=5;var lt,UO=Tn(Ys,9,0),VO=Tn(Ys,9,1),$O=Tn(id,5,0),HO=Tn(id,5,1),yb=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},Sn=function(e,r,t){var o=r/8|0;return(e[o]|e[o+1]<<8)>>(r&7)&t},bb=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},rf=function(e){return(e+7)/8|0},Qa=function(e,r,t){return(r==null||r<0)&&(r=0),(t==null||t>e.length)&&(t=e.length),new St(e.subarray(r,t))},Cb={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},zO=["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"],Xt=function(e,r,t){var o=new Error(r||zO[e]);if(o.code=e,Error.captureStackTrace&&Error.captureStackTrace(o,Xt),!t)throw o;return o},WO=function(e,r,t,o){var n=e.length,i=o?o.length:0;if(!n||r.f&&!r.l)return t||new St(0);var a=!t,l=a||r.i!=2,c=r.i;a&&(t=new St(n*3));var p=function(P){var q=t.length;if(P>q){var K=new St(Math.max(q*2,P));K.set(t),t=K}},u=r.f||0,f=r.p||0,h=r.b||0,b=r.l,v=r.d,T=r.m,x=r.n,I=n*8;do{if(!b){u=Sn(e,f,1);var M=Sn(e,f+1,3);if(f+=3,M)if(M==1)b=VO,v=HO,T=9,x=5;else if(M==2){var _=Sn(e,f,31)+257,G=Sn(e,f+10,15)+4,R=_+Sn(e,f+5,31)+1;f+=14;for(var N=new St(R),X=new St(19),z=0;z<G;++z)X[Qm[z]]=Sn(e,f+z*3,7);f+=G*3;for(var ee=yb(X),re=(1<<ee)-1,ue=Tn(X,ee,1),z=0;z<R;){var Ce=ue[Sn(e,f,re)];f+=Ce&15;var O=Ce>>4;if(O<16)N[z++]=O;else{var Oe=0,Pe=0;for(O==16?(Pe=3+Sn(e,f,3),f+=2,Oe=N[z-1]):O==17?(Pe=3+Sn(e,f,7),f+=3):O==18&&(Pe=11+Sn(e,f,127),f+=7);Pe--;)N[z++]=Oe}}var Fe=N.subarray(0,_),ce=N.subarray(_);T=yb(Fe),x=yb(ce),b=Tn(Fe,T,1),v=Tn(ce,x,1)}else Xt(1);else{var O=rf(f)+4,C=e[O-4]|e[O-3]<<8,E=O+C;if(E>n){c&&Xt(0);break}l&&p(h+C),t.set(e.subarray(O,E),h),r.b=h+=C,r.p=f=E*8,r.f=u;continue}if(f>I){c&&Xt(0);break}}l&&p(h+131072);for(var Ee=(1<<T)-1,ye=(1<<x)-1,Ge=f;;Ge=f){var Oe=b[bb(e,f)&Ee],Ie=Oe>>4;if(f+=Oe&15,f>I){c&&Xt(0);break}if(Oe||Xt(2),Ie<256)t[h++]=Ie;else if(Ie==256){Ge=f,b=null;break}else{var Xe=Ie-254;if(Ie>264){var z=Ie-257,se=ad[z];Xe=Sn(e,f,(1<<se)-1)+nI[z],f+=se}var nt=v[bb(e,f)&ye],dt=nt>>4;nt||Xt(3),f+=nt&15;var ce=GO[dt];if(dt>3){var se=ld[dt];ce+=bb(e,f)&(1<<se)-1,f+=se}if(f>I){c&&Xt(0);break}l&&p(h+131072);var $t=h+Xe;if(h<ce){var k=i-ce,H=Math.min(ce,$t);for(k+h<0&&Xt(3);h<H;++h)t[h]=o[k+h]}for(;h<$t;++h)t[h]=t[h-ce]}}r.l=b,r.p=Ge,r.b=h,r.f=u,b&&(u=1,r.m=T,r.d=v,r.n=x)}while(!u);return h!=t.length&&a?Qa(t,0,h):t.subarray(0,h)},Yi=function(e,r,t){t<<=r&7;var o=r/8|0;e[o]|=t,e[o+1]|=t>>8},od=function(e,r,t){t<<=r&7;var o=r/8|0;e[o]|=t,e[o+1]|=t>>8,e[o+2]|=t>>16},xb=function(e,r){for(var t=[],o=0;o<e.length;++o)e[o]&&t.push({s:o,f:e[o]});var n=t.length,i=t.slice();if(!n)return{t:sI,l:0};if(n==1){var a=new St(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(E,_){return E.f-_.f}),t.push({s:-1,f:25001});var l=t[0],c=t[1],p=0,u=1,f=2;for(t[0]={s:-1,f:l.f+c.f,l,r:c};u!=n-1;)l=t[t[p].f<t[f].f?p++:f++],c=t[p!=u&&t[p].f<t[f].f?p++:f++],t[u++]={s:-1,f:l.f+c.f,l,r:c};for(var h=i[0].s,o=1;o<n;++o)i[o].s>h&&(h=i[o].s);var b=new ho(h+1),v=Ib(t[u-1],b,0);if(v>r){var o=0,T=0,x=v-r,I=1<<x;for(i.sort(function(_,G){return b[G.s]-b[_.s]||_.f-G.f});o<n;++o){var M=i[o].s;if(b[M]>r)T+=I-(1<<v-b[M]),b[M]=r;else break}for(T>>=x;T>0;){var O=i[o].s;b[O]<r?T-=1<<r-b[O]++-1:++o}for(;o>=0&&T;--o){var C=i[o].s;b[C]==r&&(--b[C],++T)}v=r}return{t:new St(b),l:v}},Ib=function(e,r,t){return e.s==-1?Math.max(Ib(e.l,r,t+1),Ib(e.r,r,t+1)):r[e.s]=t},tI=function(e){for(var r=e.length;r&&!e[--r];);for(var t=new ho(++r),o=0,n=e[0],i=1,a=function(c){t[o++]=c},l=1;l<=r;++l)if(e[l]==n&&l!=r)++i;else{if(!n&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(n),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(n);i=1,n=e[l]}return{c:t.subarray(0,o),n:r}},nd=function(e,r){for(var t=0,o=0;o<r.length;++o)t+=e[o]*r[o];return t},iI=function(e,r,t){var o=t.length,n=rf(r+2);e[n]=o&255,e[n+1]=o>>8,e[n+2]=e[n]^255,e[n+3]=e[n+1]^255;for(var i=0;i<o;++i)e[n+i+4]=t[i];return(n+4+o)*8},rI=function(e,r,t,o,n,i,a,l,c,p,u){Yi(r,u++,t),++n[256];for(var f=xb(n,15),h=f.t,b=f.l,v=xb(i,15),T=v.t,x=v.l,I=tI(h),M=I.c,O=I.n,C=tI(T),E=C.c,_=C.n,G=new ho(19),R=0;R<M.length;++R)++G[M[R]&31];for(var R=0;R<E.length;++R)++G[E[R]&31];for(var N=xb(G,7),X=N.t,z=N.l,ee=19;ee>4&&!X[Qm[ee-1]];--ee);var re=p+5<<3,ue=nd(n,Ys)+nd(i,id)+a,Ce=nd(n,h)+nd(i,T)+a+14+3*ee+nd(G,X)+2*G[16]+3*G[17]+7*G[18];if(c>=0&&re<=ue&&re<=Ce)return iI(r,u,e.subarray(c,c+p));var Oe,Pe,Fe,ce;if(Yi(r,u,1+(Ce<ue)),u+=2,Ce<ue){Oe=Tn(h,b,0),Pe=h,Fe=Tn(T,x,0),ce=T;var Ee=Tn(X,z,0);Yi(r,u,O-257),Yi(r,u+5,_-1),Yi(r,u+10,ee-4),u+=14;for(var R=0;R<ee;++R)Yi(r,u+3*R,X[Qm[R]]);u+=3*ee;for(var ye=[M,E],Ge=0;Ge<2;++Ge)for(var Ie=ye[Ge],R=0;R<Ie.length;++R){var Xe=Ie[R]&31;Yi(r,u,Ee[Xe]),u+=X[Xe],Xe>15&&(Yi(r,u,Ie[R]>>5&127),u+=Ie[R]>>12)}}else Oe=UO,Pe=Ys,Fe=$O,ce=id;for(var R=0;R<l;++R){var se=o[R];if(se>255){var Xe=se>>18&31;od(r,u,Oe[Xe+257]),u+=Pe[Xe+257],Xe>7&&(Yi(r,u,se>>23&31),u+=ad[Xe]);var nt=se&31;od(r,u,Fe[nt]),u+=ce[nt],nt>3&&(od(r,u,se>>5&8191),u+=ld[nt])}else od(r,u,Oe[se]),u+=Pe[se]}return od(r,u,Oe[256]),u+Pe[256]},ZO=new tf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sI=new St(0),XO=function(e,r,t,o,n,i){var a=i.z||e.length,l=new St(o+a+5*(1+Math.ceil(a/7e3))+n),c=l.subarray(o,l.length-n),p=i.l,u=(i.r||0)&7;if(r){u&&(c[0]=i.r>>3);for(var f=ZO[r-1],h=f>>13,b=f&8191,v=(1<<t)-1,T=i.p||new ho(32768),x=i.h||new ho(v+1),I=Math.ceil(t/3),M=2*I,O=function(Q){return(e[Q]^e[Q+1]<<I^e[Q+2]<<M)&v},C=new tf(25e3),E=new ho(288),_=new ho(32),G=0,R=0,N=i.i||0,X=0,z=i.w||0,ee=0;N+2<a;++N){var re=O(N),ue=N&32767,Ce=x[re];if(T[ue]=Ce,x[re]=ue,z<=N){var Oe=a-N;if((G>7e3||X>24576)&&(Oe>423||!p)){u=rI(e,c,0,C,E,_,R,X,ee,N-ee,u),X=G=R=0,ee=N;for(var Pe=0;Pe<286;++Pe)E[Pe]=0;for(var Pe=0;Pe<30;++Pe)_[Pe]=0}var Fe=2,ce=0,Ee=b,ye=ue-Ce&32767;if(Oe>2&&re==O(N-ye))for(var Ge=Math.min(h,Oe)-1,Ie=Math.min(32767,N),Xe=Math.min(258,Oe);ye<=Ie&&--Ee&&ue!=Ce;){if(e[N+Fe]==e[N+Fe-ye]){for(var se=0;se<Xe&&e[N+se]==e[N+se-ye];++se);if(se>Fe){if(Fe=se,ce=ye,se>Ge)break;for(var nt=Math.min(ye,se-2),dt=0,Pe=0;Pe<nt;++Pe){var $t=N-ye+Pe&32767,k=T[$t],H=$t-k&32767;H>dt&&(dt=H,Ce=$t)}}}ue=Ce,Ce=T[ue],ye+=ue-Ce&32767}if(ce){C[X++]=268435456|vb[Fe]<<18|eI[ce];var P=vb[Fe]&31,q=eI[ce]&31;R+=ad[P]+ld[q],++E[257+P],++_[q],z=N+Fe,++G}else C[X++]=e[N],++E[e[N]]}}for(N=Math.max(N,z);N<a;++N)C[X++]=e[N],++E[e[N]];u=rI(e,c,p,C,E,_,R,X,ee,N-ee,u),p||(i.r=u&7|c[u/8|0]<<3,u-=7,i.h=x,i.p=T,i.i=N,i.w=z)}else{for(var N=i.w||0;N<a+p;N+=65535){var K=N+65535;K>=a&&(c[u/8|0]=p,K=a),u=iI(c,u+1,e.subarray(N,K))}i.i=a}return Qa(l,0,o+rf(u)+n)},bj=function(){for(var e=new Int32Array(256),r=0;r<256;++r){for(var t=r,o=9;--o;)t=(t&1&&-306674912)^t>>>1;e[r]=t}return e}(),YO=function(){var e=-1;return{p:function(r){for(var t=e,o=0;o<r.length;++o)t=bj[t&255^r[o]]^t>>>8;e=t},d:function(){return~e}}};var JO=function(e,r,t,o,n){if(!n&&(n={l:1},r.dictionary)){var i=r.dictionary.subarray(-32768),a=new St(i.length+e.length);a.set(i),a.set(e,i.length),e=a,n.w=i.length}return XO(e,r.level==null?6:r.level,r.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+r.mem,t,o,n)},Mb=function(e,r){var t={};for(var o in e)t[o]=e[o];for(var o in r)t[o]=r[o];return t},_O=function(e,r,t){for(var o=e(),n=e.toString(),i=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<o.length;++a){var l=o[a],c=i[a];if(typeof l=="function"){r+=";"+c+"=";var p=l.toString();if(l.prototype)if(p.indexOf("[native code]")!=-1){var u=p.indexOf(" ",8)+1;r+=p.slice(u,p.indexOf("(",u))}else{r+=p;for(var f in l.prototype)r+=";"+c+".prototype."+f+"="+l.prototype[f].toString()}else r+=p}else t[c]=l}return r},gb=[],xj=function(e){var r=[];for(var t in e)e[t].buffer&&r.push((e[t]=new e[t].constructor(e[t])).buffer);return r},vj=function(e,r,t,o){if(!gb[t]){for(var n="",i={},a=e.length-1,l=0;l<a;++l)n=_O(e[l],n,i);gb[t]={c:_O(e[a],n,i),e:i}}var c=Mb({},gb[t].e);return yj(gb[t].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,c,xj(c),o)},Ij=function(){return[St,ho,tf,ad,ld,Qm,nI,GO,VO,HO,qm,zO,Tn,yb,Sn,bb,rf,Qa,Xt,WO,Eb,wb,KO]},Sj=function(){return[St,ho,tf,ad,ld,Qm,vb,eI,UO,Ys,$O,id,qm,ZO,sI,Tn,Yi,od,xb,Ib,tI,nd,iI,rI,rf,Qa,XO,JO,Ob,wb]};var wb=function(e){return postMessage(e,[e.buffer])},KO=function(e){return e&&{out:e.size&&new St(e.size),dictionary:e.dictionary}},QO=function(e,r,t,o,n,i){var a=vj(t,o,n,function(l,c){a.terminate(),i(l,c)});return a.postMessage([e,r],r.consume?[e.buffer]:[]),function(){a.terminate()}};var ti=function(e,r){return e[r]|e[r+1]<<8},zr=function(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)>>>0},qv=function(e,r){return zr(e,r)+zr(e,r+4)*4294967296},Hr=function(e,r,t){for(;t;++r)e[r]=t,t>>>=8};function Tj(e,r,t){return t||(t=r,r={}),typeof t!="function"&&Xt(7),QO(e,r,[Sj],function(o){return wb(Ob(o.data[0],o.data[1]))},0,t)}function Ob(e,r){return JO(e,r||{},0,0)}function Cj(e,r,t){return t||(t=r,r={}),typeof t!="function"&&Xt(7),QO(e,r,[Ij],function(o){return wb(Eb(o.data[0],KO(o.data[1])))},1,t)}function Eb(e,r){return WO(e,{i:2},r&&r.out,r&&r.dictionary)}var aI=function(e,r,t,o){for(var n in e){var i=e[n],a=r+n,l=o;Array.isArray(i)&&(l=Mb(o,i[1]),i=i[0]),i instanceof St?t[a]=[i,l]:(t[a+="/"]=[new St(0),l],aI(i,a,t,o))}},RO=typeof TextEncoder<"u"&&new TextEncoder,oI=typeof TextDecoder<"u"&&new TextDecoder,Mj=0;try{oI.decode(sI,{stream:!0}),Mj=1}catch{}var wj=function(e){for(var r="",t=0;;){var o=e[t++],n=(o>127)+(o>223)+(o>239);if(t+n>e.length)return{s:r,r:Qa(e,t-1)};n?n==3?(o=((o&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023)):n&1?r+=String.fromCharCode((o&31)<<6|e[t++]&63):r+=String.fromCharCode((o&15)<<12|(e[t++]&63)<<6|e[t++]&63):r+=String.fromCharCode(o)}};function sd(e,r){if(r){for(var t=new St(e.length),o=0;o<e.length;++o)t[o]=e.charCodeAt(o);return t}if(RO)return RO.encode(e);for(var n=e.length,i=new St(e.length+(e.length>>1)),a=0,l=function(u){i[a++]=u},o=0;o<n;++o){if(a+5>i.length){var c=new St(a+8+(n-o<<1));c.set(i),i=c}var p=e.charCodeAt(o);p<128||r?l(p):p<2048?(l(192|p>>6),l(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|e.charCodeAt(++o)&1023,l(240|p>>18),l(128|p>>12&63),l(128|p>>6&63),l(128|p&63)):(l(224|p>>12),l(128|p>>6&63),l(128|p&63))}return Qa(i,0,a)}function lI(e,r){if(r){for(var t="",o=0;o<e.length;o+=16384)t+=String.fromCharCode.apply(null,e.subarray(o,o+16384));return t}else{if(oI)return oI.decode(e);var n=wj(e),i=n.s,t=n.r;return t.length&&Xt(8),i}}var qO=function(e,r){return r+30+ti(e,r+26)+ti(e,r+28)},eE=function(e,r,t){var o=ti(e,r+28),n=lI(e.subarray(r+46,r+46+o),!(ti(e,r+8)&2048)),i=r+46+o,a=zr(e,r+20),l=t&&a==4294967295?Oj(e,i):[a,zr(e,r+24),zr(e,r+42)],c=l[0],p=l[1],u=l[2];return[ti(e,r+10),c,p,n,i+ti(e,r+30)+ti(e,r+32),u]},Oj=function(e,r){for(;ti(e,r)!=1;r+=4+ti(e,r+2));return[qv(e,r+12),qv(e,r+4),qv(e,r+20)]},ef=function(e){var r=0;if(e)for(var t in e){var o=e[t].length;o>65535&&Xt(9),r+=o+4}return r},Sb=function(e,r,t,o,n,i,a,l){var c=o.length,p=t.extra,u=l&&l.length,f=ef(p);Hr(e,r,a!=null?33639248:67324752),r+=4,a!=null&&(e[r++]=20,e[r++]=t.os),e[r]=20,r+=2,e[r++]=t.flag<<1|(i<0&&8),e[r++]=n&&8,e[r++]=t.compression&255,e[r++]=t.compression>>8;var h=new Date(t.mtime==null?Date.now():t.mtime),b=h.getFullYear()-1980;if((b<0||b>119)&&Xt(10),Hr(e,r,b<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),r+=4,i!=-1&&(Hr(e,r,t.crc),Hr(e,r+4,i<0?-i-2:i),Hr(e,r+8,t.size)),Hr(e,r+12,c),Hr(e,r+14,f),r+=16,a!=null&&(Hr(e,r,u),Hr(e,r+6,t.attrs),Hr(e,r+10,a),r+=14),e.set(o,r),r+=c,f)for(var v in p){var T=p[v],x=T.length;Hr(e,r,+v),Hr(e,r+2,x),e.set(T,r+4),r+=4+x}return u&&(e.set(l,r),r+=u),r},tE=function(e,r,t,o,n){Hr(e,r,101010256),Hr(e,r+8,t),Hr(e,r+10,t),Hr(e,r+12,o),Hr(e,r+16,n)};function rE(e,r,t){t||(t=r,r={}),typeof t!="function"&&Xt(7);var o={};aI(e,"",o,r);var n=Object.keys(o),i=n.length,a=0,l=0,c=i,p=new Array(i),u=[],f=function(){for(var x=0;x<u.length;++x)u[x]()},h=function(x,I){Tb(function(){t(x,I)})};Tb(function(){h=t});var b=function(){var x=new St(l+22),I=a,M=l-a;l=0;for(var O=0;O<c;++O){var C=p[O];try{var E=C.c.length;Sb(x,l,C,C.f,C.u,E);var _=30+C.f.length+ef(C.extra),G=l+_;x.set(C.c,G),Sb(x,a,C,C.f,C.u,E,l,C.m),a+=16+_+(C.m?C.m.length:0),l=G+E}catch(R){return h(R,null)}}tE(x,a,p.length,M,I),h(null,x)};i||b();for(var v=function(x){var I=n[x],M=o[I],O=M[0],C=M[1],E=YO(),_=O.length;E.p(O);var G=sd(I),R=G.length,N=C.comment,X=N&&sd(N),z=X&&X.length,ee=ef(C.extra),re=C.level==0?0:8,ue=function(Ce,Oe){if(Ce)f(),h(Ce,null);else{var Pe=Oe.length;p[x]=Mb(C,{size:_,crc:E.d(),c:Oe,f:G,m:X,u:R!=I.length||X&&N.length!=z,compression:re}),a+=30+R+ee+Pe,l+=76+2*(R+ee)+(z||0)+Pe,--i||b()}};if(R>65535&&ue(Xt(11,0,1),null),!re)ue(null,O);else if(_<16e4)try{ue(null,Ob(O,C))}catch(Ce){ue(Ce,null)}else u.push(Tj(O,C,ue))},T=0;T<c;++T)v(T);return f}function oE(e,r){r||(r={});var t={},o=[];aI(e,"",t,r);var n=0,i=0;for(var a in t){var l=t[a],c=l[0],p=l[1],u=p.level==0?0:8,f=sd(a),h=f.length,b=p.comment,v=b&&sd(b),T=v&&v.length,x=ef(p.extra);h>65535&&Xt(11);var I=u?Ob(c,p):c,M=I.length,O=YO();O.p(c),o.push(Mb(p,{size:c.length,crc:O.d(),c:I,f,m:v,u:h!=a.length||v&&b.length!=T,o:n,compression:u})),n+=30+h+x+M,i+=76+2*(h+x)+(T||0)+M}for(var C=new St(i+22),E=n,_=i-n,G=0;G<o.length;++G){var f=o[G];Sb(C,f.o,f,f.f,f.u,f.c.length);var R=30+f.f.length+ef(f.extra);C.set(f.c,f.o+R),Sb(C,n,f,f.f,f.u,f.c.length,f.o,f.m),n+=16+R+(f.m?f.m.length:0)}return tE(C,n,o.length,_,E),C}var Tb=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function nE(e,r,t){t||(t=r,r={}),typeof t!="function"&&Xt(7);var o=[],n=function(){for(var x=0;x<o.length;++x)o[x]()},i={},a=function(x,I){Tb(function(){t(x,I)})};Tb(function(){a=t});for(var l=e.length-22;zr(e,l)!=101010256;--l)if(!l||e.length-l>65558)return a(Xt(13,0,1),null),n;var c=ti(e,l+8);if(c){var p=c,u=zr(e,l+16),f=u==4294967295||p==65535;if(f){var h=zr(e,l-12);f=zr(e,h)==101075792,f&&(p=c=zr(e,h+32),u=zr(e,h+48))}for(var b=r&&r.filter,v=function(x){var I=eE(e,u,f),M=I[0],O=I[1],C=I[2],E=I[3],_=I[4],G=I[5],R=qO(e,G);u=_;var N=function(z,ee){z?(n(),a(z,null)):(ee&&(i[E]=ee),--c||a(null,i))};if(!b||b({name:E,size:O,originalSize:C,compression:M}))if(!M)N(null,Qa(e,R,R+O));else if(M==8){var X=e.subarray(R,R+O);if(C<524288||O>.8*C)try{N(null,Eb(X,{out:new St(C)}))}catch(z){N(z,null)}else o.push(Cj(X,{size:C},N))}else N(Xt(14,"unknown compression type "+M,1),null);else N(null,null)},T=0;T<p;++T)v(T)}else a(null,{});return n}function iE(e,r){for(var t={},o=e.length-22;zr(e,o)!=101010256;--o)(!o||e.length-o>65558)&&Xt(13);var n=ti(e,o+8);if(!n)return{};var i=zr(e,o+16),a=i==4294967295||n==65535;if(a){var l=zr(e,o-12);a=zr(e,l)==101075792,a&&(n=zr(e,l+32),i=zr(e,l+48))}for(var c=r&&r.filter,p=0;p<n;++p){var u=eE(e,i,a),f=u[0],h=u[1],b=u[2],v=u[3],T=u[4],x=u[5],I=qO(e,x);i=T,(!c||c({name:v,size:h,originalSize:b,compression:f}))&&(f?f==8?t[v]=Eb(e.subarray(I,I+h),{out:new St(b)}):Xt(14,"unknown compression type "+f):t[v]=Qa(e,I,I+h))}return t}d();var Ej=e=>{if(e!=null)return e.trim()===""?void 0:e},Pj=e=>e!=null,Pb=(e,r,t=0)=>{if(D.IsNull(e))return"null";if(D.IsUndefined(e))return"undefined";if(D.IsString(e))return"<string>";if(D.IsNumber(e))return"<number>";if(D.IsBoolean(e))return"<boolean>";if(D.IsLiteral(e))return typeof e.const=="string"?`'${e.const}'`:`${e.const}`;if(D.IsRef(e)){let o=r.find(n=>n.$id===e.$ref);return o==null?e.$ref:Pb(o,r,t)}if(D.IsArray(e))return`${Pb(e.items,r,t+1)}[]`;if(D.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let n=`${e.anyOf.map(i=>Pb(i,r,t+1)).filter(Pj).join(" | ")}`;return t>0?`(${n})`:n}return e.$id??""},Fj=(e,r,t)=>{let o=r.message;return D.IsUnion(r.schema)&&(o=`Expected one of: ${Pb(r.schema,t)}`),`${`#/definitions/${e}${Ej(r.path)??""}`}: ${o}`},Fb=(e,r,t)=>{let o=r.First();if(o!=null)return Fj(e,o,t)};var cd;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(cd||(cd={}));var pd=class extends Error{constructor(t,o){super(o);m(this,"name");m(this,"kind");this.name="CompressError",this.kind=t}},Dj=e=>new pd(cd.Archive,e.message),kj=e=>{let r=Object.values(Cb);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&r.includes(e.code)},Aj=(e,r,t)=>new pd(cd.Validate,Fb(e,r,t)??"Unknown validate error"),Lj=e=>new pd(cd.Encode,e.message),_j=e=>new pd(cd.Unknown,e instanceof Error?e.message:String(e)),of=(e,r,t)=>r instanceof Kl?Lj(r):r instanceof vn?Aj(e,r,t):kj(r)?Dj(r):_j(r);d();var dd;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(dd||(dd={}));var ud=class extends Error{constructor(t,o){super(o);m(this,"name");m(this,"kind");this.name="DecompressError",this.kind=t}},Rj=e=>new ud(dd.Unarchive,e.message),Bj=e=>{let r=Object.values(Cb);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&r.includes(e.code)},Nj=(e,r,t)=>new ud(dd.Validate,Fb(e,r,t)??"Unknown validate error"),jj=e=>new ud(dd.Decode,e.message),Gj=e=>new ud(dd.Unknown,e instanceof Error?e.message:String(e)),nf=(e,r,t)=>r instanceof Jl?jj(r):r instanceof vn?Nj(e,r,t):Bj(r)?Rj(r):Gj(r);var sE=function*(e,r=""){if(e!=null){if(Array.isArray(e)){for(let t=0;t<e.length;t++)yield[r+`[${t}]`,e[t]];return}if("features"in e){for(let t=0;t<e.features.length;t++)yield[r===""?`features[${t}]`:`${r}.features[${t}]`,e.features[t]];return}for(let[t,o]of Object.entries(e)){let n=r===""?t:`${r}.${t}`;yield*sE(o,n)}}},Uj=(e,r)=>e===""?r:r.startsWith("[")?`${e}${r}`:`${e}.${r}`,er=(e,r,t)=>{let o=new Set;for(let[n,i]of sE(e)){let a=r(i);if(o.has(a))return ie({kind:_o.DuplicateIdError,properties:{id:a,path:Uj(t,n)}});o.add(a)}return oe(!0)};var aE=e=>e.floors==null?ie({kind:_o.FloorMissingError,properties:null}):er(e.floors.features,r=>r.properties.id,"floors");var lE=g.Intersect([g.Object({id:g.Ref(Ve),elevation:g.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:g.Optional(g.String({description:"The subtitle of the floor."})),maxHeight:g.Optional(g.Number({description:"The maximum height of the floor in meters. This includes the thickness of the floor itself, up to the tallest point on any wall. If the floor does not have a consistent height (eg, one room on the floor has a vaulted ceiling, the rest do not), this value represents the highest point anywhere on the floor. Must be a positive number, or undefined.",minimum:0}))}),Xo],{$id:"FloorProperties"}),cE=Ur(g.Union([g.Ref(Yp),g.Ref(Jp),g.Null()]),g.Ref(lE),{$id:"FloorFeature"}),pE=fo(g.Ref(cE),{$id:"FloorCollection"}),Vj=g.Object({floors:g.Ref(pE)}),dE={name:"core:floors",intoBundle:function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},fromBundle:(e,r,t)=>{if(e==="floors.geojson")return{floors:t(r)}},integrityCheck:aE,schema:Vj,references:[lE,cE,pE]};d();d();var tr=e=>g.Unsafe(e);d();var Ze=e=>Object.keys(e);d();d();var $j=e=>new Map(e.floors?.features.map(r=>[r.properties.id,r])??[]),ri=e=>{let r=$j(e);return o=>{let n=r.get(o);return n==null?ie({kind:_o.UnknownFloorError,properties:{floorId:o}}):oe(n)}};var uE=e=>{if(e.floors==null)return ie({kind:_o.FloorMissingError,properties:null});if(e.geometry==null)return ie({kind:_o.GeometryMissingError,properties:null});let r=er(e.geometry,o=>o.properties.id,"geometry");if(r.isErr())return r;let t=ri(e);for(let o of Ze(e.geometry)){let n=t(o);if(n.isErr())return n}return oe(!0)};var mE=g.Intersect([g.Object({id:g.Ref(ro)}),Xo],{$id:"GeometryProperties"}),fE=Ur(g.Union([g.Ref(to),g.Ref(Xy),g.Ref(Yy),g.Ref(Jy),g.Ref(Yp),g.Ref(Jp)]),g.Ref(mE),{$id:"GeometryFeature"}),hE=fo(g.Ref(fE),{$id:"GeometryCollection"}),Hj=g.Object({geometry:tr(g.Record(Ve,g.Ref(hE),{additionalProperties:!1}))},{$id:"GeometrySchema"}),zj=/^geometry\/(.*)\.geojson$/,gE={name:"core:geometry",schema:Hj,intoBundle:function*(e){if(e.geometry!=null)for(let r of Ze(e.geometry))yield{path:`geometry/${r}.geojson`,contents:e.geometry[r]}},fromBundle:(e,r,t)=>{let o=e.match(zj)?.[1];if(o)return{geometry:{[o]:t(r)}}},references:[mE,fE,hE],integrityCheck:uE};d();var cI=g.Object({type:g.Literal("file"),name:g.String({description:"The name of the file."})},{$id:"ManifestFile"}),yE=g.Recursive(e=>g.Object({type:g.Literal("folder"),name:g.String({description:"The name of the folder."}),children:g.Array(g.Union([e,g.Ref(cI)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),bE=g.Object({name:g.String({description:"The name of the map."}),version:g.Literal("3.0.0",{description:"The version of the manifest."}),orgId:g.Optional(g.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:g.Optional(g.String({description:"The identifier of the map that this MVF is for."})),contents:g.Array(g.Union([g.Ref(yE),g.Ref(cI)]),{minItems:1,description:"The contents of the MVF bundle."}),time:g.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:g.Optional(g.Unsafe(g.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:g.Optional(g.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:g.Optional(g.Ref(Ve,{description:"The default floor ID of the map."})),language:g.Optional(g.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),xE=fo(Ur(to,g.Ref(bE)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),Wj=g.Object({manifest:g.Ref(xE)}),vE={name:"core:manifest",intoBundle:function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},fromBundle:(e,r,t)=>{if(e==="manifest.geojson")return{manifest:t(r)}},schema:Wj,references:[cI,yE,bE,xE]};d();d();d();d();var pI=class extends be{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`);m(this,"schema");this.schema=t}};function Zj(e,r){let t=r.find(o=>o.$id===e.$ref);if(t===void 0)throw new pI(e);return ql(t,r)}function Db(e,r){return!Ye.IsString(e.$id)||r.some(t=>t.$id===e.$id)||r.push(e),r}function ql(e,r){return e[U]==="This"||e[U]==="Ref"?Zj(e,r):e}d();function Xj(e,r,t){let o=e.get(r);if(o!==void 0)return o;let n=Xi(r,t);return e.set(r,n),n}function kb(){let e=new WeakMap;return{HasTransform:(r,t)=>Xj(e,r,t)}}function Yt(e,r,t){try{return D.IsTransform(e)?e[Rt].Decode(t):t}catch(o){throw new Jl(e,r,t,o)}}function Yj(e,r,t,o,n){return Ye.IsArray(o)?Yt(e,t,o.map((i,a)=>Ji(e.items,r,`${t}/${a}`,i,n))):Yt(e,t,o)}function Jj(e,r,t,o,n){if(!Ye.IsObject(o)||Gr(o))return Yt(e,t,o);let i=Xa(e),a=i.map(f=>f[0]),l={...o};for(let[f,h]of i)f in l&&(l[f]=Ji(h,r,`${t}/${f}`,l[f],n));if(!D.IsTransform(e.unevaluatedProperties))return Yt(e,t,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,u={...l};for(let f of c)a.includes(f)||(u[f]=Yt(p,`${t}/${f}`,u[f]));return Yt(e,t,u)}function Kj(e,r,t,o,n){return Yt(e,t,Ji(e.not,r,t,o,n))}function Qj(e,r,t,o,n){if(!Ye.IsObject(o))return Yt(e,t,o);let i=Er(e),a={...o};for(let u of i)Ye.HasPropertyKey(a,u)&&(Ye.IsUndefined(a[u])&&(!D.IsUndefined(e.properties[u])||pt.IsExactOptionalProperty(a,u))||(a[u]=Ji(e.properties[u],r,`${t}/${u}`,a[u],n)));if(!D.IsSchema(e.additionalProperties))return Yt(e,t,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let u of l)i.includes(u)||(p[u]=Yt(c,`${t}/${u}`,p[u]));return Yt(e,t,p)}function qj(e,r,t,o,n){if(!Ye.IsObject(o))return Yt(e,t,o);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...o};for(let f of Object.getOwnPropertyNames(o))a.test(f)&&(l[f]=Ji(e.patternProperties[i],r,`${t}/${f}`,l[f],n));if(!D.IsSchema(e.additionalProperties))return Yt(e,t,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,u={...l};for(let f of c)a.test(f)||(u[f]=Yt(p,`${t}/${f}`,u[f]));return Yt(e,t,u)}function eG(e,r,t,o,n){let i=ql(e,r);return Yt(e,t,Ji(i,r,t,o,n))}function tG(e,r,t,o,n){let i=ql(e,r);return Yt(e,t,Ji(i,r,t,o,n))}function rG(e,r,t,o,n){return Ye.IsArray(o)&&Ye.IsArray(e.items)?Yt(e,t,e.items.map((i,a)=>Ji(i,r,`${t}/${a}`,o[a],n))):Yt(e,t,o)}function oG(e,r,t,o,n){for(let i of e.anyOf){if(!ei.Check(i,r,o))continue;let a=Ji(i,r,t,o,n);return Yt(e,t,a)}return Yt(e,t,o)}function Ji(e,r,t,o,n){if(!n.HasTransform(e,r))return o;let i=Db(e,r),a=e;switch(e[U]){case"Array":return Yj(a,i,t,o,n);case"Intersect":return Jj(a,i,t,o,n);case"Not":return Kj(a,i,t,o,n);case"Object":return Qj(a,i,t,o,n);case"Record":return qj(a,i,t,o,n);case"Ref":return eG(a,i,t,o,n);case"Symbol":return Yt(a,t,o);case"This":return tG(a,i,t,o,n);case"Tuple":return rG(a,i,t,o,n);case"Union":return oG(a,i,t,o,n);default:return Yt(a,t,o)}}function IE(e,r,t){let o=kb();return Ji(e,r,"",t,o)}d();function io(e,r,t){try{return D.IsTransform(e)?e[Rt].Encode(t):t}catch(o){throw new Kl(e,r,t,o)}}function nG(e,r,t,o,n){let i=io(e,t,o);return Ye.IsArray(i)?i.map((a,l)=>Ki(e.items,r,`${t}/${l}`,a,n)):i}function iG(e,r,t,o,n){let i=io(e,t,o);if(!Ye.IsObject(o)||Gr(o))return i;let a=Xa(e),l=a.map(h=>h[0]),c={...i};for(let[h,b]of a)h in c&&(c[h]=Ki(b,r,`${t}/${h}`,c[h],n));if(!D.IsTransform(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),u=e.unevaluatedProperties,f={...c};for(let h of p)l.includes(h)||(f[h]=io(u,`${t}/${h}`,f[h]));return f}function sG(e,r,t,o){return io(e.not,t,io(e,t,o))}function aG(e,r,t,o,n){let i=io(e,t,o);if(!Ye.IsObject(i))return i;let a=Er(e),l={...i};for(let f of a)Ye.HasPropertyKey(l,f)&&(Ye.IsUndefined(l[f])&&(!D.IsUndefined(e.properties[f])||pt.IsExactOptionalProperty(l,f))||(l[f]=Ki(e.properties[f],r,`${t}/${f}`,l[f],n)));if(!D.IsSchema(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,u={...l};for(let f of c)a.includes(f)||(u[f]=io(p,`${t}/${f}`,u[f]));return u}function lG(e,r,t,o,n){let i=io(e,t,o);if(!Ye.IsObject(o))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(a),c={...i};for(let h of Object.getOwnPropertyNames(o))l.test(h)&&(c[h]=Ki(e.patternProperties[a],r,`${t}/${h}`,c[h],n));if(!D.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),u=e.additionalProperties,f={...c};for(let h of p)l.test(h)||(f[h]=io(u,`${t}/${h}`,f[h]));return f}function cG(e,r,t,o,n){let i=ql(e,r),a=Ki(i,r,t,o,n);return io(e,t,a)}function pG(e,r,t,o,n){let i=ql(e,r),a=Ki(i,r,t,o,n);return io(e,t,a)}function dG(e,r,t,o,n){let i=io(e,t,o);return Ye.IsArray(e.items)?e.items.map((a,l)=>Ki(a,r,`${t}/${l}`,i[l],n)):[]}function uG(e,r,t,o,n){for(let i of e.anyOf){if(!ei.Check(i,r,o))continue;let a=Ki(i,r,t,o,n);return io(e,t,a)}for(let i of e.anyOf){let a=Ki(i,r,t,o,n);if(ei.Check(e,r,a))return io(e,t,a)}return io(e,t,o)}function Ki(e,r,t,o,n){if(!n.HasTransform(e,r))return o;let i=Db(e,r),a=e;switch(e[U]){case"Array":return nG(a,i,t,o,n);case"Intersect":return iG(a,i,t,o,n);case"Not":return sG(a,i,t,o);case"Object":return aG(a,i,t,o,n);case"Record":return lG(a,i,t,o,n);case"Ref":return cG(a,i,t,o,n);case"This":return pG(a,i,t,o,n);case"Tuple":return dG(a,i,t,o,n);case"Union":return uG(a,i,t,o,n);default:return io(a,t,o)}}function SE(e,r,t){let o=kb();return Ki(e,r,"",t,o)}d();var dI=class{constructor(r,t,o,n){this.schema=r,this.references=t,this.checkFunc=o,this.code=n,this.hasTransform=Xi(r,t)}Code(){return this.code}Errors(r){return $i(this.schema,this.references,r)}Check(r){return this.checkFunc(r)}Decode(r){if(!this.checkFunc(r))throw new ed(this.schema,r,this.Errors(r).First());return this.hasTransform?td(this.schema,this.references,r):r}Encode(r){let t=this.hasTransform?lb(this.schema,this.references,r):r;if(!this.checkFunc(t))throw new rd(this.schema,r,this.Errors(r).First());return t}},Js;(function(e){function r(i){return i===36}e.DollarSign=r;function t(i){return i===95}e.IsUnderscore=t;function o(i){return i>=65&&i<=90||i>=97&&i<=122}e.IsAlpha=o;function n(i){return i>=48&&i<=57}e.IsNumeric=n})(Js||(Js={}));var Ab;(function(e){function r(i){return i.length===0?!1:Js.IsNumeric(i.charCodeAt(0))}function t(i){if(r(i))return!1;for(let a=0;a<i.length;a++){let l=i.charCodeAt(a);if(!(Js.IsAlpha(l)||Js.IsNumeric(l)||Js.DollarSign(l)||Js.IsUnderscore(l)))return!1}return!0}function o(i){return i.replace(/'/g,"\\'")}function n(i,a){return t(a)?`${i}.${a}`:`${i}['${o(a)}']`}e.Encode=n})(Ab||(Ab={}));var uI;(function(e){function r(t){let o=[];for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);Js.IsNumeric(i)||Js.IsAlpha(i)?o.push(t.charAt(n)):o.push(`_${i}_`)}return o.join("").replace(/__/g,"_")}e.Encode=r})(uI||(uI={}));var mI;(function(e){function r(t){return t.replace(/'/g,"\\'")}e.Escape=r})(mI||(mI={}));var fI=class extends be{constructor(r){super("Unknown type"),this.schema=r}},Lb=class extends be{constructor(r){super("Preflight validation check failed to guard for the given schema"),this.schema=r}},ec;(function(e){function r(a,l,c){return pt.ExactOptionalPropertyTypes?`('${l}' in ${a} ? ${c} : true)`:`(${Ab.Encode(a,l)} !== undefined ? ${c} : true)`}e.IsExactOptionalProperty=r;function t(a){return pt.AllowArrayObject?`(typeof ${a} === 'object' && ${a} !== null)`:`(typeof ${a} === 'object' && ${a} !== null && !Array.isArray(${a}))`}e.IsObjectLike=t;function o(a){return pt.AllowArrayObject?`(typeof ${a} === 'object' && ${a} !== null && !(${a} instanceof Date) && !(${a} instanceof Uint8Array))`:`(typeof ${a} === 'object' && ${a} !== null && !Array.isArray(${a}) && !(${a} instanceof Date) && !(${a} instanceof Uint8Array))`}e.IsRecordLike=o;function n(a){return pt.AllowNaN?`typeof ${a} === 'number'`:`Number.isFinite(${a})`}e.IsNumberLike=n;function i(a){return pt.AllowNullVoid?`(${a} === undefined || ${a} === null)`:`${a} === undefined`}e.IsVoidLike=i})(ec||(ec={}));var _b;(function(e){function r(k){return k[U]==="Any"||k[U]==="Unknown"}function*t(k,H,P){yield"true"}function*o(k,H,P){yield`Array.isArray(${P})`;let[q,K]=[Xe("value","any"),Xe("acc","number")];me(k.maxItems)&&(yield`${P}.length <= ${k.maxItems}`),me(k.minItems)&&(yield`${P}.length >= ${k.minItems}`);let Q=Ee(k.items,H,"value");if(yield`${P}.every((${q}) => ${Q})`,ze(k.contains)||me(k.minContains)||me(k.maxContains)){let De=ze(k.contains)?k.contains:ft(),xt=Ee(De,H,"value"),dr=me(k.minContains)?[`(count >= ${k.minContains})`]:[],ir=me(k.maxContains)?[`(count <= ${k.maxContains})`]:[],ur=`const count = value.reduce((${K}, ${q}) => ${xt} ? acc + 1 : acc, 0)`,wi=["(count > 0)",...dr,...ir].join(" && ");yield`((${q}) => { ${ur}; return ${wi}})(${P})`}k.uniqueItems===!0&&(yield`((${q}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${P})`)}function*n(k,H,P){yield`(typeof value === 'object' && Symbol.asyncIterator in ${P})`}function*i(k,H,P){yield`(typeof ${P} === 'bigint')`,jr(k.exclusiveMaximum)&&(yield`${P} < BigInt(${k.exclusiveMaximum})`),jr(k.exclusiveMinimum)&&(yield`${P} > BigInt(${k.exclusiveMinimum})`),jr(k.maximum)&&(yield`${P} <= BigInt(${k.maximum})`),jr(k.minimum)&&(yield`${P} >= BigInt(${k.minimum})`),jr(k.multipleOf)&&(yield`(${P} % BigInt(${k.multipleOf})) === 0`)}function*a(k,H,P){yield`(typeof ${P} === 'boolean')`}function*l(k,H,P){yield*Fe(k.returns,H,`${P}.prototype`)}function*c(k,H,P){yield`(${P} instanceof Date) && Number.isFinite(${P}.getTime())`,me(k.exclusiveMaximumTimestamp)&&(yield`${P}.getTime() < ${k.exclusiveMaximumTimestamp}`),me(k.exclusiveMinimumTimestamp)&&(yield`${P}.getTime() > ${k.exclusiveMinimumTimestamp}`),me(k.maximumTimestamp)&&(yield`${P}.getTime() <= ${k.maximumTimestamp}`),me(k.minimumTimestamp)&&(yield`${P}.getTime() >= ${k.minimumTimestamp}`),me(k.multipleOfTimestamp)&&(yield`(${P}.getTime() % ${k.multipleOfTimestamp}) === 0`)}function*p(k,H,P){yield`(typeof ${P} === 'function')`}function*u(k,H,P){yield`Number.isInteger(${P})`,me(k.exclusiveMaximum)&&(yield`${P} < ${k.exclusiveMaximum}`),me(k.exclusiveMinimum)&&(yield`${P} > ${k.exclusiveMinimum}`),me(k.maximum)&&(yield`${P} <= ${k.maximum}`),me(k.minimum)&&(yield`${P} >= ${k.minimum}`),me(k.multipleOf)&&(yield`(${P} % ${k.multipleOf}) === 0`)}function*f(k,H,P){let q=k.allOf.map(K=>Ee(K,H,P)).join(" && ");if(k.unevaluatedProperties===!1){let K=Ge(`${new RegExp($s(k))};`),Q=`Object.getOwnPropertyNames(${P}).every(key => ${K}.test(key))`;yield`(${q} && ${Q})`}else if(ze(k.unevaluatedProperties)){let K=Ge(`${new RegExp($s(k))};`),Q=`Object.getOwnPropertyNames(${P}).every(key => ${K}.test(key) || ${Ee(k.unevaluatedProperties,H,`${P}[key]`)})`;yield`(${q} && ${Q})`}else yield`(${q})`}function*h(k,H,P){yield`(typeof value === 'object' && Symbol.iterator in ${P})`}function*b(k,H,P){typeof k.const=="number"||typeof k.const=="boolean"?yield`(${P} === ${k.const})`:yield`(${P} === '${mI.Escape(k.const)}')`}function*v(k,H,P){yield"false"}function*T(k,H,P){yield`(!${Ee(k.not,H,P)})`}function*x(k,H,P){yield`(${P} === null)`}function*I(k,H,P){yield ec.IsNumberLike(P),me(k.exclusiveMaximum)&&(yield`${P} < ${k.exclusiveMaximum}`),me(k.exclusiveMinimum)&&(yield`${P} > ${k.exclusiveMinimum}`),me(k.maximum)&&(yield`${P} <= ${k.maximum}`),me(k.minimum)&&(yield`${P} >= ${k.minimum}`),me(k.multipleOf)&&(yield`(${P} % ${k.multipleOf}) === 0`)}function*M(k,H,P){yield ec.IsObjectLike(P),me(k.minProperties)&&(yield`Object.getOwnPropertyNames(${P}).length >= ${k.minProperties}`),me(k.maxProperties)&&(yield`Object.getOwnPropertyNames(${P}).length <= ${k.maxProperties}`);let q=Object.getOwnPropertyNames(k.properties);for(let K of q){let Q=Ab.Encode(P,K),De=k.properties[K];if(k.required&&k.required.includes(K))yield*Fe(De,H,Q),(zs(De)||r(De))&&(yield`('${K}' in ${P})`);else{let xt=Ee(De,H,Q);yield ec.IsExactOptionalProperty(P,K,xt)}}if(k.additionalProperties===!1)if(k.required&&k.required.length===q.length)yield`Object.getOwnPropertyNames(${P}).length === ${q.length}`;else{let K=`[${q.map(Q=>`'${Q}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${P}).every(key => ${K}.includes(key))`}if(typeof k.additionalProperties=="object"){let K=Ee(k.additionalProperties,H,`${P}[key]`),Q=`[${q.map(De=>`'${De}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${P}).every(key => ${Q}.includes(key) || ${K}))`}}function*O(k,H,P){yield`(typeof value === 'object' && typeof ${P}.then === 'function')`}function*C(k,H,P){yield ec.IsRecordLike(P),me(k.minProperties)&&(yield`Object.getOwnPropertyNames(${P}).length >= ${k.minProperties}`),me(k.maxProperties)&&(yield`Object.getOwnPropertyNames(${P}).length <= ${k.maxProperties}`);let[q,K]=Object.entries(k.patternProperties)[0],Q=Ge(`${new RegExp(q)}`),De=Ee(K,H,"value"),xt=ze(k.additionalProperties)?Ee(k.additionalProperties,H,P):k.additionalProperties===!1?"false":"true",dr=`(${Q}.test(key) ? ${De} : ${xt})`;yield`(Object.entries(${P}).every(([key, value]) => ${dr}))`}function*E(k,H,P){let q=Qe(k,H);if(ce.functions.has(k.$ref))return yield`${ye(k.$ref)}(${P})`;yield*Fe(q,H,P)}function*_(k,H,P){let q=Ge(`${new RegExp(k.source,k.flags)};`);yield`(typeof ${P} === 'string')`,me(k.maxLength)&&(yield`${P}.length <= ${k.maxLength}`),me(k.minLength)&&(yield`${P}.length >= ${k.minLength}`),yield`${q}.test(${P})`}function*G(k,H,P){yield`(typeof ${P} === 'string')`,me(k.maxLength)&&(yield`${P}.length <= ${k.maxLength}`),me(k.minLength)&&(yield`${P}.length >= ${k.minLength}`),k.pattern!==void 0&&(yield`${Ge(`${new RegExp(k.pattern)};`)}.test(${P})`),k.format!==void 0&&(yield`format('${k.format}', ${P})`)}function*R(k,H,P){yield`(typeof ${P} === 'symbol')`}function*N(k,H,P){yield`(typeof ${P} === 'string')`,yield`${Ge(`${new RegExp(k.pattern)};`)}.test(${P})`}function*X(k,H,P){yield`${ye(k.$ref)}(${P})`}function*z(k,H,P){if(yield`Array.isArray(${P})`,k.items===void 0)return yield`${P}.length === 0`;yield`(${P}.length === ${k.maxItems})`;for(let q=0;q<k.items.length;q++)yield`${Ee(k.items[q],H,`${P}[${q}]`)}`}function*ee(k,H,P){yield`${P} === undefined`}function*re(k,H,P){yield`(${k.anyOf.map(K=>Ee(K,H,P)).join(" || ")})`}function*ue(k,H,P){yield`${P} instanceof Uint8Array`,me(k.maxByteLength)&&(yield`(${P}.length <= ${k.maxByteLength})`),me(k.minByteLength)&&(yield`(${P}.length >= ${k.minByteLength})`)}function*Ce(k,H,P){yield"true"}function*Oe(k,H,P){yield ec.IsVoidLike(P)}function*Pe(k,H,P){let q=ce.instances.size;ce.instances.set(q,k),yield`kind('${k[U]}', ${q}, ${P})`}function*Fe(k,H,P,q=!0){let K=He(k.$id)?[...H,k]:H,Q=k;if(q&&He(k.$id)){let De=ye(k.$id);if(ce.functions.has(De))return yield`${De}(${P})`;{let xt=Ie(De,k,H,"value",!1);return ce.functions.set(De,xt),yield`${De}(${P})`}}switch(Q[U]){case"Any":return yield*t(Q,K,P);case"Array":return yield*o(Q,K,P);case"AsyncIterator":return yield*n(Q,K,P);case"BigInt":return yield*i(Q,K,P);case"Boolean":return yield*a(Q,K,P);case"Constructor":return yield*l(Q,K,P);case"Date":return yield*c(Q,K,P);case"Function":return yield*p(Q,K,P);case"Integer":return yield*u(Q,K,P);case"Intersect":return yield*f(Q,K,P);case"Iterator":return yield*h(Q,K,P);case"Literal":return yield*b(Q,K,P);case"Never":return yield*v(Q,K,P);case"Not":return yield*T(Q,K,P);case"Null":return yield*x(Q,K,P);case"Number":return yield*I(Q,K,P);case"Object":return yield*M(Q,K,P);case"Promise":return yield*O(Q,K,P);case"Record":return yield*C(Q,K,P);case"Ref":return yield*E(Q,K,P);case"RegExp":return yield*_(Q,K,P);case"String":return yield*G(Q,K,P);case"Symbol":return yield*R(Q,K,P);case"TemplateLiteral":return yield*N(Q,K,P);case"This":return yield*X(Q,K,P);case"Tuple":return yield*z(Q,K,P);case"Undefined":return yield*ee(Q,K,P);case"Union":return yield*re(Q,K,P);case"Uint8Array":return yield*ue(Q,K,P);case"Unknown":return yield*Ce(Q,K,P);case"Void":return yield*Oe(Q,K,P);default:if(!Or.Has(Q[U]))throw new fI(k);return yield*Pe(Q,K,P)}}let ce={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Ee(k,H,P,q=!0){return`(${[...Fe(k,H,P,q)].join(" && ")})`}function ye(k){return`check_${uI.Encode(k)}`}function Ge(k){let H=`local_${ce.variables.size}`;return ce.variables.set(H,`const ${H} = ${k}`),H}function Ie(k,H,P,q,K=!0){let[Q,De]=[`
|
|
2
|
+
`,ur=>"".padStart(ur," ")],xt=Xe("value","any"),dr=se("boolean"),ir=[...Fe(H,P,q,K)].map(ur=>`${De(4)}${ur}`).join(` &&${Q}`);return`function ${k}(${xt})${dr} {${Q}${De(2)}return (${Q}${ir}${Q}${De(2)})
|
|
3
|
+
}`}function Xe(k,H){let P=ce.language==="typescript"?`: ${H}`:"";return`${k}${P}`}function se(k){return ce.language==="typescript"?`: ${k}`:""}function nt(k,H,P){let q=Ie("check",k,H,"value"),K=Xe("value","any"),Q=se("boolean"),De=[...ce.functions.values()],xt=[...ce.variables.values()],dr=He(k.$id)?`return function check(${K})${Q} {
|
|
4
|
+
return ${ye(k.$id)}(value)
|
|
5
|
+
}`:`return ${q}`;return[...xt,...De,dr].join(`
|
|
6
|
+
`)}function dt(...k){let H={language:"javascript"},[P,q,K]=k.length===2&&we(k[1])?[k[0],k[1],H]:k.length===2&&!we(k[1])?[k[0],[],k[1]]:k.length===3?[k[0],k[1],k[2]]:k.length===1?[k[0],[],H]:[null,[],H];if(ce.language=K.language,ce.variables.clear(),ce.functions.clear(),ce.instances.clear(),!ze(P))throw new Lb(P);for(let Q of q)if(!ze(Q))throw new Lb(Q);return nt(P,q,K)}e.Code=dt;function $t(k,H=[]){let P=dt(k,H,{language:"javascript"}),q=globalThis.Function("kind","format","hash",P),K=new Map(ce.instances);function Q(ir,ur,wi){if(!Or.Has(ir)||!K.has(ur))return!1;let cp=Or.Get(ir),im=K.get(ur);return cp(im,wi)}function De(ir,ur){return Fo.Has(ir)?Fo.Get(ir)(ur):!1}function xt(ir){return Ka(ir)}let dr=q(Q,De,xt);return new dI(k,H,dr,P)}e.Compile=$t})(_b||(_b={}));d();d();d();var mG=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,fG=[0,31,28,31,30,31,30,31,31,30,31,30,31],hG=e=>e%4===0&&(e%100!==0||e%400===0),Rb=e=>{let r=mG.exec(e);if(!r)return!1;let t=+r[1],o=+r[2],n=+r[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&hG(t)?29:fG[o])};d();var gG=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,Bb=e=>{let r=gG.exec(e);if(!r)return!1;let t=+r[1],o=+r[2],n=+r[3],i=r[4],a=r[5]==="-"?-1:1,l=+(r[6]||0),c=+(r[7]||0);if(l>23||c>59||!i)return!1;if(t<=23&&o<=59&&n<60)return!0;let p=o-c*a,u=t-l*a-(p<0?1:0);return(u===23||u===-1)&&(p===59||p===-1)&&n<61};var yG=/t|\s/i,TE=e=>{let r=e.split(yG);return r.length===2&&Rb(r[0])&&Bb(r[1])};d();var bG=/\/|:/,xG=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,CE=e=>bG.test(e)&&xG.test(e);var vG=[["date",Rb],["time",Bb],["date-time",TE],["uri",CE]],ME=()=>{for(let[e,r]of vG)try{tb.Format(e,r)}catch(t){if(t instanceof Xm)continue;throw t}};d();var hI=g.Record(g.String(),g.Unknown(),{$id:"Extra"}),oi=g.Object({extra:g.Optional(g.Ref(hI))}),gI=[hI];d();d();d();d();d();d();var tt=e=>Object.entries(e);var IG=e=>{let r=new Map;for(let[t,o]of tt(e.geometry??{}))r.set(t,new Map(o?.features.map(n=>[n.properties.id,n])));return r},yr=e=>{let r=IG(e);return(o,n)=>{let i=r.get(o);if(i==null)return ie({kind:_o.UnknownFloorError,properties:{floorId:o}});let a=i.get(n);return a==null?ie({kind:_o.UnknownGeometryError,properties:{floorId:o,geometryId:n}}):oe(a)}};d();var Cn=g.Object({geometryId:g.Ref(ro)},{$id:"WithGeometryId"}),md=g.Object({geometryIds:g.Array(g.Ref(ro))},{$id:"WithGeometryIds"}),yI=[Cn,md];d();d();d();var wE=e=>e instanceof Error?e:new Error(String(e));var fd=e=>(...r)=>{try{return oe(e(...r))}catch(t){return ie(wE(t))}};var OE=fd((e,r)=>{let t={};for(let o of r)for(let n of o.intoBundle(e))t[n.path]=sd(JSON.stringify(n.contents));return t}),bI=async(e,r,t)=>OE(e,r).andThenAsync(o=>new Promise(n=>{rE(o,{...t,consume:!0},(i,a)=>{n(i?ie(i):oe(a))})})),SG=fd(oE),xI=(e,r,t)=>OE(e,r).andThen(o=>SG(o,t));d();d();function Nb(e,r,t=[]){let o={...e};for(let[n,i]of Object.entries(r))if(i!==void 0)if(n in o){let a=n;if(Array.isArray(i)&&i.length>0){let l=TG(i[0],t);if(l){let c=o[a];if(!Array.isArray(c))throw new Error(`Expected array at ${n}, got ${typeof c}`);let p=new Map(i.map(h=>[EE(h,l),h])),f=c.map(h=>{let b=p.get(EE(h,l));return b?Nb(h,b,t):h});o[a]=f}else o[a]=i}else{let l=o[a];typeof l=="object"&&l!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?o[a]=i:o[a]=Nb(l,i,t):o[n]=i}}else o[n]=i;return o}function TG(e,r){function t(o){if(typeof o!="object"||o===null)return null;for(let n of r)if(n in o&&typeof o[n]<"u")return[n];if(Array.isArray(o))return null;for(let[n,i]of Object.entries(o)){let a=t(i);if(a)return[n,...a]}return null}return t(e)}function EE(e,r){return r.reduce((t,o)=>{if(t&&typeof t=="object")return t[o]},e)}var CG=e=>e,MG=e=>JSON.parse(lI(e)),PE=(e,r)=>r.some(t=>t.fromBundle(e.name,new Uint8Array,CG)!==void 0),FE=fd((e,r)=>{let t={};for(let o of Object.keys(e)){let n=e[o];for(let i of r){let a=i.fromBundle(o,n,MG);if(a){t=Nb(t,a,[]);break}}}return t}),vI=async(e,r)=>new Promise(t=>nE(e,{filter:o=>PE(o,r)},(o,n)=>{t(o?ie(o):oe(n))})).then(t=>t.andThen(o=>FE(o,r))),wG=fd(iE),II=(e,r)=>wG(e,{filter:t=>PE(t,r)}).andThen(t=>FE(t,r));d();var OG=e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string",EG=e=>{if(e.length<2)return!1;let r=e.filter(OG);if(r.length!==e.length)return!1;let t=r[0].$ref;return r.slice(1).every(o=>o.$ref===t)},jb=e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&EG(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([r,t])=>[r,jb(t)])):Array.isArray(e)?e.map(jb):e;d();var Gb=e=>typeof e=="object"&&e!=null&&"$ref"in e?{...e,$ref:`#/definitions/${e.$ref}`}:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([r,t])=>[r,Gb(t)])):Array.isArray(e)?e.map(Gb):e;var hd;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(hd||(hd={}));var PG=e=>({next(){for(let t of e){let o=t.next();if(!o.done)return o}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),FG=(...e)=>{let r=new Map;for(let t of PG(e)){if(!t.$id)continue;let o=r.get(t.$id);if(o!=null&&o!==t)return ie({kind:hd.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:t});r.set(t.$id,t)}return oe(r)},Fr,gd,en,Wr,SI=class SI{constructor(r,t,o,n){S(this,Fr);S(this,gd);S(this,en,[]);S(this,Wr);w(this,Fr,r),w(this,gd,t),w(this,en,o),w(this,Wr,n),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(r,t="CoreMVF",o=!1){let n=g.Composite(r.extensions.map(a=>a.schema),{$id:t});if(!D.IsSchema(n))return ie({kind:hd.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=FG(Nv.values(),jv.values(),Rv.values(),gI.values(),TI.values(),yI.values(),r.extensions.flatMap(a=>a.references??[]).values());if(!i.isOk())return i;try{ME();let a=o?null:_b.Compile(n,[...i.value.values()]);return oe(new SI(n,a,r.extensions,i.value))}catch(a){return a instanceof be?ie({kind:hd.TypeboxError,message:a.message,original:a}):ie({kind:hd.UnknownError,message:"An unknown error occurred while compiling the schema",original:a})}}is(r){return s(this,gd)?.Check(r)??ei.Check(s(this,Fr),[...s(this,Wr).values()],r)}parse(r){return this.is(r)?oe(r):ie(s(this,gd)?.Errors(r)??ei.Errors(s(this,Fr),[...s(this,Wr).values()],r))}decode(r){try{return oe(IE(s(this,Fr),[...s(this,Wr).values()],r))}catch(t){return ie(t)}}encode(r){try{return oe(SE(s(this,Fr),[...s(this,Wr).values()],r))}catch(t){return ie(t)}}verify(r){for(let t of s(this,en))if(t.integrityCheck){let o=t.integrityCheck(r);if(o.isErr())return ie(o.error)}return oe(!0)}jsonSchema(){let r=JSON.parse(JSON.stringify([s(this,Fr),...s(this,Wr).values()])),t=jb(Gb({$id:`#/definitions/${s(this,Fr).$id??"CoreMVF"}`,$schema:"http://json-schema.org/draft-07/schema#",references:r}));return JSON.stringify(t,null,2)}async compress(r){return this.encode(r).andThen(t=>this.parse(t)).andThenAsync(t=>bI(t,s(this,en))).then(t=>t.mapErr(o=>of(s(this,Fr).$id??"CoreMVF",o,[...s(this,Wr).values()])))}async compressUnsafe(r){return this.encode(r).andThenAsync(t=>bI(t,s(this,en))).then(t=>t.mapErr(o=>of(s(this,Fr).$id??"CoreMVF",o,[...s(this,Wr).values()])))}compressSync(r){return this.encode(r).andThen(t=>this.parse(t)).andThen(t=>xI(t,s(this,en))).mapErr(t=>of(s(this,Fr).$id??"CoreMVF",t,[...s(this,Wr).values()]))}compressUnsafeSync(r){return this.encode(r).andThen(t=>xI(t,s(this,en))).mapErr(t=>of(s(this,Fr).$id??"CoreMVF",t,[...s(this,Wr).values()]))}async decompress(r){return vI(r,s(this,en)).then(t=>t.andThen(o=>this.parse(o)).andThen(o=>this.decode(o)).mapErr(o=>nf(s(this,Fr).$id??"CoreMVF",o,[...s(this,Wr).values()])))}async decompressUnsafe(r){return vI(r,s(this,en)).then(t=>t.andThen(o=>this.decode(o)).mapErr(o=>nf(s(this,Fr).$id??"CoreMVF",o,[...s(this,Wr).values()])))}decompressSync(r){return II(r,s(this,en)).andThen(t=>this.parse(t)).andThen(t=>this.decode(t)).mapErr(t=>nf(s(this,Fr).$id??"CoreMVF",t,[...s(this,Wr).values()]))}decompressUnsafeSync(r){return II(r,s(this,en)).andThen(t=>this.decode(t)).mapErr(t=>nf(s(this,Fr).$id??"CoreMVF",t,[...s(this,Wr).values()]))}};Fr=new WeakMap,gd=new WeakMap,en=new WeakMap,Wr=new WeakMap;var Ub=SI;var yd,Vb=class{constructor(){S(this,yd,[]);this.extend=this.extend.bind(this)}extend(r){return s(this,yd).push(r),this}extendOptional(r){let t={...r,schema:g.Partial(r.schema)};return s(this,yd).push(t),this}build(r){return Ub.create(this,void 0,r?.cspSafe)}get extensions(){return s(this,yd)}};yd=new WeakMap;d();d();d();d();var bd=g.Object({geometryId:g.Ref(ro),floorId:g.Ref(Ve)},{$id:"GeometryAnchor"}),DG=g.Object({geometryAnchor:g.Ref(bd)}),sf=(e,r)=>g.Object({geometryAnchors:g.Array(g.Ref(bd),e)},r),TI=[bd];d();d();d();var DE=(e,r)=>g.Unsafe(g.Transform(g.String(r)).Decode(t=>e.includes(t)?t:"unknown").Encode(t=>t)),Ro=(e,r)=>{let t=DE(e,r),o=[...e,"unknown"],n=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:t,values:o,record:n}};var kE=()=>new Vb().extend(dE).extend(gE).extend(vE);d();d();d();d();d();d();var af;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(af||(af={}));var AE=e=>{if(e.annotations==null)return oe(!0);let r=er(e.annotations,n=>n.id,"annotations");if(r.isErr())return r;let t=yr(e),o=new Set(Ze(e.annotationSymbols??{}));for(let n of Ze(e.annotations)){let i=e.annotations[n];if(i!=null)for(let a of i){if(!o.has(a.symbolKey))return ie({kind:af.AnnotationUnknownSymbolError,properties:{annotationId:a.id,symbolKey:a.symbolKey}});let l=t(n,a.geometryId);if(l.isErr())return l;if(l.value.geometry.type!=="Point")return ie({kind:af.AnnotationNonPointGeometryError,properties:{annotationId:a.id,floorId:n,geometryId:a.geometryId}})}}return oe(!0)};var LE=qt("a","AnnotationId"),CI=g.Intersect([Cn,g.Object({id:g.Ref(LE,{description:"The unique identifier for the annotation."}),externalId:g.Optional(g.String({description:"The external identifier for the annotation."})),symbolKey:g.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),_E=g.Object({url:g.String({format:"uri",description:"The URL for the symbol."}),name:g.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),kG=g.Object({annotations:tr(g.Record(Ve,g.Array(g.Ref(CI)),{additionalProperties:!1})),annotationSymbols:tr(g.Record(g.Index(CI,["symbolKey"]),g.Ref(_E)))},{$id:"AnnotationsSchema"}),AG=/^annotations\/(.*)\.json$/,RE={name:"ext:mvf-annotations",schema:kG,intoBundle:function*(e){if(e.annotations!=null)for(let r of Ze(e.annotations))yield{path:`annotations/${r}.json`,contents:e.annotations[r]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},fromBundle:(e,r,t)=>{if(e==="annotation-symbols.json")return{annotationSymbols:t(r)};let o=e.match(AG)?.[1];if(o)return{annotations:{[o]:t(r)}}},references:[LE,CI,_E],integrityCheck:AE};d();d();d();var Ks=qt("lcat","LocationCategoryId"),MI=g.Intersect([g.Object({id:g.Ref(Ks),parent:g.Optional(g.Ref(Ks))}),Xl(["name"]),oi],{$id:"LocationCategory"}),BE=[Ks,MI];d();d();var tc;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(tc||(tc={}));var NE=e=>{if(e.locationCategories==null&&e.locations==null)return oe(!0);if(e.locationCategories!=null){let n=er(e.locationCategories,i=>i.id,"locationCategories");if(n.isErr())return n}if(e.locations!=null){let n=er(e.locations,i=>i.id,"locations");if(n.isErr())return n}if(e.locationInstances!=null){let n=er(e.locationInstances,i=>i.id,"locationInstances");if(n.isErr())return n}let r=new Set(e.locationCategories?.map(n=>n.id)??[]);for(let n of e.locationCategories??[])if(n.parent!=null&&!r.has(n.parent))return ie({kind:tc.UnknownParentCategoryError,properties:{categoryId:n.id,parentCategoryId:n.parent}});let t=yr(e);for(let n of e.locations??[]){for(let i of n.categories)if(!r.has(i))return ie({kind:tc.UnknownCategoryError,properties:{locationId:n.id,categoryId:i}});for(let i of n.geometryAnchors){let a=t(i.floorId,i.geometryId);if(a.isErr())return a}}let o=new Set(e.locations?.map(n=>n.id)??[]);for(let n of e.locationInstances??[]){if(!o.has(n.parentId))return ie({kind:tc.UnknownParentLocationError,properties:{locationInstanceId:n.id,parentLocationId:n.parentId}});for(let i of n.categories??[])if(!r.has(i))return ie({kind:tc.UnknownCategoryError,properties:{locationId:n.id,categoryId:i}});for(let i of n.geometryAnchors??[]){let a=t(i.floorId,i.geometryId);if(a.isErr())return a}}return oe(!0)};d();var Qs=qt("loc","LocationId"),$b=qt("loci","LocationInstanceId"),jE=g.Object({name:g.String(),url:g.String({format:"uri"})},{$id:"LocationSocial"}),GE=g.Object({url:g.String({format:"uri"})},{$id:"LocationImage"}),wI=g.Object({label:g.String(),url:g.String({format:"uri"})},{$id:"LocationLink"}),OI=g.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),UE=g.Union([g.Literal("Sunday"),g.Literal("Monday"),g.Literal("Tuesday"),g.Literal("Wednesday"),g.Literal("Thursday"),g.Literal("Friday"),g.Literal("Saturday")],{$id:"OpeningHoursDay"}),LG="PublicHolidays",EI=g.Union([UE,g.Literal(LG)],{$id:"OpeningHoursDayOrPublicHoliday"}),Hb=g.Object({"@type":g.Optional(g.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:g.Optional(g.Ref(OI,{description:"The time the opening hours start"})),closes:g.Optional(g.Ref(OI,{description:"The time the opening hours end"})),dayOfWeek:g.Optional(g.Union([g.Ref(EI),g.Array(g.Ref(EI))],{description:"The days of the week the opening hours apply to"})),validFrom:g.Optional(g.String({format:"date",description:"The date the opening hours start, in ISO 8601 format"})),validThrough:g.Optional(g.String({format:"date",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),zb=g.Intersect([g.Object({id:g.Ref(Qs),categories:g.Array(g.Ref(Ks)),logo:g.Optional(g.String({format:"uri"})),phone:g.Optional(g.String()),social:g.Array(g.Ref(jE)),images:g.Array(g.Ref(GE)),links:g.Array(g.Ref(wI)),website:g.Optional(g.Ref(wI)),openingHours:g.Optional(g.Array(g.Ref(Hb)))}),Xl(["name"]),sf(),oi],{$id:"Location"}),PI=g.Intersect([g.Object({id:g.Ref($b),parentId:g.Ref(Qs)}),g.Partial(g.Omit(zb,["id","parentId","details"])),Xo],{$id:"LocationInstance",description:"A location instance is a particular instance of an location that has some properties different from the parent."}),Wb=[Qs,$b,jE,GE,wI,OI,UE,EI,Hb,zb,PI];var _G=g.Object({locations:g.Array(g.Ref(zb)),locationCategories:g.Array(g.Ref(MI)),locationInstances:g.Optional(g.Array(g.Ref(PI)))},{$id:"LocationsExtensionSchema"}),VE="locations.json",$E="location-categories.json",HE="location-instances.json",zE={name:"ext:locations",schema:_G,intoBundle:function*(e){e.locations!=null&&(yield{path:VE,contents:e.locations}),e.locationCategories!=null&&(yield{path:$E,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:HE,contents:e.locationInstances})},fromBundle:(e,r,t)=>{if(e===VE)return{locations:t(r)};if(e===$E)return{locationCategories:t(r)};if(e===HE)return{locationInstances:t(r)}},references:[...BE,...Wb],integrityCheck:NE};d();d();var ni;(function(e){e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling",e.EnterpriseVenueWithUnknownTopLocationError="EnterpriseVenueWithUnknownTopLocationError",e.EnterpriseLocationWithInvalidPrimaryCategory="EnterpriseLocationWithInvalidPrimaryCategory"})(ni||(ni={}));var WE=e=>{if(e.cms==null)return oe(!0);let r=e.cms,t=er(e.cms.categories,h=>h.id,"cms.categories");if(t.isErr())return t;let o=new Set(e.locationCategories?.map(h=>h.id)??[]);for(let h of r.categories??[])if(!o.has(h.categoryId))return ie({kind:ni.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:h.id,locationCategoryId:h.categoryId}});let n=er(e.cms.locations,h=>h.id,"cms.locations");if(n.isErr())return n;let i=new Map(e.locations?.map(h=>[h.id,h])??[]);for(let h of r.locations??[]){if(!i.has(h.locationId))return ie({kind:ni.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:h.id,locationId:h.locationId}});for(let b of h.siblingGroups??[])for(let v of b.siblings??[])if(!i.has(v))return ie({kind:ni.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:h.id,siblingLocationId:v,label:b.label}});if(h.primaryCategory!=null){let b=i.get(h.locationId);if(b!=null&&!b.categories.includes(h.primaryCategory))return ie({kind:ni.EnterpriseLocationWithInvalidPrimaryCategory,properties:{enterpriseLocationId:h.id,locationId:h.locationId,primaryCategory:h.primaryCategory}})}}if(r.venue?.topLocations!=null){for(let h of r.venue.topLocations)if(!i.has(h))return ie({kind:ni.EnterpriseVenueWithUnknownTopLocationError,properties:{locationId:h}})}let a=new Set(e.cms.locations?.map(h=>h.id)??[]),l=er(e.cms.locationInstances,h=>h.id,"cms.locationInstances");if(l.isErr())return l;let c=new Set(e.locationInstances?.map(h=>h.id)??[]);for(let h of r.locationInstances??[]){if(!a.has(h.parentId))return ie({kind:ni.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:h.id,enterpriseLocationId:h.parentId}});if(!c.has(h.locationInstanceId))return ie({kind:ni.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:h.id,locationInstanceId:h.locationInstanceId}});for(let b of h.siblingGroups??[])for(let v of b.siblings??[])if(!i.has(v))return ie({kind:ni.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:h.id,siblingLocationId:v,label:b.label}})}let p=ri(e),u=yr(e),f=er(e.cms.floorText,h=>h.properties.id,"cms.floorText");if(f.isErr())return f;for(let[h,b]of tt(r.floorText??{})){let v=p(h);if(v.isErr())return v;for(let T of b.features){if(!("geometryId"in T.properties))continue;let x=u(h,T.properties.geometryId);if(x.isErr())return x}}for(let[h,b]of tt(r.textures??{})){let v=p(h);if(v.isErr())return v;for(let T of b){let x=u(h,T.geometryId);if(x.isErr())return x}}for(let[h,b]of tt(r.layers??{})){let v=p(h);if(v.isErr())return v;for(let T of Ze(b??{})){let x=u(h,T);if(x.isErr())return x}}for(let[h,b]of tt(r.textAreas??{})){let v=p(h);if(v.isErr())return v;for(let T of b.features)if("geometryId"in T.properties){let x=u(h,T.properties.geometryId);if(x.isErr())return x}}return oe(!0)};d();d();var lf=qt("el","EnterpriseLocationId"),FI=qt("ec","EnterpriseCategoryId"),DI=qt("eli","EnterpriseLocationInstanceId"),kI=qt("ev","EnterpriseVenueId"),AI=qt("eft","EnterpriseFloorTextId"),ZE=[lf,FI,DI,kI,AI];var XE=g.Object({id:g.Ref(FI),categoryId:g.Ref(Ks),color:g.Optional(g.String()),sortOrder:g.Number(),iconFromDefaultList:g.Optional(g.Union([g.String(),g.Null()])),picture:g.Optional(g.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),LI=g.Object({categories:g.Optional(g.Array(g.Ref(XE)))},{$id:"EnterpriseCategoriesSchema"}),YE=[XE,LI];d();var JE=Ro(["left","center","right"]),RG=JE.schema,lye=JE.values,_I=g.Object({id:g.Ref(AI),text:g.String(),visible:g.Boolean({default:!0}),fontSize:g.Number({default:12,exclusiveMinimum:0}),fontFamily:g.String({default:"Droid Sans"}),color:g.String({default:"black"}),rotation:g.Number({minimum:0,maximum:360}),align:RG},{$id:"FloorTextCommonProperties"}),RI=g.Intersect([g.Ref(_I),Cn],{$id:"AnchoredFloorTextProperties"}),BI=g.Intersect([g.Ref(_I),g.Object({verticalOffset:g.Number()})],{$id:"FloatingFloorTextProperties"}),KE=g.Union([g.Ref(RI),g.Ref(BI)],{$id:"FloorTextProperties"}),QE=Ur(to,g.Ref(KE),{$id:"FloorTextFeature"}),BG=Ur(to,g.Ref(RI),{$id:"AnchoredFloorTextFeature"}),NG=Ur(to,g.Ref(BI),{$id:"FloatingFloorTextFeature"}),qE=fo(g.Ref(QE),{$id:"EnterpriseFloorTextFeatureCollection"}),eP=g.Record(Ve,g.Ref(qE),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),NI=g.Object({floorText:g.Optional(g.Ref(eP))},{$id:"EnterpriseFloorTextSchema"}),tP=[_I,RI,BI,KE,QE,BG,NG,qE,eP,NI];d();var rP=tr(g.Record(ro,g.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),oP=tr(g.Record(Ve,g.Ref(rP),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),jI=g.Object({layers:g.Optional(g.Ref(oP))},{$id:"EnterpriseLayersSchema"}),nP=[rP,oP,jI];d();d();d();var GI=Ro(["closed-temporarily","new","pop-up","coming-soon","relocated"]),jG=GI.schema,xye=GI.values,vye=GI.record,UI=g.Object({type:jG,start:g.Optional(g.String({format:"date",description:"The start date of the state"})),end:g.Optional(g.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),VI=g.Object({label:g.String(),siblings:g.Array(g.Ref(Qs))},{$id:"SiblingGroup"}),Zb=g.Object({name:g.String(),code:g.String()},{$id:"Language"}),iP=[UI,VI,Zb];var Xb=g.Object({id:g.Ref(lf),locationId:g.Ref(Qs),cmsId:g.String(),type:g.String(),sortOrder:g.Number(),tags:g.Optional(g.Array(g.String())),picture:g.Optional(g.String({format:"uri",description:"The picture of the location"})),states:g.Optional(g.Array(g.Ref(UI),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:g.Optional(g.Array(g.Ref(VI))),gallery:g.Optional(g.Array(g.Object({caption:g.Optional(g.String()),image:g.String({format:"uri"}),embeddedUrl:g.Optional(g.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:g.Optional(g.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:g.Optional(g.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:g.Optional(g.Boolean({description:"Whether to show the logo of the location"})),primaryCategory:g.Optional(g.Ref(Ks))},{$id:"EnterpriseLocation"}),$I=g.Object({locations:g.Optional(g.Array(g.Ref(Xb)))},{$id:"EnterpriseLocationsSchema"}),sP=[Xb,$I];var aP=g.Intersect([g.Object({id:g.Ref(DI),parentId:g.Ref(lf),locationInstanceId:g.Ref($b)}),g.Partial(g.Omit(Xb,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),HI=g.Object({locationInstances:g.Optional(g.Array(g.Ref(aP)))},{$id:"EnterpriseLocationInstancesSchema"}),lP=[aP,HI];d();var zI=Ro(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),cP=zI.schema,jye=zI.values,Gye=zI.record,WI=g.Object({maxWidth:g.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:g.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:g.Ref(cP),rotation:g.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),pP=g.Intersect([g.Ref(WI),Cn],{$id:"EnterpriseAnchoredTextAreaProperties"}),dP=g.Intersect([g.Ref(WI),g.Object({verticalOffset:g.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),uP=g.Union([pP,dP],{$id:"EnterpriseTextAreaProperties"}),mP=Ur(g.Ref(to),uP,{$id:"EnterpriseTextAreaFeature"}),fP=fo(g.Ref(mP),{$id:"EnterpriseTextAreaCollection"}),hP=g.Record(Ve,g.Ref(fP),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),gP=g.Object({textAreas:g.Optional(g.Ref(hP))},{$id:"EnterpriseTextAreasSchema"}),yP=[cP,WI,pP,dP,uP,mP,fP,hP];d();var ZI=g.Object({u:g.Number(),v:g.Number()},{$id:"EnterpriseTextureUV"}),XI=Ro(["top","side"],{$id:"EnterpriseTextureFace"}),bP=XI.schema,zye=XI.values,Wye=XI.record,YI=Ro(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),xP=YI.schema,Zye=YI.values,Xye=YI.record,vP=g.Tuple([Zp,Xp,Zp,Xp],{$id:"EnterpriseTextureBounds"}),IP=g.Intersect([g.Object({repeat:g.Ref(ZI),offset:g.Ref(ZI),rotation:g.Number({minimum:0,maximum:360}),path:g.String({format:"uri"}),face:g.Ref(bP),surface:g.Ref(xP),bounds:g.Ref(vP)},{$id:"EnterpriseTextureProperties"}),Cn],{$id:"EnterpriseTexture"}),SP=g.Array(g.Ref(IP),{$id:"EnterpriseTextures"}),TP=g.Record(Ve,g.Ref(SP),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),JI=g.Object({textures:g.Optional(g.Ref(TP))},{$id:"EnterpriseTexturesSchema"}),CP=[IP,SP,JI,ZI,bP,xP,vP,TP];d();var MP=g.Intersect([g.Object({id:g.Ref(kI),slug:g.String(),defaultLanguage:g.Ref(Zb),languages:g.Array(g.Ref(Zb)),countrycode:g.Optional(g.String()),logo:g.Optional(g.String({format:"uri"})),mappedinWebUrl:g.Optional(g.String({format:"uri"})),topLocations:g.Optional(g.Array(g.Ref(Qs))),operationHours:g.Optional(g.Array(g.Ref(Hb))),coverImage:g.Optional(g.String({format:"uri"}))}),Xl(["name"]),oi],{$id:"EnterpriseVenue"}),KI=g.Object({venue:g.Optional(g.Ref(MP))},{$id:"EnterpriseVenueSchema"}),wP=[MP,KI];var EP=g.Intersect([KI,$I,HI,LI,JI,NI,jI,gP],{$id:"CMSProperties"}),OP=g.Object({cms:g.Optional(g.Ref(EP))},{$id:"CMSExtensionSchema"}),GG=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,PP={name:"ext:cms",schema:OP,intoBundle:function*(e){if(e.cms==null)return;let r=e.cms;for(let t of Ze(r))switch(t){case"floorText":for(let o of Ze(r.floorText??{}))yield{path:`cms/floorText/${o}.geojson`,contents:(r.floorText??{})[o]};continue;case"textures":for(let o of Ze(r.textures??{}))yield{path:`cms/textures/${o}.json`,contents:(r.textures??{})[o]};continue;case"textAreas":for(let o of Ze(r.textAreas??{}))yield{path:`cms/textAreas/${o}.geojson`,contents:(r.textAreas??{})[o]};continue;default:yield{path:`cms/${t}.json`,contents:r[t]};continue}},fromBundle:(e,r,t)=>{let o=e.match(GG);if(!o)return;let[,n,i]=o,a=t(r);switch(n){case"floorText":case"textures":case"textAreas":return{cms:{[n]:{[i]:a}}};default:return{cms:{[i]:a}}}},references:[EP,OP,...wP,...sP,...lP,...YE,...CP,...nP,...tP,...yP,...ZE,...iP,...Wb],integrityCheck:WE};d();d();d();d();var ii;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(ii||(ii={}));var FP=e=>{let{navigationFlags:r}=e;if(!r||Object.keys(r).length===0)return oe(!0);let t=Object.entries(r).map(([i,a])=>({key:i,...a})).sort((i,a)=>i.index!==a.index?i.index-a.index:i.bit-a.bit),o=0,n=-1;for(let i of t){if(i.bit===n)return ie({kind:ii.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:`navigationFlags.${i.key}`}});if(i.index!=o){if(n!=31)return ie({kind:ii.NavigationFlagMissingDeclaration,properties:{index:o,bit:n+1,path:"navigationFlags"}});if(i.index!=o+1||i.bit!=0)return ie({kind:ii.NavigationFlagMissingDeclaration,properties:{index:o+1,bit:0,path:"navigationFlags"}});o=i.index,n=0}else{if(i.bit!==n+1)return ie({kind:ii.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:n+1,path:"navigationFlags"}});n=i.bit}}return oe(!0)};d();function qa(e,r){return r&&(e.flags[r.index]&1<<r.bit)!==0}d();var DP=2**32-1,cf=e=>{let r=Object.keys(e.navigationFlags??{}).length;if(r===0)return{index:-1,flag:0};let t=Math.floor(r/32),o=r%32;return{index:t,flag:2**o-1}},xd=(e,r,t)=>{if(r.index==-1&&e.length===0)return oe(!0);let o=r.flag>0||r.index===-1?r.index+1:r.index;if(e.length!==o)return ie({kind:ii.NavigationFlagIncorrectFlagsLength,properties:{expected:o,actual:e.length,path:t}});for(let n=0;n<e.length;n++){let i=e[n];if(n<r.index){if(i>DP)return ie({kind:ii.NavigationFlagValueTooBig,properties:{index:n,flagValue:i,expectedMaxFlagValue:DP,path:t}});continue}else if(i>r.flag)return ie({kind:ii.NavigationFlagValueTooBig,properties:{index:n,flagValue:i,expectedMaxFlagValue:r.flag,path:t}})}return oe(!0)};var UG=g.Object({index:g.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:g.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),kP=g.Intersect([UG,Xo],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),QI={accessible:"accessible",outdoors:"outdoors",public:"public"},AP=g.Record(g.String(),kP,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),VG=g.Object({navigationFlags:g.Ref(AP)},{$id:"NavigationFlagsSchema"}),Yb=g.Array(g.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),qI=g.Object({flags:g.Ref(Yb)},{$id:"WithFlags"}),rc=g.Intersect([bd,qI],{$id:"FlaggedGeometryAnchor"}),$G=g.Object({geometryAnchor:rc},{$id:"WithFlaggedGeometryAnchor"}),HG=g.Object({geometryAnchors:g.Array(rc)},{$id:"WithFlaggedGeometryAnchors"}),LP={name:"ext:mvf-navigation-flags",schema:VG,intoBundle:function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},fromBundle:(e,r,t)=>e!=="navigationFlags.json"?void 0:{navigationFlags:t(r)},references:[kP,AP,Yb,rc,$G,HG],integrityCheck:FP};d();var _P=e=>{if(e.connections==null)return oe(!0);let r=er(e.connections,n=>n.id,"connections");if(r.isErr())return r;let t=yr(e),o=cf(e);for(let[n,i]of e.connections.entries()){for(let[a,l]of i.entrances.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=xd(l.flags,o,`connections[${n}].entrances[${a}]`);if(p.isErr())return p}for(let[a,l]of i.exits.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=xd(l.flags,o,`connections[${n}].exits[${a}]`);if(p.isErr())return p}}return oe(!0)};var BP=qt("c","ConnectionId"),{schema:zG,values:Kbe,record:WG}=Ro(["elevator","escalator","travelator","stairs","door","ramp","ladder"],{$id:"ConnectionType"}),NP=zG;var eS=WG,jP=g.Intersect([g.Object({id:g.Ref(BP,{description:"The unique identifier for the connection."}),entrances:g.Array(g.Ref(rc)),exits:g.Array(g.Ref(rc)),entryCost:g.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:g.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:g.Ref(NP,{description:"The type of connection."})}),Xo,oi],{$id:"ConnectionsProperties"}),GP=g.Array(g.Ref(jP),{$id:"ConnectionsCollection"}),ZG=g.Object({connections:g.Ref(GP)},{$id:"ConnectionsExtensionSchema"}),RP="connections.json",UP={name:"ext:connections",schema:ZG,intoBundle:function*(e){e.connections!=null&&(yield{path:RP,contents:e.connections})},fromBundle:(e,r,t)=>{if(e===RP)return{connections:t(r)}},references:[jP,GP,NP,BP,rc,Yb],integrityCheck:_P};d();d();var VP=e=>{if(e.defaultStyle==null)return oe(!0);let r=yr(e);for(let t of Object.values(e.defaultStyle))if(t!=null)for(let o of t.geometryAnchors){let n=r(o.floorId,o.geometryId);if(n.isErr())return n}return oe(!0)};var $P=g.Intersect([sf(),oi,g.Object({altitude:g.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:g.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:g.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:g.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:g.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:g.Optional(g.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),HP=g.Record(g.String(),g.Ref($P),{$id:"DefaultStyleCollection",additionalProperties:!1}),XG=g.Object({defaultStyle:g.Ref(HP)},{$id:"DefaultStyleSchema"}),zP={name:"ext:mvf-default-style",schema:XG,intoBundle:function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},fromBundle:(e,r,t)=>{if(e==="default-style.json")return{defaultStyle:t(r)}},references:[$P,HP],integrityCheck:VP};d();d();d();d();var Jb;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Jb||(Jb={}));var WP=e=>{if(e.floorStacks==null)return oe(!0);let r=er(e.floorStacks,o=>o.id,"floorStacks");if(r.isErr())return r;let t=ri(e);for(let o of e.floorStacks){for(let n of o.floors){let i=t(n);if(i.isErr())return i}if(o.defaultFloor!=null&&!o.floors.includes(o.defaultFloor))return ie({kind:Jb.InvalidDefaultFloorError,properties:{floorStackId:o.id,floorId:o.defaultFloor}})}return oe(!0)};var pf=qt("fs","FloorStackId"),XP=g.Intersect([g.Object({id:g.Ref(pf,{description:"The unique identifier for the floor stack."}),floors:g.Array(g.Ref(Ve),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:g.Optional(g.Ref(Ve,{description:"The default floor for the floor stack."}))}),Xo],{$id:"FloorStacksProperties"}),YP=g.Array(g.Ref(XP),{$id:"FloorStackCollection"}),YG=g.Object({floorStacks:g.Ref(YP)},{$id:"FloorStackExtensionSchema"}),ZP="floor-stacks.json",JP={name:"ext:floor-stacks",schema:YG,intoBundle:function*(e){e.floorStacks!=null&&(yield{path:ZP,contents:e.floorStacks})},fromBundle:(e,r,t)=>{if(e===ZP)return{floorStacks:t(r)}},references:[pf,XP,YP],integrityCheck:WP};d();d();var df;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(df||(df={}));var KP=e=>{if(e.facade==null)return oe(!0);if(e.floorStacks==null)return ie({kind:df.MissingFloorStackError,properties:null});let r=new Set(e.floorStacks.map(n=>n.id)),t=yr(e),o=ri(e);for(let[n,i]of tt(e.facade)){if(i==null)continue;let a=o(n);if(a.isErr())return a;for(let l of i){let{floorStackId:c,geometryIds:p}=l;if(!r.has(c))return ie({kind:df.UnknownFloorStackError,properties:{floorStackId:c}});for(let u of p){let f=t(n,u);if(f.isErr())return f}}}return oe(!0)};var QP=g.Intersect([g.Object({floorStackId:g.Ref(pf)}),md],{$id:"Facade"}),JG=g.Object({facade:tr(g.Record(Ve,g.Array(g.Ref(QP)),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),KG=/^facade\/(.*)\.json$/,qP={name:"ext:facade",schema:JG,intoBundle:function*(e){if(e.facade!=null)for(let r of Ze(e.facade))yield{path:`facade/${r}.json`,contents:e.facade[r]}},fromBundle:(e,r,t)=>{let o=e.match(KG)?.[1];if(o)return{facade:{[o]:t(r)}}},references:[pf,QP],integrityCheck:KP};d();d();var eF=e=>{if(e.floorImages==null)return oe(!0);let r=yr(e);for(let[t,o]of tt(e.floorImages))if(o!=null)for(let n of o.features){if(!("geometryId"in n.properties))continue;let i=n.properties.geometryId,a=r(t,i);if(a.isErr())return a}return oe(!0)};var tS=g.Object({path:g.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:g.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:g.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:g.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),tF=g.Intersect([g.Ref(tS),Cn],{$id:"AnchoredFloorImageProperties"}),rF=g.Intersect([g.Ref(tS),g.Object({verticalOffset:g.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),oF=g.Union([tF,rF],{$id:"FloorImageProperties"}),nF=Ur(g.Ref(to),oF,{$id:"FloorImageFeature"}),iF=fo(g.Ref(nF),{$id:"FloorImageCollection"}),QG=g.Object({floorImages:tr(g.Record(Ve,g.Ref(iF),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),qG=/^floorImages\/(.*)\.geojson$/,sF={name:"ext:floor-images",schema:QG,intoBundle:function*(e){if(e.floorImages!=null)for(let r of Ze(e.floorImages))yield{path:`floorImages/${r}.geojson`,contents:e.floorImages[r]}},fromBundle:(e,r,t)=>{let o=e.match(qG)?.[1];if(o)return{floorImages:{[o]:t(r)}}},references:[tS,tF,rF,oF,nF,iF],integrityCheck:eF};d();d();var aF=e=>{if(e.kinds==null)return oe(!0);let r=yr(e);for(let[t,o]of tt(e.kinds))if(o!=null)for(let n of Ze(o)){let i=r(t,n);if(i.isErr())return i}return oe(!0)};var{values:cxe,schema:eU,record:pxe}=Ro(["room","hallway","wall","object","poi","area","window"],{$id:"Kind"}),lF=eU;var cF=tr(g.Record(ro,g.Ref(lF),{additionalProperties:!1,$id:"GeometryKinds"})),tU=g.Object({kinds:tr(g.Record(Ve,g.Ref(cF),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),rU=/^kinds\/(.*)\.json$/,pF={name:"ext:kinds",schema:tU,intoBundle:function*(e){if(e.kinds!=null)for(let r of Ze(e.kinds))yield{path:`kinds/${r}.json`,contents:e.kinds[r]}},fromBundle:(e,r,t)=>{let o=e.match(rU)?.[1];if(o)return{kinds:{[o]:t(r)}}},references:[lF,cF],integrityCheck:aF};d();d();d();var uf;(function(e){e.UnknownNeighbor="UnknownNeighbor",e.SelfReference="SelfReference"})(uf||(uf={}));var dF=e=>{if(e.nodes==null)return oe(!0);let r=er(e.nodes,n=>n.properties.id,"nodes");if(r.isErr())return r;let t=yr(e),o=cf(e);for(let[n,i]of tt(e.nodes)){if(i==null)continue;let a=new Set(i.features.map(l=>l.properties.id));for(let[l,c]of i.features.entries()){for(let p of c.properties.geometryIds){let u=t(n,p);if(u.isErr())return u}for(let[p,u]of c.properties.neighbors.entries()){if(!a.has(u.id))return ie({kind:uf.UnknownNeighbor,properties:{floorId:n,nodeId:c.properties.id,neighborId:u.id}});if(u.id===c.properties.id)return ie({kind:uf.SelfReference,properties:{floorId:n,nodeId:c.properties.id}});let f=xd(u.flags,o,`nodes["${n}"].features[${l}].properties.neighbors[${p}]`);if(f.isErr())return f}}}return oe(!0)};var rS=qt("n","NodeId"),uF=g.Intersect([g.Object({id:g.Ref(rS,{description:"The unique identifier for the node."}),extraCost:g.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),qI],{$id:"NodeNeighbor"}),mF=g.Intersect([g.Object({id:g.Ref(rS,{description:"The unique identifier for the node."}),neighbors:g.Array(g.Ref(uF),{description:"The neighbors of the node."})}),md],{$id:"NodeProperties"}),fF=Ur(g.Ref(to),mF,{$id:"NodeFeature"}),hF=fo(g.Ref(fF),{$id:"NodeCollection"}),oU=g.Object({nodes:tr(g.Record(Ve,g.Ref(hF),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),nU=/^nodes\/(.*)\.(geo)?json$/,gF={name:"ext:nodes",schema:oU,intoBundle:function*(e){if(e.nodes!=null)for(let r of Ze(e.nodes))yield{path:`nodes/${r}.geojson`,contents:e.nodes[r]}},fromBundle:(e,r,t)=>{let o=e.match(nU)?.[1];if(o)return{nodes:{[o]:t(r)}}},references:[rS,uF,mF,fF,hF],integrityCheck:dF};d();d();d();var Kb;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(Kb||(Kb={}));var yF=e=>{if(e.outdoors==null)return oe(!0);let r=ri(e);for(let t of e.outdoors.floors){let o=r(t);if(o.isErr())return o;if(e.floorStacks!=null){for(let n of e.floorStacks)if(n.floors.includes(t))return ie({kind:Kb.FloorInFloorStackError,properties:{floorId:t,floorStackId:n.id}})}}return oe(!0)};var xF=g.Object({floors:g.Array(g.Ref(Ve),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),iU=g.Object({outdoors:g.Ref(xF)},{$id:"OutdoorsExtensionSchema"}),bF="outdoors.json",vF={name:"ext:outdoors",schema:iU,intoBundle:function*(e){e.outdoors!=null&&(yield{path:bF,contents:e.outdoors})},fromBundle:(e,r,t)=>{if(e===bF)return{outdoors:t(r)}},references:[xF],integrityCheck:yF};d();d();d();var Qb;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Qb||(Qb={}));var IF=e=>{if(e.tileset==null)return oe(!0);let r=new Set;if(r.add(e.tileset.default.key),e.tileset.others)for(let t of e.tileset.others){if(r.has(t.key))return ie({kind:Qb.TilesetDuplicateKeyError,properties:{key:t.key}});r.add(t.key)}return oe(!0)};var oS=g.Object({key:g.String({minLength:1,description:"Unique identifier for the tileset style."}),name:g.String({minLength:1,description:"Display name of the tileset style."}),url:g.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),SF=g.Object({default:g.Ref(oS,{description:"The default tileset style, which should be used."}),others:g.Optional(g.Array(g.Ref(oS,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),sU=g.Object({tileset:g.Ref(SF)},{$id:"TilesetExtensionSchema"}),TF={name:"ext:mvf-tileset",schema:sU,intoBundle:function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},fromBundle:(e,r,t)=>{if(e==="tileset.json")return{tileset:t(r)}},references:[oS,SF],integrityCheck:IF};d();var CF=g.Object({},{$id:"WalkableProperties"}),MF=g.Object({},{$id:"NonWalkableProperties"}),wF=tr(g.Record(ro,g.Ref(CF),{$id:"WalkableGeometries",additionalProperties:!1})),OF=tr(g.Record(ro,g.Ref(MF),{$id:"NonWalkableGeometries",additionalProperties:!1})),aU=g.Object({walkable:tr(g.Record(Ve,g.Ref(wF),{additionalProperties:!1})),nonwalkable:tr(g.Record(Ve,g.Ref(OF),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),lU=/^walkable\/(.*)\.json$/,cU=/^nonwalkable\/(.*)\.json$/,EF={name:"ext:mvf-traversability",schema:aU,intoBundle:function*(e){if(e.walkable!=null)for(let r of Ze(e.walkable))yield{path:`walkable/${r}.json`,contents:e.walkable[r]};if(e.nonwalkable!=null)for(let r of Ze(e.nonwalkable))yield{path:`nonwalkable/${r}.json`,contents:e.nonwalkable[r]}},fromBundle:(e,r,t)=>{let o=e.match(lU)?.[1];if(o!=null)return{walkable:{[o]:t(r)}};let n=e.match(cU)?.[1];if(n!=null)return{nonwalkable:{[n]:t(r)}}},references:[CF,MF,wF,OF]};d();d();function PF(e){return e.replace(/^g_/,"s_")}function pU(e){return e.replace(/^g_/,"o_")}function dU(e){return e.replace(/^g_/,"w_")}function FF(e){return e.replace(/^loci_/,"eli_")}function ff(e){return e.replace(/^loc_/,"el_")}function qb(e){return e.replace(/^lcat_/,"ec_")}function uU(e){return e.replace(/^g_/,"ar_")}function mU(e,r,t){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let o=[],n=0,i=e.geometry.type.replace("Multi","");for(let a of e.geometry.coordinates)o.push({...e,geometry:{type:i,coordinates:a},properties:{...e.properties,id:`${r}-${n++}`,kind:t}});return o}default:return[{...e,properties:{...e.properties,id:r,kind:t}}]}}function mf(e,r,t,o){let n=new Map;for(let{feature:i,floorId:a}of e){let l=i.properties.id,c=o.get(l);if(r.has(l)){let p=mU(i,t(l),c),u=p.map(h=>h.properties.id),f=u.map(h=>({geometryId:h,floorId:a}));n.set(l,{ids:u,features:p,anchors:f})}}return n}function DF(e){let r={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return r;let t=fU(e),o=tt(e.geometry).flatMap(([c,p])=>(p?.features??[]).map(u=>({feature:u,floorId:c}))).flat(),n=new Set(Object.values(e.walkable??{}).filter(c=>c!==void 0).flatMap(Ze)),i=new Set(Object.values(e.nonwalkable??{}).filter(c=>c!==void 0).flatMap(Ze)),a=new Set(Array.from(t.entries()).filter(([c,p])=>p==="area").map(([c])=>c)),l=new Set(Array.from(t.entries()).filter(([c,p])=>p==="window").map(([c])=>c));return n.size>0&&(r.space=mf(o,n,PF,t)),i.size>0&&(r.obstruction=mf(o,i,pU,t)),a.size>0&&(r.area=mf(o,a,uU,t)),l.size>0&&(r.window=mf(o,l,dU,t)),n.size===0&&i.size===0&&a.size===0&&(r.space=mf(o,new Set(o.map(c=>c.feature.properties.id)),PF,t)),r}function fU(e){let r=new Map(Object.values(e.kinds??{}).filter(t=>t!==void 0).flatMap(tt));for(let t of e.connections?.filter(o=>o.type!=="door")??[]){for(let o of t.entrances)r.set(o.geometryId,`connection.${t.type}`);for(let o of t.exits)r.set(o.geometryId,`connection.${t.type}`)}return r}function kF(e){let{nodesByGeometryId:r,incomingEdgesByNodeId:t}=hU(e),o=DF(e),n=gU(e),i=e.navigationFlags??{};return{geometryMaps:o,nodesByGeometryId:r,geometryFeatureById:n,navigationFlags:i,incomingEdgesByNodeId:t}}function hU(e){let r=new Map,t=new Map;for(let o of Object.values(e.nodes??{}))for(let n of o?.features??[]){if(n.properties.geometryIds.length>0)for(let i of n.properties.geometryIds){let a=r.get(i)??[];a.push(n.properties.id),r.set(i,a)}if(n.properties.neighbors.length>0)for(let i of n.properties.neighbors){let a=t.get(i.id);a!=null?a.push(i):t.set(i.id,[i])}}return{nodesByGeometryId:r,incomingEdgesByNodeId:t}}function gU(e){let r=new Map;for(let t of Object.values(e.geometry??{}))for(let o of t?.features??[])r.set(o.properties.id,o);return r}d();function AF(e,r){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let t={};for(let[o,n]of tt(e.annotations)){if(!n||n.length===0||!e.geometry[o]||e.geometry[o].features.length===0)continue;let i=new Map(e.geometry[o].features.map(l=>[l.properties.id,l])),a={type:"FeatureCollection",features:[]};for(let l of n){let c=i.get(l.geometryId);if(!c||c.geometry.type!=="Point")continue;let p={id:l.id,externalId:l.externalId,symbolId:l.symbolKey};a.features.push({type:"Feature",geometry:c.geometry,properties:p})}t[o]=a}return{annotation:t}}d();function LF(e,{nodesByGeometryId:r}){let t={"connection.json":[],entrance:{}},o=e.navigationFlags?.[QI.accessible],n=e.navigationFlags?.[QI.outdoors],i=new Map(Object.values(e.geometry??{}).flatMap(a=>a?.features??[]).map(a=>[a.properties.id,a]));for(let a of e.connections??[]){if(nS(a,i)&&!yU(a)){let u=bU(a,i,r,n);for(let[f,h]of u)t.entrance[f]||(t.entrance[f]={type:"FeatureCollection",features:[]}),t.entrance[f].features.push(h);continue}let l=o!=null&&a.entrances.some(u=>qa(u,o))&&a.exits.some(u=>qa(u,o)),c=Array.from(new Set([...a.entrances.map(u=>r.get(u.geometryId)),...a.exits.map(u=>r.get(u.geometryId))].flat().filter(u=>u!=null))),p={id:a.id,externalId:a.details?.externalId??"",type:a.type,accessible:l,nodes:c};a.details?.name&&(p.details={name:a.details.name}),a.extra&&(p.extra=a.extra),t["connection.json"].push(p)}return t}function nS(e,r){return e.type==eS.door&&e.entrances.every(t=>r.get(t.geometryId)?.geometry.type==="LineString")}function yU(e){return e.entrances.length===0||e.exits.length===0?!1:new Set([...e.entrances.map(t=>t.floorId),...e.exits.map(t=>t.floorId)]).size>=2}function bU(e,r,t,o){if(e.type!==eS.door)return[];let n=[];for(let i of e.entrances){let a=r.get(i.geometryId);if(a?.geometry.type==="LineString"){let l={type:"Feature",geometry:a.geometry,properties:{id:e.id,externalId:e.details?.externalId??"",isExterior:xU(e,o)}},c=e.details;c&&(l.properties.details={name:c.name,description:c.description},c.icon&&(l.properties.details.images=[{url:c.icon,altText:`${c.name} icon`}]));let p=t.get(i.geometryId);p&&p.length>0&&(l.properties.node=p[0]),n.push([i.floorId,l])}}return n}function xU(e,r){return e.entrances.some(t=>qa(t,r))||e.exits.some(t=>qa(t,r))}d();function RF(e,{geometryMaps:r,nodesByGeometryId:t}){let o={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"English",code:"en"},languages:[]}},n=e.manifest?.features[0];n&&(o.venue.defaultFloor=n.properties.defaultFloor,o.venue.tzid=n.properties.tzid,o.venue.name=n.properties.name,o.venue.defaultLanguage={name:n.properties.language??"English",code:n.properties.language??"en"});let i=e.cms?.venue;i&&(o.venue={...o.venue,slug:i.slug,name:i.details?.name??o.venue.name??n.properties.name,externalId:i.details?.externalId??"",defaultLanguage:i.defaultLanguage,languages:i.languages??[],countrycode:i.countrycode,coverImage:i.coverImage,logo:i.logo,icon:i.details?.icon,extra:i.extra,mappedinWebUrl:i.mappedinWebUrl,operationHours:i.operationHours,topLocations:i.topLocations});let a=new Map,l=e.locations??[],c=e.cms?.locations??[],p=e.cms?.categories??[],u=new Map((p??[]).map(O=>[O.categoryId,O]));if(l.length>0){let O=new Map(c.map(C=>[C.locationId,C]));for(let C of l){let E=O.get(C.id)??{};if(C){let _=C.details,G={id:E?.cmsId!==void 0?`el_${E?.cmsId}`:ff(C.id),name:_.name,externalId:_.externalId??"",type:E.type??"location",sortOrder:E.sortOrder??0,amenity:E.amenity,description:_.description,extra:C.extra,links:C.links,operationHours:C.openingHours,gallery:E.gallery,logo:C.logo,shortName:_.shortName,picture:E.picture,showFloatingLabelWhenImagePresent:E.showFloatingLabelWhenImagePresent,showLogo:E.showLogo,siblingGroups:E.siblingGroups,states:E.states,tags:E.tags,spaces:[],nodes:[],polygons:[]};if(C.phone&&(G.phone={number:C.phone}),E.primaryCategory){let N=u.get(E.primaryCategory);N&&(G.primaryCategory=N.id)}let R=_F(C.social);C.website&&(R.website=C.website.url),G.social=R;for(let N of C.geometryAnchors){let X=r.space.get(N.geometryId);if(X){let ee=new Set(X.features.filter(re=>re.geometry.type==="Polygon").map(re=>re.properties.id));for(let re of X.anchors)G.spaces.push({floor:re.floorId,id:re.geometryId}),ee.has(re.geometryId)&&G.polygons.push({map:re.floorId,id:re.geometryId})}let z=t.get(N.geometryId);for(let ee of z??[])G.nodes.push({map:N.floorId,id:ee})}o.locations.push(G);for(let N of C.categories)a.set(N,[...a.get(N)??[],C.id])}}}let f=e.cms?.locationInstances??[],h=e.locationInstances;if(h){let O=new Map(f.map(E=>[E.locationInstanceId,E])),C=[];for(let E of h){let _=O.get(E.id)??{};if(E){let G={id:FF(E.id),parent:_.parentId??ff(E.parentId),name:E.details?.name,externalId:E.details?.externalId,type:_.type,sortOrder:_.sortOrder,amenity:_.amenity,description:E.details?.description,extra:E.extra,links:E.links,operationHours:E.openingHours,gallery:_.gallery,picture:_.picture,showFloatingLabelWhenImagePresent:_.showFloatingLabelWhenImagePresent,showLogo:_.showLogo,siblingGroups:_.siblingGroups,states:_.states,tags:_.tags,logo:E.logo,shortName:E.details?.shortName};E.phone&&(G.phone={number:E.phone});let R=_F(E.social??[]);if(E.website&&(R.website=E.website.url),Object.keys(R).length>0&&(G.social=R),E.geometryAnchors?.length){let N=E.geometryAnchors.flatMap(X=>r.space.get(X.geometryId)?.anchors??[]);N.length>0&&(G.spaces=N.map(X=>({floor:X.floorId,id:X.geometryId})))}if(E.geometryAnchors){G.spaces=[],G.polygons=[],G.nodes=[];for(let N of E.geometryAnchors){let X=r.space.get(N.geometryId);if(X){let ee=new Set(X.features.filter(re=>re.geometry.type==="Polygon").map(re=>re.properties.id));for(let re of X.anchors)G.spaces.push({floor:re.floorId,id:re.geometryId}),ee.has(re.geometryId)&&G.polygons.push({map:re.floorId,id:re.geometryId})}let z=t.get(N.geometryId);for(let ee of z??[])G.nodes.push({map:N.floorId,id:ee})}}C.push(G)}}C.length>0&&(o.locationInstances=C)}let b=e.locationCategories;if(b){let O=[],C=new Map(b.map(R=>[R.id,R])),E=new Map((p??[]).map(R=>[R.categoryId,R])),_=new Map;for(let R of b){let N=C.get(R.parent);if(N){let X=_.get(N.id)??[];X.push(R.id),_.set(N.id,X)}}for(let R of b){let N=E.get(R.id);if(R){let X=(_.get(R.id)??[]).map(qb),z={id:qb(R.id),name:R.details.name,externalId:R.details.externalId??"",sortOrder:N?.sortOrder??0,children:X,locations:(a.get(R.id)??[]).map(ff),icon:R.details.icon,picture:N?.picture,color:N?.color,extra:R.extra,iconFromDefaultList:N?.iconFromDefaultList};O.push(z)}}o.categories=O;let G={};for(let R of l)G[ff(R.id)]=R.categories.map(qb).filter(N=>N!==void 0);o.categoryPriorities=G}let v={};for(let[O,C]of Object.entries(e.defaultStyle??{}))if(C.buffer){let E=C.geometryAnchors.flatMap(_=>r.space.get(_.geometryId)?.anchors??[]);v[O]={edgeOffset:C.buffer,geometryAnchors:E}}Object.keys(v).length>0&&(o.enterpriseStyles=v);let T=new Map;for(let O of Object.values(e.cms?.layers??{}))if(O)for(let[C,E]of tt(O)){if(typeof E!="string")continue;let _=T.get(E)??{name:E,id:`ely_${E}`,spaces:[]};_.spaces.push(...r.space.get(C)?.anchors.map(G=>({floorId:G.floorId,spaceId:G.geometryId}))??[]),T.set(E,_)}T.size>0&&(o.layers=Array.from(T.values()));let x=[];for(let O of Object.values(e.cms?.textures??{}))for(let C of O){let E=r.space.get(C.geometryId)?.anchors;!E||E.length<1||C.face==="unknown"||C.surface==="unknown"||x.push({repeat:C.repeat,offset:C.offset,rotation:C.rotation,path:C.path,face:C.face,surface:C.surface,bounds:C.bounds,geometryAnchors:E})}x.length>0&&(o.textures=x);let I={};for(let[O,C]of Object.entries(e.cms?.floorText??{})){let E={type:"FeatureCollection",features:[]};for(let _ of C.features){if(_.properties.align==="unknown")continue;let G={align:_.properties.align,color:_.properties.color,fontFamily:_.properties.fontFamily,fontSize:_.properties.fontSize,rotation:_.properties.rotation,text:_.properties.text,visible:_.properties.visible};"geometryId"in _.properties?G.geometryId=_.properties.geometryId:G.verticalOffset=_.properties.verticalOffset,E.features.push({type:"Feature",geometry:_.geometry,properties:G})}E.features.length>0&&(I[O]=E)}Object.keys(I).length>0&&(o.floorText=I);let M={enterprise:o};if(e.cms?.textAreas){let O={};for(let[C,E]of tt(e.cms.textAreas)){let _={type:"FeatureCollection",features:[]};for(let G of E.features){if(G.properties.align==="unknown")continue;let R={align:G.properties.align,maxWidth:G.properties.maxWidth,maxHeight:G.properties.maxHeight,rotation:G.properties.rotation};"geometryId"in G.properties?R.anchorId=G.properties.geometryId:R.verticalOffset=G.properties.verticalOffset;let N={type:"Feature",geometry:G.geometry,properties:R};_.features.push(N)}O[C]=_}M.textAreas=O}return M}var vU=["facebook","instagram","twitter"];function _F(e){let r={};for(let{name:t,url:o}of e){let n=t.toLowerCase();vU.includes(n)&&(r[n]=o)}return r}d();var IU=e=>`fc_${e.slice(3)}`;function BF(e,{geometryMaps:r}){if(!e.facade)return{};let t={},o={};for(let[n,i]of tt(e.facade))if(i)for(let a of Object.values(i)){let{floorStackId:l,geometryIds:c}=a,p=IU(l);o[l]??(o[l]={id:p,spaces:[]}),o[l].spaces.push(...c.map(u=>({floorId:n,spaceId:r.space.get(u)?.ids[0]??""})))}return Object.keys(o).length>0&&(t.facade=o),t}d();function NF(e,r={}){let t={type:"FeatureCollection",features:[]},o=[];for(let n of e.floors.features)o.push({id:n.properties.id,externalId:n.properties.details?.externalId??"",elevation:n.properties.elevation,name:n.properties.details?.name??"",shortName:n.properties.details?.shortName??"",subtitle:n.properties.subtitle,maxHeight:n.properties.maxHeight}),t.features.push({type:"Feature",geometry:n.geometry,properties:{id:n.properties.id,externalId:n.properties.details?.externalId??"",elevation:n.properties.elevation,name:n.properties.details?.name??"",shortName:n.properties.details?.shortName??"",subtitle:n.properties.subtitle,maxHeight:n.properties.maxHeight}});return{"floor.geojson":t,"map.geojson":o}}d();function jF(e,{geometryMaps:r}){let t={},o={};for(let[n,i]of tt(e.floorImages??{})){let a={features:[],type:"FeatureCollection"};for(let l of i?.features??[])if("verticalOffset"in l.properties)a.features.push(l);else{let{geometryId:c,...p}=l.properties,u=r.space.get(c)?.ids[0]??r.obstruction.get(c)?.ids[0];if(!u)continue;let f={geometry:l.geometry,properties:{...p,anchorId:u},type:l.type};a.features.push(f)}o[n]=a}return Object.keys(o).length>0&&(t.floorImages=o),t}d();function GF(e,r={}){let t=[];for(let n of e?.floorStacks??[]){let i={id:n.id,floors:n.floors,maps:n.floors,externalId:n.details?.externalId??"",name:n.details?.name??"",shortName:n.details?.shortName??"",type:"Building"};n.defaultFloor&&(i.defaultFloor=n.defaultFloor),t.push(i)}if(e.outdoors&&e.outdoors.floors.length>0){let n={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};t.push(n)}return{"floorstack.json":t,"mapstack.geojson":t}}d();d();var HF=gp($F(),1),wU=e=>{let r=e.geometry.coordinates[0],t=0;for(let o=0;o<r.length-1;o++)t+=r[o][0]*r[o+1][1]-r[o+1][0]*r[o][1];return Math.abs(t/2)},OU=(e,r)=>{let[t,o]=e,n=r.geometry.coordinates[0],i=!1;for(let a=0,l=n.length-1;a<n.length;l=a++){let[c,p]=n[a],[u,f]=n[l];p>o!=f>o&&t<(u-c)*(o-p)/(f-p)+c&&(i=!i)}return i},EU=e=>{let r=e.geometry.coordinates[0],t=0,o=0;for(let n=0;n<r.length-1;n++)t+=r[n][0],o+=r[n][1];return{geometry:{coordinates:[t/(r.length-1),o/(r.length-1)]}}},PU=e=>{let r=wU(e),t=Number.isFinite(r)?Math.max(r,1):1;return Math.sqrt(t)*1e-6},t1=e=>{try{let t=EU(e).geometry.coordinates;if(!OU(t,e)){let n=(0,HF.default)(e.geometry.coordinates,PU(e));return oe([n[0],n[1]])}return oe(t)}catch{return ie(new Error("Unable to calculate center of polygon"))}};function lS(e){return e?.geometry?.type==="Polygon"}function zF(e,{geometryMaps:r,nodesByGeometryId:t}){let o=LU(e.defaultStyle),n={},i={},a={},l={};for(let p of Ze(e.geometry)){let u=e.geometry[p];if(!u)continue;let f=[],h=[],b=[],v=[];for(let T of u.features){let x=T.properties.id,I=o.has(x),M=t.get(x)??[];for(let O of r.space.get(x)?.features??[])f.push(FU(O,M));for(let O of r.obstruction.get(x)?.features??[])h.push(DU(O,I));for(let O of r.area.get(x)?.features??[])b.push(kU(O,M));for(let O of r.window.get(x)?.features??[])v.push(AU(O))}f.length>0&&(n[p]={type:"FeatureCollection",features:f.filter(T=>T!==null)}),h.length>0&&(i[p]={type:"FeatureCollection",features:h.filter(T=>T!==null)}),b.length>0&&(a[p]={type:"FeatureCollection",features:b.filter(T=>T!==null)}),v.length>0&&(l[p]={type:"FeatureCollection",features:v.filter(T=>T!==null)})}let c={space:n,obstruction:i};return Object.keys(a).length>0&&(c.area=a),Object.keys(l).length>0&&(c.window=l),c}function FU(e,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let t={type:"Feature",geometry:e.geometry,properties:{destinationNodes:r,id:e.properties.id,externalId:e.properties.details?.externalId??"",kind:e.properties.kind}};return e.properties.details&&(t.properties.details={name:e.properties.details.name,description:e.properties.details.description,images:e.properties.details.icon?[{url:e.properties.details.icon,altText:e.properties.details.name?`${e.properties.details.name} icon`:"icon"}]:void 0}),lS(t)&&(t.properties.center=t1(t).unwrapOr(void 0)),t}function DU(e,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let t=e.properties,o={type:"Feature",geometry:e.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",entrances:[],kind:t.kind,footprintComponent:r}};return lS(o)&&(o.properties.center=t1(o).unwrapOr(void 0)),t.details&&(o.properties.details={name:t.details.name,description:t.details.description,images:t.details.icon?[{url:t.details.icon,altText:t.details.name?`${t.details.name} icon`:"icon"}]:void 0}),o}function kU(e,r){if(e.geometry.type!=="Polygon")return null;let t=e.properties,o={type:"Feature",geometry:e.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",destinationNodes:r}};return lS(o)&&(o.properties.center=t1(o).unwrapOr(void 0)),t.details&&(o.properties.details={name:t.details.name,description:t.details.description,images:t.details.icon?[{url:t.details.icon,altText:t.details.name?`${t.details.name} icon`:"icon"}]:void 0}),o}function AU(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}function LU(e){return new Set((e?.ExteriorWalls?.geometryAnchors??[]).map(t=>t.geometryId))}d();function WF(e,{geometryMaps:r,geometryFeatureById:t}){if(!e.locationCategories&&!e.locations)return{};let o={};if(e.locationCategories?.length){let n=[];for(let i of e.locationCategories){let a={id:i.id,name:i.details.name,icon:i.details.icon??""};i.parent&&(a.parent=i.parent),n.push(a)}o["category.json"]=n}if(e.locations?.length){let n=_U(e,{geometryFeatureById:t}),i=[];for(let a of e.locations){let l={id:a.id,name:a.details.name,categories:a.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:a.links,openingHoursSpecification:a.openingHours??[],pictures:a.images,social:a.social,description:a.details.description,externalId:a.details.externalId,icon:a.details.icon,logo:a.logo,phone:a.phone,website:a.website};i.push(l);for(let{geometryId:c,floorId:p}of a.geometryAnchors)l.spaces.push(...r.space.get(c)?.ids.map(u=>({id:u,floor:p}))??[]),l.obstructions.push(...r.obstruction.get(c)?.ids.map(u=>({id:u,floor:p}))??[]),l.areas.push(...r.area.get(c)?.ids.map(u=>({id:u,floor:p}))??[]),l.entrances.push(...n.entrancesByGeometryId.get(c)??[]),l.connections.push(...n.connectionsByGeometryId.get(c)??[]),l.annotations.push(...n.annotationsByGeometryId.get(c)??[])}o["location.json"]=i}return o}function _U(e,{geometryFeatureById:r}){let t={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[o,n]of tt(e.annotations))for(let i of n??[]){let a=i.geometryId,l=i.id,c=t.annotationsByGeometryId.get(a)??[];c.push({floor:o,id:l}),t.annotationsByGeometryId.set(a,c)}if(e.connections)for(let o of e.connections){let n=nS(o,r),i=Array.from(new Map([...o.entrances,...o.exits].map(a=>[`${a.geometryId}_${a.floorId}`,a])).values());for(let a of i){let l=a.geometryId;if(n){let c=t.entrancesByGeometryId.get(l)??[];c.push({floor:a.floorId,id:o.id}),t.entrancesByGeometryId.set(l,c)}else{let c=t.connectionsByGeometryId.get(l)??[];c.push(o.id),t.connectionsByGeometryId.set(l,c)}}}return t}d();function ZF(e,r){let t={features:[],type:"FeatureCollection"},o={"manifest.geojson":t},n=e.manifest;if(n.features.length>0){let i=n.features[0],a=i.properties,l={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:a.time,name:a.name,naturalBearing:a.naturalBearing,tzid:a.tzid,map:a.mapId,org_id:a.orgId,language:a.language}};t.features.push(l)}return o}d();function XF(e,{geometryMaps:r,navigationFlags:t,incomingEdgesByNodeId:o}){let n={"node.geojson":{type:"FeatureCollection",features:[]}},i=n["node.geojson"].features,a=RU(e),l=BU(e),c=NU(e,l,a);for(let[p,u]of tt(e.nodes??{}))for(let f of u?.features??[]){let h=r.space.get(f.properties.geometryIds[0])?.features[0],b=h?.geometry.type==="Point"&&h?.properties.details?.externalId?h.properties.details.externalId:"",v=o.get(f.properties.id)??[],T=Object.keys(t??{}),x=[];for(let M of v)for(let O of T)qa(M,t[O])&&x.push(t[O]);let I={type:"Feature",geometry:f.geometry,properties:{id:f.properties.id,floor:p,space:f.properties.geometryIds.map(M=>r.space.get(M)?.ids).flat().filter(M=>M!==void 0),neighbors:[...f.properties.neighbors.map(M=>({id:M.id,weight:M.extraCost})),...c.get(f.properties.id)??[]],map:p,externalId:b,flags:x.length>0?jU(x):void 0}};i.push(I)}return n}function RU(e){let r=new Map;for(let t of e.floors?.features??[])r.set(t.properties.id,t.properties.elevation);return r}function BU(e){let r=new Map;for(let t of Object.values(e.nodes??{}))for(let o of t?.features??[])if(o.properties.geometryIds.length!==0)for(let n of o.properties.geometryIds){let i=r.get(n)??[];i.includes(o.properties.id)||(i.push(o.properties.id),r.set(n,i))}return r}function NU(e,r,t){let o=new Map;for(let n of e.connections??[]){let i=n.exits.map(a=>({...a,nodes:r.get(a.geometryId)??[]}));for(let a of n.entrances){let l=r.get(a.geometryId)??[];for(let c of l)for(let p of i){let u=Math.abs((t.get(a.floorId)??0)-(t.get(p.floorId)??0))*n.floorCostMultiplier,f=o.get(c)??[];f.push(...p.nodes.filter(h=>h!==c).map(h=>({id:h,weight:u+n.entryCost}))),o.set(c,f)}}}return o}function jU(e){if(e==null||e.length===0)return;let r=new Array(Math.max(...e.map(t=>t.index))+1).fill(0);for(let t of e)r[t.index]|=1<<t.bit;return r}d();function GU(e,r){let t={};for(let o of e){let n=r.get(o);n&&(t[n]??(t[n]=[]),t[n].push(o))}return t}function YF(e,{geometryMaps:r}){if(!e.defaultStyle)return{};let t={},o={};t["styles.json"]=o;let n=[...Array.from(r.space.values()).map(a=>a.features),...Array.from(r.obstruction.values()).map(a=>a.features)],i=new Map(n.flatMap(a=>a.map(l=>[l.properties.id,l.geometry.type])));for(let[a,l]of tt(e.defaultStyle)){let c=GU(l.geometryAnchors.flatMap(p=>[...r.space.get(p.geometryId)?.ids??[],...r.obstruction.get(p.geometryId)?.ids??[]]),i);if(c.Point&&c.Point.length>0){let p={points:Array.from(c.Point.values()),showImage:l.extra?.showImage!==void 0?l.extra?.showImage===!0:l.opacity!==0};o[`${a}.Point`]=p}if(c.LineString&&c.LineString.length>0){let p={lineStrings:Array.from(c.LineString.values()),altitude:l.altitude,color:l.color,height:l.height,opacity:l.opacity,width:l.buffer};o[`${a}.LineString`]=p}if(c.Polygon&&c.Polygon.length>0){let p={polygons:Array.from(c.Polygon.values()),altitude:l.altitude,color:l.color,height:l.height,opacity:l.opacity};l.extra?.showImage!==void 0&&(p.showImage=l.extra.showImage===!0),o[`${a}.Polygon`]=p}}return t}var UU=kE().extendOptional(LP).extendOptional(gF).extendOptional(UP).extendOptional(pF).extendOptional(EF).extendOptional(zP).extendOptional(JP).extendOptional(vF).extendOptional(TF).extendOptional(sF).extendOptional(qP).extendOptional(RE).extendOptional(zE).extendOptional(PP).build({cspSafe:!0}).expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function JF(e){let r=kF(e),t=NF(e,r),o=zF(e,r),n=XF(e,r),i=LF(e,r),a=YF(e,r),l=GF(e,r),c=jF(e,r),p=BF(e,r),u=AF(e,r),f=WF(e,r),h=RF(e,r),b=ZF(e,r);return{...t,...o,...n,...i,...a,...l,"tileset.json":e.tileset,...c,...p,...u,...f,...h,...b}}function cS(e){let r=UU.decompressUnsafeSync(e);return r.isOk()?oe(JF(r.value)):ie(r.error)}d();function vd(e){return e.endsWith("/")?e:`${e}/`}d();var Id="https://app.mappedin.com/",KF="https://auth.mappedin.com/";d();d();var VU=e=>{let r=Date.now();return e-r},r1=(e,r)=>VU(e)<=r*60*1e3;var qF=60,e5=qF*60*1e3,QF="accessTokens";async function hf(e,r=!1){let t=`${e.key}`,o=Ps.getInstance(),n=o?.loadSessionData(QF)||{},i=Math.floor(Date.now()/1e3);if(n[t]&&!r1(n[t].expiresTimestamp*1e3,qF))return n[t];let a=r?await $U(e,i):await HU(e,i),l={...n,[t]:a};return o?.saveSessionData(QF,l),a}async function $U(e,r){let t=`${e.baseAuthUri??KF}oauth2/token`,o=await tn()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}: ${await o.text()}`);let n=await o.json();return{accessToken:n.access_token,expiresTimestamp:r+n.expires_in}}async function HU(e,r){let t=`${e.baseAuthUri?vd(e.baseAuthUri):Id}api/v1/api-key/token`,o=await tn()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}: ${await o.text()}`);let n=await o.json();return{accessToken:n.access_token,expiresTimestamp:r+n.expires_in}}d();var r5=60,o5=r5*60*1e3,t5="miSasTokens";async function pS(e,r){let t=`${r}__${e.mapId}`,o=Ps.getInstance(),n=o?.loadSessionData(t5)||{};if(n[t]&&!r1(n[t].expires,r5))return n[t];let i=await zU(e,r),a={...n,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return o?.saveSessionData(t5,a),i}async function zU(e,r){let t=`${e.baseUri?vd(e.baseUri):Id}api/v1/venue/${e.mapId}/sas-token`,o=await tn()(t,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(!o.ok)throw new Error(`${o.status} ${o.statusText}: ${await o.text()}`);let n=await o.json();return{token:n.token,expires:new Date(n.expires).getTime()}}var n5=globalThis.fetch,WU=y?.env?.npm_package_version;function tn(){if(n5==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return n5}var dS={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function s5(e){let r={...dS,...e};return r.headers={...r.headers,"mappedin-sdk-version":WU},r.things=[],"platformString"in e&&(r.headers={...r.headers,"mappedin-platform-version":e.platformString}),r.noAuth||(r.accessToken?r.authorization=`Bearer ${r.accessToken}`:r.clientId&&r.clientSecret&&(r.authorization=`Basic ${globalThis.btoa(`${r.clientId}:${r.clientSecret}`)}`)),r.language=r.language?.toLowerCase(),r}function ZU(e,r,t=!1){let o={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};t&&delete o.language;let{headers:n}=e;n["Content-Type"]=n["Content-Type"]||"text/json",e.accessToken?n.Authorization=`Bearer ${e.accessToken}`:e.noAuth||e.clientId&&e.clientSecret&&(n["x-mappedin-key"]=btoa(e.clientId),n["x-mappedin-secret"]=btoa(e.clientSecret));let i={method:"GET",headers:n};return e.secure&&(r+="&withcdntoken"),{req:i,url:r}}async function XU(e,r,t=!1){let o=ZU(e,r,t),n=await tn()(o.url,o.req);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}var YU=e=>{let r=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(r==null||Object.keys(r).length===0)return A.warn("No perspectives available in response!"),null;let t={};for(let[o,n]of Object.entries(r)){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){A.warn(`Perspective ${o} is missing url or locale_packs!`);continue}t[o]={url:i,locale_packs:a}}return t};async function JU(e,r="exports/mvf/1/bundle"){let t=s5({baseUri:"https://api-gateway.mappedin.com/",...dS,...e}),o=`${t.baseUri+r}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let n=await XU(t,o),i=n.url,a=n.locale_packs,l=t.perspective??dS.perspective,c=YU(n);if(l!=null&&l!==""&&c!=null){let p=c[l];p==null?A.warn(`Perspective ${l} not found in response! Loading default perspective instead.`):(A.log(`Loading perspective "${l}"`),i=p.url,a=p.locale_packs)}return{url:i,localePacks:a,updated_at:n.updated_at}}var Sd=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function uS(e,{signal:r}){let t=await(await tn()(e,{signal:r})).arrayBuffer();return new Uint8Array(t)}async function Td(e){let t=(await import("./browser-UGYWVBRR.js")).unzipSync(e),o={};if(t["enterprise/"]!=null){o.enterprise={};let n=t["enterprise/locations.json"];n&&(o.enterprise.locations=JSON.parse(Sd().decode(n)));let i=t["enterprise/locationInstances.json"];i&&(o.enterprise.locationInstances=JSON.parse(Sd().decode(i)));let a=t["enterprise/categories.json"];a&&(o.enterprise.categories=JSON.parse(Sd().decode(a)))}return t["floorstack.json"]&&(o["floorstack.json"]=JSON.parse(Sd().decode(t["floorstack.json"]))),t["floor.geojson"]&&(o["floor.geojson"]=JSON.parse(Sd().decode(t["floor.geojson"]))),t["manifest.json"]&&(o["manifest.geojson"]=JSON.parse(Sd().decode(t["manifest.json"]))),o}async function a5(e,{signal:r}){try{let t=await(await tn()(e,{signal:r})).arrayBuffer();if(r.aborted)return;let o=new Uint8Array(t);return await Td(o)}catch(t){let o=new Error("downloadLanguagePack failed");throw o.cause=t,o}}function KU(e){let{mvfVersion:r,useDraftData:t}=e;if(r==="3.0.0")return t?"exports/mvf3-draft/1/bundle":"exports/mvf3/1/bundle";if(r==null||r==="2.0.0")return t?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle";if(r==="2.0.0-c")return t?"exports/mvf2c-draft/1/bundle":"exports/mvf2c/1/bundle";throw new Error(`Unsupported MVF version: ${r}`)}async function mS(e){return new Promise(async(r,t)=>{try{let o=KU(e),{url:n,localePacks:i}=await JU(e,o),a=await tn()(n).then(c=>c.arrayBuffer()),l=new Uint8Array(a);r({compressed:l,localePacks:i})}catch(o){t(o)}})}async function fS(e,r){return new Promise(async(t,o)=>{try{let{url:n}=await QU(e,r),i=await tn()(n).then(l=>l.arrayBuffer()),a=new Uint8Array(i);t(a)}catch(n){o(n)}})}async function QU(e,r){let t=new URL(`${e.baseUri?vd(e.baseUri):Id}api/v1/venue/${e.mapId}/mvf`);e.viewId&&t.searchParams.set("configId",e.viewId),e.mvfVersion&&t.searchParams.set("version",e.mvfVersion);let o=await tn()(t.toString(),{headers:{Authorization:`Bearer ${r}`}});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.json()}function hS(e){let r=new TextDecoder,t=r.decode.bind(r);try{let o={"connection.json":JSON.parse(t(e["connection.json"])),"manifest.geojson":JSON.parse(t(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(t(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(t(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(t(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(t(e["tileset.json"])):void 0,"navigationFlags.json":e["navigationFlags.json"]?JSON.parse(t(e["navigationFlags.json"])):void 0};if(e.enterprise!=null&&(o.enterprise={},e.enterprise?.["locations.json"]&&(o.enterprise.locations=JSON.parse(t(e.enterprise?.["locations.json"]))),e.enterprise?.["categories.json"]&&(o.enterprise.categories=JSON.parse(t(e.enterprise?.["categories.json"]))),e.enterprise?.["venue.json"]&&(o.enterprise.venue=JSON.parse(t(e.enterprise?.["venue.json"]))),e.enterprise?.["layers.json"]&&(o.enterprise.layers=JSON.parse(t(e.enterprise?.["layers.json"]))),e.enterprise?.["locationInstances.json"]&&(o.enterprise.locationInstances=JSON.parse(t(e.enterprise?.["locationInstances.json"]))),e.enterprise?.["enterpriseStyles.json"]&&(o.enterprise.enterpriseStyles=JSON.parse(t(e.enterprise?.["enterpriseStyles.json"]))),e.enterprise?.["textures.json"]&&(o.enterprise.textures=JSON.parse(t(e.enterprise?.["textures.json"]))),e.enterprise?.["floorText.json"]&&(o.enterprise.floorText=JSON.parse(t(e.enterprise?.["floorText.json"]))),e.enterprise?.["categoryPriorities.json"]&&(o.enterprise.categoryPriorities=JSON.parse(t(e.enterprise?.["categoryPriorities.json"])))),e["floorstack.json"]!=null?o["floorstack.json"]=JSON.parse(t(e["floorstack.json"])):e["mapstack.json"]!=null&&(o["mapstack.json"]=JSON.parse(t(e["mapstack.json"]))),o["floorstack.json"]==null&&o["mapstack.json"]==null&&o["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(o["floor.geojson"]=JSON.parse(t(e["floor.geojson"]))),o["floor.geojson"]==null&&o["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(o["styles.json"]=JSON.parse(t(e["styles.json"]))),"shapes.json"in e&&(o["shapes.json"]=JSON.parse(t(e["shapes.json"]))),"location.json"in e&&(o["location.json"]=JSON.parse(t(e["location.json"]))),"category.json"in e&&(o["category.json"]=JSON.parse(t(e["category.json"]))),e.annotation!=null){o.annotation={};let i=Object.keys(e.annotation);for(let a of i){let l=a.replace(/\.json|\.geojson/g,"");o.annotation[l]=JSON.parse(t(e.annotation[a]))}}let n=Object.keys(e.space);for(let i of n){let a=i.replace(/\.json|\.geojson/g,"");o.space[a]=JSON.parse(t(e.space[i]))}if(e.obstruction!=null){let i=Object.keys(e.obstruction);for(let a of i){let l=a.replace(/\.json|\.geojson/g,"");o.obstruction[l]=JSON.parse(t(e.obstruction[a]))}}else o.obstruction={};if(e.entrance!=null){let i=Object.keys(e.entrance);for(let a of i){let l=a.replace(/\.json|\.geojson/g,"");o.entrance[l]=JSON.parse(t(e.entrance[a]))}}else o.entrance={};if("floorImages"in e&&e.floorImages!=null){o.floorImages={};for(let i of Object.keys(e.floorImages)){let a=i.replace(/\.json|\.geojson/g,"");o.floorImages[a]=JSON.parse(t(e.floorImages[i]))}}if("textAreas"in e&&e.textAreas!=null){o.textAreas={};for(let i of Object.keys(e.textAreas)){let a=i.replace(/\.json|\.geojson/g,"");o.textAreas[a]=JSON.parse(t(e.textAreas[i]))}}if("facade"in e&&e.facade!=null){o.facade={};for(let i of Object.keys(e.facade)){let a=i.replace(/\.json|\.geojson/g,"");o.facade[a]=JSON.parse(t(e.facade[i]))}}if("area"in e&&e.area!=null){o.area={};for(let i of Object.keys(e.area)){let a=i.replace(/\.json|\.geojson/g,"");o.area[a]=JSON.parse(t(e.area[i]))}}return o}catch(o){throw A.error(o),new Error("MVF parsing failed! Probably encountered a bad file.")}}function qU(e){if(e==null||typeof e!="object")return!1;let r=["connection.json","manifest.geojson","floor.geojson"in e?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in e?"floorstack.json":"mapstack.json"in e?"mapstack.json":"mapstack.geojson"];"styles.json"in e&&r.push("styles.json"),"shapes.json"in e&&r.push("shapes.json");for(let t of r)if(e[t]==null||e[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function gS(e){return new Promise(async(r,t)=>{try{if(e==null||typeof e!="object")throw new Error("Error parsing data! Unzipping failed.");if(e[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let n=(await import("./browser-UGYWVBRR.js")).unzipSync(e);if(!qU(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let i={},a=Object.keys(n);for(let l of a){if(n[l].length===0)continue;let c=l.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){i[c[0]]=n[l];continue}if(c[0]==="image"){A.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else i[c[0]]==null&&(i[c[0]]={}),i[c[0]][c[1]]=n[l]}r(i)}catch(o){t(o)}})}function tl(){let e="us",r={};function t(){return nV(sV(e),r)}return{updateByUserOption(o){o.environment&&(e=o.environment),o.baseUri&&(r.baseUri=o.baseUri),o.baseAuthUri&&(r.baseAuthUri=o.baseAuthUri),o.analytics?.baseUri&&(r.analyticsBaseUri=o.analytics?.baseUri)},updateTileServerBaseUrl(o){r.tileServerUri=o},updateEnvironment(o){e=o},setEnterprise(o){(e==="us"||e==="us-enterprise")&&(e=o?"us-enterprise":"us")},getBaseUri(){return t().baseUri},getBaseAuthUri(){return t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){e="us",r={}},__getState:t}}var l5=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"}),eV=Object.freeze({...l5,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),tV=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"}),rV=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"}),oV=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"});function nV(e,r){return{...e,...r}}var iV={eu:tV,us:l5,"us-enterprise":eV,"us-staging-enterprise":rV,"us-staging-self-serve":oV};function sV(e){return iV[e]}var o1=e=>{let r=Object.values(e["floorstack.json"]??e["mapstack.json"]??{});return r.length===1?[]:r.filter(t=>t.type!=="Outdoor").map(t=>t.id.replace("fs_","").replace("ms_",""))},i5=async e=>{let r=performance.now(),t=cS(e);return A.log(`Parsed MVFv3 in ${performance.now()-r}ms`),t.inspectErr(n=>{throw A.error(n),new Error("MVFv3 parsing failed!")}),t.unwrap()};async function n1(e,r="2.0.0"){switch(r){case"2.0.0":case"2.0.0-c":try{let t=await gS(e);return hS(t)}catch{return i5(e)}case"3.0.0":return i5(e);default:throw new Error(`Unsupported MVF version: ${r}`)}}d();d();d();function Mn(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function rn(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Cd(e){return e.type==="Feature"?e.geometry:e}function c5(e,r){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function aV(e,r,t){t===void 0&&(t={});for(var o=Mn(e),n=rn(r),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")),lV(n[i],n[i+1],o,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function lV(e,r,t,o,n){var i=t[0],a=t[1],l=e[0],c=e[1],p=r[0],u=r[1],f=t[0]-l,h=t[1]-c,b=p-l,v=u-c,T=f*v-h*b;if(n!==null){if(Math.abs(T)>n)return!1}else if(T!==0)return!1;if(o){if(o==="start")return Math.abs(b)>=Math.abs(v)?b>0?l<i&&i<=p:p<=i&&i<l:v>0?c<a&&a<=u:u<=a&&a<c;if(o==="end")return Math.abs(b)>=Math.abs(v)?b>0?l<=i&&i<p:p<i&&i<=l:v>0?c<=a&&a<u:u<a&&a<=c;if(o==="both")return Math.abs(b)>=Math.abs(v)?b>0?l<i&&i<p:p<i&&i<l:v>0?c<a&&a<u:u<a&&a<c}else return Math.abs(b)>=Math.abs(v)?b>0?l<=i&&i<=p:p<=i&&i<=l:v>0?c<=a&&a<=u:u<=a&&a<=c;return!1}var p5=aV;d();function cV(e,r){r===void 0&&(r={});var t=Ip(e),o=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return ki([o,n],r.properties,r)}var Md=cV;d();d();function pV(e,r,t){t===void 0&&(t={});var o=Mn(e),n=Mn(r),i=Po(n[1]-o[1]),a=Po(n[0]-o[0]),l=Po(o[1]),c=Po(n[1]),p=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return _C(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),t.units)}var rl=pV;function i1(e,r){return r===void 0&&(r={}),NC(e,function(t,o){var n=o.geometry.coordinates;return t+rl(n[0],n[1],r)},0)}d();d();d();function s1(e,r,t){if(t===void 0&&(t={}),t.final===!0)return dV(e,r);var o=Mn(e),n=Mn(r),i=Po(o[0]),a=Po(n[0]),l=Po(o[1]),c=Po(n[1]),p=Math.sin(a-i)*Math.cos(c),u=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-i);return fm(Math.atan2(p,u))}function dV(e,r){var t=s1(r,e);return t=(t+180)%360,t}d();function oc(e,r,t,o){o===void 0&&(o={});var n=Mn(e),i=Po(n[0]),a=Po(n[1]),l=Po(t),c=RC(r,o.units),p=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),u=i+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(p)),f=fm(u),h=fm(p);return ki([f,h],o.properties)}d();d();function uV(e){if(!e)throw new Error("geojson is required");var r=[];return Ai(e,function(t){mV(t,r)}),jl(r)}function mV(e,r){var t=[],o=e.geometry;if(o!==null){switch(o.type){case"Polygon":t=rn(o);break;case"LineString":t=[rn(o)]}t.forEach(function(n){var i=fV(n,e.properties);i.forEach(function(a){a.id=r.length,r.push(a)})})}}function fV(e,r){var t=[];return e.reduce(function(o,n){var i=Fs([o,n],r);return i.bbox=hV(o,n),t.push(i),n}),t}function hV(e,r){var t=e[0],o=e[1],n=r[0],i=r[1],a=t<n?t:n,l=o<i?o:i,c=t>n?t:n,p=o>i?o:i;return[a,l,c,p]}var yS=uV;var E5=gp(w5(),1);function VV(e,r){var t={},o=[];if(e.type==="LineString"&&(e=w0(e)),r.type==="LineString"&&(r=w0(r)),e.type==="Feature"&&r.type==="Feature"&&e.geometry!==null&&r.geometry!==null&&e.geometry.type==="LineString"&&r.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&r.geometry.coordinates.length===2){var n=O5(e,r);return n&&o.push(n),jl(o)}var i=(0,E5.default)();return i.load(yS(r)),O0(yS(e),function(a){O0(i.search(a),function(l){var c=O5(a,l);if(c){var p=rn(c).join(",");t[p]||(t[p]=!0,o.push(c))}})}),jl(o)}function O5(e,r){var t=rn(e),o=rn(r);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(o.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=t[0][0],i=t[0][1],a=t[1][0],l=t[1][1],c=o[0][0],p=o[0][1],u=o[1][0],f=o[1][1],h=(f-p)*(a-n)-(u-c)*(l-i),b=(u-c)*(i-p)-(f-p)*(n-c),v=(a-n)*(i-p)-(l-i)*(n-c);if(h===0)return null;var T=b/h,x=v/h;if(T>=0&&T<=1&&x>=0&&x<=1){var I=n+T*(a-n),M=i+T*(l-i);return ki([I,M])}return null}var Od=VV;function $V(e,r,t){t===void 0&&(t={});var o=ki([1/0,1/0],{dist:1/0}),n=0;return Ai(e,function(i){for(var a=rn(i),l=0;l<a.length-1;l++){var c=ki(a[l]);c.properties.dist=rl(r,c,t);var p=ki(a[l+1]);p.properties.dist=rl(r,p,t);var u=rl(c,p,t),f=Math.max(c.properties.dist,p.properties.dist),h=s1(c,p),b=oc(r,f,h+90,t),v=oc(r,f,h-90,t),T=Od(Fs([b.geometry.coordinates,v.geometry.coordinates]),Fs([c.geometry.coordinates,p.geometry.coordinates])),x=null;T.features.length>0&&(x=T.features[0],x.properties.dist=rl(r,x,t),x.properties.location=n+rl(c,x,t)),c.properties.dist<o.properties.dist&&(o=c,o.properties.index=l,o.properties.location=n),p.properties.dist<o.properties.dist&&(o=p,o.properties.index=l+1,o.properties.location=n+u),x&&x.properties.dist<o.properties.dist&&(o=x,o.properties.index=l),n+=u}}),o}var yf=$V;function HV(e,r,t){var o=rn(t);if(c5(t)!=="LineString")throw new Error("line must be a LineString");var n=yf(t,e),i=yf(t,r),a;n.properties.index<=i.properties.index?a=[n,i]:a=[i,n];for(var l=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)l.push(o[c]);return l.push(a[1].geometry.coordinates),Fs(l,t.properties)}var FS=HV;var zV=1e-7;function DS(e){return{type:"Point",coordinates:e}}function WV(e,r){let{coordinates:t}=r.geometry,{coordinates:o}=e.geometry,n=t.map(i=>yf(e,DS(i)));return o.reduce((i,a)=>{let l=FS(DS(a),n[0],e),c=FS(DS(a),n[1],e),p=i1(l)<i1(c)?l:c;return p.properties={...e.properties,entrances:[]},i.concat([p])},[])}function kS(e,r){return r.reduce((t,o)=>{let n={epsilon:zV},i=t.obstructions.findIndex(l=>p5(Md(o),l,n)),a=t.obstructions[i];if(a){let[l,c]=WV(a,o);t.entrances.push(o),t.obstructions.splice(i,1,l,c)}return t},{obstructions:[e],entrances:[]})}d();d();d();var xr=class{constructor(r){m(this,"id");this.id=r}};d();d();var Ed=class Ed{constructor(r,t,o){m(this,"__type",Ed.__type);m(this,"id",ut());m(this,"latitude");m(this,"longitude");m(this,"floorId");m(this,"verticalOffset");if(typeof r=="object")this.latitude=r.latitude,this.longitude=r.longitude,this.floorId=r.floorId,this.verticalOffset=r.verticalOffset??0;else{if(t==null)throw new Error("Coordinate longitude is required.");this.latitude=r,this.longitude=t,this.floorId=o,this.verticalOffset=0}}static is(r){return r.__type===Ed.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(r){return this.latitude===r.latitude&&this.longitude===r.longitude&&this.floorId===r.floorId}toJSON(){return{__type:Ed.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};m(Ed,"__type","coordinate");var AS=Ed,fe=AS;function LS(e){let r=e.enterprise?.locations?.reduce((n,i)=>(n[i.id]=i,n),{})||{};for(let n of e.enterprise?.locationInstances||[])r[n.id]=n;let t={};for(let n of e["floorstack.json"]||[])t[n.id]=n;let o={};for(let n of e["floor.geojson"]?.features||[])n.properties&&n.properties.id&&(o[n.properties.id]=n.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":r,"enterprise-category":e.enterprise?.categories?.reduce((n,i)=>(n[i.id]=i,n),{})||{},"floor-stack":t,floor:o}}}function P5(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}function F5(e){return!!e.split("?")[1]?.includes("sv=")}function Dr(e,r){let t=e?.properties?.id||"unknown";if(e.geometry==null)return A.error(`Cannot get the center coordinate for "${t}" because it has no geometry.`),new fe({latitude:0,longitude:0,floorId:r});try{if(e.geometry.type==="LineString"){let[[o,n],[i,a]]=e.geometry.coordinates,l=(o+i)/2,c=(n+a)/2;return new fe({latitude:c,longitude:l,floorId:r})}else if(e.geometry.type==="Point"){let[o,n]=e.geometry.coordinates;return new fe({latitude:n,longitude:o,floorId:r})}else if(e.geometry.type==="Polygon"){let o=e;if(o.properties.center!=null){let[n,i]=o.properties.center;return new fe({latitude:i,longitude:n,floorId:r})}}}catch{}try{let[o,n]=Md(e).geometry.coordinates;return new fe({latitude:n,longitude:o,floorId:r})}catch(o){return A.error(`Failed to get center coordinate for "${t}" ${o instanceof Error?o.stack:""}`),new fe({latitude:0,longitude:0,floorId:r})}}function D5(e,r){return r&&(e.flags[r.index]&1<<r.bit)!==0}var si,kr,nc,qs,Pd=class Pd extends xr{constructor(t,o){super(o.mvfData.properties.id);m(this,"__type",Pd.__type);S(this,si);S(this,kr,{});S(this,nc);S(this,qs);w(this,si,t),w(this,nc,o.floorId),w(this,qs,o.mvfData)}static is(t){return t.__type===Pd.__type}get locations(){return s(this,kr).locations?s(this,kr).locations:(s(this,kr).locations=(s(this,si).locationIdsByNodeId[this.id]||[]).map(t=>s(this,si).getById("enterprise-location",t)).filter(Boolean),s(this,kr).locations)}get space(){return s(this,si).getById("space",s(this,si).spaceIdsByNodeId[this.id]?.[0])}get floor(){let t=s(this,si).getById("floor",s(this,nc));if(t==null)throw new Error(`Floor ${s(this,nc)} not found!`);return t}get coordinate(){return s(this,kr).coordinate==null&&(s(this,kr).coordinate=Dr(s(this,qs),s(this,nc))),s(this,kr).coordinate}get externalId(){return s(this,qs).properties.externalId??""}get neighbors(){if(s(this,kr).neighbors==null){let t=s(this,qs).properties.neighbors.map(o=>{let n=s(this,si).getById("node",o.id);if(n==null)throw new Error(`Node ${o.id} not found!`);return n});s(this,kr).neighbors=t}return s(this,kr).neighbors}get navigationFlags(){if(s(this,kr).navigationFlags==null){let t=[],o=s(this,qs).properties.flags;if(o!=null&&o.length>0)for(let[n,i]of Object.entries(s(this,si).navigationFlags))o.length>i.index&&o[i.index]!=null&&D5({flags:o},i)&&t.push(n);s(this,kr).navigationFlags=Object.freeze(t)}return s(this,kr).navigationFlags}get geoJSON(){return{...s(this,qs),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Pd.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(t=>t.id)}}destroy(){for(let t of Object.keys(s(this,kr)))delete s(this,kr)[t]}};si=new WeakMap,kr=new WeakMap,nc=new WeakMap,qs=new WeakMap,m(Pd,"__type","node");var _S=Pd,wn=_S;d();d();d();d();var bf,ea,Fd=class Fd extends xr{constructor(t){super(String(ut()));m(this,"__type",Fd.__type);S(this,bf,{});S(this,ea);w(this,ea,t.mvfData)}static is(t){return t.__type===Fd.__type}get url(){return s(this,ea).url}get name(){if("displayName"in s(this,ea))return s(this,ea).displayName;if("label"in s(this,ea))return s(this,ea).label}toJSON(){return{__type:Fd.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,bf)))delete s(this,bf)[t]}};bf=new WeakMap,ea=new WeakMap,m(Fd,"__type","hyperlink");var RS=Fd,ic=RS;d();d();function xf(e){return typeof e=="string"?e:e.id}function NS(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}var BS=8,qi=e=>typeof e=="number"?e.toFixed(BS):NS(e)?e[1].toFixed(BS)+"-"+e[0].toFixed(BS):e.map(r=>qi(r)).join("-"),ZV=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,XV=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,YV=e=>ZV.test(e)||XV.test(e),JV=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,KV=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,QV=e=>YV(e)?!1:JV.test(e)||KV.test(e),p1=e=>{if(!QV(e))return null;let r="";e.startsWith("https://")?(r="https://",e=e.slice(8)):e.startsWith("http://")&&(r="http://",e=e.slice(7));let[t,o,n]=e.split("/"),i=n.split(".").pop()??"";return{origin:r+t,mapId:o,fileName:n,fileType:i}};var vf,nl,sc,Dd=class Dd extends xr{constructor(t){super(String(ut()));m(this,"__type",Dd.__type);S(this,vf,{});S(this,nl);S(this,sc);w(this,nl,t.mvfData),w(this,sc,t.mapData)}static is(t){return t.__type===Dd.__type}get url(){let t=s(this,nl).url;if(s(this,sc).tokenManager==null)return t;let o=p1(s(this,nl).url);if(o==null)return t;let n=o.mapId;try{if(s(this,sc).tokenManager.isEnterpriseMode())return t;let i=s(this,sc).tokenManager.getSasToken(n).token;if(i==null||i==="")throw new Error("SAS token empty!");return`${t}?${i}`}catch(i){return o.fileType!=="svg"&&A.error("Error getting SAS token for image",{error:i,url:t}),t}}get name(){return s(this,nl).altText}get altText(){return s(this,nl).altText}toJSON(){return{__type:Dd.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,vf)))delete s(this,vf)[t]}};vf=new WeakMap,nl=new WeakMap,sc=new WeakMap,m(Dd,"__type","image");var jS=Dd,ac=jS;d();var lc,ai=class{constructor(r,t){m(this,"id");S(this,lc);this.id=r}get geoJSONBoundingBox(){return s(this,lc)?s(this,lc):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(w(this,lc,Ip(this.geoJSON)),s(this,lc))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};lc=new WeakMap;var kd,ta,ra,Zr=class extends ai{constructor(t,o){super(o.properties.id,t);S(this,kd);S(this,ta);S(this,ra,{});w(this,kd,t),w(this,ta,o)}get externalId(){return s(this,ta).properties.externalId??""}get name(){let t=s(this,ta).properties.details?.name??"";return t===""&&(t=this.locationProfiles.find(o=>o.name&&o.name.length>0)?.name??""),t}get description(){let t=s(this,ta).properties.details?.description??"";return t===""&&(t=this.locationProfiles.find(o=>o.description&&o.description.length>0)?.description??""),t}get images(){if(s(this,ra).images!=null)return s(this,ra).images;let t=s(this,ta).properties.details?.images?.map(o=>new ac({mvfData:o,mapData:s(this,kd)}))??[];return(t==null||t.length===0)&&(t=this.locationProfiles.find(o=>o.images.length>0)?.images??[]),s(this,ra).images=t,t}get links(){if(s(this,ra).links!=null)return s(this,ra).links;let t=s(this,ta).properties.details?.links?.map(o=>new ic({mvfData:o}))??[];return(t==null||t.length===0)&&(t=this.locationProfiles.find(o=>o.links.length>0)?.links??[]),s(this,ra).links=t,t}get locationProfiles(){return s(this,kd).locationProfilesByAttachedFeatureId[this.id]??[]}};kd=new WeakMap,ta=new WeakMap,ra=new WeakMap;var If,cc,Ld,_d,Ad=class Ad extends Zr{constructor(t,o){super(t,o.mvfData);m(this,"__type",Ad.__type);S(this,If);S(this,cc);S(this,Ld,{});S(this,_d);w(this,If,t),w(this,cc,o.floorId),w(this,_d,o.mvfData)}static is(t){return t.__type===Ad.__type}get center(){return s(this,Ld).center==null&&(s(this,Ld).center=Dr(s(this,_d),s(this,cc))),s(this,Ld).center}get floor(){let t=s(this,If).getById("floor",s(this,cc));if(t==null)throw new Error(`Floor ${s(this,cc)} not found!`);return t}get geoJSON(){return{...s(this,_d),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:Ad.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};If=new WeakMap,cc=new WeakMap,Ld=new WeakMap,_d=new WeakMap,m(Ad,"__type","area");var GS=Ad,On=GS;d();var pc,oa,dc,uc,Rd=class Rd extends Zr{constructor(t,o){super(t,o.mvfData);m(this,"__type",Rd.__type);S(this,pc);S(this,oa);S(this,dc);S(this,uc);w(this,oa,{}),w(this,uc,o.mvfData),w(this,pc,t),w(this,dc,o.floorId)}static is(t){return t.__type===Rd.__type}get floor(){let t=s(this,pc).getById("floor",s(this,dc));if(t==null)throw new Error(`Floor ${s(this,dc)} not found!`);return t}get center(){return s(this,oa).center==null&&(s(this,oa).center=Dr(s(this,uc),s(this,dc))),s(this,oa).center}get isExterior(){if(s(this,uc).properties.isExterior)return!0;let t=s(this,pc).obstructionIdByEntranceId[this.id];return s(this,pc).getMVFFeatureById("obstruction",t)?.properties.footprintComponent??!1}get geoJSON(){return{...s(this,uc),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Rd.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,oa)))delete s(this,oa)[t]}};pc=new WeakMap,oa=new WeakMap,dc=new WeakMap,uc=new WeakMap,m(Rd,"__type","door");var US=Rd,go=US;d();var il,mc,on,na,Bd=class Bd extends Zr{constructor(t,o){super(t,o.mvfData);m(this,"__type",Bd.__type);S(this,il);S(this,mc);S(this,on,{});S(this,na);w(this,il,t),w(this,mc,o.floorId),w(this,na,o.mvfData)}static is(t){return t.__type===Bd.__type}get type(){return e$(s(this,na).properties.kind)}get locations(){if(s(this,on).locations)return s(this,on).locations;s(this,on).locations=[];let t=s(this,il).mvfLocationsBySpaceId[s(this,na).properties.id];if(t?.length>0)for(let o of t){let n=s(this,il).getById("enterprise-location",o.id);n&&s(this,on).locations.push(n)}return s(this,on).locations}get floor(){let t=s(this,il).getById("floor",s(this,mc));if(t==null)throw new Error(`Floor ${s(this,mc)} not found!`);return t}get doors(){return s(this,na).properties.destinationNodes.reduce((t,o)=>{let n=s(this,il).doorsByNodeId[o];return n&&t.push(n),t},[])}get center(){return s(this,on).center==null&&(s(this,on).center=Dr(s(this,na),s(this,mc))),s(this,on).center}get geoJSON(){return{...s(this,na),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Bd.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,on)))delete s(this,on)[t]}};il=new WeakMap,mc=new WeakMap,on=new WeakMap,na=new WeakMap,m(Bd,"__type","space");var VS=Bd,qV=["room","hallway","exterior","void","gate"];function e$(e){if(e==null||e==="default")return"room";let r=e.toLowerCase();return qV.includes(r)?r:"room"}var vr=VS;d();var En,yt,nn,jd,d1,Nd=class Nd extends ai{constructor(t,o){super(o.mvfData.properties.id,t);S(this,jd);m(this,"__type",Nd.__type);S(this,En);S(this,yt,{});S(this,nn);w(this,En,t),w(this,nn,o.mvfData)}static is(t){return t.__type===Nd.__type}get focusTarget(){return this}get name(){if(!("name"in s(this,nn).properties))return s(this,nn).properties.externalId??"";let t=W(this,jd,d1).call(this,"name");return typeof t=="string"?t:""}get shortName(){if(!("shortName"in s(this,nn).properties))return s(this,nn).properties.externalId??"";let t=W(this,jd,d1).call(this,"shortName");return typeof t=="string"?t:""}get subtitle(){let t=W(this,jd,d1).call(this,"subtitle");return typeof t=="string"?t:""}get externalId(){return s(this,nn).properties.externalId??""}get elevation(){return s(this,nn).properties.elevation}get spaces(){if(s(this,yt).spaces==null){let t=s(this,En).spaces.filter(o=>o.floor.id===this.id);s(this,yt).spaces=t}return s(this,yt).spaces}get geoJSON(){return{type:"Feature",properties:null,geometry:s(this,nn).geometry??{type:"Polygon",coordinates:[]}}}get objects(){if(s(this,yt).objects==null){let t=s(this,En).objects.filter(o=>o.floor.id===this.id);s(this,yt).objects=t}return s(this,yt).objects}get connections(){if(s(this,yt).connections==null){let t=s(this,En).connections.filter(o=>o.floors.includes(this));s(this,yt).connections=t}return s(this,yt).connections}get doors(){if(s(this,yt).doors==null){let t=s(this,En).doors.filter(o=>o.floor.id===this.id);s(this,yt).doors=t}return s(this,yt).doors}get annotations(){if(s(this,yt).annotations==null){let t=s(this,En).annotations.filter(o=>o.floor.id===this.id);s(this,yt).annotations=t}return s(this,yt).annotations}get pois(){if(s(this,yt).pois==null){let t=s(this,En).pointsOfInterest.filter(o=>o.floor.id===this.id);s(this,yt).pois=t}return s(this,yt).pois}get floorStack(){if(s(this,yt).floorStack==null){let t=s(this,En).floorStacks.find(o=>o.floors.includes(this));s(this,yt).floorStack=t}return s(this,yt).floorStack}get center(){return s(this,yt).center==null&&(s(this,yt).center=Dr(s(this,nn),this.id)),s(this,yt).center}toJSON(){return{__type:Nd.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,spaces:this.spaces.map(t=>t.id),objects:this.objects.map(t=>t.id),connections:this.connections.map(t=>t.id),doors:this.doors.map(t=>t.id),annotations:this.annotations.map(t=>t.id),pois:this.pois.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,yt)))delete s(this,yt)[t]}};En=new WeakMap,yt=new WeakMap,nn=new WeakMap,jd=new WeakSet,d1=function(t){let o=s(this,nn).properties[t];return s(this,En).getPropTranslation(this.__type,t,this.id,o)},m(Nd,"__type","floor");var $S=Nd,Bo=$S;d();d();d();function Gd(e){let r;if(vr.is(e)||go.is(e)||No.is(e)||On.is(e)||Ar.is(e))r=e.center;else if(sn.is(e)||ia.is(e))r=e.coordinate;else if(fe.is(e))r=e;else if(wn.is(e))r=e.coordinate;else if(es.is(e))r=e.coordinates[0];else return;return r}d();d();var Sf={debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!0,floorGap:10}},ts="ExteriorWalls",sl="Walls",k5=0,Ud="InteriorDoors",Vd="ExteriorDoors",rr="GeometryLayer",rs="LabelsLayer",li="MarkersLayer",$d="FootprintLayer",al="OcclusionLayer",fc="AreasLayer",Hd="ImagesLayer",hc="FacadesLayer",os="PathsLayer";var A5=["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"],t$={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var r$=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),o$=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function HS(e){e.outdoorView?.enabled&&!e.outdoorView?.token&&A.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function zS(e,r){let t=e?.outdoorView?.token||r.outdoorViewToken,o={...Sf,...e,outdoorView:{enabled:e?.outdoorView?.enabled===void 0?!!t:e?.outdoorView?.enabled,layersHiddenByGeometry:Sf.outdoorView?.layersHiddenByGeometry,...e?.outdoorView},bearing:e?.bearing??r.naturalBearing??0,imagePlacementOptions:{...Sf.imagePlacementOptions,...e?.imagePlacementOptions},multiFloorView:{...Sf.multiFloorView,...e?.multiFloorView}};return t&&o.outdoorView&&(o.outdoorView.token=t),o}function L5(e){let r={remove_watermark:!1};if(e)try{let t=ny(e);Object.assign(r,t.capabilities)}catch(t){A.error("Error decoding capabilities from token",t)}return r}function _5(e){let r=Object.fromEntries(Object.entries(e).filter(([t])=>r$.has(t)));return r.outdoorView&&(r.outdoorView=Object.fromEntries(Object.entries(r.outdoorView).filter(([t])=>o$.has(t)))),r}var ll,Pn,sa,zd=class zd extends Zr{constructor(t,o){let n=Object.values(o.mvfDataByFloorId)[0];super(t,n);m(this,"__type",zd.__type);S(this,ll);S(this,Pn);S(this,sa);w(this,Pn,{}),w(this,ll,t),w(this,sa,o.mvfDataByFloorId)}static is(t){return t.__type===zd.__type}get accessible(){return Object.values(s(this,sa))[0].properties.accessible??!1}get type(){return Object.values(s(this,sa))[0].properties.kind?.split(".")[1]??"unknown"}get extra(){return Object.values(s(this,sa))[0].properties.extra}get coordinates(){return s(this,Pn).coordinates==null&&(s(this,Pn).coordinates=Object.entries(s(this,sa)).map(([t,o])=>Dr(o,t))),s(this,Pn).coordinates}get nodes(){return Object.values(s(this,sa))[0].properties.nodes.map(t=>s(this,ll).getById("node",t))}get floors(){return this.coordinates.map(t=>t.floorId?s(this,ll).getById("floor",t.floorId):void 0).filter(vm)}get locationProfiles(){if(s(this,Pn).locationProfiles!=null)return s(this,Pn).locationProfiles;let t=super.locationProfiles;if(t==null||t.length===0){let o=[this.coordinates[0]?.longitude??0,this.coordinates[0]?.latitude??0],n=qi(o),i=s(this,ll).mvfConnectionIdsByLatLon[n]??[];for(let a of i){let l=s(this,ll).locationProfilesByAttachedFeatureId[a];if(l!=null){t=l;break}}}return s(this,Pn).locationProfiles=t??[],t}get focusTarget(){return this.coordinates}toJSON(){return{__type:zd.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(t=>t.toJSON()),floors:this.floors.map(t=>t.id),extra:this.extra}}destroy(){for(let t of Object.keys(s(this,Pn)))delete s(this,Pn)[t]}};ll=new WeakMap,Pn=new WeakMap,sa=new WeakMap,m(zd,"__type","connection");var WS=zd,an=WS;d();var Tf,gc,cl,yc,Wd=class Wd extends Zr{constructor(t,o){super(t,o.mvfData);m(this,"__type",Wd.__type);S(this,Tf);S(this,gc);S(this,cl,{});S(this,yc);w(this,Tf,t),w(this,gc,o.floorId),w(this,yc,o.mvfData)}static is(t){return t.__type===Wd.__type}get type(){let t=s(this,yc).properties.kind;return t==null&&(t="object"),t==="Desks"&&(t="desk"),t.toLowerCase()}get floor(){let t=s(this,Tf).getById("floor",s(this,gc));if(t==null)throw new Error(`Floor ${s(this,gc)} not found!`);return t}get center(){return s(this,cl).center==null&&(s(this,cl).center=Dr(s(this,yc),s(this,gc))),s(this,cl).center}get geoJSON(){return{...s(this,yc),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:Wd.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of globalThis.Object.keys(s(this,cl)))s(this,cl)[t]=null}};Tf=new WeakMap,gc=new WeakMap,cl=new WeakMap,yc=new WeakMap,m(Wd,"__type","object");var ZS=Wd,No=ZS;d();var Cf,bc,pl,Xd,Zd=class Zd extends Zr{constructor(t,o){super(t,o.mvfData);m(this,"__type",Zd.__type);S(this,Cf);S(this,bc);S(this,pl,{});S(this,Xd);w(this,Cf,t),w(this,Xd,o.mvfData),w(this,bc,o.floorId)}static is(t){return t.__type===Zd.__type}get floor(){let t=s(this,Cf).getById("floor",s(this,bc));if(t==null)throw new Error(`Floor ${s(this,bc)} not found!`);return t}get coordinate(){return s(this,pl).coordinate==null&&(s(this,pl).coordinate=Dr(s(this,Xd),s(this,bc))),s(this,pl).coordinate}get geoJSON(){return{...s(this,Xd),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Zd.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let t in s(this,pl))s(this,pl)[t]=null}};Cf=new WeakMap,bc=new WeakMap,pl=new WeakMap,Xd=new WeakMap,m(Zd,"__type","point-of-interest");var XS=Zd,sn=XS;d();var Mf,xc,dl,vc,wf,JS,Yd=class Yd extends Zr{constructor(t,o){super(t,o.mvfData);S(this,wf);m(this,"__type",Yd.__type);S(this,Mf);S(this,xc);S(this,dl,{});S(this,vc);w(this,Mf,t),w(this,xc,o.floorId),w(this,vc,o.mvfData)}static is(t){return t.__type===Yd.__type}get group(){return W(this,wf,JS).call(this).group}get type(){return W(this,wf,JS).call(this).type}get coordinate(){return s(this,dl).coordinate==null&&(s(this,dl).coordinate=Dr(s(this,vc),s(this,xc))),s(this,dl).coordinate}get floor(){let t=s(this,Mf).getById("floor",s(this,xc));if(t==null)throw new Error(`Floor ${s(this,xc)} not found!`);return t}get geoJSON(){return{...s(this,vc),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Yd.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let t of Object.keys(s(this,dl)))delete s(this,dl)[t]}};Mf=new WeakMap,xc=new WeakMap,dl=new WeakMap,vc=new WeakMap,wf=new WeakSet,JS=function(){let[t,o]=s(this,vc).properties.symbolId.split("--");return{group:t,type:o}},m(Yd,"__type","annotation");var YS=Yd,ia=YS;d();var ul,Fn,ci,Kd,Of,QS,Jd=class Jd extends ai{constructor(t,o){super(o.mvfData.id,t);S(this,Of);m(this,"__type",Jd.__type);S(this,ul);S(this,Fn,{});S(this,ci);S(this,Kd);w(this,ul,t),w(this,ci,o.mvfData),w(this,Kd,o.facadeId)}static is(t){return t.__type===Jd.__type}get type(){return s(this,ci).type}get name(){let t=W(this,Of,QS).call(this,"name");return typeof t=="string"?t:""}get shortName(){let t=W(this,Of,QS).call(this,"shortName");return typeof t=="string"?t:""}get externalId(){return s(this,ci).externalId??""}get floors(){if(s(this,Fn).floors==null){let t=(s(this,ci).floors??s(this,ci).maps??[]).reduce((o,n)=>{let i=s(this,ul).floorsById[n];return i&&o.push(i),o},[]);t.length===0&&A.error(`Floor stack ${this.id} has no floors`),s(this,Fn).floors=t.sort((o,n)=>o.elevation-n.elevation)}return s(this,Fn).floors}get defaultFloor(){if(s(this,Fn).defaultFloor!=null)return s(this,Fn).defaultFloor;let t=s(this,ci).defaultFloor?s(this,ul).getById("floor",s(this,ci).defaultFloor):void 0;return s(this,Fn).defaultFloor=t||this.floors.reduce((o,n)=>Math.abs(n.elevation)<Math.abs(o.elevation)?n:o),s(this,Fn).defaultFloor}get facade(){return s(this,Kd)?s(this,ul).facadesById[s(this,Kd)]:void 0}toJSON(){return{__type:Jd.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,Fn)))delete s(this,Fn)[t]}};ul=new WeakMap,Fn=new WeakMap,ci=new WeakMap,Kd=new WeakMap,Of=new WeakSet,QS=function(t){return s(this,ul).getPropTranslation(this.__type,t,this.id,s(this,ci)[t])},m(Jd,"__type","floor-stack");var KS=Jd,u1=KS;d();var qd,Ic,eu,ns,Qd=class Qd extends ai{constructor(t,o){super(o.mvfData.id,t);m(this,"__type",Qd.__type);S(this,qd);S(this,Ic);S(this,eu);S(this,ns,{});w(this,qd,o.mvfData),w(this,Ic,t),w(this,eu,o.floorStackId)}static is(t){return t.__type===Qd.__type}get floorStack(){return s(this,Ic).getById("floor-stack",s(this,eu))}get spaces(){if(!s(this,ns).spaces){s(this,ns).spaces=[];for(let t of s(this,qd).spaces){let o=s(this,Ic).getById("space",t.spaceId);o&&s(this,ns).spaces.push(o)}}return s(this,ns).spaces}get center(){if(!s(this,ns).center){let t={type:"FeatureCollection",features:[]};for(let n of this.spaces){let i=s(this,Ic).mvfSpacesById[n.id];i&&t.features.push(i)}if(t.features.length===0)throw new wr("No geometry found for facade!");let o=Md(t);s(this,ns).center=new fe({latitude:o.geometry.coordinates[1],longitude:o.geometry.coordinates[0],floorId:s(this,qd).spaces[0].floorId})}return s(this,ns).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}toJSON(){return{id:this.id,__type:Qd.__type,floorStackId:s(this,eu),floorStack:this.floorStack,spaces:this.spaces}}};qd=new WeakMap,Ic=new WeakMap,eu=new WeakMap,ns=new WeakMap,m(Qd,"__type","facade");var qS=Qd,Ar=qS;d();var n$=new Set(["wall","area"]),i$=new Set(["void","desk-entrance"]),s$=(e,r)=>{let t={},o={},n={},i={},a={},l={};for(let c of e["location.json"]||[]){let p=new Sc(r,{mvfData:c});if(t[c.id]=p,c.externalId&&(i[c.externalId]==null&&(i[c.externalId]=[]),i[c.externalId].push(p)),c.categories)for(let f of c.categories)a[f]==null&&(a[f]=[]),a[f].push(p);let u=[...c.obstructions?.map(f=>f.id)??[],...c.spaces?.map(f=>f.id)??[],...c.annotations?.map(f=>f.id)??[],...c.connections??[],...c.entrances?.map(f=>f.id)??[],...c.areas?.map(f=>f.id)??[]];for(let f of u)f&&(l[f]==null&&(l[f]=[]),l[f].push(p))}for(let c of e["category.json"]||[]){let p=new f1(r,{mvfData:c});o[c.id]=p,c.parent&&(n[c.parent]==null&&(n[c.parent]=[]),n[c.parent].push(p))}return{locationCategoriesByParentId:n,locationProfilesById:t,locationCategoriesById:o,locationProfilesByExternalId:i,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:l}},a$=(e,r,t)=>{let o={},n={},i={},a={},l={},c={},p={},u={},f={},h={},b={},v=globalThis.Object.keys(e.space);for(let T of v){let x=e.space[T];if(x!=null){for(let I of x.features)if(b[I.properties.id]=T,c[I.properties.id]=I,I.properties.kind==="desk-entrance"&&(l[I.properties.externalId]==null&&(l[I.properties.externalId]=[]),l[I.properties.externalId].push(...I.properties.destinationNodes)),!v$(I)){if(I.properties.kind?.includes("connection")){let M=qi(I.geometry.coordinates);f[M]==null&&(f[M]=[]),f[M].push(I.properties.id);continue}if(I.properties.kind==="poi"||I.geometry.type==="Point"&&I.properties.kind==null){let M=new sn(t,{floorId:T,mvfData:I});i[I.properties.id]=M,u[T]||(u[T]=[]),u[T].push(I),I.properties.externalId&&(a[I.properties.externalId]==null&&(a[I.properties.externalId]=[]),a[I.properties.externalId].push(M))}else if(I.geometry.type==="Point")A.warn("Encountered a point space with an unknown kind!",I.properties.kind);else{let M=new vr(t,{floorId:T,mvfData:I});o[I.properties.id]=M,I.properties.externalId&&(n[I.properties.externalId]==null&&(n[I.properties.externalId]=[]),n[I.properties.externalId].push(M)),p[T]||(p[T]=[]),p[T].push(I)}}}}for(let T in f){let x=f[T],I={};for(let O of x){let C=b[O],E=c[O],_=r?.["n_"+E.properties.id.split("s_")[1]];I[C]={...E,properties:{...E.properties,accessible:_?.accessible===!0}}}let M=new an(t,{mvfDataByFloorId:I});h[M.id]=M}return{spacesById:o,spacesByExternalId:n,poisById:i,poisByExternalId:a,connectionsById:h,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:c,connectionIdsByLatLon:f,mvfSpacesByFloorId:p,mvfPoisByFloorId:u}},l$=(e,r)=>{let t={},o={},n={},i={};for(let a of e["node.geojson"].features){n[a.properties.id]=a;let l=new wn(r,{mvfData:a,floorId:a.properties.floor??a.properties.map});t[a.properties.id]=l,a.properties.externalId&&(o[a.properties.externalId]==null&&(o[a.properties.externalId]=[]),o[a.properties.externalId].push(l));let c=a.properties.floor??a.properties.map;i[c]||(i[c]=[]),i[c].push(a)}return{nodesById:t,nodesByExternalId:o,mvfNodesById:n,mvfNodesByFloorId:i}},c$=(e,r)=>{let t={},o={},n={},i={},a=globalThis.Object.keys(e.obstruction);for(let l of a){let c=e.obstruction[l];if(c!=null)for(let p of c.features){n[p.properties.id]=p;for(let f of p.properties.entrances)i[f]=p.properties.id;if(n$.has(p.properties.kind?.toLowerCase()??""))continue;let u=new No(r,{floorId:l,mvfData:p});t[p.properties.id]=u,p.properties.externalId&&(o[p.properties.externalId]==null&&(o[p.properties.externalId]=[]),o[p.properties.externalId].push(u))}}return{objectsById:t,objectsByExternalId:o,mvfObstructionById:n,obstructionIdByEntranceId:i}},p$=(e,r)=>{let t={},o={},n={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let i of e["floor.geojson"].features){n[i.properties.id]=i.properties;let a=new Bo(r,{mvfData:i});t[i.properties.id]=a,i.properties.externalId&&(o[i.properties.externalId]==null&&(o[i.properties.externalId]=[]),o[i.properties.externalId].push(a))}else for(let i of e["map.geojson"]){n[i.id]=i;let a=new Bo(r,{mvfData:{properties:i}});t[i.id]=a}return{floorsById:t,floorsByExternalId:o,mvfFloorsById:n}},d$=(e,r)=>{let t={},o={},n={},i={},a={},l=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(l!=null)for(let c of l){let p=e.facade?.[c.id],u=new u1(r,{mvfData:c,facadeId:p?.id});if(t[c.id]=u,c.externalId&&(o[c.externalId]==null&&(o[c.externalId]=[]),o[c.externalId].push(u)),n[c.id]=c,p){let f=new Ar(r,{mvfData:p,floorStackId:c.id});i[p.id]=f;for(let h of p.spaces)a[h.spaceId]=f}}return{floorStacksById:t,floorStacksByExternalId:o,mvfFloorStacksById:n,facadesById:i,facadesBySpaceId:a}},u$=(e,r)=>{let t={},o={},n=e["connection.json"].reduce((i,a)=>{a.nodes.forEach(c=>i[c]=a),t[a.id]=a;let l=r?.[a.nodes[0]];if(l!=null){let c=qi(l.geometry.coordinates);o[c]==null&&(o[c]=[]),o[c].push(a.id)}return i},{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:n,mvfConnectionIdsByLatLon:o}},m$=(e,r)=>{let t={},o={},n={},i={},a={},l=globalThis.Object.keys(e.entrance);for(let c of l){let p=e.entrance[c];if(p!=null)for(let u of p.features){i[u.properties.id]=u;let f=new go(r,{floorId:c,mvfData:u});u.properties.node&&(n[u.properties.node]=f),t[u.properties.id]=f,u.properties.externalId&&(o[u.properties.externalId]==null&&(o[u.properties.externalId]=[]),o[u.properties.externalId].push(f)),a[c]||(a[c]=[]),a[c].push(u)}}return{doorsById:t,doorsByExternalId:o,doorsByNodeId:n,mvfEntrancesById:i,mvfEntrancesByFloorId:a}},f$=(e,r,t)=>{if(e.textAreas!=null)for(let o in e.textAreas){let n=e.textAreas[o]?.features;if(n!=null){for(let i of n)if("anchorId"in i.properties){let a=i?.properties,l=r[a.anchorId]||t[a.anchorId];if(l!=null&&a!=null){let c=l.properties;c.textArea=a,c.textArea&&(c.textArea.position=i.geometry.coordinates)}}}}},h$=(e,r,t)=>{if(e.floorImages!=null)for(let o in e.floorImages){let n=e.floorImages[o]?.features;if(n!=null){for(let i of n)if("anchorId"in i.properties){let a=i?.properties,l=r[a.anchorId]||t[a.anchorId];if(l!=null&&a!=null){let c=l.properties;c.image=a,c.image&&(c.image.position=i.geometry.coordinates)}}}}},g$=(e,r)=>{if(e.enterprise?.enterpriseStyles==null)return;let t=e.enterprise?.enterpriseStyles;for(let o in t){let n=t[o];n.geometryAnchors.forEach(i=>{let a=r[i.geometryId];if(a!=null){let l=a.properties;l.style={styleId:o,edgeOffset:n.edgeOffset}}})}},y$=(e,r,t)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let o of e.enterprise.textures)for(let n of o.geometryAnchors){let i=r[n.geometryId]||t[n.geometryId];if(i!=null){let a=i.properties;a.textures==null&&(a.textures=[]),a.textures.push(o)}}},b$=(e,r)=>{let t={},o={},n={};if(e.annotation==null)return{annotationsById:t,mvfAnnotationsById:o,mvfAnnotationsByFloorId:n};let i=globalThis.Object.keys(e.annotation);for(let a of i){let l=e.annotation[a];if(l!=null)for(let c of l.features){o[c.properties.id]=c;let p=new ia(r,{floorId:a,mvfData:c});t[c.properties.id]=p,n[a]||(n[a]=[]),n[a].push(c)}}return{annotationsById:t,mvfAnnotationsById:o,mvfAnnotationsByFloorId:n}},x$=(e,r)=>{let t={},o={},n={};if(e.area==null)return{areasById:t,areasByExternalId:o,mvfAreasById:n};let i=globalThis.Object.keys(e.area);for(let a of i){let l=e.area[a];if(l!=null)for(let c of l.features){n[c.properties.id]=c;let p=new On(r,{floorId:a,mvfData:c});t[c.properties.id]=p,c.properties.externalId&&(o[c.properties.externalId]==null&&(o[c.properties.externalId]=[]),o[c.properties.externalId].push(p))}}return{areasById:t,areasByExternalId:o,mvfAreasById:n}},R5=(e,r)=>{let t={},o={},n={},i={},a=(e.enterprise?.locations??[]).reduce((M,O)=>(M[O.id]=O,M),{}),l={},c={},p={},u={},f={},h={},b=e.enterprise?.venue||{},v={},T={},x={};for(let M of e.enterprise?.categories??[]){let O=new m1(r,{mvfData:M});l[M.id]=O,M.externalId&&(c[M.externalId]==null&&(c[M.externalId]=[]),c[M.externalId].push(O)),p[M.id]=M,M.locations.forEach(C=>{f[C]==null&&(f[C]=[]),f[C].push(M.id)})}let I={};for(let M of e.enterprise?.locationInstances??[]){let O=a[M.parent],C=Object.keys(O),E={};for(let G of C)E[G]=void 0;let _={...E,polygons:[],nodes:[],...M};I[_.parent]==null&&(I[_.parent]=[]),I[_.parent].push(new es(r,{mvfData:_,categoryIds:e.enterprise?.categoryPriorities?.[_.id]||f[_.id],parentId:M.parent})),v[_.id]=M}for(let M in e.space){let O=e.space[M];if(O!=null)for(let C of O.features){for(let E of C.properties.destinationNodes)T[E]==null&&(T[E]=[]),T[E].push(C.properties.id);x[C.properties.id]=C.properties.destinationNodes}}for(let M of e.enterprise?.locations??[]){let O=new es(r,{mvfData:M,categoryIds:e.enterprise?.categoryPriorities?.[M.id]||f[M.id],locationInstances:I[M.id]});n[M.id]=O,M.externalId&&(i[M.externalId]==null&&(i[M.externalId]=[]),i[M.externalId].push(O)),M.nodes.forEach(C=>{h[C.id]==null&&(h[C.id]=[]),h[C.id].push(M.id)});for(let C of M.polygons)u[C.id]==null&&(u[C.id]=[]),u[C.id].push(M)}if(r.enterpriseMode===!0){for(let M in r.mvfConnectionsById){let O={},C=r.mvfConnectionsById[M];for(let E of r.mvfConnectionsById[M].nodes){let _=r.nodesById[E];_!=null&&(O[_.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[_.coordinate.longitude,_.coordinate.latitude]},properties:{id:M,externalId:C.externalId,kind:"enterprise."+C.type,destinationNodes:[],flags:"",type:C.type,nodes:C.nodes,accessible:C.accessible,extra:C.extra,details:C.details}})}Object.keys(O).length>0&&(t[M]=new an(r,{mvfDataByFloorId:O}),C.externalId&&(o[C.externalId]==null&&(o[C.externalId]=[]),o[C.externalId].push(t[M])))}r.connectionsById=t}return{spaceIdsByNodeId:T,connectionsByExternalId:o,locationIdsByNodeId:h,mvfLocationsBySpaceId:u,mvfLocationsById:a,mvfCategoriesById:p,locationsById:n,locationsByExternalId:i,locationInstancesById:v,categoriesById:l,categoriesByExternalId:c,destinationNodesIdsBySpaceId:x,venue:b}},B5=(e,r)=>{let{nodesById:t,nodesByExternalId:o,mvfNodesById:n,mvfNodesByFloorId:i}=l$(e,r),{mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfConnectionIdsByLatLon:c}=u$(e,n),{spacesById:p,spacesByExternalId:u,poisById:f,poisByExternalId:h,mvfSpacesById:b,objectEntranceNodeIdsByObstructionId:v,connectionsById:T,connectionIdsByLatLon:x,mvfSpacesByFloorId:I,mvfPoisByFloorId:M}=a$(e,l,r),{objectsById:O,objectsByExternalId:C,mvfObstructionById:E,obstructionIdByEntranceId:_}=c$(e,r),{floorsById:G,floorsByExternalId:R,mvfFloorsById:N}=p$(e,r),{floorStacksById:X,floorStacksByExternalId:z,mvfFloorStacksById:ee,facadesById:re,facadesBySpaceId:ue}=d$(e,r),{doorsById:Ce,doorsByExternalId:Oe,doorsByNodeId:Pe,mvfEntrancesById:Fe,mvfEntrancesByFloorId:ce}=m$(e,r),{annotationsById:Ee,mvfAnnotationsById:ye,mvfAnnotationsByFloorId:Ge}=b$(e,r),{areasById:Ie,areasByExternalId:Xe,mvfAreasById:se}=x$(e,r);h$(e,b,E),f$(e,b,E),g$(e,b),y$(e,b,E);let{locationCategoriesByParentId:nt,locationProfilesById:dt,locationCategoriesById:$t,locationProfilesByExternalId:k,locationProfilesByCategoryId:H,locationProfilesByAttachedFeatureId:P}=s$(e,r);return{spacesById:p,spacesByExternalId:u,nodesById:t,nodesByExternalId:o,objectsById:O,objectsByExternalId:C,floorsById:G,floorsByExternalId:R,floorStacksById:X,floorStacksByExternalId:z,facadesById:re,facadesBySpaceId:ue,connectionsById:T,doorsById:Ce,doorsByExternalId:Oe,doorsByNodeId:Pe,poisById:f,poisByExternalId:h,annotationsById:Ee,areasById:Ie,areasByExternalId:Xe,objectEntranceNodeIdsByObstructionId:v,obstructionIdByEntranceId:_,connectionIdsByLatLon:x,locationProfilesById:dt,locationCategoriesById:$t,locationProfilesByExternalId:k,locationProfilesByCategoryId:H,locationCategoriesByParentId:nt,mvfSpacesById:b,mvfNodesById:n,mvfObstructionById:E,mvfFloorsById:N,mvfFloorStacksById:ee,mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfEntrancesById:Fe,mvfAnnotationsById:ye,mvfNodesByFloorId:i,mvfSpacesByFloorId:I,mvfPoisByFloorId:M,mvfAreasById:se,mvfEntrancesByFloorId:ce,mvfAnnotationsByFloorId:Ge,locationProfilesByAttachedFeatureId:P,mvfConnectionIdsByLatLon:c}};function v$(e){return!["Polygon","MultiPolygon"].includes(e.geometry.type)&&"kind"in e.properties&&e.properties.kind==null||i$.has(e.properties.kind??"")}d();var I$=new Set(["polygons"]),Dn,bt,ao,Ef,tu=class tu extends xr{constructor(t,o){super(o.mvfData.externalId);m(this,"__type",tu.__type);m(this,"description");m(this,"name","");m(this,"amenity");m(this,"externalId","");m(this,"extra");m(this,"gallery");m(this,"instances");m(this,"logo");m(this,"operationHours");m(this,"phone");m(this,"picture");m(this,"shortName");m(this,"showFloatingLabelWhenImagePresent");m(this,"showLogo");m(this,"siblingGroups");m(this,"social");m(this,"sortOrder",-1);m(this,"states");m(this,"tags");m(this,"type","");m(this,"hidden",!1);m(this,"primaryCategory");S(this,Dn);S(this,bt,{});S(this,ao);S(this,Ef);w(this,Dn,t),w(this,ao,o.mvfData),w(this,Ef,o.categoryIds||[]),this.instances=o.locationInstances||[];for(let n in o.mvfData)!I$.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(o.parentId){let i=s(this,Dn).locationsById[o.parentId];return s(this,ao)[n]!=null?s(this,Dn).getPropTranslation(this.__type,n,s(this,ao).id,s(this,ao)[n]):s(this,Dn).getPropTranslation(this.__type,n,s(this,ao).id,i[n])}return s(this,Dn).getPropTranslation(this.__type,n,s(this,ao).id,s(this,ao)[n])}})}static is(t){return t.__type===tu.__type}get focusTarget(){return this.spaces}get categories(){return s(this,bt).categories?s(this,bt).categories:(s(this,bt).categories=(s(this,Ef).map(t=>s(this,Dn).getById("enterprise-category",t))||[]).filter(Boolean),s(this,bt).categories)}get coordinates(){if(s(this,bt).coordinates)return s(this,bt).coordinates;s(this,bt).coordinates=[];for(let t=0;t<this.nodes.length;t++)s(this,bt).coordinates.push(this.nodes[t].coordinate);return s(this,bt).coordinates}get nodes(){if(s(this,bt).nodes)return s(this,bt).nodes;s(this,bt).nodes=[];for(let t=0;t<s(this,ao).nodes.length;t++){let o=s(this,Dn).getById("node",s(this,ao).nodes[t].id);o&&s(this,bt).nodes.push(o)}return s(this,bt).nodes}get points(){if(s(this,bt).points)return s(this,bt).points;s(this,bt).points=[];for(let t=0;t<s(this,ao).spaces.length;t++){let o=s(this,Dn).getById("point-of-interest",s(this,ao).spaces[t].id);o&&s(this,bt).points.push(o)}return s(this,bt).points}get spaces(){if(s(this,bt).spaces)return s(this,bt).spaces;s(this,bt).spaces=[];for(let t=0;t<s(this,ao).polygons.length;t++){let o=s(this,Dn).getById("space",s(this,ao).polygons[t].id);o&&s(this,bt).spaces.push(o)}return s(this,bt).spaces}toJSON(){return{__type:tu.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,bt)))delete s(this,bt)[t]}};Dn=new WeakMap,bt=new WeakMap,ao=new WeakMap,Ef=new WeakMap,m(tu,"__type","enterprise-location");var e2=tu,es=e2;d();var S$=new Set,Tc,yo,is,ru=class ru extends xr{constructor(t,o){super(o.mvfData.externalId);m(this,"__type",ru.__type);m(this,"name","");m(this,"color");m(this,"externalId","");m(this,"extra");m(this,"icon");m(this,"iconFromDefaultList");m(this,"sortOrder",-1);m(this,"picture");S(this,Tc);S(this,yo,{});S(this,is);w(this,Tc,t),w(this,is,o.mvfData);for(let n in o.mvfData)!S$.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,Tc).getPropTranslation(this.__type,n,s(this,is).id,s(this,is)[n])}})}static is(t){return t.__type===ru.__type}get children(){if(s(this,yo).children)return s(this,yo).children;s(this,yo).children=[];for(let t=0;t<s(this,is).children.length;t++){let o=s(this,Tc).getById("enterprise-category",s(this,is).children[t]);o&&s(this,yo).children.push(o)}return s(this,yo).children}get locations(){if(s(this,yo).locations)return s(this,yo).locations;s(this,yo).locations=[];for(let t=0;t<s(this,is).locations.length;t++){let o=s(this,Tc).getById("enterprise-location",s(this,is).locations[t]);o&&s(this,yo).locations.push(o)}return s(this,yo).locations}toJSON(){return{__type:ru.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,yo)))delete s(this,yo)[t]}};Tc=new WeakMap,yo=new WeakMap,is=new WeakMap,m(ru,"__type","enterprise-category");var t2=ru,m1=t2;d();var T$=new Set,Pf,nu,ou=class ou extends xr{constructor(t,o){super(o.mvfData.externalId);m(this,"__type",ou.__type);m(this,"countrycode");m(this,"coverImage");m(this,"externalId","");m(this,"defaultLanguage",{code:"en",name:"English"});m(this,"defaultFloor");m(this,"extra");m(this,"icon");m(this,"languages",[]);m(this,"links",[]);m(this,"logo");m(this,"mappedinWebUrl");m(this,"operationHours");m(this,"slug","");m(this,"topLocations");m(this,"tzid");S(this,Pf,{});S(this,nu);w(this,nu,o.mvfData);for(let n in o.mvfData)!T$.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=o.mvfData[n])}static is(t){return t.__type===ou.__type}get name(){return s(this,nu).name??""}get defaultMap(){return s(this,nu).defaultMap??this.defaultFloor??""}toJSON(){return{__type:ou.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,Pf)))delete s(this,Pf)[t]}};Pf=new WeakMap,nu=new WeakMap,m(ou,"__type","enterprise-venue");var r2=ou,o2=r2;d();d();function Ff(e,r,t=[]){let o={...e};for(let[n,i]of Object.entries(r))if(i!==void 0)if(n in o){let a=n;if(Array.isArray(i)&&i.length>0){let l=C$(i[0],t);if(l){let c=o[a];if(!Array.isArray(c))throw new Error(`Expected array at ${n}, got ${typeof c}`);let p=new Map(i.map(h=>[N5(h,l),h])),f=c.map(h=>{let b=p.get(N5(h,l));return b?Ff(h,b,t):h});o[a]=f}else o[a]=i}else{let l=o[a];typeof l=="object"&&l!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?o[a]=i:o[a]=Ff(l,i,t):o[n]=i}}else o[n]=i;return o}function C$(e,r){function t(o){if(typeof o!="object"||o===null)return null;for(let n of r)if(n in o&&typeof o[n]<"u")return[n];if(Array.isArray(o))return null;for(let[n,i]of Object.entries(o)){let a=t(i);if(a)return[n,...a]}return null}return t(e)}function N5(e,r){return r.reduce((t,o)=>{if(t&&typeof t=="object")return t[o]},e)}d();d();d();d();d();var j5=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(j5||{}),n2=(a=>(a.Straight="Straight",a.Right="Right",a.SlightRight="SlightRight",a.Left="Left",a.SlightLeft="SlightLeft",a.Back="Back",a))(n2||{}),G5=(p=>(p.stairs="stairs",p.elevator="elevator",p.escalator="escalator",p.door="door",p.ramp="ramp",p.slide="slide",p.portal="portal",p.security="security",p.shuttle="shuttle",p))(G5||{}),h1=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(h1||{}),g1=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(g1||{});function kn(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}function M$(e){return new Map(e.map(r=>{let{properties:t}=r,{id:o}=t;return[o,r]}))}var i2=(e,r)=>{let t=M$(r),o={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of e){let i=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((l,c)=>(t.has(c)&&l.push(t.get(c)),l),[]);if(a.length){let{entrances:l,obstructions:c}=kS(n,a);i=c.map(p=>p.geometry.coordinates),o.entrances.features.push(...l)}o.walls.geometry.coordinates.push(...i)}return o};function U5(e,r){return((r-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function V5(e,r){let t="Left";return e<=-Math.PI/4?t="Right":e<=-r?t="SlightRight":e<=r?t="Straight":e<=Math.PI/4?t="SlightLeft":t="Left",t}function $5(e){let r={};for(let t in e){let o=e[t];if(o!=null){if(o.id=t,"polygons"in o)for(let n of o.polygons)r[n]=o;else if("lineStrings"in o)for(let n of o.lineStrings)r[n]=o;else if("points"in o)for(let n of o.points)r[n]=o}}return r}function y1(e,r){return e.reduce((t,o)=>{let n=r[o.properties.id];if(n==null)return t;if("textures"in o.properties&&Array.isArray(o.properties.textures)&&o.properties.textures.length>0){let i={...n,id:n.id+"-textures"};t.set(i,[o])}else t.has(n)||t.set(n,[]),t.get(n).push(o);return t},new Map)}function iu(e,r={}){let t={...e,flipImageToFaceCamera:r?.flipImagesToFaceCamera??!0},o=r?.style?.shading??r?.shadingAndOutlines;if(o===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof o=="object"&&(t.shading={start:o.start,end:o.end,intensity:o.intensity}),t.outline=r?.style?.outlines??r?.shadingAndOutlines,"lineStrings"in e){let n=r?.style?.wallTopColor??r?.wallTopColor;n!=null&&(t.topColor=n)}return t}var H5=(e,r)=>{let o=(r.currentMap?.currentFloor).layers.get(rr);switch(e){case"interior-walls":return o?.layers.get(sl);case"exterior-walls":return o?.layers.get(ts);case"interior-doors":return o?.layers.get(Ud);case"exterior-doors":return o?.layers.get(Vd);default:return typeof e=="string"?e:e.id}};function s2(e){return new Promise(r=>{e.onComplete(r),e.onStop(r)})}function b1(e){return e.bbox?e.bbox:Ip(e)}function z5(e,r){return[Math.min(e[0],r[0]),Math.min(e[1],r[1]),Math.max(e[2],r[2]),Math.max(e[3],r[3])]}function a2(e,r,t){return e.floorId&&r.has(e.floorId)?r.get(e.floorId):t}function su(e){if(vr.is(e)||No.is(e))return e.id}function W5(e,r,t){let o=e.coordinates.length===2&&e.coordinates[0].floorId!==e.coordinates[1].floorId,n=!0;if(o&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let i=r?.getById("floor",e.coordinates[0].floorId),a=r?.getById("floor",e.coordinates[1].floorId);if(i&&a){let l=t.getState(i),c=t.getState(a);l!=null&&c!=null&&(n=l.visible&&c.visible&&l.altitude!==c.altitude)}}else{let i=e.coordinates[0].floorId!=null?r?.getById("floor",e.coordinates[0].floorId):void 0;n=i?t.getState(i)?.visible??!0:!0}return n}function Z5(e,r){let t=e.properties.path.split("/"),o=t[t.length-1].split(".")[0],n=atob(o);return"img_"+ay(n).toString()+"-"+r}var X5=Math.PI*.1,bo,jo,ln,aa,Cc,lu,An,Y5,au,J5,ml=class{constructor(r,t,o,n,i){S(this,An);m(this,"id");S(this,bo,{});S(this,jo);S(this,ln);m(this,"departure");m(this,"destination");S(this,aa);S(this,Cc);S(this,lu);this.id=i?.id??ut(),w(this,jo,t),w(this,ln,r.features),this.departure=o,this.destination=n}get path(){return s(this,ln).map(r=>s(this,jo).getById("node",r.properties.id)).filter(Boolean)}get coordinates(){return s(this,bo).coordinates?s(this,bo).coordinates:(s(this,bo).coordinates=s(this,ln).map(r=>new fe(r.geometry.coordinates[1],r.geometry.coordinates[0],r.properties.groupBy)),s(this,bo).coordinates)}get distance(){return s(this,bo).distance?s(this,bo).distance:(s(this,bo).distance=s(this,ln).reduce((r,t)=>r+(t.properties.distance||0),0),s(this,bo).distance)}get instructions(){if(s(this,ln).length<2)return[];if(s(this,bo).instructions)return s(this,bo).instructions;let r=[],t=0;for(let o=0;o<s(this,ln).length;o++){let n=s(this,ln)[o],i=s(this,ln)[o-1],a=s(this,ln)[o+1],l=new fe(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=W(this,An,Y5).call(this,{prevDirection:i,direction:n,nextDirection:a});t+=i?.properties.distance||0;for(let p of c)p&&(r.push({action:p,distance:t,coordinate:l,node:s(this,jo).getById("node",n.properties.id)}),t=0)}return s(this,bo).instructions=r,s(this,bo).instructions}toJSON(){return{id:this.id,directions:s(this,ln),__type:"directions",from:this.departure,to:this.destination}}};bo=new WeakMap,jo=new WeakMap,ln=new WeakMap,aa=new WeakMap,Cc=new WeakMap,lu=new WeakMap,An=new WeakSet,Y5=function(r){let{prevDirection:t,direction:o,nextDirection:n}=r,i=t&&s(this,jo).getById("floor",t.properties.groupBy),a=s(this,jo).getById("floor",o.properties.groupBy),l=n&&s(this,jo).getById("floor",n.properties.groupBy),c=[];t||c.push({type:"Departure"});let p=s(this,jo).getMVFFeatureByNodeId("connection",o.properties.id),u=p?s(this,jo).getById("connection",p.id):void 0,f=p&&p.nodes.length>1,h=s(this,jo).enterpriseMode&&(!o.properties.destination||!p?.nodes.includes(o.properties.destination)||!p?.nodes.includes(o.properties.id));if(p&&!(!f||h))if(!s(this,aa)||s(this,aa)==="exit")c.push(W(this,An,au).call(this,"TakeConnection",a,l,u,p)),w(this,aa,"take"),w(this,Cc,u),w(this,lu,p);else{let v=s(this,jo).getMVFFeatureByNodeId("connection",t?.properties.id??""),T=s(this,jo).getById("connection",v?.id??"");c.push(W(this,An,au).call(this,"ExitConnection",a,i,T,v)),w(this,aa,"exit"),w(this,Cc,u),w(this,lu,p)}else s(this,aa)==="take"?(c.push(W(this,An,au).call(this,"ExitConnection",a,i,s(this,Cc),s(this,lu))),w(this,aa,"exit"),w(this,Cc,u)):l&&a?.id!==l.id?c.push(W(this,An,au).call(this,"TakeConnection",a,l,u)):i&&i.id!==a?.id?c.push(W(this,An,au).call(this,"ExitConnection",a,i,u)):c.push(W(this,An,J5).call(this,t,o));return n||c.push({type:"Arrival"}),c},au=function(r,t,o,n,i){let a="none",l=t?t.elevation:0;if(l!=null&&o?.elevation!=null){let p=l-o.elevation;p>0?a="down":p<0&&(a="up")}let c=n?.type??i?.type??"stairs";return{type:r,fromFloor:t,toFloor:o,direction:a,connection:n,connectionType:c}},J5=function(r,t){let o=t.properties.edges;if(!o||o.filter(a=>a.destination.properties.id!==r?.properties.id&&a.destination.properties.id!==t.properties.destination).length===0)return null;let i=r?-U5(r.properties.angle,t.properties.angle):0;return Math.abs(i)>=X5?{type:"Turn",bearing:V5(i,X5),referencePosition:"At"}:null};d();d();d();d();d();d();d();var Mc=class{constructor({origin:r,destination:t,distance:o=0,angle:n=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:a=!0}){m(this,"origin");m(this,"destination");m(this,"distance");m(this,"angle");m(this,"weight");if(this.origin=r,this.destination=t,this.distance=o,this.angle=n,this.weight=i||0,a?r.properties.floor===t.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):r.properties.map===t.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};d();d();d();function la(e,r,t){if(t===void 0&&(t={}),!e)throw new Error("point is required");if(!r)throw new Error("polygon is required");var o=Mn(e),n=Cd(r),i=n.type,a=r.bbox,l=n.coordinates;if(a&&w$(o,a)===!1)return!1;i==="Polygon"&&(l=[l]);for(var c=!1,p=0;p<l.length&&!c;p++)if(K5(o,l[p][0],t.ignoreBoundary)){for(var u=!1,f=1;f<l[p].length&&!u;)K5(o,l[p][f],!t.ignoreBoundary)&&(u=!0),f++;u||(c=!0)}return c}function K5(e,r,t){var o=!1;r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]&&(r=r.slice(0,r.length-1));for(var n=0,i=r.length-1;n<r.length;i=n++){var a=r[n][0],l=r[n][1],c=r[i][0],p=r[i][1],u=e[1]*(a-c)+l*(c-e[0])+p*(e[0]-a)===0&&(a-e[0])*(c-e[0])<=0&&(l-e[1])*(p-e[1])<=0;if(u)return!t;var f=l>e[1]!=p>e[1]&&e[0]<(c-a)*(e[1]-l)/(p-l)+a;f&&(o=!o)}return o}function w$(e,r){return r[0]<=e[0]&&r[1]<=e[1]&&r[2]>=e[0]&&r[3]>=e[1]}d();d();function ca([e,r],[t,o]){let n=r-o,i=e-t;return(Math.atan2(i,n)+Math.PI*3)%(Math.PI*2)}d();var O$=63710088e-1;function pi(e,r){let[t,o]=e.map(u=>u*Math.PI/180),[n,i]=r.map(u=>u*Math.PI/180),a=i-o,l=n-t,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(o)*Math.cos(i)*Math.sin(l/2)*Math.sin(l/2),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return O$*p}d();d();function x1(e,r,t,o){let[n,i]=e,[a,l]=r,[c,p]=t,[u,f]=o;if(i===l&&n===a||p===f&&c===u)return null;let h=(u-c)*(l-i)-(f-p)*(a-n);if(h===0)return null;let b=((f-p)*(n-c)-(u-c)*(i-p))/h,v=((l-i)*(n-c)-(a-n)*(i-p))/h;if(b<0||b>1||v<0||v>1)return null;let T=i+b*(l-i);return[n+b*(a-n),T]}d();function l2(e,r,t,o){let n=oc(e,t/1e3,o),i=oc(r,t/1e3,o);return[n.geometry.coordinates,i.geometry.coordinates]}d();function c2(e){let r=e*(180/Math.PI);return r=r%360,r>180?r-=360:r<-180&&(r+=360),Object.is(r,-0)?0:r}var Q5=111e3;function v1(e,r,t=[],o=0){let n=!0,i=e.geometry.coordinates,a=r.geometry.coordinates,l=c2(ca(i,a)-Math.PI/2),c=c2(ca(i,a)+Math.PI/2),p=o/Q5,u=o/(Q5*Math.cos(i[1]*Math.PI/180)),f=Math.min(i[1],a[1])-p,h=Math.max(i[1],a[1])+p,b=Math.min(i[0],a[0])-u,v=Math.max(i[0],a[0])+u;for(let T of t)if(!(Math.max(T[0][1],T[1][1])<f||Math.min(T[0][1],T[1][1])>h||Math.max(T[0][0],T[1][0])<b||Math.min(T[0][0],T[1][0])>v)){if(o>0){let x=l2(i,a,o,l),I=l2(i,a,o,c);if(x1(x[0],x[1],T[0],T[1])||x1(I[0],I[1],T[0],T[1]))return n=!1,!1}else if(x1(i,a,T[0],T[1]))return n=!1,!1}return n}var d2=.4,wc,Xr,p2,q5,eD,tD,rD,oD,nD,S1,I1=class{constructor({nodes:r,groupBy:t,multiplicativeDistanceWeightScaling:o}){S(this,Xr);m(this,"edges",{});m(this,"nodesById");m(this,"nodesByGroup",new Map);S(this,wc);m(this,"hasLineOfSight",(r,t,o=[],n=d2)=>v1({type:"Feature",properties:{id:"origin",neighbors:[]},geometry:{type:"Point",coordinates:r}},{type:"Feature",properties:{id:"destination",neighbors:[]},geometry:{type:"Point",coordinates:t}},o,n)===!0);S(this,S1,(r,t)=>{let o=0;for(let n of t)(!n[s(this,wc)]||n[s(this,wc)]===r.properties[s(this,wc)])&&la(r.geometry.coordinates,n.geometry.geometry)&&(o+=Math.max(0,n.cost));return o});w(this,wc,t);let{features:n}=r;this.nodesById=W(this,Xr,q5).call(this,n),W(this,Xr,eD).call(this),W(this,Xr,tD).call(this,n,t,{multiplicativeDistanceWeightScaling:o})}getShortestEuclideanDistance(r,t){return t.reduce((o,n)=>{let i=pi(r.geometry.coordinates,n.geometry.coordinates);return Math.min(o,i)},Number.MAX_VALUE)}dijkstraFindWithinTravelDistance(r,t,o,n,i){let a=this.nodesById[r];if(!a)return[];let l=[],c={},p={},u=new Set,f=[];for(l.push({node:a,distance:0}),c[a.properties.id]=null,p[a.properties.id]=0;l.length>0;){l.sort((T,x)=>T.distance-x.distance);let h=l.shift();if(!h)break;let b=h.node,v=h.distance;if(!u.has(b.properties.id)){u.add(b.properties.id),b.properties.id!=null&&o.includes(b.properties.id?.toString())&&(i?this.hasLineOfSight(a.geometry.coordinates,b.geometry.coordinates,n)&&f.push({feature:b,distance:v}):f.push({feature:b,distance:v}));for(let T of this.edges[b.properties.id]){let x=T.destination,I=v+T.distance,M=p[b.properties.id]+T.weight;I>t||u.has(x.properties.id)||p[x.properties.id]!==void 0&&M>=p[x.properties.id]||(p[x.properties.id]=M,c[x.properties.id]=T,l.push({node:x,distance:I}))}}}return f.sort((h,b)=>h.distance-b.distance)}aStar({originIds:r,destinationNodeIds:t,disabledConnectionNodeIds:o,zones:n,overrideEdgeWeights:i}){let a=W(this,Xr,p2).call(this,r),l=W(this,Xr,p2).call(this,t);if(a.length===0||l.length===0)return[];let{frontier:c,cameFrom:p,costSoFar:u}=W(this,Xr,rD).call(this,a,l);for(;c.length>0;){let f=c.shift();if(!f)break;if(W(this,Xr,oD).call(this,f.origin,l))return W(this,Xr,nD).call(this,p,f.origin.properties.id);for(let h of this.edges[f.origin.properties.id]){let b=i?.get(h)??h.weight;if(o?.has(h.origin.properties.id)&&h.destination.properties.map!==h.origin.properties.map)continue;let v=u[f.origin.properties.id]+b+s(this,S1).call(this,h.destination,n);if(v!==1/0&&(u[h.destination.properties.id]==null||v<u[h.destination.properties.id])){let T=v+this.getShortestEuclideanDistance(h.destination,l);u[h.destination.properties.id]=v,p[h.destination.properties.id]=h,c.push({origin:h.destination,priority:T})}}c.sort((h,b)=>h.priority-b.priority)}return[]}};wc=new WeakMap,Xr=new WeakSet,p2=function(r){return r.map(t=>this.nodesById[t]).filter(Boolean)},q5=function(r){return r.reduce((t,o)=>(t[o.properties.id]=o,t),{})},eD=function(){for(let r in this.nodesById)this.nodesById.hasOwnProperty(r)&&(this.nodesById[r].properties.neighbors=this.nodesById[r].properties.neighbors.filter(({id:t})=>!!this.nodesById[t]))},tD=function(r,t,o){r.forEach(n=>{let i=t==="default"?t:n.properties[t];this.nodesByGroup.has(i)||this.nodesByGroup.set(i,[]),this.nodesByGroup.get(i).push(n),this.edges[n.properties.id]=n.properties.neighbors.map(({id:a,weight:l})=>{let c=this.nodesById[a],p=pi(n.geometry.coordinates,c.geometry.coordinates),u=ca(n.geometry.coordinates,c.geometry.coordinates);return new Mc({origin:n,destination:c,pathWeight:l,distance:p,angle:u,multiplicativeDistanceWeightScaling:o?.multiplicativeDistanceWeightScaling})})})},rD=function(r,t){let o=[],n={},i={};return r.forEach(a=>{let l=this.getShortestEuclideanDistance(a,t);o.push({origin:a,priority:l}),n[a.properties.id]=null,i[a.properties.id]=0}),o.sort((a,l)=>a.priority-l.priority),{frontier:o,cameFrom:n,costSoFar:i}},oD=function(r,t){return t.some(o=>o.properties.id===r.properties.id)},nD=function(r,t){let o=[],n=r[t];for(;n;)o.push(n),n=r[n.origin.properties.id];return o.reverse()},S1=new WeakMap;var cu=class{constructor({nodes:r,geojsonCollection:t,groupBy:o="default",multiplicativeDistanceWeightScaling:n}){m(this,"groupBy");m(this,"graph");m(this,"geometryEdgesByMapId",new Map);m(this,"generatePath",r=>{let{destination:t}=r[r.length-1],o={type:"FeatureCollection",features:[]};for(let i=0;i<r.length;i++){let{origin:a,destination:l}=r[i],c={id:a.properties.id,angle:r[i].angle,distance:r[i].distance,destination:l.properties.id,edges:this.graph.edges[a.properties.id]};this.groupBy!=="default"&&(c.groupBy=a.properties[this.groupBy]),o.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:c})}let n={id:t.properties.id,edges:this.graph.edges[t.properties.id]};return this.groupBy!=="default"&&(n.groupBy=t.properties[this.groupBy]),o.features.push({type:"Feature",geometry:{type:"Point",coordinates:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},properties:n}),o});m(this,"findNearestNodesOnGraph",(r,t,o,n,i=!1)=>this.graph.dijkstraFindWithinTravelDistance(r,t,n,this.geometryEdgesByMapId.get(o)??[],i));m(this,"hasLineOfSight",(r,t,o,n)=>this.graph.hasLineOfSight(r,t,this.geometryEdgesByMapId.get(o),n));m(this,"getDistance",(r,t)=>pi(r,t));m(this,"getAngle",(r,t)=>ca(r,t));this.groupBy=o,this.graph=new I1({nodes:r,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:n}),(t?.features||[]).forEach(a=>{let l=null;if(a.geometry.type==="LineString"?l=a.geometry.coordinates:a.geometry.type==="Polygon"&&(l=a.geometry.coordinates.flat()),l){let c=this.groupBy==="default"?this.groupBy:a.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),l.forEach((p,u)=>{this.geometryEdgesByMapId.get(c).push([p,l[u+1]||l[0]])})}})}getDirections({zones:r,originIds:t,destinationNodeIds:o,disabledConnectionNodeIds:n,simplify:i,multiplicativeDistanceWeightScaling:a,overrideEdgeWeights:l}){let c=i?.enabled??!0,p=r??[],u=this.graph.aStar({originIds:t,destinationNodeIds:o,zones:p,disabledConnectionNodeIds:new Set(n),overrideEdgeWeights:l});return u.length===0?{type:"FeatureCollection",features:[]}:(c&&(u=this.simplifyAllSteps(u,i?.bufferRadius??d2,a)),this.generatePath(u))}simplifyAllSteps(r,t,o){let n=[],i=[r[0]];for(let p=1;p<r.length;p++)if(this.groupBy!=="default"&&r[p].origin.properties[this.groupBy]!==r[p-1].origin.properties[this.groupBy]){let u=r[p-1].origin.properties[this.groupBy],f=this.geometryEdgesByMapId.get(u)??[];n.push(...this.simplifySteps(i,f,t,o)),i=[r[p]]}else i.push(r[p]);let a=r[r.length-1],l=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],c=this.geometryEdgesByMapId.get(l)??[];return n.push(...this.simplifySteps(i,c,t,o)),n}simplifySteps(r,t,o,n){if(r.length<3)return r;let i=[r[0]],a=1;for(let l=a+2;l<r.length;l++)if(r[a].origin.properties.preventSmoothing||!v1(r[a].origin,r[l].origin,t,o)){let c=l-1;i.push(new Mc({...r[a],destination:r[c].origin,distance:pi(r[a].origin.geometry.coordinates,r[c].origin.geometry.coordinates),angle:ca(r[a].origin.geometry.coordinates,r[c].origin.geometry.coordinates)})),a=c}return i.push(new Mc({...r[a],destination:r[r.length-1].origin,distance:pi(r[a].origin.geometry.coordinates,r[r.length-1].origin.geometry.coordinates),angle:ca(r[a].origin.geometry.coordinates,r[r.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:n}),r[r.length-1]),i}};d();var Dt=new WeakMap;function pu(e,r){if(Dt.has(e))return Dt.get(e);if(Sc.is(e)){let t=[];for(let o of e.navigationTarget){let n=pu(o,r);t.push(...n)}return Dt.set(e,t),t}else if(ia.is(e)){let t=r.Query.__LEGACY_NEAREST_SYNC(e,r.getByType("node")),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Dt.set(e,o),o}else if(fe.is(e)){let t=r.Query.__LEGACY_NEAREST_SYNC(e,r.getByType("node"),{lineOfSight:!0}),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Dt.set(e,o),o}else if(sn.is(e)){let t=r.Query.__LEGACY_NEAREST_SYNC(e,r.getByType("node"));return t?.[0]?.feature.id?[t[0].feature.id]:[]}else if(go.is(e)){let t=r?.getMVFFeatureById("entrance",e.id),o=t?.properties.node?[t?.properties.node]:[];return Dt.set(e,o),o}else if(On.is(e)){let o=r?.getMVFFeatureById("area",e.id)?.properties.destinationNodes??[];return Dt.set(e,o),o}else if(vr.is(e)){let t=r?.getMVFFeatureById("space",e.id);if(t==null)return[];let o=t.properties.destinationNodes;return Dt.set(e,o),o}else if(an.is(e)){let t=[];for(let o of e.coordinates){let n=r.Query.__LEGACY_NEAREST_SYNC(o,r.getByType("node"));n?.[0]?.feature.id&&t.push(n[0].feature.id)}return Dt.set(e,t),t}else if(No.is(e)){let t=r?.objectEntranceNodeIdsByObstructionId[e.id];return Dt.set(e,t??[]),t??[]}else if(Ar.is(e)){let t=e.spaces.flatMap(o=>r?.getMVFFeatureById("space",o.id)?.properties.destinationNodes??[]).filter(o=>typeof o=="string");return Dt.set(e,t),t}else if(es.is(e)){let t=e.nodes.map(o=>o.id);return Dt.set(e,t),t}else if(wn.is(e)){let t=[e.id];return Dt.set(e,t),t}else return[]}async function fl(e,r){if(Dt.has(e))return Dt.get(e);if(Sc.is(e)){let t=[];for(let o of e.navigationTarget){let n=await fl(o,r);t.push(...n)}return Dt.set(e,t),t}else if(ia.is(e)){let t=await r.Query.nearest(e,r.getByType("node")),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Dt.set(e,o),o}else if(fe.is(e)){let t=await r.Query.nearest(e,r.getByType("node"),{lineOfSight:!0}),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Dt.set(e,o),o}else if(sn.is(e)){let t=await r.Query.nearest(e,r.getByType("node")),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Dt.set(e,o),o}else if(go.is(e)){let t=r?.getMVFFeatureById("entrance",e.id),o=t?.properties.node?[t?.properties.node]:[];return Dt.set(e,o),o}else if(On.is(e)){let o=r?.getMVFFeatureById("area",e.id)?.properties.destinationNodes??[];return Dt.set(e,o),o}else if(vr.is(e)){let t=r?.getMVFFeatureById("space",e.id);if(t==null)return[];let o=t.properties.destinationNodes;return Dt.set(e,o),o}else if(an.is(e)){let t=[];for(let o of e.coordinates){let n=await r.Query.nearest(o,r.getByType("node"));n?.[0]?.feature.id&&t.push(n[0].feature.id)}return Dt.set(e,t),t}else if(No.is(e)){let t=r?.objectEntranceNodeIdsByObstructionId[e.id];return Dt.set(e,t??[]),t??[]}else{if(Ar.is(e))return e.spaces.flatMap(t=>r?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string");if(es.is(e)){let t=e.nodes.map(o=>o.id);return Dt.set(e,t),t}else if(wn.is(e)){let t=[e.id];return Dt.set(e,t),t}else return[]}}function iD(e,r,t){let o=e.features[0]?.properties.id,n=r[0];if(r.length>1){for(let i of r)if((t.get(i)??[]).includes(o)){n=i;break}}return n}function sD(e,r,t){let o=e.features[e.features.length-1]?.properties.id,n=r[0];if(r.length>1){for(let i of r)if((t.get(i)??[]).includes(o)){n=i;break}}return n}var Df,T1,du=class{constructor({nodes:r,geojsonCollection:t,connections:o,groupBy:n,multiplicativeDistanceWeightScaling:i}){m(this,"navigator");m(this,"connections");m(this,"getDirections",async(r,t,o,n)=>{let i=[],a=[],l=new Map;for(let c of r){let p=await fl(c,n);for(let u of p)i.push(u),l.set(c,p)}for(let c of t){let p=await fl(c,n);for(let u of p)a.push(u),l.set(c,p)}return s(this,Df).call(this,r,t,i,a,o,n,l)});m(this,"getDirectionsSync",(r,t,o,n)=>{let i=[],a=[],l=new Map;for(let c of r){let p=pu(c,n);for(let u of p)i.push(u),l.set(c,p)}for(let c of t){let p=pu(c,n);for(let u of p)a.push(u),l.set(c,p)}return s(this,Df).call(this,r,t,i,a,o,n,l)});S(this,Df,(r,t,o,n,i,a,l)=>{let c=this.getDisabledConnectionNodeIds(i.accessible).filter(T=>!o.includes(T)&&!n.includes(T)),p=new Map,u={...i.connectionIdWeightMap};for(let T of i.excludedConnections)u[T.id]=1/0;for(let T in u){let x=a.getById("connection",T);x&&s(this,T1).call(this,x,u[T],p)}let f=this.navigator.getDirections({zones:i.zones.map(T=>({geometry:T.geometry,cost:T.cost,map:T.floor?.id})),originIds:o,destinationNodeIds:n,disabledConnectionNodeIds:c,simplify:{enabled:i.smoothing.enabled,bufferRadius:i.smoothing.radius},overrideEdgeWeights:p,multiplicativeDistanceWeightScaling:!a.enterpriseMode});this.addCoordinateDirections(f,r,t);let h=iD(f,r,l),b=sD(f,t,l),v=new ml(f,a,h,b);if(!(v.distance===0&&new Set([...o,...n]).size===o.length+n.length))return v});m(this,"getDisabledConnectionNodeIds",r=>r===!1?[]:this.connections.reduce((t,o)=>o.accessible?t:t.concat(o.nodes),[]));S(this,T1,(r,t,o)=>{if(r.nodes.length<2)return;let n=new Set(r.nodes.map(i=>i.id));for(let i of r.nodes){let a=this.navigator.graph.edges[i.id];if(a)for(let l of a)n.has(l.destination.properties.id)&&o.set(l,t)}});m(this,"addCoordinateDirections",(r,[t],[o])=>{if(r.features.length){if(fe.is(t)){let n=this.createDirectionFeature(t,this.navigator.getAngle([t.longitude,t.latitude],r.features[0].geometry.coordinates),this.navigator.getDistance([t.longitude,t.latitude],r.features[0].geometry.coordinates));r.features.splice(0,0,n)}if(fe.is(o)){let n=this.createDirectionFeature(o,0,0),i=r.features[r.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[o.longitude,o.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[o.longitude,o.latitude]),r.features.push(n)}}});m(this,"createDirectionFeature",(r,t,o)=>({type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{groupBy:r.floorId,id:r.id,angle:t,distance:o,edges:[]}}));this.navigator=new cu({nodes:r,geojsonCollection:this.createCollection(t),groupBy:n,multiplicativeDistanceWeightScaling:i}),this.connections=o}createCollection(r){return{type:"FeatureCollection",features:Object.entries(r).reduce((t,[o,n])=>t.concat(n.features.map(i=>(i.properties.map=o,i))),[])}}};Df=new WeakMap,T1=new WeakMap;d();d();d();d();d();d();function aD(e){let r=+this._x.call(null,e),t=+this._y.call(null,e);return lD(this.cover(r,t),r,t,e)}function lD(e,r,t,o){if(isNaN(r)||isNaN(t))return e;var n,i=e._root,a={data:o},l=e._x0,c=e._y0,p=e._x1,u=e._y1,f,h,b,v,T,x,I,M;if(!i)return e._root=a,e;for(;i.length;)if((T=r>=(f=(l+p)/2))?l=f:p=f,(x=t>=(h=(c+u)/2))?c=h:u=h,n=i,!(i=i[I=x<<1|T]))return n[I]=a,e;if(b=+e._x.call(null,i.data),v=+e._y.call(null,i.data),r===b&&t===v)return a.next=i,n?n[I]=a:e._root=a,e;do n=n?n[I]=new Array(4):e._root=new Array(4),(T=r>=(f=(l+p)/2))?l=f:p=f,(x=t>=(h=(c+u)/2))?c=h:u=h;while((I=x<<1|T)===(M=(v>=h)<<1|b>=f));return n[M]=i,n[I]=a,e}function cD(e){var r,t,o=e.length,n,i,a=new Array(o),l=new Array(o),c=1/0,p=1/0,u=-1/0,f=-1/0;for(t=0;t<o;++t)isNaN(n=+this._x.call(null,r=e[t]))||isNaN(i=+this._y.call(null,r))||(a[t]=n,l[t]=i,n<c&&(c=n),n>u&&(u=n),i<p&&(p=i),i>f&&(f=i));if(c>u||p>f)return this;for(this.cover(c,p).cover(u,f),t=0;t<o;++t)lD(this,a[t],l[t],e[t]);return this}d();function pD(e,r){if(isNaN(e=+e)||isNaN(r=+r))return this;var t=this._x0,o=this._y0,n=this._x1,i=this._y1;if(isNaN(t))n=(t=Math.floor(e))+1,i=(o=Math.floor(r))+1;else{for(var a=n-t||1,l=this._root,c,p;t>e||e>=n||o>r||r>=i;)switch(p=(r<o)<<1|e<t,c=new Array(4),c[p]=l,l=c,a*=2,p){case 0:n=t+a,i=o+a;break;case 1:t=n-a,i=o+a;break;case 2:n=t+a,o=i-a;break;case 3:t=n-a,o=i-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=t,this._y0=o,this._x1=n,this._y1=i,this}d();function dD(){var e=[];return this.visit(function(r){if(!r.length)do e.push(r.data);while(r=r.next)}),e}d();function uD(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}d();d();function Lr(e,r,t,o,n){this.node=e,this.x0=r,this.y0=t,this.x1=o,this.y1=n}function mD(e,r,t){var o,n=this._x0,i=this._y0,a,l,c,p,u=this._x1,f=this._y1,h=[],b=this._root,v,T;for(b&&h.push(new Lr(b,n,i,u,f)),t==null?t=1/0:(n=e-t,i=r-t,u=e+t,f=r+t,t*=t);v=h.pop();)if(!(!(b=v.node)||(a=v.x0)>u||(l=v.y0)>f||(c=v.x1)<n||(p=v.y1)<i))if(b.length){var x=(a+c)/2,I=(l+p)/2;h.push(new Lr(b[3],x,I,c,p),new Lr(b[2],a,I,x,p),new Lr(b[1],x,l,c,I),new Lr(b[0],a,l,x,I)),(T=(r>=I)<<1|e>=x)&&(v=h[h.length-1],h[h.length-1]=h[h.length-1-T],h[h.length-1-T]=v)}else{var M=e-+this._x.call(null,b.data),O=r-+this._y.call(null,b.data),C=M*M+O*O;if(C<t){var E=Math.sqrt(t=C);n=e-E,i=r-E,u=e+E,f=r+E,o=b.data}}return o}d();function fD(e){if(isNaN(u=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var r,t=this._root,o,n,i,a=this._x0,l=this._y0,c=this._x1,p=this._y1,u,f,h,b,v,T,x,I;if(!t)return this;if(t.length)for(;;){if((v=u>=(h=(a+c)/2))?a=h:c=h,(T=f>=(b=(l+p)/2))?l=b:p=b,r=t,!(t=t[x=T<<1|v]))return this;if(!t.length)break;(r[x+1&3]||r[x+2&3]||r[x+3&3])&&(o=r,I=x)}for(;t.data!==e;)if(n=t,!(t=t.next))return this;return(i=t.next)&&delete t.next,n?(i?n.next=i:delete n.next,this):r?(i?r[x]=i:delete r[x],(t=r[0]||r[1]||r[2]||r[3])&&t===(r[3]||r[2]||r[1]||r[0])&&!t.length&&(o?o[I]=t:this._root=t),this):(this._root=i,this)}function hD(e){for(var r=0,t=e.length;r<t;++r)this.remove(e[r]);return this}d();function gD(){return this._root}d();function yD(){var e=0;return this.visit(function(r){if(!r.length)do++e;while(r=r.next)}),e}d();function bD(e){var r=[],t,o=this._root,n,i,a,l,c;for(o&&r.push(new Lr(o,this._x0,this._y0,this._x1,this._y1));t=r.pop();)if(!e(o=t.node,i=t.x0,a=t.y0,l=t.x1,c=t.y1)&&o.length){var p=(i+l)/2,u=(a+c)/2;(n=o[3])&&r.push(new Lr(n,p,u,l,c)),(n=o[2])&&r.push(new Lr(n,i,u,p,c)),(n=o[1])&&r.push(new Lr(n,p,a,l,u)),(n=o[0])&&r.push(new Lr(n,i,a,p,u))}return this}d();function xD(e){var r=[],t=[],o;for(this._root&&r.push(new Lr(this._root,this._x0,this._y0,this._x1,this._y1));o=r.pop();){var n=o.node;if(n.length){var i,a=o.x0,l=o.y0,c=o.x1,p=o.y1,u=(a+c)/2,f=(l+p)/2;(i=n[0])&&r.push(new Lr(i,a,l,u,f)),(i=n[1])&&r.push(new Lr(i,u,l,c,f)),(i=n[2])&&r.push(new Lr(i,a,f,u,p)),(i=n[3])&&r.push(new Lr(i,u,f,c,p))}t.push(o)}for(;o=t.pop();)e(o.node,o.x0,o.y0,o.x1,o.y1);return this}d();function vD(e){return e[0]}function ID(e){return arguments.length?(this._x=e,this):this._x}d();function SD(e){return e[1]}function TD(e){return arguments.length?(this._y=e,this):this._y}function kf(e,r,t){var o=new u2(r??vD,t??SD,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function u2(e,r,t,o,n,i){this._x=e,this._y=r,this._x0=t,this._y0=o,this._x1=n,this._y1=i,this._root=void 0}function CD(e){for(var r={data:e.data},t=r;e=e.next;)t=t.next={data:e.data};return r}var xo=kf.prototype=u2.prototype;xo.copy=function(){var e=new u2(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root,t,o;if(!r)return e;if(!r.length)return e._root=CD(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var n=0;n<4;++n)(o=r.source[n])&&(o.length?t.push({source:o,target:r.target[n]=new Array(4)}):r.target[n]=CD(o));return e};xo.add=aD;xo.addAll=cD;xo.cover=pD;xo.data=dD;xo.extent=uD;xo.find=mD;xo.remove=fD;xo.removeAll=hD;xo.root=gD;xo.size=yD;xo.visit=bD;xo.visitAfter=xD;xo.x=ID;xo.y=TD;d();function m2(e,r,t,o=0,n=0,i=0,a=0){if(t===void 0){t=e.root();let c=e.extent();if(c&&([[o,n],[i,a]]=c,r(t,o,n,i,a)))return!0;if(!t)return!1}let l=[[o,n,(i+o)/2,(a+n)/2],[(i+o)/2,n,i,(a+n)/2],[o,(a+n)/2,(i+o)/2,a],[(i+o)/2,(a+n)/2,i,a]];for(let c=0;c<4;c++){let p=t[c];if(p){let[u,f,h,b]=l[c];r(p,u,f,h,b)||m2(e,r,p,u,f,h,b)}}return!1}var MD=1e3,E$=.1,di,Af,Go,Oc,C1=class{constructor(r,t){S(this,di,{});S(this,Af,new Map);m(this,"getMaxSearchRadiusForFloorId",(r,t)=>{let o=s(this,Af).get(s(this,Go).mapName)?.get(t);if(o)return o;let n=this.getNodeTreeByTypeAndFloorId(r,s(this,Go).mapName,t);if(typeof n.extent=="function")if(n.extent()){let[[i,a],[l,c]]=n.extent(),p=l-i,u=c-a;o=Math.max(p,u)}else o=MD;else o=MD;return s(this,Af).set(s(this,Go).mapName,new Map([[t,o]])),o});S(this,Go);S(this,Oc);w(this,Go,r),w(this,Oc,t)}searchWithIncludedIds(r,t,o,n,i,a,l=!1){let{x:c,y:p}=s(this,Oc).call(this,r),u=c-a,f=c+a,h=p-a,b=p+a,v=this.getNodeTreeByTypeAndFloorId(t,o,n),T=[],x=new Set;return m2(v,(I,M,O,C,E)=>{let _=M>=f||O>=b||C<u||E<h;if("data"in I){let G=I.data,R=G.properties.parentId||G.properties.id;if(i.includes(R)&&!x.has(R)){x.add(R);let N=pi(r,G.geometry.coordinates);N<=a&&(l?s(this,Go).directions.navigator.hasLineOfSight(r,G.geometry.coordinates,n,E$)&&T.push({node:G,distance:N}):T.push({node:G,distance:N}))}}return _}),T.sort((I,M)=>I.distance-M.distance)}getNodeTreeByTypeAndFloorId(r,t,o){if(s(this,di)[r]||(s(this,di)[r]={}),s(this,di)[r][t]?.[o])return s(this,di)[r][t][o];s(this,di)[r][t]||(s(this,di)[r][t]={}),s(this,di)[r][t][o]=kf();let n=s(this,di)[r][t][o];n.x(a=>s(this,Oc).call(this,a.geometry.coordinates).x),n.y(a=>s(this,Oc).call(this,a.geometry.coordinates).y);let i=[];switch(r){case"space":i=s(this,Go).mvfSpacesByFloorId[o].flatMap(l=>l.properties.destinationNodes).map(l=>{let c=s(this,Go).mvfNodesById[l];return c?{...c,properties:{id:c.properties.id,parentId:c.properties.space[0]}}:null});break;case"node":i=s(this,Go).mvfNodesByFloorId[o]?.filter(l=>l.properties.neighbors.length>0)||[];break;case"point-of-interest":i=s(this,Go).mvfPoisByFloorId[o]||[];break;case"door":i=s(this,Go).mvfEntrancesByFloorId[o]||[];break;case"annotation":i=s(this,Go).mvfAnnotationsByFloorId[o]||[];break}return i?.length>0&&n.addAll(i),n}};di=new WeakMap,Af=new WeakMap,Go=new WeakMap,Oc=new WeakMap;var uu=50,wD=111319.9,f2=!1,OD=J.object({limit:J.enum(["same-floor","same-elevation"]).optional(),mode:J.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:J.boolean().optional().or(J.literal("auto")),maxDistance:J.number().optional()}),ED={lineOfSight:f2,mode:"travel-distance",maxDistance:uu,limit:"same-floor"},Ir,_f,M1,Rf,h2,mu,w1,O1,Lf=class{constructor(r){S(this,Rf);S(this,Ir);S(this,_f);S(this,M1,([r,t])=>{let[o,n]=[s(this,Ir).mapCenter.longitude,s(this,Ir).mapCenter.latitude],i=wD,a=wD*Math.cos(t*Math.PI/180),l=(r-o)*a,c=(t-n)*i;return{x:l,y:c}});m(this,"__LEGACY_NEAREST_SYNC",(r,t,o)=>{let n={...ED,...o};try{OD.parse(n)}catch(u){A.error(u);return}let i=Gd(r);if(!i)return;let a=W(this,Rf,h2).call(this,i,n),l=[],c={},p=[];for(let u of t){let f=pu(u,s(this,Ir));if(f)for(let h of f)c[h]||(c[h]=[]),c[h].push(u),p.push(h)}return o?.mode==="absolute-distance"?l=s(this,mu).call(this,i,a,t,n):l=s(this,O1).call(this,r,a,p,c,n),l.sort((u,f)=>u.distance-f.distance)});S(this,mu,(r,t,o,n)=>{let i=[],a=new Set(o.map(l=>l.__type));for(let l of t)for(let c of a){let p=s(this,_f).searchWithIncludedIds([r.longitude,r.latitude],c,s(this,Ir).mapName,l,o.filter(u=>u.__type===c).map(u=>u.id),n?.maxDistance??uu,n?.lineOfSight==="auto"?f2:n?.lineOfSight);if(p)for(let u of p)i.push({distance:u.distance,feature:s(this,Ir).getById(c,u.node.properties.parentId)||s(this,Ir).getById(c,u.node.properties.id)})}return i});S(this,w1,async(r,t,o,n,i)=>{let a=[];for(let l of t){let c,p=0;if(!wn.is(r)){let u=s(this,mu).call(this,r.anchorTarget,[l],s(this,Ir).getByType("node").filter(f=>f.floor.id===l),{limit:"same-floor",lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??uu});u.length>0&&(c=u[0].feature,p=u[0].distance)}if(c){let u=new Set,f=s(this,Ir).directions.navigator.findNearestNodesOnGraph(c.id,(i?.maxDistance??uu)-p,l,o,!1);for(let h of f)for(let b of n[h.feature.properties.id])u.has(b.id)||(a.push({distance:h.distance+p,feature:b}),u.add(b.id))}}return a});S(this,O1,(r,t,o,n,i)=>{let a=[];for(let l of t){let c;if(wn.is(r)||(c=this.__LEGACY_NEAREST_SYNC(r,s(this,Ir).getByType("node"),{lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??uu})?.[0].feature),c){let p=s(this,Ir).directions.navigator.findNearestNodesOnGraph(c.id,i?.maxDistance??uu,l,o,i?.lineOfSight==="auto"?f2:i?.lineOfSight);for(let u of p)for(let f of n[u.feature.properties.id])a.push({distance:u.distance,feature:f})}}return a});w(this,Ir,r),w(this,_f,new C1(s(this,Ir),s(this,M1)))}async nearest(r,t,o){let n={...ED,...o};try{OD.parse(n)}catch(f){A.error(f);return}let i=Gd(r);if(!i)return;let a=W(this,Rf,h2).call(this,i,n),l=[],c={},p=[],u=[];if(o?.mode==="absolute-distance")l=s(this,mu).call(this,i,a,t,n);else{for(let f of t)u.push(fl(f,s(this,Ir)).then(h=>{if(h)for(let b of h)c[b]||(c[b]=[]),c[b].push(f),p.push(b)}));await Promise.all(u),l=await s(this,w1).call(this,r,a,p,c,n)}return l.sort((f,h)=>f.distance-h.distance)}};Ir=new WeakMap,_f=new WeakMap,M1=new WeakMap,Rf=new WeakSet,h2=function(r,t){let o=r.floorId?[r.floorId]:[];if(r.floorId==null)for(let n of s(this,Ir).getByType("floor-stack")){let i=n.defaultFloor;i&&o.push(i.id)}else if(t?.limit==="same-elevation"){let n=s(this,Ir).floorsById[r.floorId];if(n){let i=n?.elevation;i&&(o=s(this,Ir).getByType("floor-stack").map(a=>a.floors.find(l=>l.elevation===i)?.id).filter(Boolean))}}return o},mu=new WeakMap,w1=new WeakMap,O1=new WeakMap;d();d();var Bf,E1=class{constructor(r){S(this,Bf);w(this,Bf,r||[])}get raw(){return s(this,Bf)}};Bf=new WeakMap;var Yr,le,Ot,fu=class fu extends xr{constructor(t,o){super(o.mvfData.id);m(this,"__type",fu.__type);m(this,"id","loc_");m(this,"name","");m(this,"externalId");m(this,"description");m(this,"logo");m(this,"phone");m(this,"social",[]);m(this,"images",[]);m(this,"links",[]);m(this,"website");m(this,"icon");S(this,Yr);S(this,le,{});S(this,Ot);w(this,Yr,t),w(this,Ot,o.mvfData);for(let n in o.mvfData)n==="links"?this.links=o.mvfData.links.map(i=>new ic({mvfData:i})):n==="pictures"?this.images=o.mvfData.pictures.map(i=>i.url?new ac({mvfData:{...i,url:i.url??""},mapData:s(this,Yr)}):void 0).filter(i=>i!=null):n==="website"?o.mvfData.website&&(this.website=new ic({mvfData:o.mvfData.website})):n==="icon"?o.mvfData.icon&&(this.icon=new ac({mvfData:{url:o.mvfData.icon},mapData:s(this,Yr)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Ot)[n]}})}static is(t){return t.__type===fu.__type}get spaces(){if(s(this,le).spaces)return s(this,le).spaces;if(s(this,Ot).spaces==null)return s(this,le).spaces=[],s(this,le).spaces;s(this,le).spaces=[];for(let t=0;t<s(this,Ot).spaces.length;t++){let o=s(this,Yr).getById("space",s(this,Ot).spaces[t].id);o&&s(this,le).spaces.push(o)}return s(this,le).spaces}get points(){if(s(this,le).points)return s(this,le).points;if(s(this,Ot).spaces==null)return s(this,le).points=[],s(this,le).points;s(this,le).points=[];for(let t=0;t<s(this,Ot).spaces.length;t++){let o=s(this,Yr).getById("point-of-interest",s(this,Ot).spaces[t].id);o&&s(this,le).points.push(o)}return s(this,le).points}get doors(){if(s(this,le).doors)return s(this,le).doors;if(s(this,Ot).entrances==null)return s(this,le).doors=[],s(this,le).doors;s(this,le).doors=[];for(let t=0;t<s(this,Ot).entrances.length;t++){let o=s(this,Yr).getById("door",s(this,Ot).entrances[t].id);o&&s(this,le).doors.push(o)}return s(this,le).doors}get connections(){if(s(this,le).connections)return s(this,le).connections;if(s(this,Ot).connections==null)return s(this,le).connections=[],s(this,le).connections;let t=new Set;for(let o=0;o<s(this,Ot).connections.length;o++){let n=s(this,Ot).connections[o],i=s(this,Yr).mvfConnectionsById[n],l=(i==null?[]:i.nodes).map(c=>s(this,Yr).getById("node",c)).filter(Boolean);for(let c of l){if(c==null)continue;let p=qi([c.coordinate.longitude,c.coordinate.latitude]),f=(s(this,Yr).connectionSpaceIdsByLatLon[p]??[]).map(h=>s(this,Yr).connectionsById[h]).filter(h=>h!=null);for(let h of f)t.add(h)}}return s(this,le).connections=Array.from(t),s(this,le).connections}get annotations(){if(s(this,le).annotations)return s(this,le).annotations;if(s(this,Ot).annotations==null)return s(this,le).annotations=[],s(this,le).annotations;s(this,le).annotations=[];for(let t=0;t<s(this,Ot).annotations.length;t++){let o=s(this,Yr).getById("annotation",s(this,Ot).annotations[t].id);o&&s(this,le).annotations.push(o)}return s(this,le).annotations}get categories(){return s(this,le).categories?s(this,le).categories:s(this,Ot).categories==null?(s(this,le).categories=[],s(this,le).categories):(s(this,le).categories=s(this,Ot).categories.map(t=>s(this,Yr).getById("location-category",t)).filter(t=>t!=null),s(this,le).categories)}get mapObjects(){return s(this,le).mapObjects?s(this,le).mapObjects:s(this,Ot).obstructions==null?(s(this,le).mapObjects=[],s(this,le).mapObjects):(s(this,le).mapObjects=s(this,Ot).obstructions.map(t=>s(this,Yr).getById("object",t.id)).filter(t=>t!=null),s(this,le).mapObjects)}get areas(){return s(this,le).areas?s(this,le).areas:s(this,Ot).areas==null?(s(this,le).areas=[],s(this,le).areas):(s(this,le).areas=s(this,Ot).areas.map(t=>s(this,Yr).getById("area",t.id)).filter(t=>t!=null),s(this,le).areas)}get focusTarget(){if(s(this,le).focusTarget)return s(this,le).focusTarget;let t=[];for(let o of this.spaces)t.push(o);for(let o of this.connections)t.push(...o.coordinates);for(let o of this.doors)t.push(o.focusTarget);for(let o of this.mapObjects)t.push(o.focusTarget);for(let o of this.annotations)t.push(o.focusTarget);for(let o of this.points)t.push(o.focusTarget);for(let o of this.areas)t.push(o.focusTarget);return s(this,le).focusTarget=t,t}get openingHours(){return s(this,le).openingHours?s(this,le).openingHours:(s(this,le).openingHours=new E1(s(this,Ot).openingHoursSpecification??[]),s(this,le).openingHours)}get navigationTarget(){if(s(this,le).navigationTarget)return s(this,le).navigationTarget;let t=[];for(let o of this.spaces)t.push(o);for(let o of this.connections)t.push(...o.coordinates);for(let o of this.doors)t.push(o.focusTarget);for(let o of this.mapObjects)t.push(o.focusTarget);for(let o of this.annotations)t.push(o.focusTarget);for(let o of this.points)t.push(o.focusTarget);return s(this,le).navigationTarget=t,t}toJSON(){return{__type:fu.__type,id:this.id,name:this.name}}};Yr=new WeakMap,le=new WeakMap,Ot=new WeakMap,m(fu,"__type","location-profile");var g2=fu,Sc=g2;d();var hl,Uo,Ec,hu=class hu extends xr{constructor(t,o){super(o.mvfData.id);m(this,"__type",hu.__type);m(this,"id","cat_");m(this,"name","");m(this,"icon","");S(this,hl);S(this,Uo,{});S(this,Ec);w(this,hl,t),w(this,Ec,o.mvfData);for(let n in o.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Ec)[n]}})}static is(t){return t.__type===hu.__type}get parent(){return s(this,Uo).parent?s(this,Uo).parent:(s(this,Uo).parent=s(this,Ec).parent?s(this,hl).getById("location-category",s(this,Ec).parent):void 0,s(this,Uo).parent)}get children(){return s(this,Uo).children?s(this,Uo).children:(s(this,Uo).children=s(this,hl).locationCategoriesByParentId[this.id]||[],s(this,Uo).children)}get locationProfiles(){if(s(this,Uo).locationProfiles)return s(this,Uo).locationProfiles;let t=[];for(let o of s(this,hl).locationProfilesByCategoryId[this.id]||[]){let n=s(this,hl).getById("location-profile",o.id);n&&t.push(n)}return s(this,Uo).locationProfiles=t,t}toJSON(){return{__type:hu.__type,id:this.id,name:this.name}}};hl=new WeakMap,Uo=new WeakMap,Ec=new WeakMap,m(hu,"__type","location-category");var y2=hu,f1=y2;var ge,P1,FD,gu,Pc=class extends ke{constructor(t,o){super();S(this,P1);m(this,"Analytics");S(this,ge,{});m(this,"Query");m(this,"mvf");m(this,"outdoorViewToken");m(this,"objectEntranceNodeIdsByObstructionId");m(this,"obstructionIdByEntranceId");m(this,"venue");m(this,"tokenManager");m(this,"directions");m(this,"enterpriseMode",!1);m(this,"nodesById");m(this,"spacesById");m(this,"floorsById");m(this,"floorStacksById");m(this,"facadesById");m(this,"facadesBySpaceId");m(this,"connectionsById");m(this,"objectsById");m(this,"doorsById");m(this,"pointsOfInterestById");m(this,"annotationsById");m(this,"areasById");m(this,"locationProfilesById");m(this,"locationCategoriesById");m(this,"locationProfilesByExternalId");m(this,"locationProfilesByCategoryId");m(this,"locationCategoriesByParentId");m(this,"doorsByNodeId");m(this,"mvfAnnotationsById");m(this,"mvfConnectionsById");m(this,"mvfConnectionsByNodeId");m(this,"mvfConnectionIdsByLatLon");m(this,"mvfEntrancesById");m(this,"mvfNodesById");m(this,"mvfObstructionById");m(this,"mvfSpacesById");m(this,"mvfFloorsById");m(this,"mvfFloorStacksById");m(this,"mvfAreasById");m(this,"spacesByExternalId");m(this,"nodesByExternalId");m(this,"objectsByExternalId");m(this,"poisByExternalId");m(this,"floorsByExternalId");m(this,"floorStacksByExternalId");m(this,"doorsByExternalId");m(this,"areasByExternalId");m(this,"connectionSpaceIdsByLatLon",{});m(this,"locationProfilesByAttachedFeatureId",{});m(this,"locationsById",{});m(this,"categoriesById",{});m(this,"mvfLocationsBySpaceId",{});m(this,"locationIdsByNodeId",{});m(this,"spaceIdsByNodeId",{});m(this,"connectionsByExternalId",{});m(this,"locationsByExternalId",{});m(this,"categoriesByExternalId",{});m(this,"destinationNodesIdsBySpaceId",{});m(this,"mvfNodesByFloorId");m(this,"mvfSpacesByFloorId");m(this,"mvfPoisByFloorId");m(this,"mvfEntrancesByFloorId");m(this,"mvfAnnotationsByFloorId");m(this,"localePacksUrls");m(this,"currentLanguage");m(this,"languagePacks",{});m(this,"tilesets",{});m(this,"navigationFlags");m(this,"binaryBundle");m(this,"envControl");m(this,"getMapDataOptions");m(this,"propTranslationCache",new Map);S(this,gu);m(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(t,o,n)=>this.__LEGACY_GET_DIRECTIONS_SYNC(t,o,{...n,multiDestination:!0}));m(this,"__LEGACY_GET_DIRECTIONS_SYNC",(t,o,n)=>{let{accessible:i=!1,multiDestination:a=!1}=n||{},l=PD(this.enterpriseMode,n),c=n?.zones||[],p={accessible:i,zones:c,smoothing:l,excludedConnections:n?.excludedConnections||[],connectionIdWeightMap:n?.connectionIdWeightMap||{}};if(a&&Array.isArray(o)){let u=Array.isArray(t)?t:[t],f=[];for(let h of o){let b=Array.isArray(h)?h:[h],v=this.directions.getDirectionsSync(u,b,p,this);if(!v){A.error("getDirections failed due to missing directions for one of the segments");return}u=b,f.push(v)}return f}else{let u=Array.isArray(t)?t:[t],f=Array.isArray(o)?o:[o];if(Array.isArray(f[0])){A.error("getDirections does not support multi-destination without multisegment option");return}u[0].id&&f[0].id&&this.Analytics.sendGetDirectionsEvent(u[0].id,f[0].id,i);try{return this.directions.getDirectionsSync(u,f,p,this)}catch(h){A.error("Unable to get directions",h);return}}});m(this,"getDirections",async(t,o,n)=>{let{accessible:i=!1}=n||{},a=PD(this.enterpriseMode,n),l=n?.zones||[],c={accessible:i,zones:l,smoothing:a,excludedConnections:n?.excludedConnections||[],connectionIdWeightMap:n?.connectionIdWeightMap||{}},p=Array.isArray(t)?t:[t],u=Array.isArray(o)?o:[o];if(Array.isArray(u[0])){A.error("getDirections does not support multi-destination without multisegment option");return}p[0].id&&u[0].id&&this.Analytics.sendGetDirectionsEvent(p[0].id,u[0].id,i);try{return this.directions.getDirections(p,u,c,this)}catch(f){A.error("Unable to get directions",f);return}});m(this,"getDirectionsMultiDestination",async(t,o,n)=>Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(t,o,n)));m(this,"transformImageRequest",async t=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:t};if(!P5(t))return{url:t};if(F5(t))return{url:t};let o=p1(t);if(!o)return{url:t};try{let i=(await this.tokenManager?.getSasTokensAsync())?.[o.mapId];if(i==null)throw new Error("SAS token not found");let[a]=t.split("?");return{url:`${a}?${i.token}`}}catch(n){return A.error("Failed to append SAS token to image request. Requests for private images may fail.",n),{url:t}}});let n=o?.env??tl();if(this.envControl=n,this.binaryBundle=o?.binaryBundle,this.Analytics=new Fp,this.localePacksUrls=o?.localePacksUrls??{},this.mvf=t,this.outdoorViewToken=o?.outdoorViewToken,this.getMapDataOptions=o?.getMapDataOptions,t["tileset.json"]?.default!=null&&(this.tilesets[t["tileset.json"].default.key]=t["tileset.json"].default,n.updateTileServerBaseUrl(t["tileset.json"].default.url),t["tileset.json"].others!=null))for(let a of t["tileset.json"].others)this.tilesets[a.key]=a;this.navigationFlags=t["navigationFlags.json"]??{},this.enterpriseMode=o?.enterprise??!1,this.tokenManager=o?.tokenManager;let i=B5(t,this);if(this.nodesById=i.nodesById,this.spacesById=i.spacesById,this.floorsById=i.floorsById,this.floorStacksById=i.floorStacksById,this.facadesById=i.facadesById,this.facadesBySpaceId=i.facadesBySpaceId,this.connectionsById=i.connectionsById,this.objectsById=i.objectsById,this.doorsById=i.doorsById,this.pointsOfInterestById=i.poisById,this.annotationsById=i.annotationsById,this.areasById=i.areasById,this.locationProfilesById=i.locationProfilesById,this.locationCategoriesById=i.locationCategoriesById,this.locationProfilesByCategoryId=i.locationProfilesByCategoryId,this.locationCategoriesByParentId=i.locationCategoriesByParentId,this.spacesByExternalId=i.spacesByExternalId,this.nodesByExternalId=i.nodesByExternalId,this.objectsByExternalId=i.objectsByExternalId,this.floorsByExternalId=i.floorsByExternalId,this.locationProfilesByExternalId=i.locationProfilesByExternalId,this.floorStacksByExternalId=i.floorStacksByExternalId,this.poisByExternalId=i.poisByExternalId,this.doorsByExternalId=i.doorsByExternalId,this.areasByExternalId=i.areasByExternalId,this.mvfAnnotationsById=i.mvfAnnotationsById,this.mvfConnectionsById=i.mvfConnectionsById,this.mvfConnectionsByNodeId=i.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=i.mvfConnectionIdsByLatLon,this.mvfEntrancesById=i.mvfEntrancesById,this.mvfNodesById=i.mvfNodesById,this.mvfObstructionById=i.mvfObstructionById,this.mvfSpacesById=i.mvfSpacesById,this.mvfFloorsById=i.mvfFloorsById,this.mvfFloorStacksById=i.mvfFloorStacksById,this.mvfNodesByFloorId=i.mvfNodesByFloorId,this.mvfSpacesByFloorId=i.mvfSpacesByFloorId,this.mvfPoisByFloorId=i.mvfPoisByFloorId,this.mvfEntrancesByFloorId=i.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=i.mvfAnnotationsByFloorId,this.mvfAreasById=i.mvfAreasById,this.doorsByNodeId=i.doorsByNodeId,this.objectEntranceNodeIdsByObstructionId=i.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=i.obstructionIdByEntranceId,this.connectionSpaceIdsByLatLon=i.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=i.locationProfilesByAttachedFeatureId,this.enterpriseMode||Nf()){let a=R5(t,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.mvfLocationsBySpaceId=a.mvfLocationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.connectionsByExternalId=a.connectionsByExternalId,this.locationsByExternalId=a.locationsByExternalId,this.categoriesByExternalId=a.categoriesByExternalId,this.destinationNodesIdsBySpaceId=a.destinationNodesIdsBySpaceId,a.venue.name!=null){this.venue=new o2(this,{mvfData:a.venue});let l={};for(let c in a.mvfLocationsById)l[c]=a.mvfLocationsById[c];for(let c in a.locationInstancesById)l[c]=a.locationInstancesById[c];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":l,"enterprise-category":a.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},o?.languagePacks?.forEach(({language:c,localePack:p})=>{this.languagePacks[c.code]=LS(p)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new du({nodes:t["node.geojson"],geojsonCollection:t.enterprise?t.space:t.obstruction,connections:t["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode}),this.Query=new Lf(this)}getEnv(){let t=this;return{get baseUri(){return t.envControl.getBaseUri()},get baseAuthUri(){return t.envControl.getBaseAuthUri()},get analyticsBaseUri(){return t.envControl.getAnalyticsBaseUri()},get tileServerUri(){return t.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){return this.mvf["manifest.geojson"].features[0].properties.org_id??""}get mapCenter(){return new fe(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){return this.mvf["manifest.geojson"].features[0].properties.naturalBearing??0}get spaces(){return s(this,ge).spaces==null&&(s(this,ge).spaces=globalThis.Object.values(this.spacesById)),s(this,ge).spaces}get objects(){return s(this,ge).objects==null&&(s(this,ge).objects=globalThis.Object.values(this.objectsById)),s(this,ge).objects}get connections(){return s(this,ge).connections==null&&(s(this,ge).connections=globalThis.Object.values(this.connectionsById)),s(this,ge).connections}get floors(){return s(this,ge).floors==null&&(s(this,ge).floors=globalThis.Object.values(this.floorsById)),s(this,ge).floors}get floorStacks(){return s(this,ge).floorStacks==null&&(s(this,ge).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,ge).floorStacks}get facades(){return s(this,ge).facades==null&&(s(this,ge).facades=globalThis.Object.values(this.facadesById)),s(this,ge).facades}get doors(){return s(this,ge).doors==null&&(s(this,ge).doors=globalThis.Object.values(this.doorsById)),s(this,ge).doors}get pointsOfInterest(){return s(this,ge).pointsOfInterest==null&&(s(this,ge).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,ge).pointsOfInterest}get annotations(){return s(this,ge).annotations==null&&(s(this,ge).annotations=globalThis.Object.values(this.annotationsById)),s(this,ge).annotations}get areas(){return s(this,ge).areas==null&&(s(this,ge).areas=globalThis.Object.values(this.areasById)),s(this,ge).areas}get nodes(){return s(this,ge).nodes==null&&(s(this,ge).nodes=globalThis.Object.values(this.nodesById)),s(this,ge).nodes}get locations(){return s(this,ge).locations==null&&(s(this,ge).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,ge).categories==null&&(s(this,ge).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return s(this,ge).locationProfiles==null&&(s(this,ge).locationProfiles=globalThis.Object.values(this.locationProfilesById)),s(this,ge).locationProfiles}get locationCategories(){return s(this,ge).locationCategories==null&&(s(this,ge).locationCategories=globalThis.Object.values(this.locationCategoriesById)),s(this,ge).locationCategories}get mvfFloors(){return s(this,ge).mvfFloors==null&&(s(this,ge).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,ge).mvfFloors}get mvfFloorStacks(){return s(this,ge).mvfFloorStacks==null&&(s(this,ge).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,ge).mvfFloorStacks}getByType(t){switch(t){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[]}}getById(t,o){let n={"location-profile":this.locationProfilesById,"location-category":this.locationCategoriesById,space:this.spacesById,floor:this.floorsById,"floor-stack":this.floorStacksById,facade:this.facadesById,node:this.nodesById,door:this.doorsById,connection:this.connectionsById,"mvf-connection":l=>W(this,P1,FD).call(this,this.mvfConnectionsById[l]),object:this.objectsById,"point-of-interest":this.pointsOfInterestById,annotation:this.annotationsById,area:this.areasById,"enterprise-location":this.locationsById,"enterprise-category":this.categoriesById},i=l=>{let c=n[l];if(c!=null)return typeof c=="function"?c(o):c[o]},a=()=>{for(let l of Object.keys(n)){let c=i(l);if(c!=null)return c}};return t==="unknown"?a():i(t)}getByExternalId(t,o){switch(t){case"location-profile":return this.locationProfilesByExternalId[o]??[];case"location-category":return[];case"space":return this.spacesByExternalId[o]??[];case"floor":return this.floorsByExternalId[o]??[];case"floor-stack":return this.floorStacksByExternalId[o]??[];case"node":return this.nodesByExternalId[o]??[];case"door":return this.doorsByExternalId[o]??[];case"connection":return this.connectionsByExternalId[o]??[];case"object":return this.objectsByExternalId[o]??[];case"point-of-interest":return this.poisByExternalId[o]??[];case"area":return this.areasByExternalId[o]??[];case"enterprise-location":return this.locationsByExternalId[o]??[];case"enterprise-category":return this.categoriesByExternalId[o]??[];default:return[]}}getMapDataById(t){return this.spacesById[t]??this.floorsById[t]??this.floorStacksById[t]??this.facadesById[t]??this.nodesById[t]??this.doorsById[t]??this.connectionsById[t]??this.objectsById[t]??this.pointsOfInterestById[t]??this.annotationsById[t]??this.areasById[t]}getMVFFeatureById(t,o){switch(t){case"space":return this.mvfSpacesById[o];case"node":return this.mvfNodesById[o];case"obstruction":return this.mvfObstructionById[o];case"floor":return this.mvfFloorsById[o];case"floor-stack":return this.mvfFloorStacksById[o];case"connection":return this.mvfConnectionsById[o];case"entrance":return this.mvfEntrancesById[o];case"annotation":return this.mvfAnnotationsById[o];case"area":return this.mvfAreasById[o];default:throw new Error(`Unknown MVF feature type: ${t}`)}}getMVFFeatureByNodeId(t,o){switch(t){case"connection":return this.mvfConnectionsByNodeId[o];default:throw new Error(`Unsupported MVF feature type: ${t}`)}}getMVFFeatureByType(t){switch(t){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error(`Unsupported MVF feature type: ${t}`)}}getPropTranslation(t,o,n,i){if(!this.currentLanguage)return i;let{code:a}=this.currentLanguage,l=this.languagePacks[a]?.optimized?.[t];if(l){let c=l[n];if(c!=null&&c[o]!==void 0){let p=c[o];if(p!=null&&typeof p=="object"){if(typeof i=="object"&&typeof p=="object"&&!Array.isArray(p)){let u=ay(a+t+n+o.toString());if(this.propTranslationCache.has(u))return this.propTranslationCache.get(u);let f=Ff(i,p,["id"]);return this.propTranslationCache.set(u,f),f}return p}return p}}return i}findPreferredLanguage(t){if(!this.venue)return;let o=b2(this.venue,t);return t?.languageCode!=null&&t.languageCode.toLowerCase()!==o.code.toLowerCase()&&A.warn(`Language code "${t.languageCode}" could not be found in the venue. Using "${o.code}" instead.`),o}async changeLanguage(t){let o=t.toLowerCase();if(!o){A.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){A.error("Changing the language is not supported for this map.");return}let n=this.currentLanguage.code,i=this.venue?.languages.find(({code:l})=>l.toLowerCase()===o.toLowerCase());if(!i){A.warn(`Language code "${o}" could not be found in the venue.`);return}if(n===i.code)return;let a=this.languagePacks[i.code];if(!a){let l=this.localePacksUrls[i.code];if(!l){A.error(`Locale pack URL not found for language code "${i.code}".`);return}s(this,gu)&&s(this,gu).abort();let c=new AbortController;w(this,gu,c);let p;try{p=await a5(l,{signal:c.signal})}catch(u){A.error(`Failed to download language pack for language code "${i.code}".`,u);return}if(!p||c.signal.aborted)return;a=LS(p),this.languagePacks[i.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=i,this.publish("language-change",this.currentLanguage)}getDistance(t,o){let n=Gd(t),i=Gd(o);return pi([n.longitude,n.latitude],[i.longitude,i.latitude])}async toJSONBundle({downloadLanguagePacks:t=!0}={}){let o=[];if(t&&this.enterpriseMode){let n=new AbortController;for(let i of this.venue?.languages||[])try{if(this.localePacksUrls[i.code]){let a=await uS(this.localePacksUrls[i.code],{signal:n.signal}),l=await Td(a);l&&o.push({language:{code:i.code,name:i.name},localePack:l})}}catch(a){A.warn("failed downloading language pack",a)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:o,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:t=!0}={}){if(!this.binaryBundle){A.error("binary bundle not found");return}let o=[];if(t&&this.enterpriseMode){let n=new AbortController;for(let i of this.venue?.languages||[])try{if(this.localePacksUrls[i.code]){let a=await uS(this.localePacksUrls[i.code],{signal:n.signal});a&&o.push({language:{code:i.code,name:i.name},localePack:a})}}catch(a){A.warn("failed downloading language pack",a)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:o,main:this.binaryBundle}}destroy(){for(let t of globalThis.Object.keys(s(this,ge)))s(this,ge)[t]=null;this.propTranslationCache.clear()}};ge=new WeakMap,P1=new WeakSet,FD=function(t){let o=t?.nodes?.[0],n=this.getById("node",o);if(n==null)return;let i=qi([n.coordinate.longitude,n.coordinate.latitude]);return this.connectionSpaceIdsByLatLon[i]?.map(l=>this.connectionsById[l]).find(l=>l!=null)},gu=new WeakMap;var PD=(e,r)=>{let t=!e,o=r?.smoothing,i=o!=null?typeof o=="object"?o.enabled??t:o:t,a=typeof o=="object"?o.radius:void 0;return{enabled:i,radius:a??.75}};d();d();d();d();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var DD="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";d();d();var kD=!1;function AD(){kD=!0}function LD(){return kD}var F1=class{constructor(r){m(this,"backgroundAlpha",1);m(this,"backgroundColor",new ar);m(this,"width",0);m(this,"height",0);m(this,"options",{});m(this,"renderer");m(this,"enabledLayers",new Set([0,1]));m(this,"handleWebGLContextCreationError",r=>{this.options.onWebGLContextCreationError?.(r)});m(this,"handleWebGLContextLost",r=>{this.options.onWebGLContextLost?.(r)});m(this,"handleWebGLContextRestored",r=>{this.options.onWebGLContextRestored?.(r)});try{this.options=r,LD()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new ar,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},clearStencil:()=>{},clearDepth:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new CC({canvas:r.canvas,alpha:r.alpha||!1,stencil:!0,antialias:typeof r.antialias=="boolean"?r.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new ar(r.backgroundColor??"#ffffff"),this.backgroundAlpha=r.backgroundAlpha??1}catch(t){A.error(t),r.onWebGLRendererError&&r.onWebGLRendererError(t)}this.domElement()?.addEventListener("webglcontextlost",this.handleWebGLContextLost),this.domElement()?.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),this.domElement()?.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){this.renderer&&this.renderer.dispose?.(),this.domElement()?.removeEventListener("webglcontextlost",this.handleWebGLContextLost),this.domElement()?.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),this.domElement()?.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(r,t){if(this.renderer){this.renderer.state.reset(),t.layers.disableAll();for(let o of this.enabledLayers.values())t.layers.enable(o);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(r,t),this.renderer.clearDepth(),t.layers.disableAll(),t.layers.enable(dy.ALWAYS_ON_TOP),this.renderer.render(r,t),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(r,t){y.env.NODE_ENV==="test"||!this.renderer||(this.width=r,this.height=t,this.renderer.setSize(r,t,!1))}setBackgroundColor(r,t){this.backgroundColor=r,this.backgroundAlpha=t}domElement(){return this.renderer?.domElement}};d();d();var _D='"use strict";(()=>{var Qe=Object.defineProperty;var _t=(r,e,t)=>e in r?Qe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var vt=(r,e)=>{for(var t in e)Qe(r,t,{get:e[t],enumerable:!0})};var w=(r,e,t)=>_t(r,typeof e!="symbol"?e+"":e,t);function Ke(r,e){return e.x+e.w<r.x+r.w&&e.x>r.x&&e.y>r.y&&e.y+e.h<r.y+r.h}function Ge(r,e){let[t,s]=e;return t>=r.x&&t<=r.x+r.w&&s>=r.y&&s<=r.y+r.h}function He(r,e){let t=e.x,s=e.y,n=e.x+e.w,a=e.y+e.h,o=r.x,i=r.y,u=r.x+r.w,l=r.y+r.h;return t<u&&o<n&&s<l&&i<a}function L(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}var b=class{constructor(e,t,s,n,a){w(this,"x");w(this,"y");w(this,"w");w(this,"h");w(this,"userData");this.userData=typeof a>"u"?null:a,this.x=e,this.y=t,this.w=s,this.h=n}contains(e){return e===this?!1:Ke(this,e)}intersects(e){return He(this,e)}intersectsPoint(e){return Ge(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var Re=class r{constructor(e,t){w(this,"topLeft");w(this,"topRight");w(this,"bottomLeft");w(this,"bottomRight");w(this,"divided",!1);w(this,"boundary");w(this,"capacity",16);w(this,"objects",[]);w(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:s,h:n}=this.boundary;this.topLeft=new r(new b(e,t,s/2,n/2),this),this.topRight=new r(new b(e+s/2,t,s/2,n/2),this),this.bottomLeft=new r(new b(e,t+n/2,s/2,n/2),this),this.bottomRight=new r(new b(e+s/2,t+n/2,s/2,n/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(L(t,this.topLeft.queryRect(e)),L(t,this.topRight.queryRect(e)),L(t,this.bottomLeft.queryRect(e)),L(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(L(t,this.topLeft.queryPoint(e)),L(t,this.topRight.queryPoint(e)),L(t,this.bottomLeft.queryPoint(e)),L(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var be={};vt(be,{BRAND:()=>Wt,DIRTY:()=>K,EMPTY_PATH:()=>wt,INVALID:()=>p,NEVER:()=>Or,OK:()=>T,ParseStatus:()=>k,Schema:()=>_,ZodAny:()=>W,ZodArray:()=>B,ZodBigInt:()=>H,ZodBoolean:()=>ee,ZodBranded:()=>Se,ZodCatch:()=>le,ZodDate:()=>te,ZodDefault:()=>ue,ZodDiscriminatedUnion:()=>Me,ZodEffects:()=>E,ZodEnum:()=>ce,ZodError:()=>C,ZodFirstPartyTypeKind:()=>m,ZodFunction:()=>Ze,ZodIntersection:()=>ae,ZodIssueCode:()=>c,ZodLazy:()=>ie,ZodLiteral:()=>oe,ZodMap:()=>_e,ZodNaN:()=>xe,ZodNativeEnum:()=>de,ZodNever:()=>j,ZodNull:()=>se,ZodNullable:()=>Z,ZodNumber:()=>G,ZodObject:()=>S,ZodOptional:()=>I,ZodParsedType:()=>f,ZodPipeline:()=>Ae,ZodPromise:()=>q,ZodReadonly:()=>fe,ZodRecord:()=>Pe,ZodSchema:()=>_,ZodSet:()=>ve,ZodString:()=>U,ZodSymbol:()=>ye,ZodTransformer:()=>E,ZodTuple:()=>P,ZodType:()=>_,ZodUndefined:()=>re,ZodUnion:()=>ne,ZodUnknown:()=>z,ZodVoid:()=>ge,addIssueToContext:()=>d,any:()=>er,array:()=>nr,bigint:()=>Jt,boolean:()=>ut,coerce:()=>Ar,custom:()=>ot,date:()=>Qt,datetimeRegex:()=>at,defaultErrorMap:()=>D,discriminatedUnion:()=>cr,effect:()=>xr,enum:()=>gr,function:()=>pr,getErrorMap:()=>he,getParsedType:()=>M,instanceof:()=>Yt,intersection:()=>dr,isAborted:()=>Ee,isAsync:()=>pe,isDirty:()=>je,isValid:()=>F,late:()=>qt,lazy:()=>mr,literal:()=>yr,makeIssue:()=>Ce,map:()=>fr,nan:()=>Xt,nativeEnum:()=>_r,never:()=>rr,null:()=>Ht,nullable:()=>kr,number:()=>dt,object:()=>ar,objectUtil:()=>ze,oboolean:()=>Sr,onumber:()=>Cr,optional:()=>br,ostring:()=>Rr,pipeline:()=>Tr,preprocess:()=>wr,promise:()=>vr,quotelessJson:()=>xt,record:()=>lr,set:()=>hr,setErrorMap:()=>kt,strictObject:()=>ir,string:()=>ct,symbol:()=>Kt,transformer:()=>xr,tuple:()=>ur,undefined:()=>Gt,union:()=>or,unknown:()=>tr,util:()=>v,void:()=>sr});var v;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let a={};for(let o of n)a[o]=o;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(i=>typeof n[n[i]]!="number"),o={};for(let i of a)o[i]=n[i];return r.objectValues(o)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.push(o);return a},r.find=(n,a)=>{for(let o of n)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(o=>typeof o=="string"?`\'${o}\'`:o).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var ze;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(ze||(ze={}));var f=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),M=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}};var c=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xt=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),C=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let i=s,u=0;for(;u<o.path.length;){let l=o.path[u];u===o.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(t(o))):i[l]=i[l]||{_errors:[]},i=i[l],u++}}};return n(this),s}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,v.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};C.create=r=>new C(r);var bt=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,v.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(r.options)}, received \'${r.received}\'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:v.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(r)}return{message:t}},D=bt;var et=D;function kt(r){et=r}function he(){return et}var Ce=r=>{let{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],o={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let i="",u=s.filter(l=>!!l).slice().reverse();for(let l of u)i=l(o,{data:e,defaultError:i}).message;return{...n,path:a,message:i}},wt=[];function d(r,e){let t=he(),s=Ce({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===D?void 0:D].filter(n=>!!n)});r.common.issues.push(s)}var k=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let n of t){let a=await n.key,o=await n.value;s.push({key:a,value:o})}return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:a,value:o}=n;if(a.status==="aborted"||o.status==="aborted")return p;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[a.value]=o.value)}return{status:e.value,value:s}}},p=Object.freeze({status:"aborted"}),K=r=>({status:"dirty",value:r}),T=r=>({status:"valid",value:r}),Ee=r=>r.status==="aborted",je=r=>r.status==="dirty",F=r=>r.status==="valid",pe=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var N=class{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},tt=(r,e)=>{if(F(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new C(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,i)=>{let{message:u}=r;return o.code==="invalid_enum_value"?{message:u??i.defaultError}:typeof i.data>"u"?{message:u??s??i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:u??t??i.defaultError}},description:n}}var _=class{get description(){return this._def.description}_getType(e){return M(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:M(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:M(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(pe(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)},n=this._parseSync({data:e,path:s.path,parent:s});return tt(s,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return F(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>F(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(pe(n)?n:Promise.resolve(n));return tt(s,a)}refine(e,t){let s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let o=e(n),i=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new E({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return I.create(this,this._def)}nullable(){return Z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return q.create(this,this._def)}or(e){return ne.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new E({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ue({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Se({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new le({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ae.create(this,e)}readonly(){return fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Tt=/^c[^\\s-]{8,}$/i,Rt=/^[0-9a-z]+$/,Ct=/^[0-9A-HJKMNP-TV-Z]{26}$/i,St=/^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i,At=/^[a-z0-9_-]{21}$/i,Ot=/^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/,It=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,Nt=/^(?!\\.)(?!.*\\.\\.)([A-Z0-9_\'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i,Et="^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$",Be,jt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/,Pt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Zt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,st="((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))",Dt=new RegExp(`^${st}$`);function nt(r){let e="[0-5]\\\\d";r.precision?e=`${e}\\\\.\\\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\\\.\\\\d+)?`);let t=r.precision?"+":"?";return`([01]\\\\d|2[0-3]):[0-5]\\\\d(:${e})${t}`}function Vt(r){return new RegExp(`^${nt(r)}$`)}function at(r){let e=`${st}T${nt(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\\\d{2}:?\\\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function zt(r,e){return!!((e==="v4"||!e)&&jt.test(r)||(e==="v6"||!e)&&Pt.test(r))}function Bt(r,e){if(!Ot.test(r))return!1;try{let[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Ft(r,e){return!!((e==="v4"||!e)&&Mt.test(r)||(e==="v6"||!e)&&Zt.test(r))}var U=class r extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),p}let s=new k,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,i=e.data.length<a.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")Nt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Be||(Be=new RegExp(Et,"u")),Be.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")St.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")At.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")Tt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")Rt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?at(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Dt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?Vt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?It.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?zt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Bt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Ft(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?$t.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Lt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):v.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};U.create=r=>new U({checks:[],typeName:m.ZodString,coerce:r?.coerce??!1,...y(r)});function Ut(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return a%o/10**n}var G=class r extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),p}let s,n=new k;for(let a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Ut(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};G.create=r=>new G({checks:[],typeName:m.ZodNumber,coerce:r?.coerce||!1,...y(r)});var H=class r extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s,n=new k;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};H.create=r=>new H({checks:[],typeName:m.ZodBigInt,coerce:r?.coerce??!1,...y(r)});var ee=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),p}return T(e.data)}};ee.create=r=>new ee({typeName:m.ZodBoolean,coerce:r?.coerce||!1,...y(r)});var te=class r extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),p}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),p}let s=new k,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):v.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};te.create=r=>new te({checks:[],coerce:r?.coerce||!1,typeName:m.ZodDate,...y(r)});var ye=class extends _{_parse(e){if(this._getType(e)!==f.symbol){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),p}return T(e.data)}};ye.create=r=>new ye({typeName:m.ZodSymbol,...y(r)});var re=class extends _{_parse(e){if(this._getType(e)!==f.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),p}return T(e.data)}};re.create=r=>new re({typeName:m.ZodUndefined,...y(r)});var se=class extends _{_parse(e){if(this._getType(e)!==f.null){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),p}return T(e.data)}};se.create=r=>new se({typeName:m.ZodNull,...y(r)});var W=class extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}};W.create=r=>new W({typeName:m.ZodAny,...y(r)});var z=class extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}};z.create=r=>new z({typeName:m.ZodUnknown,...y(r)});var j=class extends _{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),p}};j.create=r=>new j({typeName:m.ZodNever,...y(r)});var ge=class extends _{_parse(e){if(this._getType(e)!==f.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),p}return T(e.data)}};ge.create=r=>new ge({typeName:m.ZodVoid,...y(r)});var B=class r extends _{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return d(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),p;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(o||i)&&(d(t,{code:o?c.too_big:c.too_small,minimum:i?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(d(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(d(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>n.type._parseAsync(new N(t,o,t.path,i)))).then(o=>k.mergeArray(s,o));let a=[...t.data].map((o,i)=>n.type._parseSync(new N(t,o,t.path,i)));return k.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}};B.create=(r,e)=>new B({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function me(r){if(r instanceof S){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=I.create(me(s))}return new S({...r._def,shape:()=>e})}else return r instanceof B?new B({...r._def,type:me(r.element)}):r instanceof I?I.create(me(r.unwrap())):r instanceof Z?Z.create(me(r.unwrap())):r instanceof P?P.create(r.items.map(e=>me(e))):r}var S=class r extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){let l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:f.object,received:l.parsedType}),p}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof j&&this._def.unknownKeys==="strip"))for(let l in n.data)o.includes(l)||i.push(l);let u=[];for(let l of o){let g=a[l],R=n.data[l];u.push({key:{status:"valid",value:l},value:g._parse(new N(n,R,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof j){let l=this._def.unknownKeys;if(l==="passthrough")for(let g of i)u.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(l==="strict")i.length>0&&(d(n,{code:c.unrecognized_keys,keys:i}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let g of i){let R=n.data[g];u.push({key:{status:"valid",value:g},value:l._parse(new N(n,R,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let g of u){let R=await g.key,Oe=await g.value;l.push({key:R,value:Oe,alwaysSet:g.alwaysSet})}return l}).then(l=>k.mergeObjectSync(s,l)):k.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let s of v.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let s of v.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}deepPartial(){return me(this)}partial(e){let t={};for(let s of v.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let s of v.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof I;)a=a._def.innerType;t[s]=a}return new r({...this._def,shape:()=>t})}keyof(){return it(v.objectKeys(this.shape))}};S.create=(r,e)=>new S({shape:()=>r,unknownKeys:"strip",catchall:j.create(),typeName:m.ZodObject,...y(e)});S.strictCreate=(r,e)=>new S({shape:()=>r,unknownKeys:"strict",catchall:j.create(),typeName:m.ZodObject,...y(e)});S.lazycreate=(r,e)=>new S({shape:r,unknownKeys:"strip",catchall:j.create(),typeName:m.ZodObject,...y(e)});var ne=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=a.map(i=>new C(i.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:o}),p}if(t.common.async)return Promise.all(s.map(async a=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);{let a,o=[];for(let u of s){let l={...t,common:{...t.common,issues:[]},parent:null},g=u._parseSync({data:t.data,path:t.path,parent:l});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(u=>new C(u));return d(t,{code:c.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}};ne.create=(r,e)=>new ne({options:r,typeName:m.ZodUnion,...y(e)});var V=r=>r instanceof ie?V(r.schema):r instanceof E?V(r.innerType()):r instanceof oe?[r.value]:r instanceof ce?r.options:r instanceof de?v.objectValues(r.enum):r instanceof ue?V(r._def.innerType):r instanceof re?[void 0]:r instanceof se?[null]:r instanceof I?[void 0,...V(r.unwrap())]:r instanceof Z?[null,...V(r.unwrap())]:r instanceof Se||r instanceof fe?V(r.unwrap()):r instanceof le?V(r._def.innerType):[],Me=class r extends _{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return d(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),p;let s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let a of t){let o=V(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \\`${e}\\` could not be extracted from all schema options`);for(let i of o){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,a)}}return new r({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}};function Fe(r,e){let t=M(r),s=M(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){let n=v.objectKeys(e),a=v.objectKeys(r).filter(i=>n.indexOf(i)!==-1),o={...r,...e};for(let i of a){let u=Fe(r[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let o=r[a],i=e[a],u=Fe(o,i);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var ae=class extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(a,o)=>{if(Ee(a)||Ee(o))return p;let i=Fe(a.value,o.value);return i.valid?((je(a)||je(o))&&t.dirty(),{status:t.value,value:i.data}):(d(s,{code:c.invalid_intersection_types}),p)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>n(a,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};ae.create=(r,e,t)=>new ae({left:r,right:e,typeName:m.ZodIntersection,...y(t)});var P=class r extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return d(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),p;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...s.data].map((o,i)=>{let u=this._def.items[i]||this._def.rest;return u?u._parse(new N(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>k.mergeArray(t,o)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};P.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:r,typeName:m.ZodTuple,rest:null,...y(e)})};var Pe=class r extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return d(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),p;let n=[],a=this._def.keyType,o=this._def.valueType;for(let i in s.data)n.push({key:a._parse(new N(s,i,s.path,i)),value:o._parse(new N(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?k.mergeObjectAsync(t,n):k.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof _?new r({keyType:e,valueType:t,typeName:m.ZodRecord,...y(s)}):new r({keyType:U.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}},_e=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return d(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),p;let n=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([i,u],l)=>({key:n._parse(new N(s,i,s.path,[l,"key"])),value:a._parse(new N(s,u,s.path,[l,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let u of o){let l=await u.key,g=await u.value;if(l.status==="aborted"||g.status==="aborted")return p;(l.status==="dirty"||g.status==="dirty")&&t.dirty(),i.set(l.value,g.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let u of o){let l=u.key,g=u.value;if(l.status==="aborted"||g.status==="aborted")return p;(l.status==="dirty"||g.status==="dirty")&&t.dirty(),i.set(l.value,g.value)}return{status:t.value,value:i}}}};_e.create=(r,e,t)=>new _e({valueType:e,keyType:r,typeName:m.ZodMap,...y(t)});var ve=class r extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return d(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),p;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function o(u){let l=new Set;for(let g of u){if(g.status==="aborted")return p;g.status==="dirty"&&t.dirty(),l.add(g.value)}return{status:t.value,value:l}}let i=[...s.data.values()].map((u,l)=>a._parse(new N(s,u,s.path,l)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new r({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ve.create=(r,e)=>new ve({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});var Ze=class r extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return d(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),p;function s(i,u){return Ce({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),D].filter(l=>!!l),issueData:{code:c.invalid_arguments,argumentsError:u}})}function n(i,u){return Ce({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),D].filter(l=>!!l),issueData:{code:c.invalid_return_type,returnTypeError:u}})}let a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof q){let i=this;return T(async function(...u){let l=new C([]),g=await i._def.args.parseAsync(u,a).catch(ke=>{throw l.addIssue(s(u,ke)),l}),R=await Reflect.apply(o,this,g);return await i._def.returns._def.type.parseAsync(R,a).catch(ke=>{throw l.addIssue(n(R,ke)),l})})}else{let i=this;return T(function(...u){let l=i._def.args.safeParse(u,a);if(!l.success)throw new C([s(u,l.error)]);let g=Reflect.apply(o,this,l.data),R=i._def.returns.safeParse(g,a);if(!R.success)throw new C([n(g,R.error)]);return R.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:P.create(e).rest(z.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||P.create([]).rest(z.create()),returns:t||z.create(),typeName:m.ZodFunction,...y(s)})}},ie=class extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};ie.create=(r,e)=>new ie({getter:r,typeName:m.ZodLazy,...y(e)});var oe=class extends _{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}};oe.create=(r,e)=>new oe({value:r,typeName:m.ZodLiteral,...y(e)});function it(r,e){return new ce({values:r,typeName:m.ZodEnum,...y(e)})}var ce=class r extends _{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{expected:v.joinValues(s),received:t.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:s}),p}return T(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};ce.create=it;var de=class extends _{_parse(e){let t=v.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){let n=v.objectValues(t);return d(s,{expected:v.joinValues(n),received:s.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=v.objectValues(t);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),p}return T(e.data)}get enum(){return this._def.values}};de.create=(r,e)=>new de({values:r,typeName:m.ZodNativeEnum,...y(e)});var q=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),p;let s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return T(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};q.create=(r,e)=>new q({type:r,typeName:m.ZodPromise,...y(e)});var E=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:o=>{d(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let o=n.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return p;let u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?p:u.status==="dirty"?K(u.value):t.value==="dirty"?K(u.value):u});{if(t.value==="aborted")return p;let i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?p:i.status==="dirty"?K(i.value):t.value==="dirty"?K(i.value):i}}if(n.type==="refinement"){let o=i=>{let u=n.refinement(i,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?p:(i.status==="dirty"&&t.dirty(),o(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?p:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(n.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!F(o))return p;let i=n.transform(o.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>F(o)?Promise.resolve(n.transform(o.value,a)).then(i=>({status:t.value,value:i})):p);v.assertNever(n)}};E.create=(r,e,t)=>new E({schema:r,typeName:m.ZodEffects,effect:e,...y(t)});E.createWithPreprocess=(r,e,t)=>new E({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...y(t)});var I=class extends _{_parse(e){return this._getType(e)===f.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};I.create=(r,e)=>new I({innerType:r,typeName:m.ZodOptional,...y(e)});var Z=class extends _{_parse(e){return this._getType(e)===f.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z({innerType:r,typeName:m.ZodNullable,...y(e)});var ue=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ue.create=(r,e)=>new ue({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var le=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return pe(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new C(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new C(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};le.create=(r,e)=>new le({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var xe=class extends _{_parse(e){if(this._getType(e)!==f.nan){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),p}return{status:"valid",value:e.data}}};xe.create=r=>new xe({typeName:m.ZodNaN,...y(r)});var Wt=Symbol("zod_brand"),Se=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Ae=class r extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),K(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:m.ZodPipeline})}},fe=class extends _{_parse(e){let t=this._def.innerType._parse(e),s=n=>(F(n)&&(n.value=Object.freeze(n.value)),n);return pe(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}};fe.create=(r,e)=>new fe({innerType:r,typeName:m.ZodReadonly,...y(e)});function rt(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function ot(r,e={},t){return r?W.create().superRefine((s,n)=>{let a=r(s);if(a instanceof Promise)return a.then(o=>{if(!o){let i=rt(e,s),u=i.fatal??t??!0;n.addIssue({code:"custom",...i,fatal:u})}});if(!a){let o=rt(e,s),i=o.fatal??t??!0;n.addIssue({code:"custom",...o,fatal:i})}}):W.create()}var qt={object:S.lazycreate},m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));var Yt=(r,e={message:`Input not instance of ${r.name}`})=>ot(t=>t instanceof r,e),ct=U.create,dt=G.create,Xt=xe.create,Jt=H.create,ut=ee.create,Qt=te.create,Kt=ye.create,Gt=re.create,Ht=se.create,er=W.create,tr=z.create,rr=j.create,sr=ge.create,nr=B.create,ar=S.create,ir=S.strictCreate,or=ne.create,cr=Me.create,dr=ae.create,ur=P.create,lr=Pe.create,fr=_e.create,hr=ve.create,pr=Ze.create,mr=ie.create,yr=oe.create,gr=ce.create,_r=de.create,vr=q.create,xr=E.create,br=I.create,kr=Z.create,wr=E.createWithPreprocess,Tr=Ae.create,Rr=()=>ct().optional(),Cr=()=>dt().optional(),Sr=()=>ut().optional(),Ar={string:r=>U.create({...r,coerce:!0}),number:r=>G.create({...r,coerce:!0}),boolean:r=>ee.create({...r,coerce:!0}),bigint:r=>H.create({...r,coerce:!0}),date:r=>te.create({...r,coerce:!0})};var Or=p;var Ns=be.union([be.enum(["low","medium","high","always-visible"]),be.number()]);var $e=5;var Ir=9,Y=200,Le=10;function lt(r,e,t,s,n,a,o="-1"){let i=1/0,u=1/0,l=-1/0,g=-1/0,R=new b(-Le,0,5,t),Oe=new b(-Le,0,e,5),ke=new b(e-5,0,e+Le,t),ht=new b(0,t-5,e,t+Le),pt=Nr(e,t,s,n,a),mt=[R,Oe,ke,ht],Ue=new b(-Y,-Y,e+Y*2,t+Y*2);for(let x of r){let $,Te;for(let A=0;A<x.bboxes.length;A++){if(x.bboxes[A]==null||($=x.bboxes[A].boundingBox,Te=x.bboxes[A].index,x.lockedToStrategyIndex!==-1&&Te!==x.lockedToStrategyIndex))continue;let[Ne,O,J,qe]=$,[Q,yt,Ye,gt]=[x.y-Ne,x.y+O,x.x-J,x.x+qe],De=Ye,Ve=Q,Xe=gt-Ye,Je=yt-Q;i=Math.min(i,De)-Y,u=Math.min(u,Ve)-Y,l=Math.max(l,De+Xe)+Y,g=Math.max(g,Ve+Je)+Y,x.bboxes[A].boundingRect=new b(De,Ve,Xe,Je)}}let Ie=new Re(new b(i,u,l-i,g-u)),X={msgId:o,colliders:new Array(r.length),staticColliders:[],debug:[]},We=0;for(let x=0;x<r.length;x++){let $=r[x];$.bboxes?.[0]?.index===Ir&&(X.staticColliders.push($.bboxes[0].boundingRect),Ie.insert($.bboxes[0].boundingRect),We++)}r=r.slice(We,r.length);let we;for(let x=0;x<r.length;x++)if(we=r[x],X.colliders[x]=[-1,0],we.enabledAndVisible){let[$,Te,A]=[1/0,-1,void 0];for(let{index:Ne,boundingRect:O}of we.bboxes){if(O==null)continue;let J=[];if(J=Ie.queryRect(O).filter(Q=>O.intersects(Q)),we.shouldCollideWithScreenEdges&&mt.forEach(Q=>{O.intersects(Q)&&J.push(Q)}),O.intersects(pt)){X.colliders[x]=[-1,0,O];break}if(J.length<=$&&(A=O,Te=Ne,$=J.length),J.length===0){Ie.insert(O),X.colliders[x]=[Ne,Ue.contains(O)?0:1,O];break}}we.rank===$e&&A!=null&&(Ie.insert(A),X.colliders[x]=[Te,Ue.contains(A)?0:1,A])}else X.colliders[x]=[-1,0];return X}function Nr(r,e,t,s,n){switch(n){case"top-right":return new b(r-t,0,t,s);case"bottom-left":return new b(0,e-s,t,s);case"bottom-right":return new b(r-t,e-s,t,s);case"top-left":return new b(0,0,t,s)}}function ft(r){let e=r[0].map(t=>{let s=t[0].map(n=>({index:n[4],boundingBox:[n[0],n[1],n[2],n[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?$e:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:s,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:r[3],totalHeight:r[2],watermarkWidth:r[4],watermarkHeight:r[5],watermarkPosition:r[6],colliders:e,devicePixelRatio:r[1]}}self.onmessage=r=>{let e=ft(r.data);self.postMessage(lt(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';d();d();d();d();d();function RD(e,r){return r.x+r.w<e.x+e.w&&r.x>e.x&&r.y>e.y&&r.y+r.h<e.y+e.h}d();function BD(e,r){let[t,o]=r;return t>=e.x&&t<=e.x+e.w&&o>=e.y&&o<=e.y+e.h}d();function ND(e,r){let t=r.x,o=r.y,n=r.x+r.w,i=r.y+r.h,a=e.x,l=e.y,c=e.x+e.w,p=e.y+e.h;return t<c&&a<n&&o<p&&l<i}d();function pa(e,r){for(let t=0;t<r.length;t++)e.push(r[t])}d();var rt=class{constructor(r,t,o,n,i){m(this,"x");m(this,"y");m(this,"w");m(this,"h");m(this,"userData");this.userData=typeof i>"u"?null:i,this.x=r,this.y=t,this.w=o,this.h=n}contains(r){return r===this?!1:RD(this,r)}intersects(r){return ND(this,r)}intersectsPoint(r){return BD(this,r)}draw(r){r.fillStyle="rgba(123,222,26, 0.8)",r.fillRect(this.x,this.y,this.w,this.h)}};var Ln=class e{constructor(r,t){m(this,"topLeft");m(this,"topRight");m(this,"bottomLeft");m(this,"bottomRight");m(this,"divided",!1);m(this,"boundary");m(this,"capacity",16);m(this,"objects",[]);m(this,"parent");this.parent=t,this.boundary=r}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:r,y:t,w:o,h:n}=this.boundary;this.topLeft=new e(new rt(r,t,o/2,n/2),this),this.topRight=new e(new rt(r+o/2,t,o/2,n/2),this),this.bottomLeft=new e(new rt(r,t+n/2,o/2,n/2),this),this.bottomRight=new e(new rt(r+o/2,t+n/2,o/2,n/2),this),this.divided=!0}queryRect(r){let t=[];if(this.boundary.intersects(r))t.push(...this.objects);else return[];return this.divided&&(pa(t,this.topLeft.queryRect(r)),pa(t,this.topRight.queryRect(r)),pa(t,this.bottomLeft.queryRect(r)),pa(t,this.bottomRight.queryRect(r))),t}queryPoint(r){let t=[];if(this.boundary.intersectsPoint(r))t.push(...this.objects);else return[];return this.divided&&(pa(t,this.topLeft.queryPoint(r)),pa(t,this.topRight.queryPoint(r)),pa(t,this.bottomLeft.queryPoint(r)),pa(t,this.bottomRight.queryPoint(r))),t}insert(r){return(this.parent?!this.boundary.contains(r):!this.boundary.intersects(r))?!1:this.objects.length<this.capacity?(this.objects.push(r),!0):(this.divided||this.subdivide(),(this.topLeft.insert(r)||this.topRight.insert(r)||this.bottomLeft.insert(r)||this.bottomRight.insert(r))===!1&&this.objects.push(r),!0)}drawObjects(r){this.objects.forEach(t=>t.draw(r)),this.divided&&(this.topLeft.drawObjects(r),this.topRight.drawObjects(r),this.bottomLeft.drawObjects(r),this.bottomRight.drawObjects(r))}draw(r){r.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(r),this.topRight.draw(r),this.bottomLeft.draw(r),this.bottomRight.draw(r)),r.strokeStyle="black",r.lineWidth=4,r.stroke()}};d();function jD(e,r,t){let o,n,i,a=null,l=0;t||(t={});let c=function(){l=t.leading===!1?0:Date.now(),a=null,i=e.apply(o,n),a||(o=n=null)};return function(){let p=Date.now();!l&&t.leading===!1&&(l=p);let u=r-(p-l);return o=globalThis,n=arguments,u<=0||u>r?(a&&(clearTimeout(a),a=null),l=p,i=e.apply(o,n),a||(o=n=null)):!a&&t.trailing!==!1&&(a=setTimeout(c,u)),i}}function GD(e){let r=e[0].map(t=>{let o=t[0].map(n=>({index:n[4],boundingBox:[n[0],n[1],n[2],n[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?Sp:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:o,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:e[3],totalHeight:e[2],watermarkWidth:e[4],watermarkHeight:e[5],watermarkPosition:e[6],colliders:r,devicePixelRatio:e[1]}}d();var x2=9,gl=200,D1=10;function UD(e,r,t,o,n,i,a="-1"){let l=1/0,c=1/0,p=-1/0,u=-1/0,f=new rt(-D1,0,5,t),h=new rt(-D1,0,r,5),b=new rt(r-5,0,r+D1,t),v=new rt(0,t-5,r,t+D1),T=F$(r,t,o,n,i),x=[f,h,b,v],I=new rt(-gl,-gl,r+gl*2,t+gl*2);for(let _ of e){let G,R;for(let N=0;N<_.bboxes.length;N++){if(_.bboxes[N]==null||(G=_.bboxes[N].boundingBox,R=_.bboxes[N].index,_.lockedToStrategyIndex!==-1&&R!==_.lockedToStrategyIndex))continue;let[X,z,ee,re]=G,[ue,Ce,Oe,Pe]=[_.y-X,_.y+z,_.x-ee,_.x+re],Fe=Oe,ce=ue,Ee=Pe-Oe,ye=Ce-ue;l=Math.min(l,Fe)-gl,c=Math.min(c,ce)-gl,p=Math.max(p,Fe+Ee)+gl,u=Math.max(u,ce+ye)+gl,_.bboxes[N].boundingRect=new rt(Fe,ce,Ee,ye)}}let M=new Ln(new rt(l,c,p-l,u-c)),O={msgId:a,colliders:new Array(e.length),staticColliders:[],debug:[]},C=0;for(let _=0;_<e.length;_++){let G=e[_];G.bboxes?.[0]?.index===x2&&(O.staticColliders.push(G.bboxes[0].boundingRect),M.insert(G.bboxes[0].boundingRect),C++)}e=e.slice(C,e.length);let E;for(let _=0;_<e.length;_++)if(E=e[_],O.colliders[_]=[-1,0],E.enabledAndVisible){let[G,R,N]=[1/0,-1,void 0];for(let{index:X,boundingRect:z}of E.bboxes){if(z==null)continue;let ee=[];if(ee=M.queryRect(z).filter(ue=>z.intersects(ue)),E.shouldCollideWithScreenEdges&&x.forEach(ue=>{z.intersects(ue)&&ee.push(ue)}),z.intersects(T)){O.colliders[_]=[-1,0,z];break}if(ee.length<=G&&(N=z,R=X,G=ee.length),ee.length===0){M.insert(z),O.colliders[_]=[X,I.contains(z)?0:1,z];break}}E.rank===Sp&&N!=null&&(M.insert(N),O.colliders[_]=[R,I.contains(N)?0:1,N])}else O.colliders[_]=[-1,0];return O}function F$(e,r,t,o,n){switch(n){case"top-right":return new rt(e-t,0,t,o);case"bottom-left":return new rt(0,r-o,t,o);case"bottom-right":return new rt(e-t,r-o,t,o);case"top-left":return new rt(0,0,t,o)}}d();var jf=class{constructor(){m(this,"onerror",()=>{});m(this,"onmessage",()=>{});m(this,"postMessage",r=>{let t=GD(r);this.onmessage({data:UD(t.colliders,t.totalWidth,t.totalHeight,t.watermarkWidth,t.watermarkHeight,t.watermarkPosition,t.msgId)})});m(this,"terminate",()=>{})}};var yu=!1,D$=150,k1=class extends ke{constructor(t,o,n=!0){super();m(this,"worker");m(this,"debugContext");m(this,"debugCanvas");m(this,"collidersDirty",!0);m(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);m(this,"visibleCollidersQTree",new Ln(new rt(0,0,0,0)));m(this,"interactiveCollidersQTree",new Ln(new rt(0,0,0,0)));m(this,"coreState");m(this,"postMessage");m(this,"showCollisionBoxes",()=>{yu=!0,this.debugCanvas.style.display="block"});m(this,"hideCollisionBoxes",()=>{yu=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});m(this,"currentMsgId","");m(this,"working",!1);m(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});m(this,"componentArray",[]);m(this,"update",(t,o,n="bottom-left",i=!1,a=[])=>{let l=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let u;for(let f of this.coreState.geometry2DIdsInScene){let h=this.coreState.geometry2DMap.get(f);h&&(u=h.components[0],this.componentArray.push(u))}this.resize(t,o,n),this.collidersDirty=!1,l=!0}else l=this.componentArray.some(u=>u.collisionDirty===!0);l&&this.componentArray.sort((u,f)=>f.rank-u.rank);let c=0;for(let u of a)this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=[[u.h/2,u.h/2,u.w/2,u.w/2,x2]],this.packedMessage[0][c][1]=1,this.packedMessage[0][c][2]=1,this.packedMessage[0][c][3]=u.x,this.packedMessage[0][c][4]=u.y,this.packedMessage[0][c][5]=0,this.packedMessage[0][c][6]=-1,c++;let p=0;for(;c<this.componentArray.length+a.length;){if(this.packedMessage){let u=this.componentArray[p].toPackedMessage(i&&!l);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=u.bboxes,this.packedMessage[0][c][1]=u.enabled&&this.componentArray[p].visible&&!this.componentArray[p].isOccluded?1:0,this.packedMessage[0][c][2]=u.rank===Sp?1:0,this.packedMessage[0][c][3]=u.x,this.packedMessage[0][c][4]=u.y,this.packedMessage[0][c][5]=u.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=u.lockedToStrategyIndex}c++,p++}this.working||this.postMessage()});m(this,"resolve",t=>{if(this.working=!1,this.collidersDirty||!t.data)return;let o=t.data.colliders,n=-1,i,a,l,c=new rt(0,0,this.debugCanvas.width,this.debugCanvas.height);if(this.visibleCollidersQTree=new Ln(c),this.interactiveCollidersQTree=new Ln(c),yu)for(let p of t.data.staticColliders)this.visibleCollidersQTree.insert(new rt(p.x,p.y,p.w,p.h));for(let p=0;p<this.componentArray.length;p++){let u=this.componentArray[p];o[p]!=null&&(n=o[p][0],i=o[p][2],u.offscreen=o[p][1]===1,n!==-1&&i!=null?(l=new rt(i.x,i.y,i.w,i.h,{entityId:u.id}),this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(u.id),a?.components[1]!=null&&this.interactiveCollidersQTree.insert(l),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),n!==-1&&n!==u.currentStrategyIndex&&(u.activeBoundingBox=l,u.onStrategySelected(n))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),n!==-1&&n!==u.currentStrategyIndex&&u.onStrategySelected(n)))}yu&&this.drawDebug(),this.publish("visibility-changed")});m(this,"drawDebug",()=>{yu&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});m(this,"destroy",()=>{this.worker.terminate()});this.worker=n===!1?new jf:Fc!==""?new Worker(Fc):new Worker(URL.createObjectURL(new Blob([_D],{type:"text/javascript"}))),this.worker.onerror=()=>{this.worker=new jf,this.worker.onmessage=i=>this.resolve(i)},this.coreState=o,this.debugCanvas=t,this.debugContext=t.getContext("2d"),this.worker.onmessage=i=>this.resolve(i),this.postMessage=jD(this._postMessage,D$,!1),yu?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(t,o,n){this.packedMessage[6]=n,this.packedMessage[5]=o,this.packedMessage[4]=t,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};d();d();d();d();var A1=class{constructor(r){m(this,"type");m(this,"event");this.type=0,this.event=r}get timestamp(){return this.event.timeStamp}},L1=class{constructor(){m(this,"taps",[])}add(r){this.lastPointerDown&&r.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(r)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){return this.isSingleTap&&this.lastPointerDown?.type===1}get isSingleTapWithOneFinger(){return this.isSingleTap&&this.lastPointerDown?.type===0}get isDoubleTapWithOneFinger(){return this.isDoubleTap&&this.taps[0]?.type===0&&this.taps[1]?.type===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(r){this.taps=this.taps.filter(t=>r-t.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};d();function I2(e){let r=new Set;for(let t of e){let o=t.object;for(;o.visible&&o.parent&&o.parent.visible===!0&&!r.has(o.parent);)o=o.parent,o instanceof hr&&o.type==="group-container"&&o.visible&&o.components[0]&&r.add(o)}return Array.from(r)}var bu,Gf=class extends ke{constructor(t,o,n,i,a){super();m(this,"raycaster",new Pi);m(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});m(this,"coreState");m(this,"camera");m(this,"worldPlane");m(this,"_quadtree",new Ln(new rt(0,0,0,0)));m(this,"_container");m(this,"lastPointerEvent");m(this,"cursor","grab");m(this,"touchesCount",0);m(this,"isUserInteracting");m(this,"hasTouched",!1);S(this,bu);m(this,"onPointerMoveRaf",t=>{this.lastPointerEvent=t,s(this,bu)&&cancelAnimationFrame(s(this,bu)),w(this,bu,requestAnimationFrame(()=>{this.onPointerMove(t)}))});m(this,"onPointerMove",t=>{t.preventDefault(),this.updateInteractionStateIfPanning(t),(t.pointerType!=="touch"||t.pointerType===void 0&&this.hasTouched)&&this.handleHover(t),this.handleCursor()});m(this,"tapsControl",new L1);m(this,"onPointerDown",t=>{t.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:t.timeStamp,offsetX:t.offsetX,offsetY:t.offsetY},this.lastPointerEvent=t,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),t.pointerType==="touch"&&(this.tapsControl.add(new A1(t)),this.touchesCount=Math.max(0,this.touchesCount+1)))});m(this,"clickTimeout");m(this,"onPointerUp",t=>{this.tapsControl.discardOutsideOfWaitWindow(t.timeStamp),this.lastPointerEvent=t,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(t);let{mouseDownStart:o}=this.state.interaction;!o||this.state.interaction.distanceFromMouseDown==null||(Date.now()<o.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(t.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",t),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(t),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",t),this.flush()):this.handleClick(t)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())});m(this,"dirty3D",!0);m(this,"cachedHitBoxes",{entities:[]});m(this,"ndcPoint",new Me);m(this,"debugPanel");this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=t,this.coreState=o,this.worldPlane=i,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(t){this._quadtree=t}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let t=this.state.hovered3DEntity.components[2];t&&(t.dirty=!0)}}getThreeDIntersectsFromXY(t){this.raycaster.setFromCamera(t,this.camera),this.raycaster.layers.enable(0);let o=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(i=>i.object?.name==="worldPlane"||i.object?.visible),n=o.findIndex(i=>i.object?.name==="worldPlane");return n!==-1&&o.push(o.splice(n,1)[0]),o}getGroupContainerIntersectsFromXY(t){let o=this.getThreeDIntersectsFromXY(t),n;return o!=null&&o.length>0&&(n=I2(o)),n}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(t){let o=t||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!o||this.isUserInteracting())return;let{entity3D:n,entity2D:i,position:a,groupContainers:l}=this.intersect(o);(this.detect3DEntityHover(n)||this.detect2DEntityHover(i)||this.detect3DContainerHover(l))&&(this.state.hovered3DEntity=n,this.state.lastHover=n,this.state.hovered2DEntity=i,this.state.hovered3DContainers=l,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:l})),this.handleCursor()}handleCursor(){let t=!!(this.state.hovered3DEntity&&this.state.hovered3DEntity?.components[2]||this.state.hovered2DEntity),o=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,i=L$(t,n,o);this.cursor!==i&&(this.cursor=i,i==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(t){return this.state.hovered2DEntity!==t}handleClick(t){let o=this.intersect(t);this.publish("click",{entity2D:o.entity2D,entity3D:o.entity3D,position:o.position,groupContainers:o.groupContainers,pointerEvent:{button:t.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[];let t;for(let o of this.coreState.geometry3DIdsInScene)t=this.coreState.geometry3DMap.get(o),(t?.type==="geometry"||t?.type==="model"||t?.type==="path"||t?.type==="custom-geometry")&&t.components[0].mesh&&!this.cachedHitBoxes.entities.includes(t.components[0].mesh)&&this.cachedHitBoxes.entities.push(t.components[0].mesh);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(t){let{offsetX:o,offsetY:n}=t,i=[o,n],a=this._quadtree.queryPoint(i),[l]=a.filter(I=>I.intersectsPoint(i));this.ndcPoint.x=o/this._container.clientWidth*2-1,this.ndcPoint.y=-(n/this._container.clientHeight)*2+1;let c=this.getThreeDIntersectsFromXY(this.ndcPoint),p=c[0]?.point,u=[],f=[],h=c.filter(I=>I.object.name!=="worldPlane");for(let I of h)I.object instanceof Le&&I.object.material.depthTest===!1?u.push(I):f.push(I);let b=u[0]??f[0]??void 0,v,T;if(b!=null){if(v=R$(b.object,this.coreState.geometry3DMap),!v){let I=b?.instanceId??b?.batchId;v=I!=null&&b?.object.userData.entities?this.coreState.geometry3DMap.get(b?.object.userData.entities[I]):this.coreState.geometry3DMap.get(b?.object.userData.entityId)}v?.components[2]&&(T=v)}let x=I2(h);return{entity2D:l?.userData?.entityId==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(l?.userData.entityId),entity3D:T,position:p,groupContainers:x.length>0?x:void 0}}detect3DEntityHover(t){return this.state.lastHover!==t&&(this.state.lastHover&&HD(this.state.lastHover,!1,this.coreState),t&&HD(t,!0,this.coreState)),this.state.hovered3DEntity!==t}detect3DContainerHover(t){return!MC(this.state.hovered3DContainers,t)}updateInteractionStateIfPanning(t){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(t.offsetX-this.state.interaction.mouseDownStart.offsetX,2)+Math.pow(t.offsetY-this.state.interaction.mouseDownStart.offsetY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="white",t.style.padding="10px",document.body.append(t),t.id="interaction-debug-panel",this.debugPanel=t,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",o=>{this.queueDebugMessage(`CLICK
|
|
7
|
+
3D: ${o.entity3D?.id}
|
|
8
|
+
2D: ${o.entity2D?.id}
|
|
9
|
+
Pos: ${o.position?.toArray().join(", ")}`,"#fdffb6")}),this.on("hover",o=>{this.queueDebugMessage(`HOVER
|
|
10
|
+
3D: ${o.entity3D?.id}
|
|
11
|
+
2D: ${o.entity2D?.id}
|
|
12
|
+
Pos: ${o.position?.toArray().join(", ")}`,"#caffbf")})}get _state(){return this.state}queueDebugMessage(t,o){let n=document.createElement("pre");n.style.maxWidth="300px",n.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",n.style.backgroundColor=o,n.textContent=t,this.debugPanel?.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};bu=new WeakMap;function HD(e,r,t){let o=e.components[2];o&&o.hover!==!0&&(o.hover=r?"user-interaction":!1,o.dirty=!0);let n=e.components[0].textMesh?.userData.entityId;if(!n)return;let i=t.geometry3DMap.get(n);i?.type==="text3d"&&(i.components[1].hoverByPolygon=r,i.components[1].dirty=!0)}function L$(e,r,t){return r?"grabbing":e?"pointer":t?"grabbing":"grab"}function _$(e){let r=e;for(;r?.parent;){if(r instanceof Ra)return;if(r.userData.isSingleModel)return r;r=r.parent}}function R$(e,r){let t=_$(e);return t?r.get(t.userData.entityId):void 0}d();d();var Dc,ss,_1,bl,zD,Vf,R1,WD,ZD,$f,B1,Hf,zf,N1,Uf=class{constructor(r){S(this,bl);S(this,Dc,null);S(this,ss);m(this,"getCurrentSceneGLTF",async r=>{let t={onlyVisible:!0,binary:!0,light:!0,scale:1,...r},o=await W(this,bl,zD).call(this),n=s(this,_1).call(this,t),i=await o.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:t.onlyVisible,binary:t.binary,scale:t.scale}),a;if(i instanceof ArrayBuffer)a=new Blob([i],{type:"application/octet-stream"});else{let l=JSON.stringify(i,null,2);a=new Blob([l],{type:"text/plain"})}return a});S(this,_1,r=>{let{scale:t,light:o,onlyVisible:n}=r,i=new Ra,a=new sr().setFromObject(s(this,ss).entityScene);if(s(this,Vf).call(this,s(this,ss).entityScene,i,n),o){let l=new oy(16777215,.3*Math.PI);l.position.set(0,Math.max(a.max.x,a.max.y)*t*.5,a.max.y*t*4),l.lookAt(0,0,-1),l.target.position.set(0,0,-1),l.add(l.target),i.add(l)}return i});S(this,Vf,(r,t,o)=>{r.material&&(r instanceof ey?W(this,bl,WD).call(this,r).forEach(n=>t.add(n)):r instanceof dm&&t.add(W(this,bl,ZD).call(this,r))),r.children.forEach(n=>{(!o||n.visible)&&s(this,Vf).call(this,n,t,o)})});S(this,R1,(r,t,o)=>{let n=new vC({color:new ar(r),metalness:0});return n.opacity=t,n.transparent=o,n});S(this,$f,r=>{let{geometry:t,material:o,position:n,rotation:i,quaternion:a,scale:l}=r;if(!t?.isBufferGeometry)return r;let c=t.attributes.position,p=t.attributes.normal,u=t.attributes.uv;return s(this,B1).call(this,c,p),s(this,zf).call(this,n,l,i,a),u&&s(this,N1).call(this,u),o?.map&&t.type==="PlaneGeometry"&&(r.side=ws),r});S(this,B1,(r,t)=>{let o=new ae,n=new ae;for(let i=0;i<r.count;i++)o.fromBufferAttribute(r,i),s(this,Hf).call(this,o),r.setXYZ(i,o.x,o.y,o.z),t&&(n.fromBufferAttribute(t,i),s(this,Hf).call(this,n),t.setXYZ(i,n.x,n.y,n.z))});S(this,Hf,r=>{let t=r.y;r.y=r.z,r.z=-t});S(this,zf,(r,t,o,n)=>{let i=r.y;r.y=r.z,r.z=-i;let a=t.y;if(t.y=t.z,t.z=a,o instanceof yp)o.order="YXZ",o.set(o.x,o.y,o.z,o.order);else{let l=n.y;n.set(n.x,n.z,-l,n.w)}});S(this,N1,r=>{for(let t=0;t<r.count;t++){let o=r.getX(t),n=r.getY(t);r.setXY(t,o,n)}});w(this,ss,r),s(this,ss).entityScene=r.entityScene,s(this,ss).geometry3DMap=r.geometry3DMap}destroy(){w(this,Dc,null)}};Dc=new WeakMap,ss=new WeakMap,_1=new WeakMap,bl=new WeakSet,zD=async function(){if(!s(this,Dc)){let{GLTFExporter:r}=await import("./GLTFExporter-KUER62PN.js");w(this,Dc,new r)}return s(this,Dc)},Vf=new WeakMap,R1=new WeakMap,WD=function(r){let t=[],n=(r.userData?.entities?Object.values(r.userData?.entities):[]).map(a=>s(this,ss).geometry3DMap.get(a)),i=new Map;return n.forEach(a=>{if(!a||!(a instanceof Mt))return;let l=a.components[1],c=a.components[2];if(!l.visible||l instanceof Ri&&l.opacity===0||l instanceof bm||l instanceof hy)return;let u=`${c?.hover?l.hoverColor||s(this,ss).hoverColor:l.color}-${l.opacity}-${Number(l.visible)}`;i.has(u)||i.set(u,[]),i.get(u)?.push(a)}),i.forEach((a,l)=>{let[c,p,u]=l.split("-"),f=a.reduce((T,x)=>{if(x.type==="custom-geometry")return T;let I=x.components[0];return"geometry"in I&&I.geometry instanceof Qg&&T.push(I.geometry),T},[]),h=s(this,R1).call(this,c,Number(p),r.material.transparent),b=_i(f,!0),v=new Le(b,h);v.position.copy(r.position),v.rotation.copy(r.rotation),v.scale.copy(r.scale),v.visible=!!u,s(this,zf).call(this,v.position,v.scale,v.rotation,v.quaternion),t.push(s(this,$f).call(this,v))}),t},ZD=function(r){let t=r.geometry.clone(),o=r.material,n=new Nr({color:o.color,side:ws});n.opacity=o.opacity,n.transparent=o.transparent;let i=new dm(t,n);return i.position.copy(r.position),i.rotation.copy(r.rotation),i.scale.copy(r.scale),i.visible=r.visible,s(this,$f).call(this,i)},$f=new WeakMap,B1=new WeakMap,Hf=new WeakMap,zf=new WeakMap,N1=new WeakMap;d();d();var B$="gray",N$=.1,Wf=100,T2=new Li.ClipperOffset;function j$(e,r){T2.Clear(),r/=2;let t=e.map(n=>({X:n.x*Wf,Y:n.y*Wf}));T2.AddPath(t,Li.JoinType.jtMiter,Li.EndType.etClosedPolygon);let o=new Li.Paths;return T2.Execute(o,r*Wf),o.length?o.map(i=>i.map(a=>({x:a.X/Wf,y:a.Y/Wf}))):[e]}function j1(e,r,t){let{color:o=B$,opacity:n=1,altitude:i=0,height:a=N$}=t||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i},center:{x:0,y:0,z:(a+i)/2}},p=e.geometry.coordinates[0].map(b=>{let v=r(b[1],b[0]);return l.min.x=Math.min(l.min.x,v.x),l.min.y=Math.min(l.min.y,v.y),l.max.x=Math.max(l.max.x,v.x),l.max.y=Math.max(l.max.y,v.y),v});e.properties?.style?.edgeOffset!=null&&e.properties.style.edgeOffset!==0||e.properties?.image!=null?p=j$(p,e.properties?.style?.edgeOffset||0):p=[p];let u=[];for(let b of p){let v=new Na;v.moveTo(b[0].x,b[0].y),b.slice(1).forEach(M=>v.lineTo(M.x,M.y)),v.lineTo(b[0].x,b[0].y);let T=e.geometry.coordinates.slice(1);v.holes=T.map(M=>{let O=M.map(E=>r(E[1],E[0])),C=new bp;return C.moveTo(O[0].x,O[0].y),O.slice(1).forEach(E=>C.lineTo(E.x,E.y)),C.lineTo(O[0].x,O[0].y),C});let x=gm(t?.bevel,a),I=new ja(v,x);I.userData={style:{color:o,opacity:n},usedBevelSettings:x},u.push(I)}if(u.length===1)return u[0];let f=_i(u);u.forEach(b=>b.dispose());let h=gm(t?.bevel,a);return f.userData={style:{color:o,opacity:n},usedBevelSettings:h,_split:!0},f}d();var G$="gray",U$=.1;function G1(e,r,t){let{color:o=G$,opacity:n=1,altitude:i=0,height:a=U$}=t||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i}},c=gm(t?.bevel,a),p=[];e.geometry.coordinates.forEach(f=>{let h=new Na,b=f[0].map(x=>{let I=r(x[1],x[0]);return l.min.x=Math.min(l.min.x,I.x),l.min.y=Math.min(l.min.y,I.y),l.max.x=Math.max(l.max.x,I.x),l.max.y=Math.max(l.max.y,I.y),I});h.moveTo(b[0].x,b[0].y),b.slice(1).forEach(x=>h.lineTo(x.x,x.y)),h.lineTo(b[0].x,b[0].y);let v=f.slice(1);h.holes=v.map(x=>{let I=x.map(O=>r(O[1],O[0])),M=new bp;return M.moveTo(I[0].x,I[0].y),I.slice(1).forEach(O=>M.lineTo(O.x,O.y)),M.lineTo(I[0].x,I[0].y),M});let T=new ja(h,c);p.push(T)});let u=_i(p);return p.forEach(f=>f.dispose()),u.translate(0,0,i||0),u.userData={style:{color:o,opacity:n},usedBevelSettings:c},u}d();var Io=100,V$=.22,$$=.01;function XD(e,r,t={}){let{width:o=V$,height:n=$$,color:i="gray",opacity:a=1,altitude:l=0}=t,c={min:{x:1/0,y:1/0,z:l},max:{x:-1/0,y:-1/0,z:l+n}},p={bevelEnabled:!1,depth:n},u=new Li.ClipperOffset,f=e.geometry.coordinates.map(T=>T.map(x=>r(x[1],x[0])));u.AddPaths(f.map(T=>T.map(x=>({X:x.x*Io,Y:x.y*Io}))),Li.JoinType.jsMiter,Li.EndType.etOpenRound);let h=new Li.PolyTree;u.Execute(h,o/2*Io);let b=[];for(let T of h.m_AllPolys){let x=new Na;if(T.IsHole())continue;c.min.x=Math.min(c.min.x,T.m_polygon[0].X),c.min.y=Math.min(c.min.y,T.m_polygon[0].Y),c.max.x=Math.max(c.max.x,T.m_polygon[0].X),c.max.y=Math.max(c.max.y,T.m_polygon[0].Y);let I=T.m_polygon;x.moveTo(I[0].X/Io,I[0].Y/Io),I.slice(1).forEach(M=>x.lineTo(M.X/Io,M.Y/Io)),x.lineTo(I[0].X/Io,I[0].Y/Io),x.holes=T.m_Childs.map(M=>{let O=new bp,C=M.m_polygon;return O.moveTo(C[0].X/Io,C[0].Y/Io),C.slice(1).forEach(E=>O.lineTo(E.X/Io,E.Y/Io)),O.lineTo(C[0].X/Io,C[0].Y/Io),O}),b.push(new ja(x,p))}let v=_i(b);return v.translate(0,0,l||0),v.userData={style:{color:i,opacity:a}},u.Clear(),v}d();d();var xu=F.object({type:F.enum(["Point"]),coordinates:F.array(F.number()).min(2).max(3)});var C2=F.object({rotation:F.array(F.number()).length(3).optional(),altitude:F.number().optional(),scale:F.array(F.number()).length(3).optional(),interactive:F.boolean().optional(),verticalOffset:F.number().optional(),id:F.union([F.number(),F.string()]).optional()}),H$=F.object({type:F.enum(["Feature"]),geometry:xu,properties:C2}),z$=F.object({type:F.enum(["FeatureCollection"]),features:F.array(H$)}),M2=F.object({color:F.string()}),W$=F.object({url:F.string(),color:F.string().optional(),opacity:F.number().optional(),material:F.record(F.string(),M2).optional()});function JD(e,r,t){F.union([F.number(),F.string()]).parse(e),z$.parse(r),W$.parse(t)}var Zf,Xf,xl=class{constructor(r){m(this,"mesh");m(this,"type","model");m(this,"positionDirty",!0);m(this,"outline");m(this,"geometry");m(this,"material");m(this,"feature");m(this,"instanceIndex",-1);m(this,"visible",!0);m(this,"color",new ar);m(this,"position",new ae);S(this,Zf,0);S(this,Xf,1);this.feature=r}setOpacity(){}setColor(){}get altitude(){return s(this,Zf)}set altitude(r){this.mesh&&(this.mesh.position.z=r,w(this,Zf,r))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(r){this.mesh&&this.mesh.rotation.set(Ue.degToRad(r[0]),Ue.degToRad(r[1]),Ue.degToRad(r[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(r){this.mesh&&this.mesh.scale.set(r[0],r[1],r[2])}get opacity(){return s(this,Xf)}set opacity(r){if(this.mesh){if(this.mesh.children[0]instanceof Ba){for(let t of this.mesh.children)if(t instanceof Ba){t.userData?.originalOpacity===void 0&&(t.userData.originalOpacity=t.material.opacity);let o=Nl(r,0,t.userData?.originalOpacity,0,1);t.material.opacity=o,t.material.transparent=o<1,t.material.needsUpdate=!0}}else this.mesh?.traverse(t=>{t instanceof Le&&t.material&&(Array.isArray(t.material)?t.material.forEach(o=>{YD(o,r)}):YD(t.material,r))});w(this,Xf,r)}}};Zf=new WeakMap,Xf=new WeakMap;function YD(e,r){e.opacity!==r&&(r===1?(e.opacity=1,e.transparent=!1):(e.opacity=r,e.transparent=!0),e.needsUpdate=!0)}d();function U1(e){let r=e.components[0],t=e.components[1];t.opacity!=null&&t.opacity!==r.opacity&&(r.opacity=t.opacity);let o=t.material,n=t.color;if(o||n){let l=Z$(n,o);r.mesh?.traverse(c=>{c instanceof Le&&c.material&&(Array.isArray(c.material)?c.material.forEach(p=>{l[p.name]?p.color.set(l[p.name].color):p.color.set(n)}):l[c.material.name]?c.material.color.set(l[c.material.name].color):c.material.color.set(n))})}let i=r.feature.geometry.coordinates[2]??0,a=t.verticalOffset+i;r.altitude!==a&&(r.altitude=a),t.visible!==r.visible&&(r.visible=t.visible),t.rotation&&r.setRotation(t.rotation),t.scale&&r.setScale(t.scale)}function Z$(e,r){let t={};if(e&&Object.assign(t,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),r)for(let o in r)r[o].color&&(t[o]?t[o].color=r[o].color:t[o]={color:r[o].color});return t}function KD(e,r){let t=e.components[0],n=e.components[1].verticalOffset??0,i=t.feature.geometry.coordinates.slice();i[2]=(i[2]??0)+n,t.mesh?t.mesh.position.copy(r(i)):t.position.copy(r(i))}function QD(e){return e instanceof fr?e.material:null}function qD(e){return e.side===S0?"back":e.side===cm?"front":"double"}function e4(e,r){e.side=r==="back"?S0:r==="front"?cm:ws}function X$(e){let{color:r,opacity:t,topColor:o,texture:n,topTexture:i}=e;return`${r}${t}${o||""}${n||""}${i||""}`}var V1=class extends ke{constructor(t,o){super();m(this,"state");m(this,"convertTo3DMapPosition");m(this,"loader");m(this,"optimizePromise",[]);this.state=t,this.convertTo3DMapPosition=o}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:t}=await import("./GLTFLoader-57WSAB45.js");return this.loader=new t,this.loader}createEntityFromFeature(t,o,n){let i=new fr(o),a=o?.properties?.bevel,l=n&&"bevel"in n?n.bevel:void 0,c;l?c={...a,...l}:a&&(c=a);let p=new Mt(i,new Ri({...n,url:o.properties?.image?.path,bevel:c}));return n?.outline&&(p.components[3]=new dM(fM(n.color))),n?.focusable&&(p.components[4]=new xm),p.id=t,p}createModelFromFeature(t,o,n){let i=new xl(o),a={...n};o.properties.verticalOffset!=null&&(a.verticalOffset=o.properties.verticalOffset),o.properties.rotation!=null&&(a.rotation=o.properties.rotation),o.properties.scale!=null&&(a.scale=o.properties.scale);let l=new hy(a),c=new Mt(i,l);return c.id=t,c}populateEntityMesh(t,o){let n=t.components[0];n.geometry=o,n.batchedProps={range:{start:0,count:1/0,indexCount:1/0,indexStart:0,vertexCount:1/0,vertexStart:0,reservedVertexCount:1/0,reservedIndexCount:1/0},geometryId:-1,positionCount:o.attributes.position.count},n.currentHeight=t.components[1].height,n.dirty=!1}async populateModelGroup(t,o,n){let i=new zn,a=new yp,l=new Kg,c=new ae,p=new Ga,u=await this.getGLTFLoader(),f=new Promise(h=>{u.load(o,b=>{"entities3D"in n.userData&&(n.userData.entities3D.size>1?b.scene.traverse(v=>{let T=v;if("isMesh"in T&&T.isMesh===!0){let x=new Ba(T.geometry,T.material,t.size);x.userData={entities:{}},p.add(x),n.add(p)}}):(b.scene.traverse(v=>{"isMesh"in v&&v.isMesh===!0&&(v.position.set(0,0,0),v.rotation.set(0,0,0),v.scale.set(1,1,1),v.updateMatrix())}),p.add(b.scene),n.add(p),p.userData.isSingleModel=!0,p.userData.entityId=t.values().next().value,p.userData.type="model")),h()})});return this.optimizePromise.push(f.then(()=>{let h=0,b;for(let v of t.values()){if(b=this.state.geometry3DMap.get(v),!b||b?.type!=="model")continue;let T=b.components[0],x=b.components[1],I=b.components[0].feature;T.mesh=p,T.instanceIndex=h,U1(b),b.components[1].dirty=!1;let{x:M,y:O}=this.convertTo3DMapPosition(I.geometry.coordinates[1],I.geometry.coordinates[0],0);T.position.set(M,O,T.altitude),a.set(Ue.degToRad(x.rotation?.[0]??Ep[0]),Ue.degToRad(x.rotation?.[1]??Ep[1]),Ue.degToRad(x.rotation?.[2]??Ep[2])),c.set(x.scale?.[0]??Op[0],x.scale?.[1]??Op[1],x.scale?.[2]??Op[2]),l.setFromEuler(a),i.compose(T.position,l,c),p.children.forEach(C=>{!b||b?.type!=="model"||!(C instanceof Ba)||(C.setMatrixAt(h,i),C.userData.entities[h]=b.id)}),T.mesh.userData.isSingleModel&&(T.mesh.matrix.copy(i),T.mesh.matrix.decompose(T.mesh.position,T.mesh.quaternion,T.mesh.scale)),h++}this.publish("model-loaded")})),p}populateEntityGroup(t){let o,n,i,a;for(let l of t.values())a=this.state.geometry3DMap.get(l),a.components[0]instanceof fr&&(n=a.components[0].feature,i=a.components[1],n.geometry.type==="Polygon"?(o=j1(n,this.convertTo3DMapPosition,i),n.properties?.textures&&n.properties.textures.length>0&&hM(o,n.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,o)):n.geometry.type==="MultiPolygon"?(o=G1(n,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,o)):n.geometry.type==="LineString"?(o=_M(n,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,o)):n.geometry.type==="MultiLineString"&&(o=XD(n,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,o)));return t}update(){for(let t of this.state.geometryGroupIdsToLoad.values()){let o=this.state.geometry3DMap.get(t);if(o instanceof Zn&&o.userData.dirty){if(o.userData.modelURL)o.userData.modelURL&&(this.populateModelGroup(o.userData.entities3D,o.userData.modelURL,o),o.userData.dirty=!1);else try{this.populateEntityGroup(o.userData.entities3D)}catch(a){A.warn(a)}let n,i={};for(let a of o.userData.entities3D.values()){n=this.state.geometry3DMap.get(a);let l=n?.components[0];if(n?.type==="geometry"){let c=n.components[1],p=X$(c);i[p]===void 0&&(i[p]={style:c,entities:[]}),i[p].entities.push(n)}else l&&"mesh"in l&&l.mesh&&l.mesh?.parent!==o&&o.add(l.mesh)}for(let a in i){let l=mM(i[a].entities,i[a].style);o.add(l)}for(let a of o.userData.entities3D.values())if(n=this.state.geometry3DMap.get(a),n!=null&&n.entities2D.size>0)for(let l of n.entities2D.values())l&&(n.attach(l),this.publish("geometry-2d-added"));this.publish("geometry-group-added"),o.userData.dirty=!1}}return Promise.resolve()}};d();var $1=class{constructor(r,t){m(this,"state");m(this,"dirty",!0);m(this,"domTree");this.state=r,this.domTree=t}update(){if(this.dirty){let r;for(let t of Array.from(this.domTree.children))if(r=this.state.geometry2DMap.get(t.userData.entityId),r){let o=r.components[0];(!o.enabled||!o.visible||!this.state.geometry2DIdsInScene.has(t.userData.entityId))&&this.domTree.removeChild(t)}else this.domTree.removeChild(t);for(let t of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(t),r){let o=r.components[0];o instanceof ks&&o.enabled&&o.markerContainer&&!this.domTree.contains(o.markerContainer)&&(o.markerContainer.userData={entityId:r.id},this.domTree.appendChild(o.markerContainer),o.updateDimensions())}this.dirty=!1}}};d();var H1=class{constructor(r,t){m(this,"state");m(this,"project");this.state=r,this.project=t}update(){let r,t=0,o,n;for(let i of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(i),r){n=r.components[0];let a=r.attachedTo?this.state.geometry3DMap.get(r.attachedTo):void 0;if(a instanceof Mt)if(this.state.geometry3DIdsInScene.has(a.id)){o=a.components[1],n=r.components[0],(o.dirty||r.components[0].attachedDirty)&&(t=o.height,r.setAltitude(t));let l=o.visible;n.visible!==l&&(n.visible=l)}else n.visible===!0&&(n.visible=!1);this.project(r.components[0].projection,r.position),r.components[0].attachedDirty=!1}}};d();d();d();var Y$=function(){let r,t;return o=>{if((!t||!t)&&(r=document.createElement("canvas"),r.width=500*o,r.height=500*o,r.style.width="500px",r.style.height="500px",t=r.getContext("2d")),!t)throw new Error("Could not get 2D context");return{measureCanvas:r,measureCanvasContext:t}}}(),t4=({text:e,size:r,maxWidth:t,pixelRatio:o,maxLines:n=2,lineHeight:i=1.2,options:a={strokeText:!0}})=>{let l=`bold ${r*o}px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif`,{measureCanvasContext:c}=Y$(o);c.font=l;let p=[],u=e.split(" "),f=0,h=0,b=0;for(;h<u.length;){let I=u[h];if(f===n&&f>0){p[f-1]+="...";break}if(p[f]==null&&(p[f]=I,h++),u.length===1){p[f]=I;break}if(u[h]==null)break;let{width:M}=c.measureText(p[f]+" "+u[h]);M<=t*o?(p[f]+=" "+u[h],h++):f++}p.forEach(I=>{let{width:M}=c.measureText(I);b=Math.max(M,b)});let v=r*o*i,T=p.length*v;return{maxWidth:b,maxHeight:T,lines:p.length,draw:(I,M,O)=>{p.length===1?(a.strokeText&&I.strokeText(p[0],M,O),I.fillText(p[0],M,O)):(a.strokeText&&(I.strokeText(p[0],M,O-v/2),I.strokeText(p[1],M,O+v/2)),I.fillText(p[0],M,O-v/2),I.fillText(p[1],M,O+v/2))}}};d();function r4(e){let r=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?r.src=`data:image/svg+xml;base64,${btoa(e)}`:r.src=e),r}var z1=class extends ke{constructor(t,o,n){super();m(this,"dirty",!1);m(this,"state");m(this,"colliderContext");m(this,"colliderCanvas");m(this,"transformRequestFunc");m(this,"transformRequest",async t=>this.transformRequestFunc?await this.transformRequestFunc(t):{url:t});m(this,"pinCache",{});m(this,"imageCache",{});m(this,"imagePromiseCache",{});m(this,"imageDimensionsCache",{});m(this,"textCache",{});m(this,"update",t=>{let o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let n,i,a,l,c,p,u;for(let f of this.state.geometry2DIdsInScene)if(u=this.state.geometry2DMap.get(f),u!=null&&(p=u.components[0],p instanceof Ds&&!u.disposed)){if(c=p.appearance.iconVisible,p.appearance.icon!=null&&c!=null){let b=typeof c=="boolean"?c:t>=c;b!==p.iconVisible&&(p.iconVisible=b,p.dirty=!0)}if((p.dirty||this.dirty)&&p.calculatePinSize(),i={active:p.appearance.pinColor,inactive:p.appearance.pinColorInactive},a={active:p.appearance.pinOutlineColor,inactive:p.appearance.pinOutlineColorInactive},l=Di(p.pinSize,2),n=`${i.active}-${i.inactive}-${a.active}-${a.inactive}-${l}-${p.iconVisible}`,p.labelCacheId=n,(!this.pinCache[n]||this.dirty)&&(this.prepare(p,n,this.colliderContext),p.dirty=!0),(p.appearance.icon&&(!p.imageHash||p.pinDirty)||this.dirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.textDirty||this.dirty){p.dirty=!0,this.textCache[p.id]={};let{textDrawFn:b,width:v,height:T}=this.processText(p.text,p.appearance.textSize,p.appearance.maxWidth,p.appearance.maxLines,p.appearance.lineHeight);["left","center","right"].forEach(x=>{this.textCache[p.id][x]=this.textToCanvas(b,p.appearance.textSize,x,v,T,p.appearance.textColor,p.appearance.textOutlineColor)}),p.dimensions={width:Math.ceil(v/o),height:Math.ceil(T/o)}}let h=1;if(p.appearance.iconScale)if(typeof p.appearance.iconScale=="number")h=p.appearance.iconScale;else{let{on:b,input:v,output:T,easing:x}=p.appearance.iconScale;b==="zoom-level"?h=kC(t,v,T,x??"linear"):A.warn(`Unsupported interpolation property: ${b}`)}p.recomputeCurrentStrategy(p.iconVisible?h:1),p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,n,this.colliderContext),p.textDirty=!1,p.pinDirty=!1}this.dirty=!1});m(this,"processText",(t,o,n,i,a)=>{let l=this.state.pixelRatio,{draw:c,maxWidth:p,maxHeight:u}=t4({text:t,size:o,pixelRatio:l,maxWidth:n,maxLines:i,lineHeight:a});return{textDrawFn:c,width:p+2.5*l*2,height:u+2.5*l*2}});m(this,"textToCanvas",(t,o,n,i,a,l,c)=>{let p=this.state.pixelRatio,u,f=i,h=a;window.OffscreenCanvas!=null&&!YC()?u=new OffscreenCanvas(f,h):(u=document.createElement("canvas"),u.width=f,u.height=h,u.style.width=f+"px",u.style.height=h+"px");let b=u.getContext("2d",{willReadFrequently:!0});if(!b)return;let v=2.5*p;b.textAlign=n,b.font=`bold ${o*p}px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif`,b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=v,b.fillStyle=l,b.strokeStyle=c;let T=n==="left"?v/2:n==="center"?f/2:f-v/2;return t(b,T,(h+v/2)/2),u});m(this,"cacheImage",t=>{if(!t.appearance.icon)return;let o=tM(t.appearance.icon);this.imagePromiseCache[o]||(this.imagePromiseCache[o]=new Promise(n=>{this.transformRequest(t.appearance.icon).then(i=>{let a=r4(i.url);a.onload=()=>{this.imageCache[o]=a,this.publish("img:loaded"),n(a)}})})),t.imageHash!==o&&(t.imageHash=o,this.imagePromiseCache[o].then(()=>{t.dirty=!0}))});m(this,"createPinCanvas",(t,o,n,i,a=1)=>{let l,c=this.state.pixelRatio,p=t.totalPinSize*2*c*a;window.OffscreenCanvas!=null?l=new OffscreenCanvas(p,p):(l=document.createElement("canvas"),l.width=p,l.height=p,l.style.width=p/c+"px",l.style.height=p/c+"px");let u=l.getContext("2d");return u.shadowColor="rgba(0,0,0,0.3)",u.shadowOffsetY=2*c,u.shadowBlur=5*c,u.beginPath(),u.arc(p/2,p/2,(o/2+2.5*c/2)*a,0,2*Math.PI),u.fillStyle=n,u.fill(),u.beginPath(),u.arc(p/2,p/2,o/2*a,0,2*Math.PI),u.shadowColor="transparent",u.fillStyle=i,u.fill(),l});m(this,"prepare",(t,o,n)=>{let i=this.state.pixelRatio;n.lineWidth=4*i;let a=typeof t.appearance.iconScale=="number"?[t.appearance.iconScale]:t.appearance.iconScale==null?[]:t.appearance.iconScale.output,l=a.length>0?Math.max(...a):void 0,c=this.createPinCanvas(t,t.pinSize,t.appearance.pinOutlineColor,t.appearance.pinColor,l),p=this.createPinCanvas(t,3.5*i,t.appearance.pinOutlineColorInactive,t.appearance.pinColorInactive,l);this.pinCache[o]=[c,p]});this.state=t,this.colliderCanvas=o,this.colliderContext=o.getContext("2d"),this.transformRequestFunc=n}draw(t,o,n){if(!t.canShow||!t.visible)return;n.save(),n.globalAlpha=t.currentOpacity;let i=this.state.pixelRatio,a=t.projection.x*i,l=t.projection.y*i,c=t.style.pinVisibility===1?this.pinCache[o][0]:this.pinCache[o][1],p=t.style.pinVisibility===1?t.scaledPinSize*i:t.totalPinSize*i;if(t.style.pinVisibility!==0&&n.drawImage(c,a-p,l-p,p*2,p*2),t.appearance.icon&&t.iconVisible&&t.imageHash&&t.appearance.iconSize&&this.imageCache[t.imageHash]&&t.style.pinVisibility===1){let u=this.imageCache[t.imageHash],f=(t.scaledPinSize-t.scaledIconPadding)*i,h=t.appearance.iconFit,b=f,v=f,T=`${t.imageHash}_${h}`;if(this.imageDimensionsCache[T])b=this.imageDimensionsCache[T].width,v=this.imageDimensionsCache[T].height;else{let x=u.width*i,I=u.height*i;if(h==="contain"){let M=Math.sqrt(x**2+I**2),O=f/M;b=x*O,v=I*O}if(h==="cover"){let M=f/x,O=f/I,C=Math.max(M,O);b=x*C,v=I*C}}n.save(),n.beginPath(),n.arc(a,l,f/2,0,2*Math.PI),n.closePath(),t?.appearance?.iconOverflow!=="visible"&&n.clip(),n.drawImage(u,a-b/2,l-v/2,b,v),n.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left!=null&&t.style.top!=null&&n.drawImage(this.textCache[t.id][t.style.textAlign],a+t.style.left*i,l+t.style.top*i),n.restore()}};d();d();var kc=class kc{constructor(){m(this,"loader");this.loader=new xp}static getInstance(){return kc.instance||(kc.instance=new kc),kc.instance}getLoader(){return this.loader}load(r){return new Promise((t,o)=>{this.loader.load(r,t,void 0,o)})}};m(kc,"instance");var O2=kc,vl=O2.getInstance();function eH(e,r){let t=e.components[2],o=e.components[1];return t?.hover?[o.hoverColor||r,o.hoverColor||r]:[o.color,o.topColor||o.color]}var Ac,Yf,W1=class extends ke{constructor(t,o){super();S(this,Ac);m(this,"state");m(this,"convertTo3DMapPosition");m(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=o,this.state=t}processTextures(t,o,n){if(o.texture!==t.texture&&o.texture!==""&&W(this,Ac,Yf).call(this,o.texture,t,"texture"),o.topTexture!==t.topTexture&&o.topTexture!==""&&W(this,Ac,Yf).call(this,o.topTexture,t,"topTexture"),(t.texture==null||t.topTexture==null)&&Array.isArray(t.feature.properties?.textures)&&t.feature.properties.textures.length>0)for(let i of t.feature.properties.textures)i.face==="top"&&t.topTexture!==i.path?W(this,Ac,Yf).call(this,i.path,t,"topTexture"):i.face==="side"&&t.texture!==i.path&&W(this,Ac,Yf).call(this,i.path,t,"texture"),t.blendTexture=!0;(t.texture!=null||t.topTexture!=null)&&(n?.hover&&t.texturesVisible?t.hideTextures():t.texturesVisible||t.showTextures(),o.texture===""&&t.removeSideTexture(),o.topTexture===""&&t.removeTopTexture())}update(){let t,o,n;for(let i of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(i),n&&(n.type==="geometry"||n.type==="custom-geometry")&&(n.components[1]?.dirty||n.components[2]?.dirty)){let a=n.components[0],l=n.components[1];o=n.components[2];let c=eH(n,this.state.hoverColor);a.setColor(c[0],c[1]);let p=QD(a);if(l.visible!==a.visible&&(a.visible=l.visible,a instanceof fr&&a.textMesh)){let f=this.state.geometry3DMap.get(a.textMesh.userData.entityId);f?.type==="text3d"&&f.components[0].polygonEntityId!=null&&(f.components[0].visible=l.visible)}l.altitude!==a.altitude&&(a.altitude=l.altitude);let u=l.opacity*Mp(n);u!==a.opacity&&(a.opacity=u),l.renderOrder!==a.renderOrder&&(a.renderOrder=l.renderOrder),p&&l.side!==qD(p)&&e4(p,l.side),a instanceof fr&&l.shading!=null&&(l.shading?.start!==p?.getGradientShading().start||l.shading?.end!==p?.getGradientShading().end||l.shading?.intensity!==p?.getGradientShading().intensity)&&p?.setGradientShading(l.shading?.start??0,l.shading?.end??0,l.shading?.intensity??0),l.dirty=!1,a instanceof fr&&this.processTextures(a,l,o),n.components[2]&&(n.components[2].dirty=!1)}else if(n?.type==="model")n.components[1].dirty&&(U1(n),n.components[1].dirty=!1),n.components[0].positionDirty&&(KD(n,this.convertTo3DMapPosition),n.components[0].positionDirty=!1);else if(n?.type==="image"&&n.components[1]?.dirty){t=n.components[0];let a=n.components[1];a.visible!==t.visible&&(t.visible=a.visible),a.dirty=!1}else if(n?.type==="text3d"&&n.components[1]?.dirty&&n.components[0].polygonEntityId!=null){t=n.components[0];let a=n.components[1];a.visible!=null&&a.visible!==t.visible&&(t.visible=a.visible);let{textMesh:l}=t;if(l){Object.assign(l,a.getState());let c=a.hoverColor??this.state.text3dHoverColor;l.color=a.hoverByPolygon?c:a.color??wp.color,l.outlineColor=a.hoverByPolygon?c:a.outlineColor??wp.outlineColor,l.strokeColor=a.hoverByPolygon?c:a.strokeColor??wp.strokeColor}a.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async t=>{(await t).dispose()}),this.textureLoadingCache.clear()}};Ac=new WeakSet,Yf=async function(t,o,n){if(!(!t||!o.showTextures))if(this.textureLoadingCache.has(t)){n==="topTexture"?o.topTexture=await this.textureLoadingCache.get(t):o.texture=await this.textureLoadingCache.get(t),o.showTextures();return}else{let i=new Promise((a,l)=>{vl.getLoader().load(t,c=>{n==="topTexture"?o.topTexture=c:o.texture=c,o.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{A.error(`Failed to load texture: ${t}`),l(`Failed to load texture: ${t}`)})});this.textureLoadingCache.set(t,i)}};d();var Z1=class extends ke{constructor(t){super();m(this,"state");m(this,"animating",new Map);m(this,"isAnimating",!1);m(this,"startTime",-1);m(this,"showDuration",300);m(this,"hideDuration",250);m(this,"update",()=>{this.animating.clear();let t,o;for(let n of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(n),t&&(o=t.components[0],o instanceof Ds&&(o.visibilityNeedsUpdate==="show"?(o.canShow=!0,this.animating.set(o,[o.currentOpacity,o.appearance.opacity??1])):o.visibilityNeedsUpdate==="hide"&&this.animating.set(o,[o.currentOpacity,0])));this.startTime=performance.now(),this.publish("animate:2d")});m(this,"playAnimations");this.state=t,this.playAnimations=this._playAnimations}_playAnimations(){let t=performance.now();for(let[o,[n,i]]of this.animating.entries()){let a=i===1?this.showDuration:this.hideDuration,l=(t-this.startTime)/a;o.currentOpacity=Nl(l,0,1,n,i,i===0?PC:FC),t-this.startTime>=a&&(i===1?o.canShow=!0:i===0&&(o.canShow=!1),o.visibilityNeedsUpdate=!1,this.animating.delete(o))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};d();var X1=class extends ke{constructor(t,o,n,i,a,l,c){super();m(this,"state");m(this,"renderer");m(this,"mode");m(this,"scene");m(this,"cameraObject");m(this,"viewCamera");m(this,"systems");m(this,"needs2DRecompute",!1);m(this,"twoDdirty",!0);m(this,"threeDdirty",!0);m(this,"frameId",null);m(this,"twoDFrameId",null);m(this,"animationFrameId",null);m(this,"nextFrame",null);m(this,"update",(t=!1)=>{if(this.renderer?.renderer==null)return Promise.resolve();if(t){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise((o,n)=>{this.frameId=requestAnimationFrame(()=>this.renderer?.renderer==null?o():this.mode==="standalone"?this.commitRenderState()?.then(()=>{this.paint(),o()}).catch(i=>{n(i)}):o())})});m(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});m(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});m(this,"updateEntities2D",()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})});m(this,"commitRenderState",()=>{try{let t=[];this.frameId=null,this.publish("pre-render"),this.state.internalTweenGroup.update(),this.state.externalTweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),QC(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),this.state.geometryGroupIdsToLoad.clear(),KC(this.state.entityScene,this.state.geometry3DIdsInScene,this.state.geometryGroupIdsToLoad),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let o=this.systems.meshOptimizationSystem.update();o&&t.push(o),this.systems.borderSystem.update(),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),t.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let n=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!n,this.systems.imageSystem.currentImageScreenBBoxes)}),this.systems.drawSystem.update(),this.systems.geometryDisposalSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.systems.cameraSystem.stateDirty&&(this.publish("camera-state-change"),this.systems.cameraSystem.stateDirty=!1),this.publish("post-render"),this.needs2DRecompute=!1,Promise.all(t)}catch(t){return Promise.reject(t)}});this.renderer=t,this.state=o,this.mode=n,this.scene=i,this.cameraObject=a,this.viewCamera=l,this.systems=c,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){this.renderer?.renderer&&(this.mode==="standalone"&&this.renderer.clear(),this.renderer.render(this.scene,this.state.useStandaloneCamera||this.mode==="standalone"?this.cameraObject:this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};d();var tH=F.object({interactive:F.boolean().optional(),id:F.string().optional(),width:F.union([F.number(),F.object({on:F.literal("zoom-level").optional(),input:F.array(F.number()).nonempty(),output:F.array(F.number()).nonempty(),easing:F.string().optional()})]).optional(),accentColor:F.string().optional(),displayArrowsOnPath:F.boolean().optional(),animateArrowsOnPath:F.boolean().optional(),visibleThroughGeometry:F.boolean().optional(),dashed:F.boolean().optional()}),rH=F.object({type:F.enum(["Feature"]),geometry:xu,properties:F.object({parentId:F.any().optional()})});function o4(e,r){F.object({features:F.array(rH)}).parse(e),tH.parse(r)}var Jf,Il=class{constructor(r,t){m(this,"type","path");m(this,"mesh",new Ga);m(this,"material");m(this,"geometry");m(this,"outline");m(this,"feature");m(this,"options");m(this,"width",{on:"zoom-level",input:[17,22],output:[.8,.4]});m(this,"breakpoint",0);m(this,"altitudeBreakpoints");m(this,"accentColor","blue");m(this,"completeFraction",1);m(this,"altitudeAdjustment",1);m(this,"displayArrowsOnPath",!1);m(this,"animateArrowsOnPath",!1);m(this,"visibleThroughGeometry",!1);m(this,"dashed",!1);m(this,"isVertical",!1);m(this,"dirty",!0);m(this,"materialDirty",!0);m(this,"position",new ae);S(this,Jf,0);this.feature=r,this.options=t||{},this.width=t?.width??this.width,this.accentColor=t?.accentColor??this.accentColor,this.displayArrowsOnPath=t?.displayArrowsOnPath??this.displayArrowsOnPath,this.animateArrowsOnPath=t?.animateArrowsOnPath??this.animateArrowsOnPath,this.visibleThroughGeometry=t?.visibleThroughGeometry??this.visibleThroughGeometry,this.dashed=t?.dashed??this.dashed}setColor(){}setOpacity(){}set visible(r){this.mesh&&(this.mesh.visible=r)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return s(this,Jf)}set altitude(r){this.mesh&&(this.mesh.position.z=r,w(this,Jf,r))}set complete(r){this.material&&(this.material.uniforms.complete.value=r,this.material.needsUpdate=!0)}};Jf=new WeakMap;d();d();d();var Vo=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var r=1.70158;return e===1?1:e*e*((r+1)*e-r)},Out:function(e){var r=1.70158;return e===0?0:--e*e*((r+1)*e+r)+1},InOut:function(e){var r=2.5949095;return(e*=2)<1?.5*(e*e*((r+1)*e-r)):.5*((e-=2)*e*((r+1)*e+r)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Vo.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Vo.Bounce.In(e*2)*.5:Vo.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(r){return Math.pow(r,e)},Out:function(r){return 1-Math.pow(1-r,e)},InOut:function(r){return r<.5?Math.pow(r*2,e)/2:(1-Math.pow(2-r*2,e))/2+.5}}}}),Kf=function(){return performance.now()},Y1=function(){function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,r)}return e.prototype.getAll=function(){var r=this;return Object.keys(this._tweens).map(function(t){return r._tweens[t]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var r,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];for(var n=0,i=t;n<i.length;n++){var a=i[n];(r=a._group)===null||r===void 0||r.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},e.prototype.remove=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var o=0,n=r;o<n.length;o++){var i=n[o];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(r){return!r.isPlaying()})},e.prototype.update=function(r,t){r===void 0&&(r=Kf()),t===void 0&&(t=!0);var o=Object.keys(this._tweens);if(o.length!==0)for(;o.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<o.length;n++){var i=this._tweens[o[n]],a=!t;i&&i.update(r,a)===!1&&!t&&this.remove(i)}o=Object.keys(this._tweensAddedDuringUpdate)}},e}(),vu={Linear:function(e,r){var t=e.length-1,o=t*r,n=Math.floor(o),i=vu.Utils.Linear;return r<0?i(e[0],e[1],o):r>1?i(e[t],e[t-1],t-o):i(e[n],e[n+1>t?t:n+1],o-n)},Bezier:function(e,r){for(var t=0,o=e.length-1,n=Math.pow,i=vu.Utils.Bernstein,a=0;a<=o;a++)t+=n(1-r,o-a)*n(r,a)*e[a]*i(o,a);return t},CatmullRom:function(e,r){var t=e.length-1,o=t*r,n=Math.floor(o),i=vu.Utils.CatmullRom;return e[0]===e[t]?(r<0&&(n=Math.floor(o=t*(1+r))),i(e[(n-1+t)%t],e[n],e[(n+1)%t],e[(n+2)%t],o-n)):r<0?e[0]-(i(e[0],e[0],e[1],e[1],-o)-e[0]):r>1?e[t]-(i(e[t],e[t],e[t-1],e[t-1],o-t)-e[t]):i(e[n?n-1:0],e[n],e[t<n+1?t:n+1],e[t<n+2?t:n+2],o-n)},Utils:{Linear:function(e,r,t){return(r-e)*t+e},Bernstein:function(e,r){var t=vu.Utils.Factorial;return t(e)/t(r)/t(e-r)},Factorial:function(){var e=[1];return function(r){var t=1;if(e[r])return e[r];for(var o=r;o>1;o--)t*=o;return e[r]=t,t}}(),CatmullRom:function(e,r,t,o,n){var i=(t-e)*.5,a=(o-r)*.5,l=n*n,c=n*l;return(2*r-2*t+i+a)*c+(-3*r+3*t-2*i-a)*l+i*n+r}}},n4=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),E2=new Y1,ui=function(){function e(r,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Vo.Linear.None,this._interpolationFunction=vu.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=n4.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=r,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=E2,E2.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(r,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=r,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(r){return r===void 0&&(r=1e3),this._duration=r<0?0:r,this},e.prototype.dynamic=function(r){return r===void 0&&(r=!1),this._isDynamic=r,this},e.prototype.start=function(r,t){if(r===void 0&&(r=Kf()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var o in this._valuesStartRepeat)this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=r,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var i in this._valuesEnd)n[i]=this._valuesEnd[i];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(r){return this.start(r,!0)},e.prototype._setupProperties=function(r,t,o,n,i){for(var a in o){var l=r[a],c=Array.isArray(l),p=c?"array":typeof l,u=!c&&Array.isArray(o[a]);if(!(p==="undefined"||p==="function")){if(u){var f=o[a];if(f.length===0)continue;for(var h=[l],b=0,v=f.length;b<v;b+=1){var T=this._handleRelativeValue(l,f[b]);if(isNaN(T)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(T)}u&&(o[a]=h)}if((p==="object"||c)&&l&&!u){t[a]=c?[]:{};var x=l;for(var I in x)t[a][I]=x[I];n[a]=c?[]:{};var f=o[a];if(!this._isDynamic){var M={};for(var I in f)M[I]=f[I];o[a]=f=M}this._setupProperties(x,t[a],f,n[a],i)}else(typeof t[a]>"u"||i)&&(t[a]=l),c||(t[a]*=1),u?n[a]=o[a].slice().reverse():n[a]=t[a]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(r){return r===void 0&&(r=Kf()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=r,this)},e.prototype.resume=function(r){return r===void 0&&(r=Kf()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=r-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var r=0,t=this._chainedTweens.length;r<t;r++)this._chainedTweens[r].stop();return this},e.prototype.group=function(r){return r?(r.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var r;return(r=this._group)===null||r===void 0||r.remove(this),this},e.prototype.delay=function(r){return r===void 0&&(r=0),this._delayTime=r,this},e.prototype.repeat=function(r){return r===void 0&&(r=0),this._initialRepeat=r,this._repeat=r,this},e.prototype.repeatDelay=function(r){return this._repeatDelayTime=r,this},e.prototype.yoyo=function(r){return r===void 0&&(r=!1),this._yoyo=r,this},e.prototype.easing=function(r){return r===void 0&&(r=Vo.Linear.None),this._easingFunction=r,this},e.prototype.interpolation=function(r){return r===void 0&&(r=vu.Linear),this._interpolationFunction=r,this},e.prototype.chain=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return this._chainedTweens=r,this},e.prototype.onStart=function(r){return this._onStartCallback=r,this},e.prototype.onEveryStart=function(r){return this._onEveryStartCallback=r,this},e.prototype.onUpdate=function(r){return this._onUpdateCallback=r,this},e.prototype.onRepeat=function(r){return this._onRepeatCallback=r,this},e.prototype.onComplete=function(r){return this._onCompleteCallback=r,this},e.prototype.onStop=function(r){return this._onStopCallback=r,this},e.prototype.update=function(r,t){var o=this,n;if(r===void 0&&(r=Kf()),t===void 0&&(t=e.autoStartOnUpdate),this._isPaused)return!0;var i;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(r,!0);else return!1;if(this._goToEnd=!1,r<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=r-this._startTime,l=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),c=this._duration+this._repeat*l,p=function(){if(o._duration===0||a>c)return 1;var T=Math.trunc(a/l),x=a-T*l,I=Math.min(x/o._duration,1);return I===0&&a===o._duration?1:I},u=p(),f=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||a>=this._duration)if(this._repeat>0){var h=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=h);for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*h,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,v=this._chainedTweens.length;b<v;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(r,t,o,n){for(var i in o)if(t[i]!==void 0){var a=t[i]||0,l=o[i],c=Array.isArray(r[i]),p=Array.isArray(l),u=!c&&p;u?r[i]=this._interpolationFunction(l,n):typeof l=="object"&&l?this._updateProperties(r[i],a,l,n):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(r[i]=a+(l-a)*n))}},e.prototype._handleRelativeValue=function(r,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?r+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(r){var t=this._valuesStartRepeat[r],o=this._valuesEnd[r];typeof o=="string"?this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(o):this._valuesStartRepeat[r]=this._valuesEnd[r],this._valuesEnd[r]=t},e.autoStartOnUpdate=!1,e}();var d5e=n4.nextId,as=E2,u5e=as.getAll.bind(as),m5e=as.removeAll.bind(as),f5e=as.add.bind(as),h5e=as.remove.bind(as),g5e=as.update.bind(as);d();d();d();var i4=(e,r)=>(r-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,s4=(e,r)=>new Me(e.clientX-r.offsetLeft,e.clientY-r.offsetTop),P2=(e,r)=>Math.atan2(r.y-e.y,r.x-e.x),Qf=(e,r)=>Math.sqrt((r.y-e.y)**2+(r.x-e.x)**2),F2=(e,r)=>new Me((e.x+r.x)/2,(e.y+r.y)/2),D2=e=>{let r=0,{wheelDelta:t,detail:o}=e;return t!==void 0?r=t:o!==void 0&&(r=-o),r};var J1=class{constructor(r,t){m(this,"input1");m(this,"input2");m(this,"lastAngle");m(this,"lastDistance");m(this,"totalDistance");m(this,"first");m(this,"second");this.input1=r,this.input2=t,this.lastAngle=P2(r,t),this.lastDistance=Qf(r,t),this.totalDistance=0,this.first=r,this.second=t}update(r,t){let o=Qf(r,t);this.input1=r,this.input2=t;let n=P2(r,t);this.lastAngle=n,this.lastDistance=o,this.totalDistance+=(Qf(this.first,r)+Qf(this.second,t))/2,this.first=F2(this.first,r),this.second=F2(this.second,t)}};d();var qf=class{constructor(r,t,o){m(this,"touch");m(this,"camera");m(this,"cameraPlane");m(this,"viewCoordinate");m(this,"snapHolderMatrix");m(this,"snapCamera");m(this,"cameraPosition");m(this,"raycaster");m(this,"worldCoordinate");m(this,"snapshotted",!1);this.touch=r,this.camera=t,this.cameraPlane=o,this.viewCoordinate={x:r.x,y:r.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let r=new Me(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Pi,this.raycaster.setFromCamera(r,this.snapCamera);let t=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=t&&t.length>0?t[0].point:null,this.snapshotted=!0}updateAnchorState(r,t){this.camera=r,this.snapCamera=r.clone(),this.snapHolderMatrix=r.matrixWorld.clone(),this.updateViewCoordinate(t),this.snapshotCameraState()}updateViewCoordinate(r){this.viewCoordinate={x:r.x,y:r.y}}reUnproject(){let r=new Me(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster?.setFromCamera(r,this.snapCamera);let t=this.raycaster?.intersectObject(this.cameraPlane,!0)[0];return t?t.point:void 0}};var mi={};La(mi,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>nH,CLIPPING_RADIUS:()=>eh,CONTROL_OPTIONS:()=>oH,DEFAULT_ANIMATION_DURATION:()=>R2,DEFAULT_BEARING:()=>cH,DEFAULT_MAX_ZOOM_LEVEL:()=>aH,DEFAULT_MIN_ZOOM_LEVEL:()=>B2,DEFAULT_PITCH:()=>lH,DEFAULT_ZOOM_LEVEL:()=>sH,EVENTS:()=>ex,MAPLIBRE_TILE_SIZE:()=>K1,MAX_LAT:()=>A2,MAX_MERCATOR_ZOOM_LEVEL:()=>q1,MIN_LAT:()=>k2,MIN_MERCATOR_ZOOM_LEVEL:()=>Q1,ROOM_MERCATOR_ZOOM_LEVEL:()=>iH,TWO_PI:()=>L2,WHEEL_ZOOM_MULTIPLIER:()=>_2,ZRANGE:()=>Iu});d();var K1=512,k2=-85.051129,A2=85.051129,eh=1e4,oH={chain:"chain",cancel:"cancel"},L2=Math.PI*2,Iu=100,_2=1e4,Q1=0,q1=24,nH=17,iH=20,R2=200,ex=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],sH=18,B2=12,aH=22,lH=0,cH=0;var tx=!1,pH=!1;var rx,Lc=class extends ke{constructor(t,o,n,i,a){super();m(this,"dirty",!1);m(this,"zoomDirty",!1);m(this,"rotationDirty",!1);m(this,"panDirty",!1);m(this,"stateDirty",!1);S(this,rx,B2);m(this,"zoomSpeed",5);m(this,"rotateSpeed",100);m(this,"enabled",!0);m(this,"enableZoom",!0);m(this,"enablePan",!0);m(this,"enablePedestal",!1);m(this,"maxPedestal",1/0);m(this,"minPedestal",0);m(this,"enableRotate",!0);m(this,"minZoomAltitude",0);m(this,"maxZoomAltitude",1/0);m(this,"ignoreZoomLimits",!1);m(this,"zoomFactor",1);m(this,"panBounds",{min:new ae(1/0,1/0),max:new ae(-1/0,-1/0),center:new ae(0,0,0),radius:1/0});m(this,"minTilt",0);m(this,"maxTilt",1.2);m(this,"MOUSE_BUTTONS",{ORBIT:Zg.RIGHT,ZOOM:Zg.MIDDLE,PAN:Zg.LEFT});m(this,"camera");m(this,"scene");m(this,"renderer");m(this,"elevation");m(this,"orbit");m(this,"cameraPlane");m(this,"raycaster",new Pi);m(this,"rendererState");m(this,"options");m(this,"state",-1);m(this,"intersection");m(this,"viewState",null);m(this,"tweens",new Map);m(this,"clock",new SC(!0));m(this,"coords",{mouse:new Me,rotateStart:new Me,rotateEnd:new Me,rotateDelta:new Me,panStart:new ae,panCameraStart:new ae,panEnd:new ae,panDelta:new ae,initialShiftPos:new Me,initialPedestal:0,floorAnchor:new ae});m(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});m(this,"scrollTimer",null);m(this,"lastWheelTime",0);m(this,"resetZoom",!1);m(this,"zoomStart");m(this,"pedestalScaleFactor",1);m(this,"isUserZooming",!1);m(this,"stayInsideBounds",!0);m(this,"userInteracting",!1);m(this,"cameraMoving",!1);m(this,"lastCameraMoveTime",Date.now());m(this,"raycastToFloor",t=>{this.raycaster.setFromCamera(t,this.camera);let o=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return o?o.point:new ae});m(this,"isUserInteracting",()=>this.userInteracting);m(this,"getPosition",()=>new ae(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));m(this,"getPedestal",()=>this.orbit.position.z);m(this,"pan",(t,o)=>{isNaN(t)||isNaN(o)||(this.setPosition(this.orbit.position.x+t,this.orbit.position.y+o),this.publish("position-updated"))});m(this,"postRender",()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))});m(this,"isCameraMoving",()=>this.cameraMoving);m(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);m(this,"setPosition",(t,o)=>{t===void 0||o===void 0||isNaN(t)||isNaN(o)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(t,o),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0,this.stateDirty=!0)});m(this,"updateCameraPosition",(t,o)=>{let n=t-this.panBounds.center.x,i=o-this.panBounds.center.y,a=Math.sqrt(n*n+i*i);if(this.stayInsideBounds&&a>this.panBounds.radius){let l=Math.atan2(i,n),c={x:Math.cos(l)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(l)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=t,this.orbit.position.y=o});m(this,"tilt",t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(t+this.getTilt(),this.maxTilt),this.minTilt):t+this.getTilt();o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end"),this.stateDirty=!0});m(this,"zoomIn",(t,o,n)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},t,o,n)});m(this,"zoomOut",(t,o,n)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},t,o,n)});m(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));m(this,"cancelAnimation",()=>{let t=Array.from(this.tweens.keys()),o=t[t.length-1];o.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(o)});m(this,"animateCamera",(t,o,n,i,a,l)=>{let c={interruptible:!0,...l},p={},u={},f=this.getPosition();if(t.position!=null&&(t.position.x!==void 0&&(p.x=f.x,u.x=t.position.x),t.position.y!==void 0&&(p.y=f.y,u.y=t.position.y),t.position.z!==void 0&&(p.z=f.z,u.z=t.position.z)),t.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?u.zoom=t.zoom:u.zoom=Math.min(Math.max(t.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),t.rotation!==void 0){let{start:O,end:C}=sy(this.getRotation(),t.rotation);p.rotation=O,u.rotation=C}t.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?u.tilt=t.tilt:u.tilt=Math.max(Math.min(t.tilt,this.maxTilt),this.minTilt));let h=p.zoom!==u.zoom,b=p.rotation!==u.rotation,v=p.tilt!==u.tilt,T=new ui(p).to(u,y.env.TESTING?0:o).onUpdate(O=>{this.setMulti({x:O.x,y:O.y,z:O.z},O.zoom,O.rotation,O.tilt)}).onComplete(()=>{this.completeTween(T),this.publish("multi-end",{zooming:h,rotating:b,tilting:v}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,T.state=7,this.publish("multi-start",{zooming:h,rotating:b,tilting:v})),this.publish("change")});this.rendererState.internalTweenGroup.add(T);let x=Array.from(this.tweens.entries()),I=x[x.length-1],M=!1;return I!=null&&(I[1].interruptible?(typeof I[1].cancelledCallback=="function"&&I[1].cancelledCallback(),this.completeTween(I[0])):(M=!0,I[0].chain(T))),this.tweens.set(T,{cancelledCallback:a,interruptible:c.interruptible}),n?T.easing(n):T.easing(Vo.Quadratic.In),!t.doNotAutoStart&&!M&&(T.start(),this.publish("change")),T.cameraAnimation=!0,T});m(this,"setMulti",(t,o,n,i,a=!0)=>{this.state===-1&&this.publish("multi-start");let l=!1;t!=null&&(t.x!==void 0&&!isNaN(t.x)&&t.y!==void 0&&!isNaN(t.y)&&(this.updateCameraPosition(t.x,t.y),l=!0),t.z!==void 0&&!isNaN(t.z)&&(this.setPedestal(t.z,!0,!1),l=!0)),l&&this.publish("position-updated");let c={zooming:!1,tilting:!!o,rotating:!1};if(o!==void 0&&!isNaN(o)){let p=this.stayInsideBounds?Math.min(Math.max(o,this.getZoomScaledMin()),this.getZoomScaledMax()):o;p!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?o>eh&&(this.camera.near=o-eh,this.camera.far=o+eh):(this.camera.near=o/Iu,this.camera.far=o*Iu),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(c.rotating=!0,this.orbit.rotation.z=-n,this.publish("rotation-updated")),i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;p!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c),this.stateDirty=!0});m(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);m(this,"getZoomScaledMax",()=>{let t=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,t)});m(this,"setRotation",(t,o)=>{if(isNaN(t))return;this.state===-1&&!o&&this.publish("rotate-start");let n=-(t%L2);n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,o||this.publish("rotation-updated")),o||this.publish("change"),this.state===-1&&!o&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0,o||(this.stateDirty=!0)});m(this,"setZoomAltitude",t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let o=this.stayInsideBounds?Math.min(Math.max(t,this.getZoomScaledMin()),this.getZoomScaledMax()):t;o!==this.camera.position.z&&(this.camera.position.z=o,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=o/Iu,this.camera.far=o*Iu,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0,this.stateDirty=!0});m(this,"setZoomLevel",t=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(t))});m(this,"getZoomAltitude",()=>this.camera.position.z);m(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));m(this,"setTilt",(t,o)=>{if(isNaN(t))return;this.state===-1&&!o&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(t,this.maxTilt),this.minTilt):t;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,o||this.publish("tilt-updated")),o||this.publish("change"),this.state===-1&&!o&&this.publish("rotate-end"),this.dirty=!0,o||(this.stateDirty=!0)});m(this,"getTilt",()=>this.elevation.rotation.x);m(this,"setCameraPlaneElevation",t=>{this.cameraPlane.position.z=t});m(this,"zoom",t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let o=this.getZoomAltitude()-t;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(o,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):o,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.stateDirty=!0});m(this,"getProjectionScaleFactor",(t,o,n)=>B0(t,o,n));m(this,"update",()=>{this.orbit.updateMatrixWorld(),this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});m(this,"setPedestal",(t,o=!1,n=!0)=>{typeof t=="number"&&!isNaN(t)&&(this.orbit.position.z=t,o&&(this.publishPedestalChangeEvent(t),this.publish("pedestal-change",{pedestal:t})),this.publish("change"),this.dirty=!0,n&&(this.stateDirty=!0))});m(this,"dispose",()=>{for(let t of ex)t.endsWith("start")?(this.off(t,this.setCameraMoving),t.startsWith("user")&&this.off(t,this.setUserInteracting)):(t.endsWith("end")||t.endsWith("cancel"))&&(this.off(t,this.unsetCameraMoving),t.startsWith("user")&&this.off(t,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane),this.destroy()});m(this,"createCameraPlane",()=>{let t=tx?2e3:1e10,o=tx?100:1,n=new Es(t,t,o,o),i=new Nr({color:0,wireframe:tx,visible:tx}),a=new Le(n,i);return this.scene.add(a),a});m(this,"addEventListeners",()=>{let{domElement:t}=this.renderer;for(let o of ex)o.endsWith("start")?(this.on(o,this.setCameraMoving),o.startsWith("user")&&this.on(o,this.setUserInteracting)):(o.endsWith("end")||o.endsWith("cancel"))&&(this.on(o,this.unsetCameraMoving),o.startsWith("user")&&this.on(o,this.unsetUserInteracting));t.addEventListener("contextmenu",this.onContextMenu,!1),t.addEventListener("mousedown",this.onMouseDown,!1),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchmove",this.onTouchMove,!1)});m(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});m(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});m(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});m(this,"removeEventListeners",()=>{let{domElement:t}=this.renderer;t.removeEventListener("contextmenu",this.onContextMenu,!1),t.removeEventListener("mousedown",this.onMouseDown,!1),t.removeEventListener("wheel",this.onMouseWheel,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});m(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});m(this,"onContextMenu",t=>{t.preventDefault()});m(this,"onMouseUp",()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}});m(this,"onMouseMove",t=>{if(this.enabled!==!1)if(t.preventDefault(),this.mouseToScene(t),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(t)});m(this,"onTouchStart",t=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(t),t.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(t),this.state=9):this.enablePan&&(this.handleTouchStartPan(t),this.state=6);break;case 2:this.touch.inputs=new J1(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});m(this,"onTouchMove",t=>{if(this.enabled!==!1)switch(this.touchToScene(t),t.touches.length){case 2:t.preventDefault(),t.stopPropagation();let o={...this.touch.inputs.first},n={...this.touch.inputs.second},i=new Me(this.touch.touches[0].x,this.touch.touches[0].y),a=new Me(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(t);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let l=o.y<i.y&&n.y<a.y,c=o.y>i.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(c||l)?(this.handleTouchStartTilt(t),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(t.preventDefault(),t.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(t):this.enablePan&&this.state===6&&this.handleTouchMovePan(t);break;default:this.state=-1}});m(this,"onTouchEnd",t=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}t.touches.length?this.onTouchStart(t):this.state=-1}});m(this,"handleTouchMovePan",t=>{let o=Object.hasOwn(t,"x")?new Me(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(o);this.coords.panEnd.set(n.x,n.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});m(this,"handleTouchStartDolly",()=>{let t=this.touch.touches[0].x-this.touch.touches[1].x,o=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let n=new Me(this.touch.touches[0].x-t/2,this.touch.touches[0].y-o/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new qf(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new qf(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")});m(this,"handleMouseMovePan",()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(t.x,t.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});m(this,"handleTouchStartTilt",t=>{this.coords.rotateStart.set(t.touches[1].clientX,t.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});m(this,"handleTouchMovePedestal",t=>{this.handleMouseMovePedestal(t.touches[0])});m(this,"handleTouchMoveTilt",t=>{this.coords.rotateEnd.set(t.touches[1].clientX,t.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)});m(this,"handleTouchMoveDolly",()=>{let t=this.touch.inputs.first,o=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:t.x,y:t.y},this.touch.anchor2.viewCoordinate={x:o.x,y:o.y};let n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,t),this.touch.anchor2.updateAnchorState(this.camera,o)});m(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});m(this,"handleTouchStartPan",t=>{let o=Object.hasOwn(t,"x")?new Me(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(o);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")});m(this,"handleTouchStartPedestal",t=>{this.handleMouseDownPedestal(t.touches[0])});m(this,"onMouseDown",t=>{if(this.enabled!==!1){if(this.mouseToScene(t),t.preventDefault(),this.state===3&&this.publish("zoom-end"),t.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else t.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(t),this.state=8));this.state!==-1&&this.addMouseEventListeners()}});m(this,"onMouseWheel",t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(t.preventDefault(),t.stopPropagation(),this.mouseToScene(t),this.canScrollZoom(t)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(t)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(t))});m(this,"handleMouseWheel",t=>{if(this.publish("zoom-start"),!this.canScrollZoom(t)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let o=this.getZoomAltitude(),n=o-D2(t)*o/_2*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let i=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-i),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")});m(this,"setCameraFromTransformMatrix",t=>{this.orbit.updateMatrixWorld();let o=new yp;o.setFromRotationMatrix(t,"ZYX");let n=(t.elements[14]-this.cameraPlane.position.z)/Math.cos(o.x),i=o.z,a=new ae(0,0,1);a.applyEuler(o),a.setLength(n);let l=new ae;l.setFromMatrixPosition(t),l.sub(a),this.enablePan&&this.setPosition(l.x,l.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-i)});m(this,"makeTransformFromTouchAnchors",(t,o)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),i=t.worldCoordinate,a=o.worldCoordinate,l=t.reUnproject(),c=o.reUnproject();if(!l||!c||!i||!a)return null;let p=t.viewCoordinate,u=o.viewCoordinate,f=a.x-i.x,h=a.y-i.y,b=Math.atan2(h,f),v=c.x-l.x,T=c.y-l.y,x=Math.atan2(T,v),I=i4(b,x),M=new zn;M.makeRotationZ(-I);let O=M.clone();O.multiply(t.snapHolderMatrix);let C=(Hg,dp,up)=>Hg.elements[(dp-1)*4+up-1],E=C(n,1,1)*C(O,1,1)-p.x*C(n,3,4)*C(O,3,1),_=C(n,1,1)*C(O,1,2)-p.x*C(n,3,4)*C(O,3,2),G=C(n,1,1)*C(O,1,3)-p.x*C(n,3,4)*C(O,3,3),R=i.x*E+i.y*_+i.z*G,N=C(n,2,2)*C(O,2,1)-p.y*C(n,3,4)*C(O,3,1),X=C(n,2,2)*C(O,2,2)-p.y*C(n,3,4)*C(O,3,2),z=C(n,2,2)*C(O,2,3)-p.y*C(n,3,4)*C(O,3,3),ee=i.x*N+i.y*X+i.z*z,re=C(n,1,1)*C(O,1,1)-u.x*C(n,3,4)*C(O,3,1),ue=C(n,1,1)*C(O,1,2)-u.x*C(n,3,4)*C(O,3,2),Ce=C(n,1,1)*C(O,1,3)-u.x*C(n,3,4)*C(O,3,3),Oe=a.x*re+a.y*ue+a.z*Ce,Pe=C(n,2,2)*C(O,2,1)-u.y*C(n,3,4)*C(O,3,1),Fe=C(n,2,2)*C(O,2,2)-u.y*C(n,3,4)*C(O,3,2),ce=C(n,2,2)*C(O,2,3)-u.y*C(n,3,4)*C(O,3,3),Ee=a.x*Pe+a.y*Fe+a.z*ce,ye=Math.abs(re-E),Ge=Math.abs(ue-_),Ie=Math.abs(Ce-G),Xe=Math.abs(re-N),se=Math.abs(ue-X),nt=Math.abs(Ce-z),dt=Math.abs(Pe-E),$t=Math.abs(Fe-_),k=Math.abs(ce-G),H=Math.abs(Pe-N),P=Math.abs(Fe-X),q=Math.abs(ce-z),K=Math.min(ye+Ge+Ie,Xe+se+nt),Q=Math.min(dt+$t+k,H+P+q);K<Q&&(re=Pe,ue=Fe,Ce=ce,Oe=Ee);let De=N*G-E*z,xt=X*G-_*z,dr=ee*G-R*z,ir=re*z-N*Ce,ur=ue*z-X*Ce,wi=Oe*z-ee*Ce,cp=(wi*xt-dr*ur)/(ir*xt-De*ur),im=(wi*De-dr*ir)/(ur*De-xt*ir),pp=X*E-_*N,Rl=z*E-G*N,ka=ee*E-R*N,Is=ue*N-X*re,$g=Ce*N-z*re,sm=((Oe*N-ee*re)*pp-ka*Is)/($g*pp-Rl*Is),Aa=O.clone();return Aa.elements[12]=cp,Aa.elements[13]=im,Aa.elements[14]=sm,sm>0?Aa:null});m(this,"updateTouchOrigin",()=>{let t=this.renderer.domElement;this.touch.origin.offsetLeft=t.getBoundingClientRect().left,this.touch.origin.offsetTop=t.getBoundingClientRect().top});m(this,"touchToScene",t=>{this.touch.touches=[];for(let o=0,n=t.touches.length;o<n;o++){let i=t.touches[o],a=s4(i,this.touch.origin);this.touch.touches.push(new Me(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});m(this,"canScrollZoom",t=>{let o=D2(t),n=this.getZoomAltitude();return!(o<0&&n===this.getZoomScaledMax()||o>0&&n===this.getZoomScaledMin())});m(this,"mouseToScene",t=>{let o=this.getMousePos(t);return this.coords.mouse.x=o.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(o.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse});m(this,"getMousePos",t=>({x:t.offsetX,y:t.offsetY}));m(this,"handleMouseDownRotate",t=>{this.coords.rotateStart.set(t.clientX,t.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});m(this,"handleMouseDownPan",()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(t.x,t.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")});m(this,"handleMouseDownPedestal",t=>{let o=new Me(t.clientX,t.clientY);this.coords.initialShiftPos=o,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=B0(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});m(this,"handleMouseMovePedestal",t=>{let o={x:t.clientX,y:t.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(o.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)});m(this,"handleMouseMoveRotate",t=>{this.coords.rotateEnd.set(t.clientX,t.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")});m(this,"publishUserZoomDebounced",ym(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));m(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});m(this,"setCameraMoving",()=>{this.cameraMoving=!0});m(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});m(this,"setUserInteracting",()=>{this.userInteracting=!0});m(this,"unsetUserInteracting",()=>{this.userInteracting=!1});m(this,"publishPedestalChangeEvent",t=>{this.publish("pedestal-change",{pedestal:t,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});m(this,"convertAltitudeToZoomLevel",t=>{let[,o]=this.center,i=t*2*Math.tan(Ue.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(Ue.degToRad(o))*2*Math.PI*I0/i;return Ue.clamp(Math.log2(a/512),Q1,q1)});m(this,"convertZoomLevelToAltitude",t=>{let[,o]=this.center,n=Ue.clamp(t,Q1,q1),i=Math.pow(2,n),a=Ue.clamp(o,k2,A2),l=i*512;return Math.cos(Ue.degToRad(a))*Math.PI*2*I0/l*this.options.canvasHeight/2/Math.tan(Ue.degToRad(this.camera.fov)/2)});m(this,"completeTween",t=>{t.isPlaying()&&t.stop(),this.rendererState.internalTweenGroup.remove(t),this.tweens.delete(t)});m(this,"debugContainer",new Os);this.camera=t,this.renderer=n,this.rendererState=i,this.scene=o,this.options=a,this.elevation=t.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=t.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(t){this.minZoomAltitude=this.convertZoomLevelToAltitude(t),this.stateDirty=!0}get defaultMinZoomLevel(){return s(this,rx)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(t){this.maxZoomAltitude=this.convertZoomLevelToAltitude(t),this.stateDirty=!0}get scrollPercent(){let t=this.minPedestal,o=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,o),n=Math.max(n,t),(n-t)/(o-t)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){let t=this.getPosition(),{lat:o,lon:n}=uy(this.rendererState.center?.[1]??0,this.rendererState.center?.[0]??0,t.x,t.y);return[n,o]}setCenter(t,o){let{x:n,y:i}=my(this.rendererState.center?.[1]??0,this.rendererState.center?.[0]??0,o,t);this.setPosition(n,i)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(t=>t.cameraAnimation)}getCameraFrameForCoordinates(t,o){let n=o.minZoom!==void 0?o.minZoom:this.minZoomAltitude,i=o.maxZoom!==void 0?o.maxZoom:this.maxZoomAltitude,a=this.options.canvasWidth,l=this.options.canvasHeight,c=this.getRotation(),p=this.getTilt(),u=this.getPosition();this.setRotation(o.rotation??c,!0),this.setTilt(o.tilt??p,!0);let f=a4(t,{canvasWidth:a,canvasHeight:l,paddingOption:o.padding,verticalPadding:o.verticalPadding,minZoom:n,maxZoom:i,position:u,camera:this.camera,orbit:this.orbit});return this.setRotation(c,!0),this.setTilt(p,!0),{center:f.position,zoomLevel:this.convertAltitudeToZoomLevel(f.zoom)}}focusOn(t,o){if(pH){this.debugContainer&&Ht(this.debugContainer);let x=new Wn(4,4,4),I=new Nr({color:65280,depthTest:!1}),M=new Ba(x,I,t.length),O=new zn;t.forEach((C,E)=>{O.setPosition(C),M.setMatrixAt(E,O)}),M.instanceMatrix.needsUpdate=!0,this.debugContainer.add(M),this.scene.add(this.debugContainer)}let n=o.curve,i=o.callback,a=o.cancelledCallback,l=o.minZoom!==void 0?o.minZoom:this.minZoomAltitude,c=o.maxZoom!==void 0?o.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,u=this.options.canvasHeight,f;o.duration!==void 0?f=o.duration:y.env.TESTING==="true"?f=0:f=R2;let h=o.padding,b=this.getRotation(),v=this.getTilt();o.rotation!=null&&this.setRotation(o.rotation),o.tilt!=null&&this.setTilt(o.tilt);let T=a4(t,{canvasHeight:u,paddingOption:h,canvasWidth:p,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:o.verticalPadding});this.setRotation(b),this.setTilt(v),this.animateCamera({position:T.position,tilt:o.tilt,rotation:o.rotation,zoom:T.zoom},f,n,i,a,o)}resize(t,o){this.options.canvasWidth=t,this.options.canvasHeight=o}};rx=new WeakMap,m(Lc,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function a4(e,{canvasWidth:r,orbit:t,paddingOption:o,verticalPadding:n=0,canvasHeight:i,minZoom:a,maxZoom:l,camera:c,position:p}){let u={zoom:a,position:p};if(e.length===0)return u;for(let De of Lc.CAMERA_FRAME_PADDING_SIDES)typeof o[De]!="number"&&(o[De]=0);let f=o.type==="portion"?{top:o.top*i,bottom:o.bottom*i,left:o.left*r,right:o.right*r,type:"pixel"}:o;if(f.left+f.right>=r||f.top+f.bottom>=i)return u;t.updateMatrixWorld();let h=c.matrixWorldInverse,b=c.fov*(Math.PI/180)/2,v=b,x=Math.atan(Math.tan(b)*(r/i)),I=new ae(1/0,1/0,1/0),M=new ae(-1/0,-1/0,-1/0),O=new sr,C=new ae;for(let De=0,xt=e.length;De<xt;De++)C.copy(e[De]),O.expandByPoint(C),C.applyMatrix4(h),I.min(C),M.max(C),C.copy(e[De]),C.z-=n,C.applyMatrix4(h),I.min(C),M.max(C),C.copy(e[De]),C.z+=n,C.applyMatrix4(h),I.min(C),M.max(C);let E=M.x-I.x,_=M.y-I.y,G=r-f.left-f.right,R=i-f.top-f.bottom,N=(M.x+I.x)/2,X=(M.y+I.y)/2,z=E/G,ee=_/R,re=a,ue=l,Ce=re*Math.tan(x)*2,Oe=ue*Math.tan(x)*2,Pe=Ce/r,Fe=Oe/r,ce=Math.max(z,ee);ce=Ue.clamp(ce,Pe,Fe);let Ee=G*ce,ye=R*ce,Ge={min:{x:N-Ee/2-f.left*ce,y:X-ye/2-f.bottom*ce},max:{x:N+Ee/2+f.right*ce,y:X+ye/2+f.top*ce}},Ie=(Ge.min.x+Ge.max.x)/2,Xe=(Ge.min.y+Ge.max.y)/2,se=O.getCenter(new ae),nt=Math.abs(Ie-Ge.min.x),dt=Math.abs(Xe-Ge.min.y),$t=nt/Math.tan(x),k=dt/Math.tan(v),H=new ae;H.set(Ie,Xe,M.z+Math.max($t,k)),H.applyMatrix4(c.matrixWorld);let P=new ae;P.set(Ie,Xe,M.z),P.applyMatrix4(c.matrixWorld);let q=new ae().subVectors(P,H),K=(se.z-H.z)/q.z,Q=new ae().copy(H).add(q.clone().multiplyScalar(K));return P.set(Q.x,Q.y,Q.z),H.sub(P),{position:Q,zoom:H.length()}}d();var dH=300,th,rh,ox=class{constructor(r){m(this,"state");S(this,th,new ae);S(this,rh,new ae);this.state=r}update(r){let t,o;this.state.cameraObject.getWorldPosition(s(this,rh));for(let n of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(n),t&&(o=t.components[0],o&&"containerEl"in o&&o.markerContainer!=null)){if(o.visibilityNeedsUpdate!==!1&&(o.visibilityNeedsUpdate==="show"?o.canShow=!0:o.canShow=!1),(o.canShow&&o.visible===!0||o.animation?.pending===!0)&&!o.offscreen)if(o.options.zIndex!=null)o.markerContainer.style.transform=`translate3D(${o.projection.x}px, ${o.projection.y}px, ${o.options.zIndex}px)`;else{t.object3d.getWorldPosition(s(this,th));let i=s(this,rh).distanceTo(s(this,th));o.markerContainer.style.transform=`translate3D(${o.projection.x}px, ${o.projection.y}px, ${-i}px)`}if(o.canShow===!0&&o.visible===!0?o.markerContainer.style.pointerEvents=r?"none":o.pointerEvents:o.markerContainer.style.pointerEvents="none",o.currentStrategyIndex===-1&&o.visible&&o.visibilityNeedsUpdate==="show")continue;o.visibilityNeedsUpdate!==!1&&!o.offscreen&&(o.visibilityNeedsUpdate==="show"&&(o.markerContainer.style.opacity="0"),o.animation&&o.animation.cancel(),o.animation=o.markerContainer.animate([{opacity:o.canShow&&o.visible?"1":"0"}],{duration:dH,easing:"ease-in-out",fill:"forwards"}),o.visibilityNeedsUpdate=!1)}}};th=new WeakMap,rh=new WeakMap;d();var nx=class extends ke{constructor(t,o){super();m(this,"state");m(this,"dirty",!0);m(this,"domTree");m(this,"observers",new Map);m(this,"updateDimensions",t=>{t.forEach(o=>{let i=o.target.parentElement?.getAttribute("data-marker-id");if(i){let a=this.state.geometry2DMap.get(i),l=a?.components[0];a&&l instanceof ks&&(l.updateDimensions(o.contentRect.width,o.contentRect.height),l.collisionDirty=!0)}}),this.publish("dimensions-update")});this.state=t,this.domTree=o}setupObserver(){if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let t,o;for(let n of this.domTree.children){let i=n.getAttribute("data-marker-id");if(i!=null&&(t=this.state.geometry2DMap.get(i),o=t.components[0],o.options?.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(o.containerEl),this.observers.set(n.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let t of this.observers.values())t.disconnect();this.observers.clear()}};d();var uH=0,mH=90,fH=(y.env.NODE_ENV==="test",!1),ls={linear:Vo.Linear.None,"ease-in":Vo.Quadratic.In,"ease-out":Vo.Quadratic.Out,"ease-in-out":Vo.Quadratic.InOut},hH=-50,de,Se,da,oh,nh,j2,ix=class{constructor(r,t,o){S(this,nh);S(this,de);S(this,Se);S(this,da);S(this,oh);w(this,de,r),w(this,Se,t),w(this,da,o),s(this,de).map&&s(this,de).map.transform.setMinElevationForCurrentTile(hH),s(this,Se).cameraSystem.on("pedestal-change",({pedestal:n})=>{s(this,Se).cameraSystem.setCameraPlaneElevation(n)})}get center(){return s(this,de).mode==="outdoors-overlay"&&s(this,de).map?s(this,de).map.getCenter?.().toArray():s(this,Se).cameraSystem.center}setCenter(r){if(s(this,de).mode==="outdoors-overlay"&&s(this,de).map){s(this,de).map?.setCenter(r),s(this,Se).interactionSystem.handleHover();return}s(this,Se).cameraSystem.setCenter(r[0],r[1]),s(this,Se).interactionSystem.handleHover()}get zoomLevel(){return s(this,de).mode==="outdoors-overlay"&&s(this,de).map?s(this,de).map?.getZoom():s(this,Se).cameraSystem.getZoomLevel()}setZoomLevel(r){s(this,de).mode==="outdoors-overlay"&&s(this,de).map&&s(this,de).map?.setZoom(r),s(this,Se).cameraSystem.setZoomLevel(Fi(r,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}getState(){return{zoomLevel:this.zoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,minPitch:this.minPitch,maxPitch:this.maxPitch,autoMinZoomLevel:this.autoMinZoomLevel,panMode:this.panMode,screenOffsets:this.insetsPadding,center:this.center,bearing:this.bearing,pitch:this.pitch,elevation:this.elevation}}get isAnimating(){return s(this,Se).cameraSystem.isAnimating}cancelAnimation(){s(this,Se).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,Se).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,Se).cameraSystem.minZoomLevel}setAutoMinZoomLevel(r){s(this,Se).panBoundsSystem.autoMinZoomLevel=r,r&&(s(this,Se).panBoundsSystem.dirty=!0,s(this,Se).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,Se).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(r,t=!1){t&&this.setAutoMinZoomLevel(!1);let o=Fi(r,mi.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,`setMinZoomLevel was clamped. minZoomLevel must be between ${mi.MIN_MERCATOR_ZOOM_LEVEL} and maxZoomLevel.`);s(this,Se).cameraSystem.setMinZoomLevel(o),this.zoomLevel<o&&this.setZoomLevel(o),s(this,de).map?.setMinZoom(o)}setMaxZoomLevel(r){let t=Fi(r,this.minZoomLevel,mi.MAX_MERCATOR_ZOOM_LEVEL,`setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ${mi.MAX_MERCATOR_ZOOM_LEVEL}.`);s(this,Se).cameraSystem.setMaxZoomLevel(t),this.zoomLevel>t&&this.setZoomLevel(t),s(this,de).map?.setMaxZoom(t)}get maxPitch(){return s(this,de).mode==="outdoors-overlay"&&s(this,de).map?s(this,de).map?.getMaxPitch?.():Ue.radToDeg(s(this,Se).cameraSystem.maxTilt)}get minPitch(){return s(this,de).mode==="outdoors-overlay"&&s(this,de).map?s(this,de).map?.getMinPitch?.():Ue.radToDeg(s(this,Se).cameraSystem.minTilt)}setMinPitch(r){let t=Math.max(uH,r);s(this,de).map?.setMinPitch(t),s(this,Se).cameraSystem.minTilt=Ue.degToRad(t)}setMaxPitch(r){let t=Math.min(mH,r);s(this,de).map?.setMaxPitch(t),s(this,Se).cameraSystem.maxTilt=Ue.degToRad(t)}get bearing(){return s(this,de).mode==="outdoors-overlay"&&s(this,de).map?s(this,de).map?.getBearing():Ue.radToDeg(s(this,Se).cameraSystem.getRotation())}setBearing(r){if(s(this,de).mode==="outdoors-overlay"&&s(this,de).map){s(this,de).map?.setBearing(r);return}s(this,Se).cameraSystem.setRotation(Ue.degToRad(r))}get pitch(){return s(this,de).mode==="outdoors-overlay"&&s(this,de).map?s(this,de).map?.getPitch():Ue.radToDeg(s(this,Se).cameraSystem.getTilt())}setPitch(r){if(s(this,de).mode==="outdoors-overlay"&&s(this,de).map){s(this,de).map?.setPitch(r);return}s(this,Se).cameraSystem.setTilt(Ue.degToRad(Fi(r,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return s(this,Se).cameraSystem.getPedestal()}setElevation(r){s(this,Se).cameraSystem.setPedestal(r,!0)}animateElevation(r,t){return s(this,oh)&&s(this,oh).stop(),new Promise(o=>{s(this,Se).cameraSystem.animateCamera({position:{z:r}},t?.duration||300,ls[t?.easing||"ease-in-out"],o,o,{interruptible:t?.interruptible??!0})})}get insetsPadding(){return s(this,da).insetsPadding}get panMode(){return s(this,Se).cameraSystem.enablePan===!1&&s(this,Se).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(r){if(r!=="default"&&r!=="elevation")throw new Error("Invalid pan mode");r!==this.panMode&&(r==="default"?(s(this,Se).cameraSystem.enablePan=!0,s(this,Se).cameraSystem.enablePedestal=!1):(s(this,Se).cameraSystem.enablePan=!1,s(this,Se).cameraSystem.enablePedestal=!0))}setInsetPadding(r){s(this,da).insetsPadding=Object.assign({},s(this,da).insetsPadding,r)}animateTo(r){if(s(this,de).mode==="outdoors-overlay"&&s(this,de).map)return s(this,de).map?.flyTo({center:r.center??this.center,zoom:r.zoomLevel??this.zoomLevel,bearing:r.bearing??this.bearing,pitch:r.pitch??this.pitch,duration:r.duration??600}),Promise.resolve();let t=r.center?s(this,de).convertTo3DMapPosition(r.center[1],r.center[0],r.center[2]||this.elevation):void 0,o=r.zoomLevel!==void 0?s(this,Se).cameraSystem.convertZoomLevelToAltitude(Fi(r.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,n=r.bearing!==void 0?Ue.degToRad(r.bearing):void 0,i=r.pitch!==void 0?Ue.degToRad(Fi(r.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(a=>{s(this,Se).cameraSystem.animateCamera({position:t,zoom:o,rotation:n,tilt:i},r.duration||0,ls[r.easing||"ease-in-out"],()=>{s(this,Se).interactionSystem.handleHover(),a()},a,{interruptible:r?.interruptible??!0})})}getCameraFrameForCoordinates(r,t){let o=W(this,nh,j2).call(this,t||{},()=>Promise.resolve()),{pointCloud:n}=l4(r,s(this,de),s(this,da).geometry3DMap);if(n.length===0)return A.error("No valid coordinates found in targets:",r),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:a}=s(this,Se).cameraSystem.getCameraFrameForCoordinates(n,o);return{center:s(this,de).convert3DMapPositionToCoordinate(i),zoomLevel:a}}focusOn(r,t){let{pointCloud:o,geoBounds:n,firstPosition:i}=l4(r,s(this,de),s(this,da).geometry3DMap);return o.length===0?(A.error("No valid coordinates found in targets:",r),Promise.resolve()):s(this,de).mode==="outdoors-overlay"&&s(this,de).map?(o.length===1&&i?s(this,de).map?.flyTo({center:[i[0],i[1]],duration:t?.duration||s(this,de).map.getBearing(),animate:!0,bearing:t?.bearing===void 0?s(this,de).map.getBearing():t?.bearing,pitch:t?.pitch===void 0?s(this,de).map.getPitch():t?.pitch,zoom:t?.maxZoomLevel||s(this,de).map.getMaxZoom()}):(fH&&gH(s(this,de),n),s(this,de).map?.fitBounds(n,{duration:t?.duration??mi.DEFAULT_ANIMATION_DURATION,bearing:t?.bearing===void 0?s(this,de).map.getBearing():t?.bearing,pitch:t?.pitch===void 0?s(this,de).map.getPitch():t?.pitch,maxZoom:t?.maxZoomLevel??s(this,de).map.getMaxZoom()})),s(this,Se).interactionSystem.handleHover(),Promise.resolve()):new Promise(a=>{s(this,Se).cameraSystem.focusOn(o,W(this,nh,j2).call(this,t||{},a))})}};de=new WeakMap,Se=new WeakMap,da=new WeakMap,oh=new WeakMap,nh=new WeakSet,j2=function(r,t){return{minZoom:r?.maxZoomLevel===void 0?void 0:s(this,Se).cameraSystem.convertZoomLevelToAltitude(Fi(r.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:r?.minZoomLevel===void 0?void 0:s(this,Se).cameraSystem.convertZoomLevelToAltitude(Fi(r.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:r?.padding?Object.assign({},py,r?.padding):this.insetsPadding,curve:ls[r?.easing||"ease-in-out"],rotation:r?.bearing===void 0?void 0:Ue.degToRad(r.bearing),tilt:r?.pitch!==void 0?Ue.degToRad(Fi(r.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:r?.duration,callback:()=>{s(this,Se).interactionSystem.handleHover(),t()},cancelledCallback:t,interruptible:r?.interruptible??!0,verticalPadding:r?.verticalPadding}};function N2(e,r){e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[0]),e[3]=Math.max(e[3],r[1])}function l4(e,r,t){let o=[],n=[1/0,1/0,-1/0,-1/0],i=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:o,geoBounds:n,firstPosition:i};let a=r.getSystems().renderSystem;(a.threeDdirty||a.twoDdirty)&&r.renderSync();for(let l of e)if(typeof l=="string"){let c=t.get(l);if(!c){A.error("Entity not found with id:",l);continue}let p=new sr;XC(r,"userData"in c?c.userData.entityId??c.id:c.id,o,p,c instanceof hr?c.position.z:void 0);let u=r.convert3DMapPositionToCoordinate(p.min),f=r.convert3DMapPositionToCoordinate(p.max);N2(n,u),N2(n,f),i||(i=r.convert3DMapPositionToCoordinate(p.getCenter(new ae)))}else o.push(r.convertTo3DMapPosition(l[1],l[0],l[2]||0)),N2(n,l),i||(i=l);return{pointCloud:o,geoBounds:n,firstPosition:i}}function gH(e,r){let t=[[r[0],r[1]],[r[0],r[3]],[r[2],r[3]],[r[2],r[1]],[r[0],r[1]]];e.map?.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),e.map?.getSource("bounds-source")&&e.map.removeSource("bounds-source"),e.map?.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:t}}}),e.map?.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}d();d();var c4=`uniform vec4 uSize;
|
|
13
|
+
varying vec2 vUv;
|
|
14
|
+
void main() {
|
|
15
|
+
vUv = uv;
|
|
16
|
+
// Scale the position by the size of the quad
|
|
17
|
+
// and shift to top left corner for 0,0
|
|
18
|
+
vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);
|
|
19
|
+
// Apply width .x and height .y of image
|
|
20
|
+
transformed += vec2(uSize.x, -uSize.y);
|
|
21
|
+
// Apply left .w and top .z offset
|
|
22
|
+
transformed += vec2(uSize.w, -uSize.z) * 2.0;
|
|
23
|
+
gl_Position = vec4(transformed, 1.0, 1.0);
|
|
24
|
+
}`;d();var p4=`varying vec2 vUv;
|
|
25
|
+
uniform sampler2D uTexture;
|
|
26
|
+
uniform float uOpacity;
|
|
27
|
+
void main() {
|
|
28
|
+
#ifndef debug
|
|
29
|
+
vec4 texture = texture2D(uTexture, vUv);
|
|
30
|
+
gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);
|
|
31
|
+
#else
|
|
32
|
+
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
|
33
|
+
#endif
|
|
34
|
+
}`;d();var d4=4.291666666666667,u4=15,m4=25,f4=43/60;d();var h4=["horizontal","icon"],yH=new Map([[h4[0],`<svg viewBox="0 0 206 48">
|
|
35
|
+
<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"/>
|
|
36
|
+
<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"/>
|
|
37
|
+
<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"/>
|
|
38
|
+
<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"/>
|
|
39
|
+
</svg>`],[h4[1],`<svg viewBox="0 0 43 60">
|
|
40
|
+
<path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>
|
|
41
|
+
<path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>
|
|
42
|
+
<path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>
|
|
43
|
+
</svg>`]]),bH=/<svg([^>]*)>/g;function g4(e,r,t,o){let n=yH.get(e);return n?n.replace(bH,`<svg$1 width="${t}" height="${o}" xmlns="http://www.w3.org/2000/svg" style="fill: ${r};">`):""}var y4=!1,Tt,ua,Su,Sr,So,_c,fi,cs,sx=class extends ke{constructor(t,o,n){super();S(this,Tt,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window?.open("https://www.mappedin.com")},interactive:!0,visible:!0});S(this,ua);S(this,Su);S(this,Sr);S(this,So);S(this,_c);S(this,fi,0);S(this,cs,0);m(this,"dirty",!0);m(this,"getPositionAlignedCanvasCoordinates",(t,o)=>({"top-left":{x:0,y:0},"top-right":{x:t,y:0},"bottom-left":{x:0,y:o},"bottom-right":{x:t,y:o},center:{x:t/2,y:o/2},top:{x:t/2,y:0},bottom:{x:t/2,y:o},left:{x:0,y:o/2},right:{x:t,y:o/2}})[s(this,Tt).position]);m(this,"getPositionAlignedPadding",()=>{let t=s(this,Tt).padding;if(typeof t=="number")return{"top-left":{x:t,y:t},"top-right":{x:-t,y:t},"bottom-left":{x:t,y:-t},"bottom-right":{x:-t,y:-t},center:{x:0,y:0},top:{x:0,y:t},bottom:{x:0,y:-t},left:{x:t,y:0},right:{x:-t,y:0}}[s(this,Tt).position];let o={top:t.top??0,right:t.right??0,bottom:t.bottom??0,left:t.left??0};return{x:o.left-o.right,y:o.top-o.bottom}});n&&Object.entries(n).forEach(([i,a])=>{a!==void 0&&(s(this,Tt)[i]=a)}),w(this,Su,t),w(this,ua,o)}get color(){return s(this,Tt).color==="light"?"white":"#293136"}get iconName(){return s(this,Tt).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,Tt).iconOnly?u4:75}get defaultWidth(){return s(this,Tt).iconOnly?m4:150}get aspectRatio(){return s(this,Tt).iconOnly?f4:d4}get options(){return{...s(this,Tt)}}set options(t){w(this,Tt,{padding:t.padding||s(this,Tt).padding,position:t.position||s(this,Tt).position,iconOnly:t.iconOnly||s(this,Tt).iconOnly,color:t.color||s(this,Tt).color,scale:t.scale||s(this,Tt).scale,onClick:s(this,Tt).onClick,interactive:t.interactive??s(this,Tt).interactive,visible:t.visible??s(this,Tt).visible})}get icon(){return g4(this.iconName,this.color,s(this,fi)*s(this,ua).pixelRatio,s(this,cs)*s(this,ua).pixelRatio)}setSize(t,o){s(this,So)&&(s(this,So).uniforms.uSize.value.x=t,s(this,So).uniforms.uSize.value.y=o)}setXY(t,o){s(this,So)&&(s(this,So).uniforms.uSize.value.w=t,s(this,So).uniforms.uSize.value.z=o)}get width(){return s(this,fi)}get height(){return s(this,cs)}getPositionAlignedOffset(t,o){return{"top-left":{x:0,y:0},"top-right":{x:-t,y:0},"bottom-left":{x:0,y:-o},"bottom-right":{x:-t,y:-o},center:{x:-(t/2),y:-(o/2)},top:{x:-(t/2),y:0},bottom:{x:-(t/2),y:-o},left:{x:0,y:-(o/2)},right:{x:-t,y:-(o/2)}}[s(this,Tt).position]}insertIntoQuadTree(t){s(this,_c)!=null&&typeof s(this,Tt).onClick=="function"&&s(this,Tt).interactive&&t.insert(s(this,_c))}resize(t,o){if(s(this,Tt).visible!==!0)return;let n=this.getPositionAlignedCanvasCoordinates(t,o),i=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,fi),s(this,cs)),l=Math.min(t-s(this,fi),Math.max(0,n.x+i.x+a.x)),c=Math.min(o-s(this,cs),Math.max(0,n.y+i.y+a.y));this.setSize(s(this,fi)/t,s(this,cs)/o),this.setXY(l/t,c/o),w(this,_c,new rt(l,c,s(this,fi),s(this,cs),{entityId:"watermark"}))}update(){this.dirty&&(s(this,Tt).visible===!0?(w(this,fi,Math.min(s(this,ua).canvasWidth,Math.max(this.minWidth,this.defaultWidth*s(this,Tt).scale))),w(this,cs,s(this,fi)/this.aspectRatio),vl.getLoader().load(`data:image/svg+xml;base64,${btoa(this.icon)}`,t=>{if(w(this,So,new _a({uniforms:{uTexture:{value:t},uSize:{value:new uC(0,0,0,0)},uOpacity:{value:.7}},vertexShader:c4,fragmentShader:p4,depthWrite:!1,depthTest:!1,defines:{debug:y4},wireframe:y4,transparent:!0,visible:!0})),s(this,Sr))s(this,Sr).visible=!0,s(this,Sr).material=s(this,So),s(this,Sr).material.needsUpdate=!0;else{let o=new Es(2,2,1,1);w(this,Sr,new Le(o,s(this,So))),s(this,Sr).position.set(0,0,-1),s(this,Sr).frustumCulled=!1,s(this,Sr).renderOrder=999;let n=new Wn(1,1,1),i=new Le(n,new Nr({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),s(this,Sr).add(i),s(this,Su).add(s(this,Sr))}this.resize(s(this,ua).canvasWidth,s(this,ua).canvasHeight),this.publish("texture-loaded")})):s(this,Sr)&&(s(this,Sr).visible=!1),this.dirty=!1)}destroy(){s(this,Sr)&&(s(this,Su).remove(s(this,Sr)),Ht(s(this,Sr))),w(this,Sr,void 0),s(this,So)&&s(this,So).dispose(),w(this,So,void 0),w(this,_c,void 0)}};Tt=new WeakMap,ua=new WeakMap,Su=new WeakMap,Sr=new WeakMap,So=new WeakMap,_c=new WeakMap,fi=new WeakMap,cs=new WeakMap;d();var ax=100,IH=!1,cx=class extends ke{constructor(t,o){super();m(this,"currentTotalBoundingBox");m(this,"state");m(this,"cameraSystem");m(this,"debugMesh",null);m(this,"dirty",!0);m(this,"autoMinZoomLevel",!0);this.state=t,this.cameraSystem=o}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new sr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new ae(0,0,0),new ae(ax*2,ax*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(ax)));let t=new sr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(t);let o=t.getSize(new ae),n=Math.max(o.x,o.y,o.z);for(let a of this.state.geometry2DMap.values())a.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(a.position),a.positionDirty=!1);let i=lx.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(n,ax)).getBoundingSphere(SH).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new ae),min:lx.min,max:lx.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,IH&&this.state.entityScene.parent instanceof Ra){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Os,this.debugMesh.add(new Le(new ry(this.cameraSystem.panBounds.radius),new Nr({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let a=new ae;lx.getSize(a);let l=new Wn(a.x,a.y,a.z),c=new Nr({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new Le(l,c);p.position.copy(this.currentTotalBoundingBox.getCenter(new ae)),this.debugMesh.add(p)}}}},lx=new sr,SH=new fC;d();var G2="\xA9 Mappedin",TH="https://info.mappedin.com/feedback",V2=["top-left","top-right","bottom-left","bottom-right"],CH=640,MH=()=>`<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>
|
|
44
|
+
<circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>
|
|
45
|
+
<path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>
|
|
46
|
+
</svg>`,U2={custom:[],position:"bottom-right",feedback:!0},Tu,px=class{constructor(r,t={}){m(this,"controlContainerEl");m(this,"controlPositions");m(this,"compact");S(this,Tu);m(this,"attribContainerEl");m(this,"attribInnerEl");m(this,"attribButtonEl");m(this,"feedbackLinkEl");m(this,"attribHTML",G2);m(this,"customAttributions",[]);m(this,"toggleAttribution",r=>{this.attribContainerEl!=null&&(r.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))});w(this,Tu,!!t.outdoorEnabled),this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),r.appendChild(this.controlContainerEl),this.controlPositions=V2.reduce((o,n)=>{let i=document.createElement("div");return i.classList.add(`mappedin-ctrl-${n}`),this.controlContainerEl.appendChild(i),o[n]=i,o},{})}addAttributionControl(r=U2){let t=r.position&&V2.includes(r.position)?r.position:U2.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib",`mappedin-ctrl-attrib-${t}`),this.attribContainerEl.open=!0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[t].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=MH(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribHTML=s(this,Tu)?G2:"",this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),(r.feedback??U2.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=TH,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),r.custom&&(this.customAttributions=r.custom),this.updateAttributionDisplay()}updateAttribution(r){if(!r.style||!this.attribInnerEl||!this.attribContainerEl)return;let t=s(this,Tu)?[G2]:[],o=r.style.sourceCaches;for(let n in o){let i=o[n];if(i.used||i.usedForTerrain){let a=i.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t=t.filter(n=>String(n).trim()),t=t.filter((n,i)=>{for(let a=i+1;a<t.length;a++)if(t[a].indexOf(n)>=0)return!1;return!0}),this.attribHTML=t.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let r=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=r)}resizeAttribution(r){this.attribContainerEl&&(r<=CH||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(r){this.resizeAttribution(r)}updateData(r){this.updateAttribution(r)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};Tu=new WeakMap;d();var ih,sh,Cu=class{constructor(r,t){m(this,"mesh");m(this,"type","custom-geometry");m(this,"dirty",!0);m(this,"feature");m(this,"builder");m(this,"outline");S(this,ih,1);m(this,"color",new ar);S(this,sh,0);this.mesh=new Ga,this.feature=r,this.builder=t}get visible(){return this.mesh.visible}set visible(r){this.mesh.visible=r}set opacity(r){w(this,ih,r)}get opacity(){return s(this,ih)}setColor(r){this.color.set(r)}get position(){return this.mesh?.position}get altitude(){return s(this,sh)}set altitude(r){this.mesh&&(this.mesh.position.z=r,w(this,sh,r))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(r){this.mesh&&(this.mesh.renderOrder=r)}};ih=new WeakMap,sh=new WeakMap;d();var dx=class{constructor(r,t){m(this,"state");m(this,"convertTo3DMapPosition");this.state=r,this.convertTo3DMapPosition=t}update(){let r,t;for(let o of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(o);n?.type==="custom-geometry"&&(r=n.components[0],t=n.components[1],r.dirty&&t.visible!==!1&&(r.position.copy(this.convertTo3DMapPosition(r.feature.geometry.coordinates[1],r.feature.geometry.coordinates[0],t.altitude)),r.builder.setup(r.mesh),r.mesh.traverse(i=>{i.userData={...i.userData,entityId:o,type:"custom-geometry"}}),r.dirty=!1),t.visible!==!1&&r.builder.update(r.mesh))}}};d();d();function b4(e){return e.children.some(r=>r.userData.isOutline)}function x4(e,r){let t=e.userData.entities3D.values().next().value;return t?r.geometry3DMap.get(t)?.components[3]!==void 0:!1}function ux(e,r,t,o){let i=e.getAttribute("position").array,a=-1/0;for(let l=0;l<r.count;l++){let p=(r.start+l)*3,u=i[p+2];a=Math.max(a,u)}for(let l=0;l<r.count;l++){let p=(r.start+l)*3,u=i[p+2];Math.abs(u-a)<1e-4?i[p+2]=Math.max(t+o,2e-4+o):i[p+2]=o}e.attributes.position.needsUpdate=!0}d();function $2(e){let r=new Qg,t=e.mesh?.geometry;if(!t||!e.batchedProps?.range)return;let o=e.batchedProps.range,n=o.start,i=o.count,a=t.getAttribute("position");if(a){let p=new Float32Array(i*3);for(let u=0;u<i;u++){let f=n+u;p[u*3]=a.array[f*3],p[u*3+1]=a.array[f*3+1],p[u*3+2]=a.array[f*3+2]}r.setAttribute("position",new po(p,3))}let l=t.getAttribute("normal");if(l){let p=new Float32Array(i*3);for(let u=0;u<i;u++){let f=n+u;p[u*3]=l.array[f*3],p[u*3+1]=l.array[f*3+1],p[u*3+2]=l.array[f*3+2]}r.setAttribute("normal",new po(p,3))}let c=t.getAttribute("uv");if(c){let p=new Float32Array(i*2);for(let u=0;u<i;u++){let f=n+u;p[u*2]=c.array[f*2],p[u*2+1]=c.array[f*2+1]}r.setAttribute("uv",new po(p,2))}if(t.index){let p=t.index,u=new Uint32Array(i);for(let f=0;f<i;f++)u[f]=p.array[n+f];r.setIndex(new po(u,1))}return r}function v4(e,r){let t=$2(e);if(!t||!e.mesh)return;e.mesh.deleteInstance(e.instanceIndex),e.mesh.optimize();let o=r.addGeometry(t);r.addInstance(o);let n=r.getGeometryIdAt(o),i=r.getGeometryRangeAt(n);return i&&e.batchedProps&&(e.batchedProps.range=i),t.dispose(),o}d();d();var I4=`// Modified from https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderLib/linedashed.glsl.js
|
|
47
|
+
uniform float scale;
|
|
48
|
+
attribute float lineDistance;
|
|
49
|
+
|
|
50
|
+
varying float vLineDistance;
|
|
51
|
+
attribute float visibility;
|
|
52
|
+
varying vec4 v_color;
|
|
53
|
+
|
|
54
|
+
#include <common>
|
|
55
|
+
#include <uv_pars_vertex>
|
|
56
|
+
#include <color_pars_vertex>
|
|
57
|
+
#include <fog_pars_vertex>
|
|
58
|
+
#include <morphtarget_pars_vertex>
|
|
59
|
+
#include <logdepthbuf_pars_vertex>
|
|
60
|
+
#include <clipping_planes_pars_vertex>
|
|
61
|
+
|
|
62
|
+
void main() {
|
|
63
|
+
|
|
64
|
+
vLineDistance = scale * lineDistance;
|
|
65
|
+
v_color = color;
|
|
66
|
+
|
|
67
|
+
#include <uv_vertex>
|
|
68
|
+
#include <color_vertex>
|
|
69
|
+
#include <morphinstance_vertex>
|
|
70
|
+
#include <morphcolor_vertex>
|
|
71
|
+
#include <begin_vertex>
|
|
72
|
+
#include <morphtarget_vertex>
|
|
73
|
+
#include <project_vertex>
|
|
74
|
+
if (visibility < 0.5) {
|
|
75
|
+
gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);
|
|
76
|
+
}
|
|
77
|
+
#include <logdepthbuf_vertex>
|
|
78
|
+
#include <clipping_planes_vertex>
|
|
79
|
+
#include <fog_vertex>
|
|
80
|
+
|
|
81
|
+
}`;d();var S4=`// Modified from https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderLib/linedashed.glsl.js
|
|
82
|
+
uniform vec3 diffuse;
|
|
83
|
+
uniform float opacity;
|
|
84
|
+
|
|
85
|
+
uniform float dashSize;
|
|
86
|
+
uniform float totalSize;
|
|
87
|
+
|
|
88
|
+
varying float vLineDistance;
|
|
89
|
+
varying vec4 v_color;
|
|
90
|
+
|
|
91
|
+
#include <common>
|
|
92
|
+
#include <color_pars_fragment>
|
|
93
|
+
#include <uv_pars_fragment>
|
|
94
|
+
#include <map_pars_fragment>
|
|
95
|
+
#include <fog_pars_fragment>
|
|
96
|
+
#include <logdepthbuf_pars_fragment>
|
|
97
|
+
#include <clipping_planes_pars_fragment>
|
|
98
|
+
|
|
99
|
+
void main() {
|
|
100
|
+
|
|
101
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
102
|
+
#include <clipping_planes_fragment>
|
|
103
|
+
|
|
104
|
+
if ( mod( vLineDistance, totalSize ) > dashSize ) {
|
|
105
|
+
|
|
106
|
+
discard;
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
vec3 outgoingLight = vec3( 0.0 );
|
|
111
|
+
|
|
112
|
+
#include <logdepthbuf_fragment>
|
|
113
|
+
#include <map_fragment>
|
|
114
|
+
#include <color_fragment>
|
|
115
|
+
|
|
116
|
+
outgoingLight = diffuseColor.rgb; // simple shader
|
|
117
|
+
|
|
118
|
+
#include <opaque_fragment>
|
|
119
|
+
#include <tonemapping_fragment>
|
|
120
|
+
#include <colorspace_fragment>
|
|
121
|
+
#include <fog_fragment>
|
|
122
|
+
#include <premultiplied_alpha_fragment>
|
|
123
|
+
|
|
124
|
+
// Discard alpha lower than 0.01 to avoid opacity fighting
|
|
125
|
+
if (v_color.a <= 0.01) {
|
|
126
|
+
discard;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`;var mx=class extends gC{constructor(r){super(r),this.onBeforeCompile=t=>{t.vertexShader=I4,t.fragmentShader=S4}}};var EH=80,Rc,Mu,hx,gx,fx=class{constructor(r){m(this,"rendererState");m(this,"outlineOpacitiesDirty",!0);S(this,Rc,!0);S(this,Mu,-1/0);S(this,hx,new Map);S(this,gx,new mx({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:cm}));this.rendererState=r}get geometries3DDirty(){return s(this,Rc)}set geometries3DDirty(r){w(this,Rc,r)}update(r,t=!0){let o;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof Zn&&x4(a,this.rendererState)&&!b4(a)&&a.userData.entities3D.size>0){let l=[];for(let x of a.userData.entities3D.values()){let I=this.rendererState.geometry3DMap.get(x);if(I instanceof Mt&&I.type==="geometry"&&I.components[3]&&I.components[3].dirty===!0&&I.components[0].material!=null){let M=I.components[0].geometry,O=!1;M||(M=$2(I.components[0]),O=!0);let C=I.components[1];l.push([I.components[3],new bC(M,C.bevel?.enabled?1:EH)]),O&&(M?.dispose(),M=void 0)}}if(l.length===0)continue;let c=_i(l.map(x=>x[1]),!1);if(c==null)continue;let p=c.getAttribute("position"),u=new Float32Array(p.count*4),f=new po(u,4);c.setAttribute("color",f);let h=new Uint8Array(p.count);h.fill(0);let b=new po(h,1,!1);c.setAttribute("visibility",b);let v=0;for(let x=0;x<l.length;x++){let[I,M]=l[x],O=M.getAttribute("position").count;I.edgeColors=f,I.edgeVisibility=b,I.geometry=c,I.ranges={count:O,start:v},v+=O,M.dispose()}let T=new dm(c,s(this,gx));T.userData.isOutline=!0,a.add(T)}}w(this,Rc,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof Mt&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].material!=null&&a.parentObject3D instanceof Zn){let l=a.components[3].geometry;if(!l)continue;let c=a.components[3];if(!c)continue;let p=c.enabled&&a.components[1].visible;if(c.visible!==p&&(c.visible=p),!c.visible)continue;let u=c.edgeColors;if(!u||!c.ranges)continue;let f=new ar(c.color);for(let T=0;T<c.ranges.count;T++){let x=c.ranges.start+T;u.setXYZ(x,f.r,f.g,f.b)}let h=a.components[1].height,b=a.components[1].altitude;a.components[1]?.bevel?.enabled||ux(l,c.ranges,h,b),l.attributes.color.needsUpdate=!0,l.computeBoundingSphere(),c.dirty=!1}}let n=t?Nl(r,16,19,0,1):s(this,Mu);if((n!==s(this,Mu)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let i of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(i),o?.type==="geometry"&&o.components[0]instanceof fr){let a=o.components[3];if(a&&a.edgeColors&&a.geometry&&a.visible){let l=Math.min(n,o.components[1].opacity*Mp(o));if(a.currentOpacity!==l){for(let c=0;c<a.ranges.count;c++){let p=a.ranges.start+c;a.edgeColors.setW(p,l)}a.geometry.attributes.color.needsUpdate=!0}}}}w(this,Mu,n),w(this,Rc,!1),this.outlineOpacitiesDirty=!1}destroy(){s(this,hx).clear()}};Rc=new WeakMap,Mu=new WeakMap,hx=new WeakMap,gx=new WeakMap;d();d();var yx=class extends Le{constructor(){super(...arguments);m(this,"userData",{entityId:""})}},PH=F.object({flipImageToFaceCamera:F.boolean().optional(),url:F.string()}),FH=F.object({type:F.enum(["Feature"]),properties:F.object({width:F.number(),height:F.number(),rotation:F.number().min(0).max(360).optional(),verticalOffset:F.number().optional()}),geometry:xu});function T4(e,r,t){F.union([F.number(),F.string()]).parse(e),FH.parse(r),PH.parse(t)}var bx=class{constructor(r){m(this,"mesh",new Ga);m(this,"imageMesh");m(this,"outline");m(this,"type","image");m(this,"instanceIndex",-1);m(this,"geometry");m(this,"material");m(this,"feature");m(this,"position",new ae);this.feature=r}get visible(){return this.mesh?.visible??!1}set visible(r){this.mesh&&(this.mesh.visible=r)}};d();function H2(e,r){return{x:e.x*Math.cos(r)-e.y*Math.sin(r),y:e.x*Math.sin(r)+e.y*Math.cos(r)}}function DH(e,r){return e.map(t=>H2(t,r))}function kH(e){let r=1/0,t=1/0,o=-1/0,n=-1/0;for(let i of e)r=Math.min(r,i.x),t=Math.min(t,i.y),o=Math.max(o,i.x),n=Math.max(n,i.y);return{minX:r,minY:t,maxX:o,maxY:n}}function AH(e,r){let t=!1;for(let o=0,n=r.length-1;o<r.length;n=o++){let i=r[o].x,a=r[o].y,l=r[n].x,c=r[n].y;a>e.y!=c>e.y&&e.x<(l-i)*(e.y-a)/(c-a)+i&&(t=!t)}return t}function C4(e,r,t,o,n){for(let i=0;i<n;i++)for(let a=0;a<o;a++)if(e[t+i][r+a]!==1)return!1;return!0}function LH(e,r,t){let o=e.maxX-e.minX,n=e.maxY-e.minY,i,a,l={...e};return o/n>r?(a=n/t,i=a*r,l.minX+=(o-i*t)/2):(i=o/t,a=i/r,l.minY+=(n-a*t)/2),{dx:i,dy:a,gridBounds:l}}function _H(e,r,t,o,n){let i=Array(t).fill(0).map(()=>Array(t).fill(0));for(let a=0;a<t;a++)for(let l=0;l<t;l++){let c={x:r.minX+l*o,y:r.minY+a*n};AH(c,e)&&(i[a][l]=1)}return i}function RH(e,r){let t=Array(r).fill(0).map(()=>Array(r).fill(0));for(let o=0;o<r;o++)for(let n=0;n<r;n++)if(e[o][n]===1){let i=0;for(let a=1;a<=Math.min(r-n,r-o)&&C4(e,n,o,a,a);a++)i=a;t[o][n]=i}return t}function BH(e,r,t,o,n,i){let a=0,l=0,c=0;for(let p=0;p<o;p++)for(let u=0;u<o;u++)if(e[p][u]===1){let f=Math.pow(r[p][u],2),h=t.minX+u*n,b=t.minY+p*i;a+=f,l+=h*f,c+=b*f}return{x:l/a,y:c/a}}function NH(e,r,t,o,n,i,a){let l=-1/0,c=null,p=e.length,u=Math.sqrt(Math.pow(r.maxX-r.minX,2)+Math.pow(r.maxY-r.minY,2));for(let f=0;f<p;f++)for(let h=0;h<p;h++)if(e[f][h]===1)for(let b=1;b<=p-h;b++){let v=b;if(!(v>p-f)&&C4(e,h,f,b,v)){let T=b*v,x=r.minX+(h+b/2)*t,I=r.minY+(f+v/2)*o,M={x,y:I},C=Math.sqrt(Math.pow(M.x-n.x,2)+Math.pow(M.y-n.y,2))/u,E=T*(1-i)-C*i*T;E>l&&(l=E,c={center:M,width:b*t*a,height:b*o*a})}}return c}function z2(e,r,t,o={}){let{scaleFactor:n=.9,centerPriority:i=.5,resolution:a=100,minimumSizeRatio:l=.5}=o,c=wC(t),p=e.width/e.height,u=DH(r,c),f=kH(u),{dx:h,dy:b,gridBounds:v}=LH(f,p,a),T=_H(u,v,a,h,b),x=RH(T,a),I=BH(T,x,v,a,h,b),M=NH(T,v,h,b,I,i,n);return!M||M.width<e.width*l||M.height<e.height*l?e:{...M,center:H2(M.center,-c),rotation:t,polygonCenter:H2(I,-c)}}var ah=Math.PI*2,jH=Math.PI/2,GH=Math.PI*1.5,UH=Di(jH,2),VH=Di(GH,2),$H=.01,M4=!1,xx=class extends ke{constructor(t,o,n,i=0,a=0,l={}){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"projectToScreen");m(this,"initialBearing",0);m(this,"naturalBearing",0);m(this,"imagePlacementOptions");m(this,"cameraFrustum",new qg);m(this,"imageLoadingCache",new Map);m(this,"currentImageScreenBBoxes",[]);m(this,"viewProjectionMatrix",new zn);this.rendererState=t,this.convertTo3DMapPosition=o,this.projectToScreen=n,this.initialBearing=i,this.naturalBearing=a,this.imagePlacementOptions=l}createImageMesh(t,o,n,i=0,a,l){let c={width:n.width,height:n.height,center:this.convertTo3DMapPosition(a),rotation:n.rotation??0},p=this.imagePlacementOptions.mode??"default",u=(()=>{switch(p){case"fit-nearest-90":let v=(this.initialBearing-this.naturalBearing+360)%180;return v>=45&&v<=135?z2(c,l,c.rotation+90,this.imagePlacementOptions):c;case"fit-initial-bearing":return z2(c,l,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return c}})();if(M4&&u.polygonCenter){let v=new Le(new ry(1),new Ei({color:65280}));v.position.set(u.polygonCenter.x,u.polygonCenter.y,i),this.rendererState.entityScene.add(v)}let f=new Ei({transparent:!0,depthWrite:!1,side:ws}),h=new Es(u.width,u.height),b=new yx(h);if(b.visible=!1,b.renderOrder=1,this.getOrDownloadImage(o)?.then(v=>{f.map=v,f.needsUpdate=!0,f.map.colorSpace=Xg,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=t,b.material=f,M4){let v=new Le(new Es(n.width,n.height),new Ei({color:"gray"}));b.add(v);let T=new TC;b.add(T),T.scale.set(10,10,10)}return b.position.set(u.center.x,u.center.y,i+$H),b.rotation.z=(-Ue.degToRad(u.rotation)+ah)%ah,b}getOrDownloadImage(t){if(this.imageLoadingCache.has(t))return this.imageLoadingCache.get(t)?.promise;{let o=new Promise(n=>{vl.getLoader().load(t,i=>{let a=this.imageLoadingCache.get(t);a&&!a.loaded&&(a.loaded=!0),n(i)})});return this.imageLoadingCache.set(t,{loaded:!1,promise:o}),o}}flipIfNeeded(t,o){if(t.imageMesh==null)return;let n=-o,i=t.imageMesh.rotation.z,a=Di((i-n+ah)%ah,2);a>UH&&a<VH&&(t.imageMesh.rotation.z=(i+Math.PI)%ah)}update(t){this.currentImageScreenBBoxes=[],this.viewProjectionMatrix.identity().multiply(this.rendererState.cameraObject.projectionMatrix).multiply(this.rendererState.cameraObject.matrixWorldInverse),this.cameraFrustum.setFromProjectionMatrix(this.viewProjectionMatrix);let o,n,i;for(let a of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(a),o?.type==="image"){if(n=o.components[0],i=o.components[1],i.url&&n.imageMesh==null){let l=this.convertTo3DMapPosition(n.feature.geometry.coordinates),c={x:l.x,y:l.y};n.imageMesh=this.createImageMesh(o.id,i.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates,[c]),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)}n.imageMesh&&(i.flipImageToFaceCamera&&this.flipIfNeeded(n,t),n.imageMesh.material instanceof Ei&&i.dirty&&(n.imageMesh.material.opacity=i.opacity))}else if(o?.type==="geometry"){if(n=o.components[0],i=o.components[1],i.showImage&&n.feature.properties?.image&&n.imageMesh==null&&n.visible&&n.mesh!=null&&n.mesh.parent!=null&&n.feature.properties?.image.position!=null&&n.feature.geometry.coordinates!=null&&n.feature.geometry.coordinates.length>0){let l=n.feature.geometry.coordinates[0].map(p=>{let u=this.convertTo3DMapPosition(p);return{x:u.x,y:u.y}}),c=this.createImageMesh(a,n.feature.properties?.image.path,n.feature.properties?.image,i.height,n.feature.properties?.image.position,l);n.mesh.parent.add(c),n.imageMesh=c}if(n.imageMesh){if(!n.visible)n.imageMesh.visible=!1;else if(i.showImage&&!n.imageMesh.visible)if(i.url){let l=this.imageLoadingCache.get(i.url);l&&l.loaded&&(n.imageMesh.visible=!0)}else n.imageMesh.visible=!0;else!i.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1);i.flipImageToFaceCamera&&this.flipIfNeeded(n,t),i.enableImageCollisions===!0&&this.updateImageScreenBBoxes(n)}}}updateImageScreenBBoxes(t){if(t.imageMesh==null)return;let o=t.imageMesh.geometry.boundingBox;if(o!=null){let n=new ae;if(t.imageMesh.getWorldPosition(n),!this.cameraFrustum.containsPoint(n))return;let i=new Me;this.projectToScreen(i,n);let a=[new ae(o.min.x,o.min.y,o.min.z),new ae(o.max.x,o.min.y,o.min.z),new ae(o.min.x,o.max.y,o.min.z),new ae(o.max.x,o.max.y,o.min.z),new ae(o.min.x,o.min.y,o.max.z),new ae(o.max.x,o.min.y,o.max.z),new ae(o.min.x,o.max.y,o.max.z),new ae(o.max.x,o.max.y,o.max.z)],l=[];for(let b of a){let v=b.clone().applyMatrix4(t.imageMesh.matrixWorld),T=new Me;this.projectToScreen(T,v),l.push(T)}let c=1/0,p=1/0,u=-1/0,f=-1/0;for(let b of l)c=Math.min(c,b.x),p=Math.min(p,b.y),u=Math.max(u,b.x),f=Math.max(f,b.y);let h=new rt(i.x,i.y,u-c,f-p);this.currentImageScreenBBoxes.push(h)}}};d();var HH=250,Sl,vx=class extends ke{constructor(t,o){super();m(this,"cameraDirty",!0);m(this,"focusablesDirty",!0);m(this,"state");m(this,"camera");m(this,"debugEl",null);m(this,"raycasters",[]);m(this,"collisions",new Map);m(this,"focusableEntities",new Set);m(this,"debugRaycasters",!1);S(this,Sl);m(this,"update",(t=!1,o=Date.now())=>{this.focusablesDirty&&this.updateFocusableEntities(),!t&&(Date.now()-o>HH||(s(this,Sl)&&cancelAnimationFrame(s(this,Sl)),w(this,Sl,requestAnimationFrame(()=>{this.updateRaf()}))))});this.state=t,this.camera=o,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let t=new Me(this.state.canvasWidth/2,this.state.canvasHeight/2),o=new Me(t.x/1.2,t.y/1.2),n=new Me(t.x+(t.x-o.x),o.y),i=new Me(o.x,t.y+(t.y-o.y)),a=new Me(n.x,i.y),l=new Me(t.x,t.y/1.5),c=new Me(t.x,t.y+(t.y-l.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[t,l,c,o,n,i,a].map((p,u)=>{if(this.debugRaycasters){let T=document.createElement("div");T.style.position="absolute",T.style.top=p.y+"px",T.style.left=p.x+"px",T.style.width="10px",T.style.height="10px",T.style.backgroundColor="red",this.debugEl.append(T)}let f=p.x/this.state.canvasWidth*2-1,h=-(p.y/this.state.canvasHeight)*2+1,b=new Me(f,h),v=new Pi;return v.setFromCamera(b,this.camera),[v,b,u===0?10:u<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let t,o,n;for(let i of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(i),n!=null){if(n.type==="group-container"&&n.components[1]!==void 0&&n.components[1]instanceof xm){if(o=n.components[1],o.dirty===!0||o.focusMesh==null){o.focusMesh&&Ht(o.focusMesh);let a=new sr;a.setFromObject(n);let l=a.max.x-a.min.x,c=a.max.y-a.min.y,p=a.max.z-a.min.z;if(!isFinite(l)||!isFinite(c)||!isFinite(p)||isNaN(l)||isNaN(c)||isNaN(p)||l<=0||c<=0||p<=0)continue;let u=new Wn(l,c,p),f={transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters};if(this.debugRaycasters){let v=["red","green","blue","yellow","purple","orange","pink","brown","gray","black"];f.color=v[Math.floor(Math.random()*v.length)]}let h=new Nr(f),b=new Le(u,h);b.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,0),b.userData={entityId:n.userData.entityId},o.focusMesh=b,n.add(b),n.components[1].dirty=!1}this.focusableEntities.add(o.focusMesh)}else if(n.type==="geometry"&&n.components[4]&&n.components[4]instanceof xm&&(t=n.components[0],o=n.components[4],t instanceof fr&&t.geometry!=null&&(o.dirty===!0||o.focusMesh==null))){if(o.focusMesh==null){let a=new Le(t.geometry);a.userData={entityId:n.id},o.focusMesh=a}this.focusableEntities.add(o.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.cameraDirty&&this.raycast()}raycast(){this.collisions.clear();for(let[o,n]of this.raycasters)o.setFromCamera(n,this.camera);for(let[o,n,i]of this.raycasters)o.intersectObjects(Array.from(this.focusableEntities.values())).forEach(l=>{if(l?.object!=null&&"isMesh"in l.object&&l?.object.isMesh){let c=l.object.userData.entityId,p=this.collisions.get(c)??0;this.collisions.set(c,p+i)}});let t=Array.from(this.collisions,([o,n])=>({entityId:o,weight:n})).sort((o,n)=>n.weight-o.weight).map(({entityId:o})=>o);this.publish("geometry-in-focus",t),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){s(this,Sl)&&cancelAnimationFrame(s(this,Sl)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Sl=new WeakMap;d();d();d();d();function Ix(e,r){r===void 0&&(r={});var t=Cd(e);switch(!r.properties&&e.type==="Feature"&&(r.properties=e.properties),t.type){case"Polygon":return zH(t,r);case"MultiPolygon":return WH(t,r);default:throw new Error("invalid poly")}}function zH(e,r){r===void 0&&(r={});var t=Cd(e),o=t.coordinates,n=r.properties?r.properties:e.type==="Feature"?e.properties:{};return w4(o,n)}function WH(e,r){r===void 0&&(r={});var t=Cd(e),o=t.coordinates,n=r.properties?r.properties:e.type==="Feature"?e.properties:{},i=[];return o.forEach(function(a){i.push(w4(a,n))}),jl(i)}function w4(e,r){return e.length>1?AC(e,r):Fs(e[0],r)}function ZH(e,r){var t=!0;return Ai(e,function(o){Ai(r,function(n){if(t===!1)return!1;t=XH(o.geometry,n.geometry)})}),t}function XH(e,r){switch(e.type){case"Point":switch(r.type){case"Point":return!QH(e.coordinates,r.coordinates);case"LineString":return!O4(r,e);case"Polygon":return!la(e,r)}break;case"LineString":switch(r.type){case"Point":return!O4(e,r);case"LineString":return!YH(e,r);case"Polygon":return!E4(r,e)}break;case"Polygon":switch(r.type){case"Point":return!la(r,e);case"LineString":return!E4(e,r);case"Polygon":return!JH(r,e)}}return!1}function O4(e,r){for(var t=0;t<e.coordinates.length-1;t++)if(KH(e.coordinates[t],e.coordinates[t+1],r.coordinates))return!0;return!1}function YH(e,r){var t=Od(e,r);return t.features.length>0}function E4(e,r){for(var t=0,o=r.coordinates;t<o.length;t++){var n=o[t];if(la(n,e))return!0}var i=Od(r,Ix(e));return i.features.length>0}function JH(e,r){for(var t=0,o=e.coordinates[0];t<o.length;t++){var n=o[t];if(la(n,r))return!0}for(var i=0,a=r.coordinates[0];i<a.length;i++){var l=a[i];if(la(l,e))return!0}var c=Od(Ix(e),Ix(r));return c.features.length>0}function KH(e,r,t){var o=t[0]-e[0],n=t[1]-e[1],i=r[0]-e[0],a=r[1]-e[1],l=o*a-n*i;return l!==0?!1:Math.abs(i)>=Math.abs(a)?i>0?e[0]<=t[0]&&t[0]<=r[0]:r[0]<=t[0]&&t[0]<=e[0]:a>0?e[1]<=t[1]&&t[1]<=r[1]:r[1]<=t[1]&&t[1]<=e[1]}function QH(e,r){return e[0]===r[0]&&e[1]===r[1]}var P4=ZH;function W2(e,r){var t=!1;return Ai(e,function(o){Ai(r,function(n){if(t===!0)return!0;t=!P4(o.geometry,n.geometry)})}),t}var F4=20,qH=5e3,Z2="outdoor-system-debug-container",D4=!1,hi,Ut,lh,Bc,gi,wu,Tl,Nc,_n,Ou,ch,ph,dh,ps,Sx,jc,yi,Cl,Ml,Gc,Cx,uh,mh,k4,A4,Tx=class{constructor(r){S(this,ps);S(this,hi,!0);S(this,Ut);S(this,lh,"");S(this,Bc,new Set);S(this,gi,new Set);S(this,wu);S(this,Tl);S(this,Nc);S(this,_n,null);S(this,Ou,!1);S(this,ch,r=>{if(!s(this,Ut))throw new Error("Map not initialized");let o=[[r[0],r[1]],[r[2],r[1]],[r[2],r[3]],[r[0],r[3]]].map(c=>s(this,Ut).project(c)),n=Math.max(...o.map(c=>c.x)),i=Math.min(...o.map(c=>c.x)),a=Math.max(...o.map(c=>c.y)),l=Math.min(...o.map(c=>c.y));return[new D0.default(i,l),new D0.default(n,a)]});S(this,ph,()=>{s(this,_n)&&(clearTimeout(s(this,_n)),w(this,_n,null),w(this,hi,!1))});S(this,dh,()=>{s(this,_n)&&(clearTimeout(s(this,_n)),w(this,_n,null)),w(this,_n,setTimeout(()=>{s(this,ph).call(this)},qH))});S(this,jc,async()=>{if(D4&&s(this,Tl)){let r=s(this,ch).call(this,s(this,Tl));W(this,ps,A4).call(this,r)}if(!(!s(this,Ut)||!s(this,Ou))&&s(this,hi)&&!(!s(this,gi)||s(this,gi).size===0)){if(s(this,Cl)&&(s(this,Cx).call(this),w(this,Cl,!1)),s(this,wu)){let r=s(this,Ut).project(s(this,wu)),t=s(this,Ut).queryRenderedFeatures(r,{layers:Array.from(s(this,gi))});if(t.length>0){for(let o of t)s(this,yi).push(["!=",["id"],o.id]);s(this,yi).length>0&&s(this,gi).forEach(o=>{s(this,Ut)?.setFilter(o,["all",...s(this,yi)])}),w(this,yi,[]),w(this,Cl,!1),w(this,hi,!1)}}else if(s(this,Tl)&&s(this,Nc)){let r=s(this,ch).call(this,s(this,Tl)),t=s(this,Ut).queryRenderedFeatures(r,{layers:Array.from(s(this,gi))});if(t.length>0){w(this,Cl,!0),s(this,Ml).push(()=>{s(this,yi).length>0&&(s(this,gi).forEach(o=>{s(this,Ut)?.setFilter(o,["all",...s(this,yi)])}),w(this,hi,!1)),w(this,yi,[])});for(let o=0;o<t.length;o+=F4){let n=t.slice(o,o+F4);s(this,Ml).push(()=>{for(let i of n)if(i.geometry!=null&&"coordinates"in i.geometry){if(s(this,Nc)==null)return;let a;if(i.geometry.type==="Polygon"?a=ly(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(a=LC(i.geometry.coordinates)),!a)continue;for(let l of s(this,Nc))if(W2(l,a)){s(this,yi).push(["!=",["id"],i.id]);continue}}})}s(this,uh).call(this)}}}});S(this,yi,[]);S(this,Cl,!1);S(this,Ml,[]);S(this,Gc,null);S(this,Cx,()=>{s(this,Gc)&&(globalThis.cancelAnimationFrame(s(this,Gc)),w(this,Gc,null)),w(this,Ml,[])});S(this,uh,()=>{let r=s(this,Ml).pop();typeof r=="function"&&(r(),s(this,Ml).length>0&&w(this,Gc,globalThis.requestAnimationFrame(s(this,uh)))),w(this,Cl,!1),s(this,ph).call(this)});S(this,mh,r=>{if(s(this,Ut)&&r&&r.dataType==="style"&&r.type==="styledata"&&s(this,Bc).size>0){let t=r?.style?.stylesheet?.id;(!t||t!==s(this,lh))&&(w(this,lh,t),W(this,ps,Sx).call(this),w(this,hi,!0))}});r&&(w(this,Ut,r),s(this,Ut).on("styledata",s(this,mh)),s(this,Ut).on("render",s(this,jc)),w(this,Ou,s(this,Ut).loaded()),s(this,Ut).on("load",()=>{w(this,Ou,!0)})),D4&&W(this,ps,k4).call(this)}hideLayersUnderPoint(r,t){s(this,dh).call(this),w(this,wu,r);for(let o of t)s(this,Bc).add(o);w(this,hi,!0),W(this,ps,Sx).call(this),s(this,jc).call(this)}hideLayersIntersectingPolygons(r,t,o){s(this,_n)&&clearTimeout(s(this,_n)),s(this,dh).call(this),w(this,Tl,r),w(this,Nc,t.reduce((n,i)=>{if(i.geometry.type==="Polygon"){let a=ly(i.geometry.coordinates);n.push(a)}else i.geometry.type==="MultiPolygon"&&n.push(...i.geometry.coordinates.map(a=>ly(a)));return n},[]));for(let n of o)s(this,Bc).add(n);w(this,hi,!0),W(this,ps,Sx).call(this),s(this,jc).call(this)}destroy(){s(this,Ut)&&(s(this,Ut).off("styledata",s(this,mh)),s(this,Ut).off("render",s(this,jc)))}};hi=new WeakMap,Ut=new WeakMap,lh=new WeakMap,Bc=new WeakMap,gi=new WeakMap,wu=new WeakMap,Tl=new WeakMap,Nc=new WeakMap,_n=new WeakMap,Ou=new WeakMap,ch=new WeakMap,ph=new WeakMap,dh=new WeakMap,ps=new WeakSet,Sx=function(){if(w(this,gi,new Set),s(this,Ut))for(let r of s(this,Bc))s(this,Ut).getLayer(r)&&s(this,gi).add(r)},jc=new WeakMap,yi=new WeakMap,Cl=new WeakMap,Ml=new WeakMap,Gc=new WeakMap,Cx=new WeakMap,uh=new WeakMap,mh=new WeakMap,k4=function(){if(!document.getElementById(Z2)&&s(this,Ut)){let r=document.createElement("div");r.id=Z2,r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.bottom="0",r.style.right="0",r.style.pointerEvents="none",r.style.zIndex="1000",s(this,Ut).getContainer().appendChild(r)}},A4=function(r){let t=document.getElementById(Z2);if(!t)return;let o=document.getElementById("bbox");o==null&&(o=document.createElement("div"),o.id="bbox",o.style.position="absolute",t.appendChild(o));let n=[Math.min(r[0].x,r[1].x),Math.min(r[0].y,r[1].y)],i=[Math.max(r[0].x,r[1].x),Math.max(r[0].y,r[1].y)];o.style.top=n[1]+"px",o.style.left=n[0]+"px",o.style.width=i[0]-n[0]+"px",o.style.height=i[1]-n[1]+"px",o.style.border=`2px solid ${s(this,hi)?"red":"blue"}`};d();d();d();d();var Mx=`attribute float pathDistance;
|
|
130
|
+
attribute vec3 pathNormal;
|
|
131
|
+
attribute vec3 pathTangent;
|
|
132
|
+
|
|
133
|
+
uniform vec2 uvScale;
|
|
134
|
+
uniform float vertexes;
|
|
135
|
+
uniform float complete;
|
|
136
|
+
uniform float nearRadius;
|
|
137
|
+
uniform float farRadius;
|
|
138
|
+
uniform float nearZoom;
|
|
139
|
+
uniform float farZoom;
|
|
140
|
+
uniform float pulse;
|
|
141
|
+
uniform float pulseLength;
|
|
142
|
+
uniform bool pathIsVertical;
|
|
143
|
+
uniform bool displayArrowsOnPath;
|
|
144
|
+
uniform vec2 cameraParameters;
|
|
145
|
+
|
|
146
|
+
varying float zoomLevel;
|
|
147
|
+
varying float radius;
|
|
148
|
+
varying vec2 fragTexcoord;
|
|
149
|
+
varying float fragTopTextureU;
|
|
150
|
+
varying float fragPathDistance;
|
|
151
|
+
|
|
152
|
+
float flattenFactor = 0.0;
|
|
153
|
+
// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using
|
|
154
|
+
// linear interpolation/extrapolation.
|
|
155
|
+
//
|
|
156
|
+
// This performs a pure linear mapping y = mx + b where
|
|
157
|
+
// 'm = (yMax - yMin) / (xMax - xMin)',
|
|
158
|
+
// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.
|
|
159
|
+
float remap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
160
|
+
return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear
|
|
164
|
+
// interpolation, clamping result values outside [yMin, yMax].
|
|
165
|
+
float clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
166
|
+
return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
void main() {
|
|
170
|
+
fragPathDistance = pathDistance;
|
|
171
|
+
|
|
172
|
+
// We can get an origin point for the cross-section of the path by
|
|
173
|
+
// subtracting the surface normal times the radius, since the surface normal
|
|
174
|
+
// points strictly away from the centre.
|
|
175
|
+
vec3 origin = position - nearRadius * normal;
|
|
176
|
+
|
|
177
|
+
// Inflate the path along its surface normal to increase its radius from
|
|
178
|
+
// 'nearRadius' to 'farRadius' when the camera is at 'farZoom'.
|
|
179
|
+
vec3 adjustedPosition = position;
|
|
180
|
+
zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);
|
|
181
|
+
adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;
|
|
182
|
+
|
|
183
|
+
// Determine how far the path extends "up" or "down" in the direction of the
|
|
184
|
+
// path normal.
|
|
185
|
+
float height = dot(adjustedPosition - origin, pathNormal);
|
|
186
|
+
|
|
187
|
+
// For horizontal paths, flatten the bottom half entirely so that it's flat
|
|
188
|
+
// against the floor. This makes the path look nicer when it's
|
|
189
|
+
// semitransparent behind opaque geometry, so you don't see it
|
|
190
|
+
// peeking through. For vertical paths, preserve the full tube geometry.
|
|
191
|
+
if (!pathIsVertical) {
|
|
192
|
+
float desiredHeight = max(height, 0.0);
|
|
193
|
+
desiredHeight = desiredHeight * flattenFactor;
|
|
194
|
+
float flattenMagnitude = height - desiredHeight;
|
|
195
|
+
adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Transform the vertices into NDC.
|
|
199
|
+
vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);
|
|
200
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
201
|
+
|
|
202
|
+
fragTexcoord = uv;
|
|
203
|
+
|
|
204
|
+
// Compute a texture coordinate for mapping the arrow texture to the path.
|
|
205
|
+
// We don't want to use the u-value that Three.js provides, because the
|
|
206
|
+
// path may end up twisting arbitrarily -- but we want the arrow texture to
|
|
207
|
+
// always be on the top of the path.
|
|
208
|
+
vec3 bitangent = cross(normal, pathTangent);
|
|
209
|
+
fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;
|
|
210
|
+
|
|
211
|
+
radius = mix(nearRadius, farRadius, zoomLevel);
|
|
212
|
+
}
|
|
213
|
+
`;d();var X2=`#define ARROW_FADING_POINT 0.15
|
|
214
|
+
|
|
215
|
+
uniform float complete;
|
|
216
|
+
uniform float nearRadius;
|
|
217
|
+
uniform float farRadius;
|
|
218
|
+
uniform vec2 resolution;
|
|
219
|
+
uniform vec2 cameraParameters;
|
|
220
|
+
uniform vec3 color;
|
|
221
|
+
uniform float pathLength;
|
|
222
|
+
uniform bool showPulse;
|
|
223
|
+
uniform vec3 pulseColor;
|
|
224
|
+
uniform float pulse;
|
|
225
|
+
uniform float pulseLength;
|
|
226
|
+
uniform bool pathIsVertical;
|
|
227
|
+
uniform bool displayArrowsOnPath;
|
|
228
|
+
uniform float arrowAnimationTimer;
|
|
229
|
+
uniform float opacityMultiplier;
|
|
230
|
+
uniform bool dashed;
|
|
231
|
+
uniform sampler2D arrowTexture;
|
|
232
|
+
|
|
233
|
+
varying float zoomLevel;
|
|
234
|
+
varying float radius;
|
|
235
|
+
varying vec2 fragTexcoord;
|
|
236
|
+
varying float fragTopTextureU;
|
|
237
|
+
varying float fragPathDistance;
|
|
238
|
+
|
|
239
|
+
// How long the arrow should be, as a factor of pathRadius. Since we've
|
|
240
|
+
// mostly flattened the top of the path, values near 2.0 (the diameter)
|
|
241
|
+
// will probably look best.
|
|
242
|
+
const float arrowLength = 2.0;
|
|
243
|
+
|
|
244
|
+
// How much of a relative margin the arrow texture should have inside the
|
|
245
|
+
// area laid out for it. Useful to pull the arrow away from the edges of the
|
|
246
|
+
// path, which slope down.
|
|
247
|
+
const float arrowMargin = 0.1;
|
|
248
|
+
|
|
249
|
+
// How many arrow-lengths of space should be between arrows on a short path.
|
|
250
|
+
const float arrowSpacingOnShortPath = 6.0;
|
|
251
|
+
|
|
252
|
+
// How many arrow-lengths of space should be between arrows on a long path.
|
|
253
|
+
const float arrowSpacingOnLongPath = 7.5;
|
|
254
|
+
|
|
255
|
+
// How long a path must be to be considered "long", as a factor of
|
|
256
|
+
// the path radius.
|
|
257
|
+
const float longPathLength = 200.;
|
|
258
|
+
|
|
259
|
+
// How long a path must be to be considered "short", as a factor of the
|
|
260
|
+
// path radius.
|
|
261
|
+
const float shortPathLength = 75.;
|
|
262
|
+
|
|
263
|
+
// How much of the path's length the fade-in should comprise when going from
|
|
264
|
+
// zero opacity to full opacity.
|
|
265
|
+
const float completeLength = 0.1;
|
|
266
|
+
|
|
267
|
+
// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using
|
|
268
|
+
// linear interpolation/extrapolation.
|
|
269
|
+
//
|
|
270
|
+
// This performs a pure linear mapping 'y = mx + b' where
|
|
271
|
+
// 'm = (yMax - yMin) / (xMax - xMin)',
|
|
272
|
+
// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.
|
|
273
|
+
float remap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
274
|
+
return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear
|
|
278
|
+
// interpolation, clamping result values outside [yMin, yMax].
|
|
279
|
+
float clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
280
|
+
return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
void main(void) {
|
|
284
|
+
// Compute the opacity of the path based on the distance from the current
|
|
285
|
+
// fragment to the 'complete' value as it varies from 0.0 to 1.0.
|
|
286
|
+
// Fragments that are at the 'complete' value or past it will be fully
|
|
287
|
+
// transparent, while fragments that are at 'complete - completeLength'
|
|
288
|
+
// or before it will be fully opaque. However, we adjust the 'complete'
|
|
289
|
+
// value here so that it overshoots by one full 'completeLength', so that
|
|
290
|
+
// the entire path will be opaque when the 'complete' value is at 1.0.
|
|
291
|
+
float completeLocation = complete * (1.0 + completeLength);
|
|
292
|
+
float completeAmount = clampRemap(
|
|
293
|
+
fragPathDistance,
|
|
294
|
+
completeLocation - completeLength,
|
|
295
|
+
completeLocation,
|
|
296
|
+
0.0,
|
|
297
|
+
1.0
|
|
298
|
+
);
|
|
299
|
+
float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);
|
|
300
|
+
|
|
301
|
+
// 2020/01/09 Terence Dickson
|
|
302
|
+
// When we render the background and overlay for the mapbox outdoor context
|
|
303
|
+
// behind everything else in single-buffer rendering, the fact that the path
|
|
304
|
+
// writes to the depth buffer means that the background and overlay will not
|
|
305
|
+
// be drawn behind the path even when the path is still fading in. The effect
|
|
306
|
+
// is subtle and is only visible in single-buffer rendering so this quick fix
|
|
307
|
+
// prevents writes to the depth buffer for zero opacity fragments, which gets
|
|
308
|
+
// rid of the most visually-offensive ghosting.
|
|
309
|
+
if (opacity <= 0.0) {
|
|
310
|
+
discard;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Push in the texture coordinates so that they ramp up
|
|
314
|
+
// at 'arrowMargin' instead of at zero; this remapping looks somewhat
|
|
315
|
+
// like this:
|
|
316
|
+
// 1 ^ ___
|
|
317
|
+
// | /
|
|
318
|
+
// | /
|
|
319
|
+
// | /
|
|
320
|
+
// | /
|
|
321
|
+
// |___/
|
|
322
|
+
// 0 +---------->
|
|
323
|
+
// 0 ^ 1
|
|
324
|
+
// arrowMargin
|
|
325
|
+
// Making the arrows narrower on the path.
|
|
326
|
+
float u = fragTopTextureU;
|
|
327
|
+
u = clamp(
|
|
328
|
+
u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,
|
|
329
|
+
0.0,
|
|
330
|
+
1.0
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
float arrowSpacing = clampRemap(
|
|
334
|
+
pathLength,
|
|
335
|
+
shortPathLength * radius,
|
|
336
|
+
longPathLength * radius,
|
|
337
|
+
arrowSpacingOnShortPath,
|
|
338
|
+
arrowSpacingOnLongPath
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
// Reduce the spacing between arrows when the camera zooms out, as increasing
|
|
342
|
+
// the path radius will increase the arrow size and thus be able to fit
|
|
343
|
+
// fewer arrows on in total, and this secondary movement of the arrows
|
|
344
|
+
// "zooming off" the end of the path is unpleasant
|
|
345
|
+
float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);
|
|
346
|
+
float effectiveArrowSpacing =
|
|
347
|
+
arrowSpacing * 1.0 / expandAmount +
|
|
348
|
+
arrowMargin * 2.0;
|
|
349
|
+
|
|
350
|
+
float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);
|
|
351
|
+
|
|
352
|
+
// Adjust the slope of the vertical texture coordinate so that it goes
|
|
353
|
+
// from 0 to 1 along the length of the arrow plus the spacing between
|
|
354
|
+
// arrows, and adjust its x-intercept so that one arrow moves to the
|
|
355
|
+
// exact position of the next arrow as 'arrowAnimationTimer' goes
|
|
356
|
+
// from 0 to 1
|
|
357
|
+
float v = (
|
|
358
|
+
fragTexcoord.x * (pathLength / effectiveArrowLength)
|
|
359
|
+
- arrowAnimationTimer * (1. + effectiveArrowSpacing)
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
// Compute a "looping sawtooth" wave for determining the vertical texture
|
|
363
|
+
// coordinates of the arrow texture, roughly as follows:
|
|
364
|
+
// 3 ^ /
|
|
365
|
+
// | ___/
|
|
366
|
+
// 2 | /
|
|
367
|
+
// | ___/
|
|
368
|
+
// 1 | /
|
|
369
|
+
// |___/
|
|
370
|
+
// 0 +--------------->
|
|
371
|
+
// 0 ^ ^
|
|
372
|
+
// ^ |_|
|
|
373
|
+
// | effectiveArrowLength
|
|
374
|
+
// |___|
|
|
375
|
+
// effectiveArrowSpacing
|
|
376
|
+
//
|
|
377
|
+
// This is effectively equivalent to this sort of sawtooth wave:
|
|
378
|
+
// ^
|
|
379
|
+
// 1 | / / /
|
|
380
|
+
// |___/ ___/ ___/
|
|
381
|
+
// 0 +--------------->
|
|
382
|
+
//
|
|
383
|
+
// Causing the image of the arrow to repeat, with dead space (the bottom
|
|
384
|
+
// edge of the texture stretched out) between the arrows at the provided
|
|
385
|
+
// spacing. The reason why the "looping" design is preferred is because
|
|
386
|
+
// it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour
|
|
387
|
+
// to avoid the discontinuity that can end up causing visual artifacts.
|
|
388
|
+
if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {
|
|
389
|
+
v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));
|
|
390
|
+
} else {
|
|
391
|
+
v = ceil(v / (1. + effectiveArrowSpacing));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Use the r-component of the texture to determine whether the arrow covers
|
|
395
|
+
// this fragment or not
|
|
396
|
+
vec2 sampleTexcoord = vec2(u, v);
|
|
397
|
+
float arrowAmount = 0.0;
|
|
398
|
+
vec3 secondColor = pulseColor;
|
|
399
|
+
|
|
400
|
+
if (displayArrowsOnPath) {
|
|
401
|
+
arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;
|
|
402
|
+
float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);
|
|
403
|
+
secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (dashed) {
|
|
407
|
+
float dashLength = 0.1; // Adjust this value to change the dash length
|
|
408
|
+
float gapLength = 0.1; // Adjust this value to change the gap length
|
|
409
|
+
float totalLength = dashLength + gapLength;
|
|
410
|
+
float numSegments = ceil(1.0 / totalLength);
|
|
411
|
+
float adjustedTotalLength = 1.0 / numSegments;
|
|
412
|
+
float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));
|
|
413
|
+
float pattern = mod(fragPathDistance, adjustedTotalLength);
|
|
414
|
+
opacity = pattern < adjustedDashLength ? 1.0 : 0.0;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
if (showPulse) {
|
|
419
|
+
// Add the pulse color to the path by determining how far the current fragment
|
|
420
|
+
// is from 'pulse'
|
|
421
|
+
float pulseLocation = remap(
|
|
422
|
+
pulse,
|
|
423
|
+
0.0,
|
|
424
|
+
1.0,
|
|
425
|
+
-pulseLength,
|
|
426
|
+
1.0 + pulseLength
|
|
427
|
+
);
|
|
428
|
+
float pulseDistance = smoothstep(
|
|
429
|
+
0.0,
|
|
430
|
+
pulseLength,
|
|
431
|
+
abs(fragPathDistance - pulseLocation)
|
|
432
|
+
);
|
|
433
|
+
|
|
434
|
+
// Blend the pulse color to the path based on how close this fragment is to
|
|
435
|
+
// the 'pulse' value and whether it's covered by an arrow -- but if it's
|
|
436
|
+
// covered by *both*, then we go back to using the regular path color
|
|
437
|
+
// (making arrows look like "holes" when they're overlapping the pulse.)
|
|
438
|
+
float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);
|
|
439
|
+
|
|
440
|
+
gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);
|
|
441
|
+
} else if (displayArrowsOnPath) {
|
|
442
|
+
gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);
|
|
443
|
+
} else {
|
|
444
|
+
gl_FragColor = vec4(color, opacity * opacityMultiplier);
|
|
445
|
+
}
|
|
446
|
+
#include <colorspace_fragment>
|
|
447
|
+
}
|
|
448
|
+
`;d();var L4=`uniform float complete;
|
|
449
|
+
uniform float nearRadius;
|
|
450
|
+
uniform float farRadius;
|
|
451
|
+
varying float fragPathDistance;
|
|
452
|
+
const float completeLength = 0.1;
|
|
453
|
+
|
|
454
|
+
// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using
|
|
455
|
+
// linear interpolation/extrapolation.
|
|
456
|
+
//
|
|
457
|
+
// This performs a pure linear mapping 'y = mx + b' where
|
|
458
|
+
// 'm = (yMax - yMin) / (xMax - xMin)',
|
|
459
|
+
// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.
|
|
460
|
+
float remap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
461
|
+
return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear
|
|
465
|
+
// interpolation, clamping result values outside [yMin, yMax].
|
|
466
|
+
float clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
467
|
+
return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
void main(void) {
|
|
471
|
+
// this ensures that the stencil mask moves along with the path above it, to avoid the progress bar effect
|
|
472
|
+
float completeLocation = complete * (1.0 + completeLength);
|
|
473
|
+
float completeAmount = clampRemap(
|
|
474
|
+
fragPathDistance,
|
|
475
|
+
completeLocation - completeLength,
|
|
476
|
+
completeLocation,
|
|
477
|
+
0.0,
|
|
478
|
+
1.0
|
|
479
|
+
);
|
|
480
|
+
float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);
|
|
481
|
+
|
|
482
|
+
// 2020/01/09 Terence Dickson
|
|
483
|
+
// When we render the background and overlay for the mapbox outdoor context
|
|
484
|
+
// behind everything else in single-buffer rendering, the fact that the path
|
|
485
|
+
// writes to the depth buffer means that the background and overlay will not
|
|
486
|
+
// be drawn behind the path even when the path is still fading in. The effect
|
|
487
|
+
// is subtle and is only visible in single-buffer rendering so this quick fix
|
|
488
|
+
// prevents writes to the depth buffer for zero opacity fragments, which gets
|
|
489
|
+
// rid of the most visually-offensive ghosting.
|
|
490
|
+
if (opacity <= 0.0) {
|
|
491
|
+
discard;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
gl_FragColor = vec4(0.0, 1.0, 0.0, opacity);
|
|
495
|
+
}`;var _4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var tz=new xp;function R4(e,r,t){let{breakpoint:o,width:n,accentColor:i,completeFraction:a,isVertical:l,visibleThroughGeometry:c,dashed:p}=r,{color:u}=t,f=!0,h=0,b=1/0,v=r.displayArrowsOnPath,T=!0,x=v,I=typeof n=="object"?Number(n.output[o])/2:n/2,M=typeof n=="object"?Number(n.output[o+1]??n.output[o])/2:n/2,O=(t.altitude??0)+rz,C=0;e[0].z+=O;for(let H=1;H<e.length;++H){e[H].z+=O;let P=e[H].x-e[H-1].x,q=e[H].z-e[H-1].z;if(l)C+=Math.sqrt(P*P+q*q);else{let K=e[H].y-e[H-1].y;C+=Math.sqrt(P*P+K*K+q*q)}}if(!l){let H=e[0],P=e[e.length-1];e.push(P.clone().setZ(P.z-.01)),e.unshift(H.clone().setZ(H.z-.01))}let E=new dC;x&&(E=tz.load(_4),E.colorSpace=Xg);let _=new ar(u),G=new ar(i),R={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Me(1,1)},cameraParameters:{type:"v2",value:new Me(h,0)},complete:{type:"f",value:f?0:1},color:{type:"c",value:_},pathLength:{type:"f",value:C},nearRadius:{type:"f",value:I},farRadius:{type:"f",value:M},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:b},pulseColor:{type:"c",value:G},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:E},displayArrowsOnPath:{type:"b",value:v},showPulse:{type:"b",value:T},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:p}},N=new yC(e);N.curveType="catmullrom",N.tension=0;let X=30,z=8,ee=X*e.length,re=new xC(N,ee,I,z,!1),ue=new Float32Array(re.attributes.position.count);for(let H=e.length;H<ue.length;H++)ue[H]=H;re.setAttribute("vertexIndex",new po(ue,1));let Ce=new Float32Array(re.attributes.position.count),Oe=new po(Ce,1);for(let H=0;H<=ee;H++)for(let P=0;P<=z;++P)Oe.setX(H*(z+1)+P,H/ee);re.setAttribute("pathDistance",Oe);let Pe=new Float32Array(re.attributes.normal.count*3),Fe=new po(Pe,3);for(let H=0;H<ee;H++){let P=re.tangents[H];for(let q=0;q<=z;++q)Fe.setXYZ(H*(z+1)+q,P.x,P.y,P.z)}re.setAttribute("pathTangent",Fe);let ce=new Float32Array(re.attributes.normal.count*3),Ee=new po(ce,3);for(let H=0;H<ee;H++){let P=re.tangents[H];var ye,Ge,Ie;l?(ye=P.x*P.y,Ge=-1+P.y*P.y,Ie=P.z*P.y):(ye=-P.x*P.z,Ge=-P.y*P.z,Ie=1-P.z*P.z);let q=Math.sqrt(ye*ye+Ge*Ge+Ie*Ie);q===0&&(q=1);let K=ye/q,Q=Ge/q,De=Ie/q;for(let xt=0;xt<=z;++xt)Ee.setXYZ(H*(z+1)+xt,K,Q,De)}re.setAttribute("pathNormal",Ee);let Xe=new _a({uniforms:R,vertexShader:Mx,fragmentShader:X2});Xe.transparent=!0,Xe.alphaTest=.5,R.resolution.value.x=1,R.resolution.value.y=1,R.vertexes.value=ue.length,R.arrowTexture.value.wrapS=pm,R.arrowTexture.value.wrapT=pm,R.arrowTexture.value.anisotropy=16;let se=new Le(re,Xe),nt=se.clone(),dt={...R,opacityMultiplier:{type:"f",value:.25},pathIsVertical:{type:"b",value:l}};dt.complete.value=1,nt.material=new _a({uniforms:dt,vertexShader:Mx,fragmentShader:X2}),nt.material.transparent=!0,nt.material.alphaTest=.5,nt.material.depthWrite=!1,nt.material.depthTest=!1,dt.resolution.value.x=1,dt.resolution.value.y=1,dt.vertexes.value=ue.length,dt.arrowTexture.value.wrapS=pm,dt.arrowTexture.value.wrapT=pm,dt.arrowTexture.value.anisotropy=16,dt.complete.value=a,se.userData=nt.userData=r.mesh.userData;let $t=r.mesh;if(!c){let H=new _a({uniforms:R,vertexShader:Mx,fragmentShader:L4}),P=new Le(re,H);P.name="stencil",P.material.colorWrite=!1,P.material.stencilWrite=!0,P.material.stencilRef=1,P.material.stencilFunc=cC,P.material.stencilZPass=Jg,P.material.stencilZFail=Jg,P.material.stencilFail=Jg,P.material.depthWrite=!1,P.material.depthTest=!1,P.userData=r.mesh.userData,$t.add(P),$t.add(nt),nt.renderOrder=0,se.renderOrder=1}if($t.add(se),l){let H=new sr().setFromObject(se),P=new ae;H.getCenter(P),$t.children.forEach(q=>{q.geometry.center(),q.position.copy(P)})}c&&(se.material.stencilWrite=!0,se.material.stencilRef=1,se.material.stencilFunc=lC,se.material.stencilZPass=Yg,se.material.stencilZFail=Yg,se.material.stencilFail=Yg,se.material.needsUpdate=!0,se.layers.disableAll(),se.layers.enable(dy.ALWAYS_ON_TOP)),re.computeBoundingBox();let k=new ae;return re.boundingBox.getCenter(k),{mesh:$t,material:Xe,center:k}}var rz=.15;var oz=.5,fh=class extends ke{constructor(t,o,n,i){super();m(this,"rendererState");m(this,"verticalDistanceDirty",!0);m(this,"convertTo3DMapPosition");m(this,"getParentContainer");m(this,"convertZoomLevelToAltitude");this.rendererState=t,this.convertTo3DMapPosition=o,this.getParentContainer=n,this.convertZoomLevelToAltitude=i}update(t,o,n){let i,a=!1;for(let l of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(l),i&&i.type==="path"&&i.components[0].type==="path"){let c=i.components[0],p=i.components[1],u=c.isVertical&&this.verticalDistanceDirty;if(!(c instanceof Il))continue;let f=[];if(c.dirty||p.dirty||u){if(c.mesh.parent!=null)for(let h=c.mesh.children.length-1;h>=0;h--)Ht(c.mesh.children[0]);if(c.feature.features.length===2&&c.feature.features[0].properties.parentId&&c.feature.features[1].properties.parentId){let h=c.feature.features[0],b=c.feature.features[c.feature.features.length-1],v,T,x=h.geometry.coordinates[2]||0,I=b.geometry.coordinates[2]||0;h.properties.parentId&&(v=this.getParentContainer(h.properties.parentId,!0),v!=null&&v.altitude!=null&&(x+=v.altitude,c.isVertical=!0)),b.properties.parentId&&(T=this.getParentContainer(b.properties.parentId,!0),T!=null&&T.altitude!=null&&(I+=T.altitude,c.isVertical=!0));let M=this.convertTo3DMapPosition(h.geometry.coordinates[1],h.geometry.coordinates[0],x),O=this.convertTo3DMapPosition(b.geometry.coordinates[1],b.geometry.coordinates[0],I);Math.abs(M.z-O.z)>oz&&v!=null&&v.visible&&T!=null&&T.visible&&(f=[M,O])}else{let h=c.feature.features;for(let b=0;b<h.length;b++)if(b===0||!nM(h[b].geometry.coordinates,h[b-1].geometry.coordinates)){let v=this.convertTo3DMapPosition(h[b].geometry.coordinates[1],h[b].geometry.coordinates[0],h[b].geometry.coordinates[2]||0);f.push(v)}}if(f.length>1){let{mesh:h,material:b,center:v}=R4(f,c,{color:p.color,altitude:p.altitude,isVertical:c.isVertical});c.mesh=h,c.material=b,c.position=v}c.dirty&&typeof c.width=="object"&&c.width.on==="zoom-level"&&(c.altitudeBreakpoints=c.width.input.map(h=>this.convertZoomLevelToAltitude(h))),c.dirty=!1}p.dirty&&(c.mesh.children.forEach(h=>{h.name!=="stencil"&&(h.material.uniforms.color.value.set(p.color),h.material.visible=p.visible,h.material.needsUpdate=!0)}),c.mesh.position.z=p.altitude,p.dirty=!1),c.material&&(c.mesh.children.forEach(h=>{let b=h.material.uniforms;if(h.name==="stencil"){c.materialDirty&&(b.complete.value=c.completeFraction);return}if(typeof c.width=="object"&&c.width.on==="zoom-level"){c.altitudeBreakpoints&&c.altitudeBreakpoints.length>2&&A.warn("Path width interpolation does not yet support more than 2 breakpoints! This will be added in a future version. Path width will only use the first two breakpoints.");let v=DC(n,c.altitudeBreakpoints?.slice(0,2)??[t,o]);c.breakpoint=v,b.nearZoom.value=c.altitudeBreakpoints?.[v]??t,b.farZoom.value=c.altitudeBreakpoints?.[v+1]??o,b.nearRadius.value=Number(c.width.output[v])/2,b.farRadius.value=Number(c.width.output[v+1]??c.width.output[v])/2}b.cameraParameters.value.x=n,c.materialDirty&&(b.displayArrowsOnPath.value=c.displayArrowsOnPath,b.pulseColor.value.set(c.accentColor),b.complete.value=c.completeFraction,typeof c.width=="number"&&(b.nearZoom.value=t,b.farZoom.value=o,b.nearRadius.value=Number(c.width)/2,b.farRadius.value=Number(c.width)/2))}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(h=>{h.name!=="stencil"&&(h.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,h.material.needsUpdate=!0)}),a=!0),c.materialDirty=!1)}this.verticalDistanceDirty=!1,a&&this.publish("animate:path")}};d();var pr,Eu,ma,wx=class{constructor(r){m(this,"rendererState");m(this,"dirty",!1);S(this,pr);S(this,Eu);S(this,ma);this.rendererState=r}updateOne(r){if(r instanceof Mt&&r.components[0]instanceof fr&&r.components[1]instanceof Ri&&r.parentObject3D instanceof Zn&&(w(this,pr,r.components[0]),w(this,ma,r.components[1]),s(this,pr).detached&&s(this,pr).dirty&&s(this,pr).mesh!=null&&s(this,pr).material!=null&&s(this,pr).batchedProps!=null)){w(this,Eu,r.parentObject3D),s(this,pr).visible=!1;let t=new ar(s(this,ma).color),o=s(this,ma).opacity*Mp(r),n=new uM({color:t,side:ws,opacity:o??1,transparent:o!==void 0?o<1:!1},1,s(this,pr).material.repeatYFactor),i=new NM(1,s(this,pr).batchedProps.positionCount,0,n),a=v4(s(this,pr),i);if(a==null)return;i.userData={entities:{0:r.id},detached:!0},s(this,pr).instanceIndex=a,s(this,pr).material.setColor(s(this,pr).instanceIndex,t,s(this,ma).topColor?new ar(s(this,ma).topColor):t),s(this,pr).mesh=i,s(this,pr).material=n,s(this,Eu).add(i),s(this,pr).dirty=!1}}update(){if(!this.dirty)return;let r;for(let t of this.rendererState.geometry3DIdsInScene)r=this.rendererState.geometry3DMap.get(t),this.updateOne(r);this.dirty=!1,this.cleanup()}cleanup(){w(this,pr,void 0),w(this,Eu,void 0),w(this,ma,void 0)}};pr=new WeakMap,Eu=new WeakMap,ma=new WeakMap;d();d();function B4(e,r,t){if(e.batchedProps?.range&&e.mesh){let o=r||1e-4,n=o/Math.max(t,1e-4);return ux(e.mesh.geometry,e.batchedProps.range,o,0),e.material&&(e.material.repeatYFactor=n),e.currentHeight=o,!0}return!1}function N4(e,r,t,o,n,i){return e.mesh&&e.instanceIndex!==-1?(e.mesh.getMatrixAt(e.instanceIndex,t),t.decompose(o,n,i),o.z=r,t.compose(o,n,i),e.mesh.setMatrixAt(e.instanceIndex,t),e.altitude=r,!0):!1}var bi,ds,Ex,Px,Fx,Dx,Ox=class{constructor(r){m(this,"rendererState");m(this,"dirty",!1);S(this,bi);S(this,ds);S(this,Ex,new zn);S(this,Px,new ae);S(this,Fx,new Kg);S(this,Dx,new ae);this.rendererState=r}updateOne(r){if(r instanceof Mt&&r.type==="geometry"&&r.components[1]?.dirty&&(w(this,bi,r.components[0]),w(this,ds,r.components[1]),r.type==="geometry")){let t=!1;s(this,ds).height!==s(this,bi).currentHeight&&(t=B4(s(this,bi),s(this,ds).height,s(this,ds).initialHeight)),s(this,ds).altitude!==s(this,bi).altitude&&(t=N4(s(this,bi),s(this,ds).altitude,s(this,Ex),s(this,Px),s(this,Fx),s(this,Dx))),t&&s(this,bi).mesh!=null&&s(this,bi).mesh.computeBoundingSphere()}}update(){let r;for(let t of this.rendererState.geometry3DIdsInScene)r=this.rendererState.geometry3DMap.get(t),this.updateOne(r);this.cleanup()}cleanup(){w(this,bi,void 0),w(this,ds,void 0)}};bi=new WeakMap,ds=new WeakMap,Ex=new WeakMap,Px=new WeakMap,Fx=new WeakMap,Dx=new WeakMap;d();var nz={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},kx=class{constructor(r){m(this,"state",nz);m(this,"core");this.core=r}update(r){let t={};for(let[o,n]of Object.entries(r))o in this.state&&this.state[o]!==r[o]&&(this.state[o]=n,t[o]=n);this.handleUpdate(t)}handleUpdate(r){r.showPolygonLabelTextAreaMesh!=null&&(r.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),r.showEnvMap!=null&&(r.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),r.showCollisionBoxes!=null&&(r.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};d();var hh=9,iz=!1,j4=.1;function sz(e,r,t){for(let o=0;o<r;o++){let n=(t&16711680)>>16,i=(t&65280)>>8,a=t&255;e[o*3]=n/255,e[o*3+1]=i/255,e[o*3+2]=a/255}}var Ax=class{constructor(r,t,o){m(this,"state");m(this,"renderer");m(this,"renderService");m(this,"pickingTexture");m(this,"pickingMaterial");m(this,"pixelBuffer");m(this,"width",0);m(this,"height",0);m(this,"scale",1/2);m(this,"color",1);m(this,"convertTo3DMapPosition");m(this,"destroyed",!1);m(this,"enabled",!1);m(this,"backgroundId",16777215);m(this,"resize",()=>{let r=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/r*this.scale),this.height=Math.floor(this.renderer.domElement.height/r*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new mC(this.width,this.height,{format:aC,type:sC,internalFormat:"RGBA"})});m(this,"shouldShowByXY",(r,t,o)=>{if(this.pixelBuffer==null)return!1;let n=r+(this.height-t-1)*this.width,i=this.pixelBuffer[n*4],a=this.pixelBuffer[n*4+1],l=this.pixelBuffer[n*4+2],c=i<<16|a<<8|l;return c===o||c===this.backgroundId});m(this,"activeOccluders",new Set);m(this,"update",()=>{if(!this.enabled||this.destroyed||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let r,t;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);if(i&&i instanceof hr&&i.userData.occluderFeature!=null&&i.userData.occluderId!=null&&(this.activeOccluders.add(i.userData.occluderId),i.userData.occluderDirty)){if(r=i.userData.occluderFeature,r.geometry.type==="Polygon"){let a=j1(r,this.convertTo3DMapPosition,{color:"white",height:j4});t=this.createOccluderMesh(a,i.userData.occluderId),i.add(t)}else if(r.geometry.type==="MultiPolygon"){let a=G1(r,this.convertTo3DMapPosition,{color:"white",height:j4});t=this.createOccluderMesh(a,i.userData.occluderId),i?.add(t)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let o=new ar(this.backgroundId);this.renderer.setClearColor(o),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(hh),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(hh),iz?this.renderService.enabledLayers.add(hh):this.renderService.enabledLayers.delete(hh),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let n of this.state.geometry2DIdsInScene){let i=this.state.geometry2DMap.get(n);if(i&&i?.occluderId!=null&&this.activeOccluders.has(i?.occluderId)){let a=i.components[0].projection,l=Math.floor(a.x*this.scale),c=Math.floor(a.y*this.scale),p=this.shouldShowByXY(l,c,i.occluderId);i.components[0].isOccluded=!p}}}).catch(n=>{this.destroyed||A.error(n)})});if(this.state=r,this.convertTo3DMapPosition=t,o?.renderer==null)throw new Error("No Renderer");this.renderService=o,this.renderer=o.renderer,this.resize(),this.pickingMaterial=new _a({glslVersion:pC,vertexShader:`
|
|
496
|
+
attribute vec3 color;
|
|
497
|
+
varying vec3 vColor;
|
|
498
|
+
void main() {
|
|
499
|
+
vColor = color;
|
|
500
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
501
|
+
}
|
|
502
|
+
`,fragmentShader:`
|
|
503
|
+
varying vec3 vColor;
|
|
504
|
+
out vec4 fragColor;
|
|
505
|
+
|
|
506
|
+
void main() {
|
|
507
|
+
fragColor = vec4(vColor, 1.0);
|
|
508
|
+
}
|
|
509
|
+
`})}applyId(r,t){let o=r.attributes.position,n=new Float32Array(o.count*3);sz(n,o.count,t),r.setAttribute("color",new po(n,3))}createOccluderMesh(r,t){let o=new Le(r,this.pickingMaterial);return o.layers.set(hh),this.applyId(o.geometry,t),o.userData.occluderId=t,o}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){this.destroyed=!0,this.pickingTexture?.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};d();var Lx=class{constructor(r){this.state=r;m(this,"dirty",!0)}update(){if(this.dirty){for(let r of this.state.geometry3DIdsInScene){let t=this.state.geometry3DMap.get(r);if(t instanceof Mt&&t.type==="geometry"&&t.components[0]?.geometry!=null){let o=t.components[0];o.geometry&&(o.geometry.dispose(),o.geometry=void 0)}}this.dirty=!1}}};var G4=new Pi;var{DEFAULT_PITCH:q2,DEFAULT_BEARING:eT,DEFAULT_ZOOM_LEVEL:tT,DEFAULT_MIN_ZOOM_LEVEL:az,DEFAULT_MAX_ZOOM_LEVEL:lz}=mi,cz=Ue.radToDeg(.6435011087932844),Jt,Vt,Uc,gh,Pu,wl,Vc,Fu,Jr,J2,j,Rn,$c,ct,xi,Kt,Bn,_r,B,yh,Tr,Ct,U4,V4,$4,fa,bh,xh,vh,Ih,Du,_x,Sh,ku,Th,Hc,K2,zc,Ch,Mh,To,Co,Q2,Rx,Bx,Au,wh,Y2=class extends ke{constructor(t,o={}){super();S(this,Jr);m(this,"options");m(this,"container");m(this,"Debug");S(this,Jt);S(this,Vt);S(this,Uc);S(this,gh);S(this,Pu);S(this,wl);S(this,Vc);S(this,Fu);m(this,"rendererDomElement");S(this,j,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,geometryGroupIdsToLoad:new Set,entityScene:new hr("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:py,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new Y1,externalTweenGroup:new Y1,cameraObject:new T0,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});S(this,Rn,{});S(this,$c,new AbortController);m(this,"camera");S(this,ct);S(this,xi);S(this,Kt);S(this,Bn);S(this,_r);S(this,B,{});S(this,yh,window.matchMedia("screen and (min-resolution: 2dppx)"));m(this,"map");S(this,Tr,()=>{this.aborted||!s(this,B)?.renderSystem||(s(this,B).renderSystem.twoDdirty=!0)});S(this,Ct,()=>{this.aborted||!s(this,B)?.renderSystem||(s(this,B).renderSystem.threeDdirty=!0)});S(this,fa,"standalone");S(this,bh,()=>{s(this,B).geometryDisposalSystem.dirty=!0,this.render()});S(this,xh,t=>Math.trunc(t*10)/10);S(this,vh,()=>{W(this,Jr,J2).call(this,Cp()),s(this,B).twoDDrawSystem.dirty=!0,s(this,Du).call(this,void 0,void 0,!0)});S(this,Ih,()=>{s(this,Du).call(this)});S(this,Du,(t,o,n=!1)=>{let i=t??this.rendererDomElement.clientWidth,a=o??this.rendererDomElement.clientHeight;if((i===0||a===0)&&!n)return;s(this,j).canvasWidth=i,s(this,j).canvasHeight=a,W(this,Jr,J2).call(this,Cp()),s(this,Hc).call(this),W(this,Jr,$4).call(this),s(this,B).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,B).cameraSystem.dirty=!0,s(this,B).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,B).htmlControlsSystem.resize(this.canvasWidth),s(this,B).geometryInFocusSystem.resize(),s(this,B).occlusion2DSystem.resize();let{top:l,left:c}=this.container.getBoundingClientRect();s(this,j).containerOffset=[l,c],this.publish("resize"),this.render()});S(this,_x,()=>{this.renderSync()});S(this,Sh,new ae);S(this,ku,(t,o)=>{let n=this.mode==="standalone"?s(this,Vt):this.viewCamera;if(s(this,Vt).position.z+this.camera.elevation>o.z){s(this,Sh).copy(o);let i=s(this,Sh).project(n),a=(i.x+1)/2*this.canvasWidth-0/2,l=(-i.y+1)/2*this.canvasHeight-0/2,c=s(this,xh).call(this,a),p=s(this,xh).call(this,l);t.x=c,t.y=p}else t.x=-1e3,t.y=-1e3});S(this,Th,(t,o)=>{s(this,_r).setBufferSize(t,o),s(this,Vt).aspect=t/o,s(this,Vt).updateProjectionMatrix(),s(this,Vt).updateMatrixWorld(!0),s(this,Pu).x=t,s(this,Pu).y=o});S(this,Hc,()=>{let t=s(this,j).canvasWidth=this.rendererDomElement.clientWidth,o=s(this,j).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(t*this.resolutionScale),i=Math.floor(o*this.resolutionScale);s(this,Th).call(this,n,i),this.map?.resize(),s(this,j).shouldMeasureCanvas=!1});m(this,"getParentContainer",(t,o=!0)=>{if(!t)return o?s(this,j).entityScene:void 0;if(typeof t=="string"||typeof t=="number"){let n=s(this,j).geometry3DMap.get(t);return n instanceof hr?n:(A.warn(`Parent (${typeof t=="object"?t.id:t}) is not a valid container, adding to scene`),o?s(this,j).entityScene:void 0)}else if(t.type==="group-container"){let n=s(this,j).geometry3DMap.get(t.id);if(n instanceof hr)return n}return o?s(this,j).entityScene:void 0});m(this,"showCollisionBoxes",()=>{s(this,B).collisionSystem.showCollisionBoxes(),this.render()});m(this,"hideCollisionBoxes",()=>{s(this,B).collisionSystem.hideCollisionBoxes(),this.render()});m(this,"projectScreenXYToCoordinate",(t,o,n=!1)=>{let i=this.container.getBoundingClientRect(),a=(t-i.left)/s(this,j).canvasWidth*2-1,l=-((o-i.top)/s(this,j).canvasHeight)*2+1,c=new Me(a,l),p,u;if(n?(G4.setFromCamera(c,s(this,Vt)),p=G4.intersectObject(s(this,wl),!1)[0]?.point):(p=s(this,B).interactionSystem.getThreeDIntersectsFromXY(c)?.[0]?.point,u=s(this,B).interactionSystem.getGroupContainerIntersectsFromXY(c)),p)return{coordinate:this.convert3DMapPositionToCoordinate(p),groupContainers:u}});m(this,"projectCoordinateToScreenXY",t=>{let o=this.convertTo3DMapPosition(t[1],t[0],t[2]||0),n=new Me;return s(this,ku).call(this,n,o),{x:n.x,y:n.y}});m(this,"convert3DMapPositionToCoordinate",t=>{let{lat:o,lon:n}=uy(s(this,j).center?.[1]??0,s(this,j).center?.[0]??0,t.x,t.y);return[n,o,t.z]});m(this,"setBackgroundColor",(t,o)=>{s(this,_r).setBackgroundColor(t,o)});m(this,"getMetresPerPixel",()=>{let t=this.container.clientWidth,o=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,o,!0),i=this.projectScreenXYToCoordinate(t,o,!0);return n==null||i==null?void 0:iy(n.coordinate,i.coordinate)/t});m(this,"hideOutdoorLayersUnderPoint",(t,o)=>{!this.map||o?.length===0||(s(this,B).outdoorLayersSystem.hideLayersUnderPoint(t,o),this.render())});m(this,"hideOutdoorLayersIntersectingPolygons",(t,o,n)=>{s(this,B).outdoorLayersSystem.hideLayersIntersectingPolygons(t,o,n),this.render()});S(this,zc,new qg);S(this,Ch,new zn);S(this,Mh,t=>{A.error("Render failed: ",t,t.stack??"No stack trace available"),this.publish("render-error",{error:t})});m(this,"render",()=>{if(!(s(this,B)?.renderSystem==null||this.aborted))if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return s(this,B).renderSystem.update().catch(s(this,Mh))});m(this,"renderSync",()=>this.aborted?Promise.resolve():s(this,B).renderSystem.update(!0).catch(s(this,Mh)));S(this,To,ym(()=>{this.publish("user-interaction-start",void 0)},0,!0));S(this,Co,ym(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));m(this,"on",(t,o)=>{this.aborted||(super.on(t,o),["outdoor-view-loaded","outdoor-style-loaded"].includes(t)&&this.mode==="standalone"&&y.env.NODE_ENV!=="test"&&(A.warn(`"${t}" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.`),this.publish(t)))});m(this,"off",(t,o)=>{super.off(t,o)});m(this,"getCursor",()=>s(this,B).interactionSystem.getCursor());S(this,Rx,()=>{if(s(this,j).entityScene.removeEventListener("childadded",s(this,Ct)),s(this,j).entityScene.removeEventListener("childadded",s(this,Tr)),s(this,j).entityScene.removeEventListener("childremoved",s(this,Ct)),s(this,j).entityScene.removeEventListener("childremoved",s(this,Tr)),window.removeEventListener("resize",s(this,Ih),!1),s(this,yh).removeEventListener("change",s(this,vh)),this.map){for(let t in s(this,Rn))for(let o of s(this,Rn)[t])this.map.off(t,o);w(this,Rn,{})}this._subscribers={}});S(this,Bx,()=>{try{s(this,fa)!=="outdoors-overlay"&&(this.map&&this.map.remove(),this.container&&this.rendererDomElement&&this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container&&(s(this,Bn)&&this.container.contains(s(this,Bn))&&this.container.removeChild(s(this,Bn)),s(this,ct)&&this.container.contains(s(this,ct))&&this.container.removeChild(s(this,ct)))}catch(t){A.warn("Error during DOM cleanup, some elements may not have been removed:",t)}});m(this,"destroy",()=>{s(this,B)&&(this.aborted||s(this,$c).abort(),s(this,Rx).call(this),this.remove("__scene"),s(this,B).renderSystem.destroy(),s(this,B).cameraSystem.dispose(),s(this,B).exporterSystem.destroy(),s(this,B).outdoorLayersSystem.destroy(),s(this,B).borderSystem.destroy(),s(this,B).drawSystem.destroy(),s(this,Vc)&&s(this,Vc).disconnect(),s(this,_r).destroy(),s(this,Jt)?.traverse(t=>{Ht(t),"dispose"in t&&typeof t.dispose=="function"&&t.dispose()}),w(this,Jt,void 0),s(this,B).htmlControlsSystem.destroy(),s(this,B).collisionSystem.destroy(),s(this,B).interactionSystem.destroy(),s(this,B).domMutationSystem.destroy(),s(this,B).geometryInFocusSystem.destroy(),s(this,B).occlusion2DSystem.destroy(),w(this,B,void 0),s(this,Bx).call(this),w(this,_r,void 0))});S(this,Au,new ae);S(this,wh,new ae);if(w(this,$c,new AbortController),s(this,j).useStandaloneCamera=o.useStandaloneCamera??!1,s(this,j).naturalBearing=o.naturalBearing??0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!t.clientWidth||!t.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(o.mode==="outdoors-interleaved"||o.mode==="outdoors-overlay")&&o.map&&(w(this,fa,o.mode),this.map=o.map),s(this,j).entityScene.addEventListener("childadded",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),s(this,j).entityScene.addEventListener("childremoved",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),s(this,j).geometry3DMap.set(s(this,j).entityScene.userData.entityId,s(this,j).entityScene),o.center&&(s(this,j).center=o.center?[...o.center]:[0,0]),this.options=o,this.container=t,W(this,Jr,U4).call(this),W(this,Jr,V4).call(this),s(this,B).htmlControlsSystem=new px(this.container,{outdoorEnabled:!!this.map}),s(this,fa)!=="outdoors-overlay"&&s(this,B).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),y.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),w(this,_r,new F1({antialias:typeof o.antialias=="boolean"?o.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?o.gl?.canvas:void 0,onWebGLContextCreationError:o.onWebGLContextCreationError,onWebGLContextLost:o.onWebGLContextLost,onWebGLContextRestored:v=>{o.onWebGLContextRestored?.(v),s(this,Tr).call(this),s(this,Ct).call(this),this.render()},onWebGLRendererError:o.onWebGLRendererError,backgroundColor:o.backgroundColor||"#ffffff",backgroundAlpha:o.backgroundAlpha??1})),w(this,Jt,new Ra),s(this,fa)!=="standalone"&&s(this,Jt).add(iM()),s(this,Jt).add(s(this,j).entityScene);let n=window.__THREE_DEVTOOLS__;y.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Jt)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,_r)}))),w(this,Vt,new T0(cz,this.aspect,50,1e5)),s(this,j).cameraObject=s(this,Vt),w(this,gh,new hC),s(this,Vt).renderOrder=999;let i=new Os;i.add(s(this,Vt)),w(this,Fu,new Os),s(this,Fu).add(i),s(this,Jt).add(s(this,Fu)),s(this,Vt).updateProjectionMatrix(),s(this,Vt).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=s(this,_r).domElement(),w(this,Pu,new Me);let a=new Es(1e6,1e6),l=new Nr({color:0,visible:!1});w(this,wl,new Le(a,l)),s(this,wl).name="worldPlane",s(this,Jt).add(s(this,wl)),o.gl?.canvas||t.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,Ih),!1),s(this,yh).addEventListener("change",s(this,vh)),typeof ResizeObserver=="function"&&y.env?.NODE_ENV!=="test"&&(w(this,Vc,new ResizeObserver(zC(v=>{s(this,Du).call(this,v[0].contentRect.width,v[0].contentRect.height)},50))),s(this,Vc)?.observe(t)),t.classList.add("mappedin-map"),this.rendererDomElement.style.width=globalThis.MappedinDebug?.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=globalThis.MappedinDebug?.TEST_IOS?"1920px":"100%",y.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),this.mode!=="outdoors-overlay"&&this.rendererDomElement.tabIndex!==void 0&&this.rendererDomElement.removeAttribute("tabindex"),s(this,j).canvasWidth=this.rendererDomElement.clientWidth,s(this,j).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,p=this.canvasHeight;s(this,B).watermarkSystem=new sx(s(this,Vt),s(this,j),o?.watermark),s(this,B).watermarkSystem.on("texture-loaded",this.render),s(this,j).shouldMeasureCanvas=!0,s(this,j).pixelRatio=this.resolutionScale,s(this,Th).call(this,Math.floor(c*this.resolutionScale),Math.floor(p*this.resolutionScale));let u=new oy(16777215,.3*Math.PI);u.position.set(-150,-150,350),s(this,Jt).add(u);let f=new IC(16777215,.741*Math.PI);s(this,Jt).add(f),s(this,B).cameraSystem=new Lc(s(this,Vt),s(this,Jt),s(this,_r).renderer,s(this,j),{mode:this.mode,canvasHeight:p,canvasWidth:c}),s(this,B).cameraSystem.on("user-dolly-start",s(this,To)),s(this,B).cameraSystem.on("user-pan-start",s(this,To)),s(this,B).cameraSystem.on("user-rotate-start",s(this,To)),s(this,B).cameraSystem.on("user-zoom-start",s(this,To)),s(this,B).cameraSystem.on("user-tilt-start",s(this,To)),s(this,B).cameraSystem.on("user-pedestal-start",s(this,To)),s(this,B).cameraSystem.on("user-dolly-end",s(this,Co)),s(this,B).cameraSystem.on("user-pan-end",s(this,Co)),s(this,B).cameraSystem.on("user-rotate-end",s(this,Co)),s(this,B).cameraSystem.on("user-zoom-end",s(this,Co)),s(this,B).cameraSystem.on("user-tilt-end",s(this,Co)),s(this,B).cameraSystem.on("user-pedestal-end",s(this,Co)),s(this,B).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,B).geometryInFocusSystem&&(s(this,B).geometryInFocusSystem.cameraDirty=!0),this.render()}),this.onAbort(()=>{s(this,B).cameraSystem.off("user-dolly-start",s(this,To)),s(this,B).cameraSystem.off("user-pan-start",s(this,To)),s(this,B).cameraSystem.off("user-rotate-start",s(this,To)),s(this,B).cameraSystem.off("user-zoom-start",s(this,To)),s(this,B).cameraSystem.off("user-tilt-start",s(this,To)),s(this,B).cameraSystem.off("user-pedestal-start",s(this,To)),s(this,B).cameraSystem.off("user-dolly-end",s(this,Co)),s(this,B).cameraSystem.off("user-pan-end",s(this,Co)),s(this,B).cameraSystem.off("user-rotate-end",s(this,Co)),s(this,B).cameraSystem.off("user-zoom-end",s(this,Co)),s(this,B).cameraSystem.off("user-tilt-end",s(this,Co)),s(this,B).cameraSystem.off("user-pedestal-end",s(this,Co)),s(this,B).renderSystem.off("measure-canvas",s(this,Hc)),s(this,B).cameraSystem.off("change",this.render)}),s(this,B).pathSystem=new fh(s(this,j),this.convertTo3DMapPosition,this.getParentContainer,s(this,B).cameraSystem.convertZoomLevelToAltitude),s(this,B).pathSystem.on("animate:path",this.render),this.onAbort(()=>{s(this,B).pathSystem.off("animate:path",this.render)}),s(this,B).panBoundsSystem=new cx(s(this,j),s(this,B).cameraSystem);let h=()=>{let{panBounds:v,fov:T,convertAltitudeToZoomLevel:x}=s(this,B).cameraSystem;if(s(this,B).panBoundsSystem.autoMinZoomLevel){if(v.radius<=0)return;let I=Math.min(s(this,j).canvasWidth/s(this,j).canvasHeight,1),M=T*Math.PI/180*I,O=Math.tan(M/2),{radius:C,center:E}=s(this,B).cameraSystem.panBounds,_=C/O,G=this.getThreeCamera().getWorldPosition(new ae),R=E.distanceTo(G),N=Math.abs(G.z-E.z),X=_*N/R,z=x(X);oM(z,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(z)}this.publish("pan-bounds-change",s(this,B).cameraSystem.panBounds)};s(this,B).panBoundsSystem.on("update",h),this.onAbort(()=>{s(this,B).panBoundsSystem.off("update",h)}),this.camera=new ix(this,s(this,B),s(this,j)),this.camera.setZoomLevel(o.zoomLevel??tT),this.camera.setBearing(o.bearing??eT),this.camera.setPitch(o.pitch??q2),this.camera.setMaxZoomLevel(lz),this.camera.setMinZoomLevel(az),s(this,B).domVisiblitySystem=new $1(s(this,j),s(this,Bn)),s(this,B).domMutationSystem=new nx(s(this,j),s(this,Bn)),s(this,B).domMutationSystem.on("dimensions-update",()=>{s(this,B).collisionSystem.collidersDirty=!0,this.render()}),s(this,B).domDrawSystem=new ox(s(this,j)),s(this,B).collisionSystem=new k1(s(this,xi),s(this,j),(o.useCollisionWorker??!0)&&(o.useWorkers??!0)),s(this,B).twoDDrawSystem=new z1(s(this,j),s(this,Kt),o.transformImageRequest),s(this,B).twoDDrawSystem.on("img:loaded",this.render),s(this,B).interactionSystem=new Gf(this.rendererDomElement,s(this,j),s(this,Vt),s(this,wl),s(this,B).cameraSystem.isUserInteracting),s(this,B).interactionSystem.on("doubletap-with-onefinger",v=>{s(this,B).cameraSystem.enableZoom&&this.camera.animateTo({center:this.projectScreenXYToCoordinate(v.clientX,v.clientY)?.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:L0,easing:"ease-out"})}),s(this,B).interactionSystem.on("singletap-with-twofinger",()=>{s(this,B).cameraSystem.enableZoom&&this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:L0,easing:"ease-out"})}),s(this,B).interactionSystem.on("hover",this.render),s(this,B).interactionSystem.on("click",v=>{if(v.entity2D?.id==="watermark"&&typeof s(this,B).watermarkSystem.options.onClick=="function"&&s(this,B).watermarkSystem.options.interactive){s(this,B).watermarkSystem.options.onClick();return}let T=v.entity3D?[v.entity3D?.id]:[];v.entity3D?.parentObject3D?.userData?.entityId&&T.push(v.entity3D?.parentObject3D?.userData?.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(v.position),geometry:T,paths:v.entity3D?.components[0]instanceof Il?[v.entity3D.id]:[],markers:v.entity2D?.components[0]instanceof ks?[v.entity2D.id]:[],models:v.entity3D?.components[0]instanceof xl?[v.entity3D.id]:[],labels:v.entity2D?.components[0]instanceof Ds?[v.entity2D.id]:[],containers:Array.isArray(v.groupContainers)?v.groupContainers.map(x=>x.userData.entityId):[],pointerEvent:v.pointerEvent})}),s(this,B).interactionSystem.on("hover",v=>{v.position&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(v.position),geometry:v.entity3D?[v.entity3D?.id]:[],paths:v.entity3D?.components[0]instanceof Il?[v.entity3D.id]:[],markers:v.entity2D?.components[0]instanceof ks?[v.entity2D.id]:[],models:v.entity3D?.components[0]instanceof xl?[v.entity3D.id]:[],labels:v.entity2D?.components[0]instanceof Ds?[v.entity2D.id]:[],containers:Array.isArray(v.groupContainers)?v.groupContainers.map(T=>T.userData.entityId):[]})}),s(this,B).geometryInFocusSystem=new vx(s(this,j),s(this,Vt));let b=v=>{this.publish("geometry-in-focus",v)};s(this,B).geometryInFocusSystem.on("geometry-in-focus",b),this.onAbort(()=>{s(this,B).geometryInFocusSystem.off("geometry-in-focus",b)}),s(this,B).twoDVisiblitySystem=new Z1(s(this,j)),s(this,B).drawSystem=new W1(s(this,j),this.convertTo3DMapPosition),s(this,B).drawSystem.on("texture-loaded",this.render),s(this,B).twoDProjectionSystem=new H1(s(this,j),s(this,ku)),s(this,B).exporterSystem=new Uf(s(this,j)),s(this,B).meshOptimizationSystem=new V1(s(this,j),this.convertTo3DMapPosition),s(this,B).meshOptimizationSystem.on("model-loaded",this.render),s(this,B).meshOptimizationSystem.on("geometry-2d-added",this.render),s(this,B).meshOptimizationSystem.on("geometry-group-added",s(this,bh)),this.onAbort(()=>{s(this,B).meshOptimizationSystem.off("model-loaded",this.render),s(this,B).meshOptimizationSystem.off("geometry-2d-added",this.render),s(this,B).meshOptimizationSystem.off("geometry-group-added",s(this,bh))}),s(this,B).meshDetachmentSystem=new wx(s(this,j)),s(this,B).meshModificationSystem=new Ox(s(this,j)),s(this,B).geometryDisposalSystem=new Lx(s(this,j)),s(this,B).borderSystem=new RM(s(this,j),this.convertTo3DMapPosition),s(this,B).customGeometrySystem=new dx(s(this,j),this.convertTo3DMapPosition),s(this,B).outlineInterpolationSystem=new fx(s(this,j)),s(this,B).renderSystem=new X1(s(this,_r),s(this,j),this.mode,s(this,Jt),s(this,Vt),this.viewCamera,s(this,B)),s(this,B).imageSystem=new xx(s(this,j),this.convertTo3DMapPosition,s(this,ku),o.bearing,o.naturalBearing,o.imagePlacementOptions),s(this,B).text3DSystem=new aM(s(this,j),this.convertTo3DMapPosition,o.useWorkers??!0),s(this,B).text3DSystem.on("render",this.render),s(this,B).imageSystem.on("image-loaded",this.render),s(this,B).renderSystem.on("pre-render",()=>this.publish("pre-render")),s(this,B).renderSystem.on("post-render",()=>this.publish("post-render")),s(this,B).renderSystem.on("measure-canvas",s(this,Hc)),this.onAbort(()=>{s(this,B).renderSystem.off("pre-render",()=>this.publish("pre-render")),s(this,B).renderSystem.off("post-render",()=>this.publish("post-render")),s(this,B).renderSystem.off("measure-canvas",s(this,Hc))}),s(this,B).outdoorLayersSystem=new Tx(this.map),s(this,B).occlusion2DSystem=new Ax(s(this,j),this.convertTo3DMapPosition,s(this,_r)),o.occlusionEnabled&&s(this,B).occlusion2DSystem.enable(),this.Debug=new kx(this),o.environment!==!1&&w(this,Uc,W(this,Jr,Q2).call(this)),s(this,_x).call(this)}get viewCamera(){return s(this,gh)}get canvasWidth(){return s(this,j).canvasWidth}get canvasHeight(){return s(this,j).canvasHeight}get resolutionScale(){return this.map?._getClampedPixelRatio(this.canvasWidth,this.canvasHeight)??Cp()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,fa)}addGroupContainer(t,o,n){if(!s(this,j).geometry3DMap.has(t)&&!s(this,j).geometry2DMap.has(t)){let i=new hr(t);i.addEventListener("childadded",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),i.addEventListener("childremoved",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),o?.visible!==void 0&&(i.visible=o.visible),o?.altitude!==void 0&&i.setAltitude(o.altitude),o?.interactive!==void 0&&zo(i,o.interactive,s(this,j)),o?.focusable!==void 0&&xy(i,o.focusable),o?.preloadGeometry!==void 0&&(i.userData.preloadGeometry=o.preloadGeometry),s(this,j).geometry3DMap.set(t,i);let a=this.getParentContainer(n);a instanceof hr&&a.addEntity(i),s(this,Ct).call(this),this.render()}else A.error(`Group container with ID '${t}' already exists. The group container cannot be added.`);return{id:t,type:"group-container"}}addCustomGeometry(t,o,n,i,a){if(s(this,j).geometry3DMap.has(t))A.error(`Custom geometry with ID '${t}' already exists. The custom geometry cannot be added.`);else{let l=new Cu(o,n),c=new Mt(l,new Ri(i));i?.interactive!==void 0&&zo(c,i.interactive,s(this,j)),c.id=t,l.mesh.userData={entityId:t,type:"custom-geometry"},s(this,j).geometry3DMap.set(c.id,c);let p=this.getParentContainer(a);a&&p instanceof hr?p.addEntity(c):s(this,j).entityScene.addEntity(c),s(this,Ct).call(this),this.render()}return{id:t,type:"custom-geometry"}}addGeometryGroup(t,o,n,i){if(!s(this,j).geometry3DMap.has(t)&&!s(this,j).geometry2DMap.has(t)){let a=new Zn(t);a.addEventListener("childadded",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),a.addEventListener("childremoved",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),a.userData.dirty=!0,s(this,j).geometry3DMap.set(t,a);for(let c of o.features){if(c.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(c.geometry.type))continue;let p=c?.id||c?.properties?.id||ut(),{visible:u,altitude:f,...h}=n||{color:BM},b=s(this,B).meshOptimizationSystem.createEntityFromFeature(p,c,{outline:!0,...h});s(this,j).geometry3DMap.set(p,b),a.userData.entities3D.add(p)}a.setVisible(n?.visible??!0),n?.altitude!=null&&a.setAltitude(n.altitude);let l=this.getParentContainer(i);l instanceof hr&&l.addEntity(a),s(this,Ct).call(this),this.render()}else A.error(`Geometry group with ID '${t}' already exists. The geometry group cannot be added.`);return s(this,B).outlineInterpolationSystem.geometries3DDirty=!0,{id:t,type:"geometry-group"}}addOccluder(t,o){let n=this.getParentContainer(o),i=s(this,B).occlusion2DSystem.reserveOccluderId();return n?.addOccluderFeature(t,i),i}addImage(t,o,n,i){try{T4(t,o,n)}catch(a){A.error(a);return}if(!s(this,j).geometry3DMap.has(t)&&!s(this,j).geometry2DMap.has(t)){let a=new bx(o),l=new Mt(a,new Ri(n));l.id=t||ut(),a.mesh.userData={entityId:l.id,type:"path"},s(this,j).geometry3DMap.set(l.id,l);let c=this.getParentContainer(i);c instanceof hr&&c.addEntity(l),s(this,Ct).call(this),this.render()}else A.error(`Image with ID '${t}' already exists. The image cannot be added.`);return{id:t,type:"image"}}addModelGroup(t,o,n,{parent:i,onComplete:a}={}){try{JD(t,o,n)}catch(l){A.error(l);return}if(!s(this,j).geometry3DMap.has(t)&&!s(this,j).geometry2DMap.has(t)){let l=new Zn(t);l.addEventListener("childadded",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),l.addEventListener("childremoved",()=>{s(this,Ct).call(this),s(this,Tr).call(this)}),s(this,j).geometry3DMap.set(t,l),l.userData.dirty=!0,l.userData.modelURL=n.url;for(let p of o.features){let u=p.id||p.properties.id||ut(),f=s(this,B).meshOptimizationSystem.createModelFromFeature(u,p,{...n});(p.properties.interactive!==void 0||n.interactive!=null)&&zo(f,p.properties.interactive??n.interactive,s(this,j)),f.parentId=l.userData.entityId,s(this,j).geometry3DMap.set(u,f),l.userData.entities3D.add(u)}let c=this.getParentContainer(i);c instanceof hr&&c.addEntity(l),s(this,Ct).call(this),this.render()?.then(a)}else A.error(`Model group with ID '${t}' already exists. The model group cannot be added.`);return{id:t,type:"geometry-group"}}addMarker2D(t,o,n,i){let a=n?.id;try{HC(t,o,n||{})}catch(l){A.error(l);return}if(a===void 0||!s(this,j).geometry2DMap.has(a)&&!s(this,j).geometry3DMap.has(a)){let l=W(this,Jr,K2).call(this,t,new ks(o,n),n?.occluderId,n?.verticalOffset);l.id=a||String(l.id),a=l.id,n?.interactive!=null&&n.interactive!=="pointer-events-auto"&&zo(l,n?.interactive,s(this,j)),n?.enabled!=null&&yy(l,n.enabled);let c=typeof n?.attachTo=="string"||typeof n?.attachTo=="number"?s(this,j).geometry3DMap.get(n.attachTo):void 0;c instanceof Mt&&c.attach(l),this.getParentContainer(i)?.addEntity(l),this.render()}else A.error(`Marker2D with ID '${a}' already exists. The marker cannot be added.`);return{id:a,type:"marker"}}addText3D(t,o,n,i){if(!s(this,j).geometry3DMap.has(t)&&!s(this,j).geometry2DMap.has(t)){let a=new gy({...o,properties:{...o.properties,id:t,content:o.properties.text}}),l=new Mt(a,new bm(n?.appearance));l.id=t,a.mesh.userData.entityId=t.toString(),a.mesh.userData.type="text3d",s(this,j).geometry3DMap.set(t,l);let c=this.getParentContainer(i);c instanceof hr&&c.addEntity(l),s(this,Ct).call(this),this.render()}else A.error(`Text3D with ID '${t}' already exists. The text3d cannot be added.`);return{id:t,type:"text3d"}}labelText3D(t,o,n={}){try{if(!o||!t)throw new Error("content and meshGeometryId are required");pM.parse(n)}catch(p){A.error(p);return}let i=s(this,j).geometry3DMap.get(t);if(i?.type!=="geometry"){A.error(".labelText3D failed: target incorrect");return}let a=i?.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let p=s(this,j).geometry3DMap.get(a.textEntityId);if(p?.type!=="text3d"){A.error(".labelText3D failed: existing text3d not found");return}return{id:p.id,type:p.type}}let l=new gy({type:"Feature",geometry:{coordinates:a.feature.properties.textArea?.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:o,id:ut()}});l.polygonEntityId=t;let c=new Mt(l,new bm(n?.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",s(this,j).geometry3DMap.set(c.id.toString(),c),n.parentId&&this.getParentContainer(n.parentId)?.addEntity(c),this.render(),{id:c.id,type:"text3d"}}addLabel2D(t,o,n,i){let a=n?.id;try{VC(t,o,n||{})}catch(l){A.error(l);return}if(a===void 0||!s(this,j).geometry2DMap.has(a)&&!s(this,j).geometry3DMap.has(a)){let l=W(this,Jr,K2).call(this,t,new Ds(o,n||{},s(this,j)),n?.occluderId,n?.verticalOffset);l.id=a||String(l.id),a=l.id,n?.interactive!=null&&zo(l,n?.interactive,s(this,j)),n?.enabled!=null&&yy(l,n.enabled);let c=typeof n?.attachTo=="string"||typeof n?.attachTo=="number"?s(this,j).geometry3DMap.get(n.attachTo):void 0;c instanceof Mt&&c.attach(l),this.getParentContainer(i)?.addEntity(l),s(this,Tr).call(this),this.render()}else A.error(`Label2D with ID '${a}' already exists. The label cannot be added.`);return{id:a,type:"label"}}addPath(t,o={},n){try{o4(t,o||{})}catch(c){A.error(c);return}let i=new Il(t,DM(o)),a=new Mt(i,new Ri({color:o?.color??"#ff834c",altitude:o?.verticalOffset??.1}));a.id=o?.id||ut(),i.mesh.userData={entityId:a.id,type:"path"},s(this,j).geometry3DMap.set(a.id,a),o?.interactive!=null&&zo(a,o?.interactive,s(this,j));let l=this.getParentContainer(n);return l instanceof hr&&l.addEntity(a),s(this,Ct).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(t){s(this,B).watermarkSystem.options=t,s(this,B).watermarkSystem.dirty=!0,s(this,B).collisionSystem.collidersDirty=!0,this.render()}remove(t){let o;if(typeof t=="string"||typeof t=="number"?(o=s(this,j).geometry2DMap.get(t),o==null&&(o=s(this,j).geometry3DMap.get(t))):typeof t.id=="string"||typeof t.id=="number"?(o=s(this,j).geometry2DMap.get(t.id),o==null&&(o=s(this,j).geometry3DMap.get(t.id))):o=t,o!=null){if(o.type==="custom-geometry")s(this,j).geometry3DMap.delete(o.id),o.object3d&&Ht(o.object3d);else if(o.type==="group-container"){s(this,j).geometry3DMap.delete(o.userData.entityId);for(let i of o.childrenIds.values())this.remove(i),o.userData.entities2D.delete(i);let n=o.components[1];n&&n.focusMesh&&Ht(n.focusMesh),Ht(o)}else if(o.type==="geometry-group"){s(this,j).geometry3DMap.delete(o.userData.entityId);for(let n of o.userData.entities3D.values())this.remove(n),o.userData.entities3D.delete(n);Ht(o)}else if(o.type==="geometry"||o.type==="model"||o.type==="path"){let n=o.components[0],i=o.components[4];if(o.entities2D.size>0){for(let l of o.entities2D.values())this.remove(l);o.removeAllEntities()}let a=o.parentObject3D?.userData.entityId??o.parentId;if(a){let l=s(this,j).geometry3DMap.get(a);l instanceof Zn&&l.userData.entities3D.delete(o.id)}if(o.object3d&&Ht(o.object3d),o.type==="geometry"){let l=o.components[3];l&&(l.enabled=!1,l.dirty=!0)}i&&"focusMesh"in i&&i.focusMesh!=null&&Ht(i.focusMesh),"textMesh"in n&&n.textMesh!=null&&this.remove(n.textMesh.userData.entityId),s(this,j).geometry3DMap.delete(o.id)}else if(o.type==="marker"||o.type==="label"){let n=o.attachedTo;if(n){let i=s(this,j).geometry3DMap.get(n);i instanceof Mt&&i.detach(o)}o.object3d&&Ht(o.object3d),o.type==="label"&&delete s(this,B).twoDDrawSystem.textCache[o.id],s(this,j).geometry2DMap.delete(o.id)}else if(o.type==="image")o.object3d&&Ht(o.object3d),s(this,j).geometry3DMap.delete(o.id);else if(o.type==="text3d"){Ht(o.object3d);let{batchedText:n,textMesh:i,polygonEntityId:a}=o.components[0];if(i&&(n&&n.removeText(i),Ht(i)),a){s(this,B).text3DSystem.remove(a);let l=s(this,j).geometry3DMap.get(a);l?.type==="geometry"&&(l.components[0].textMesh=void 0,l.components[0].textEntityId=void 0)}s(this,j).geometry3DMap.delete(o.id)}s(this,Ct).call(this),s(this,Tr).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return s(this,Jt)}getThreeCamera(){return s(this,Vt)}async setEnvironment(t){if(s(this,Jt))if(t==="basic"){s(this,Uc)||w(this,Uc,W(this,Jr,Q2).call(this));let o=await s(this,Uc);s(this,Jt).environment=o}else s(this,Jt).environment=null}getEnvironment(){return s(this,Jt)?.environment?"basic":!1}getCurrentSceneGLTF(t){return s(this,B).exporterSystem.getCurrentSceneGLTF(t)}getBoundingArea(t){(s(this,B).renderSystem.threeDdirty||s(this,B).renderSystem.twoDdirty)&&this.renderSync();let o=new sr;if(t==null)o.setFromObject(s(this,j).entityScene);else{let n=Tp(s(this,j),t);if(n?.type==="geometry"&&n?.object3d!=null){let i=n.components[0],a=i instanceof fr?i.geometry:void 0;i.mesh instanceof ey&&a?(a.computeBoundingBox(),a.boundingBox&&o.union(a.boundingBox)):o.setFromObject(n.object3d)}else(n?.type==="geometry-group"||n?.type==="group-container")&&n?.userData.entityId!=null&&o.setFromObject(n)}if(Bl(o))return ZC(o).map(this.convert3DMapPositionToCoordinate)}hasState(t){return Tp(s(this,j),t)!=null}getState(t){if(t==null)return{type:"map-view",hoverColor:s(this,j).hoverColor,text3dHoverColor:s(this,j).text3dHoverColor};let o=Tp(s(this,j),t);if(o?.type==="custom-geometry"){let n=o.components[0],i=o.components[1];return{id:o.id,type:"custom-geometry",visible:i.visible,altitude:i.altitude,parent:o.parentObject3D?.userData.entityId,position:this.convert3DMapPositionToCoordinate(n.position)}}else if(o?.type==="geometry-group"){let n=Array.from(o.userData.entities3D.values()),i=n?.[0],a=i?this.getState(i):{};return{id:o.userData.entityId,type:"geometry-group",visible:o.visible,altitude:o.altitude,color:a?.color,initialColor:a?.initialColor,side:a?.side??"double",opacity:a?.opacity,height:a?.height,texture:a?.texture,topColor:a?.topColor,topTexture:a?.topTexture,interactive:a?.interactive,children:n,bevel:a?.bevel}}else{if(o?.type==="group-container")return{id:o.userData.entityId,type:"group-container",visible:o.visible,altitude:o.getWorldPosition(pz).z??0,opacity:o.opacity,interactive:!!o.components[0],children:Array.from(o.childrenIds.values()).map(n=>this.getState(n)).filter(Boolean)};if(o?.type==="label"){let n=o.components[0],i=o.object3d.parent,a=i?.userData.entityId;return{id:o.id,type:"label",text:n.text||"",parent:{id:a,type:i?.type},position:this.convert3DMapPositionToCoordinate(o.position),enabled:n.enabled,visible:n.visible,initialRank:hm(n.initialRank),options:{rank:hm(n.rank),appearance:n.appearance,interactive:o.components[1]!=null,verticalOffset:o.verticalOffset,attachTo:o.attachedTo}}}else if(o?.type==="marker"){let n=o.components[0],i=o.object3d.parent,a=i?.userData.entityId;return{id:o.id,type:"marker",enabled:n.enabled,visible:n.visible,placement:n.options.placement,dynamicResize:n.options.dynamicResize,parent:{id:a,type:i?.type},position:this.convert3DMapPositionToCoordinate(o.position),element:n.containerEl,initialRank:hm(n.initialRank),contentHTML:n.contentHtml,options:{rank:hm(n.rank),interactive:o.components[1]!=null||!1,verticalOffset:o.verticalOffset,attachTo:o.attachedTo,lowPriorityPin:n.options.lowPriorityPin}}}else if(o?.type==="geometry"){let{color:n,hoverColor:i,initialColor:a,initialTopColor:l,topColor:c,altitude:p}=o.components[1],u=o.components[0],f=o.components[1],h=o.components[1],b=o.components[2],v=o.components[3],T=o.parentObject3D;return{id:o.id,type:"geometry",opacity:h.opacity,initialColor:a,color:n,focusable:f!=null&&f.focusMesh!=null,initialTopColor:l,topColor:c,side:h.side,hoverColor:i,hovered:!!b?.hover,height:h.height,visible:h.visible,outline:v?.enabled,showImage:h.showImage,texture:h.texture,topTexture:h.topTexture,flipImageToFaceCamera:h.flipImageToFaceCamera,enableImageCollisions:h.enableImageCollisions,parent:{id:T?.userData.entityId,type:T?.type},altitude:p,bevel:h.bevel,position:this.convert3DMapPositionToCoordinate(u.position),interactive:o.components[2]!=null,borderVisible:h.borderVisible,borderColor:h.borderColor,borderWidth:h.borderWidth}}else if(o?.type==="model"){let n=o.components[0],i=o.components[1],a=o.components[2];return{id:o.id,type:"model",position:n.mesh?this.convert3DMapPositionToCoordinate(n.mesh?.getWorldPosition(new ae)):this.convert3DMapPositionToCoordinate(n.position),interactive:a!=null,material:i.material,parent:o.parentObject3D?.parent?{id:o.parentObject3D.parent.userData.entityId,type:o.parentObject3D.parent.type}:void 0,visible:i.visible,verticalOffset:i.verticalOffset,color:i.color,opacity:i.opacity,rotation:i.rotation??Ep,scale:i.scale??Op}}else if(o?.type==="path"){let n=o.components[0],i=o.components[2],a=o.components[1];return{id:o.id,type:"path",position:this.convert3DMapPositionToCoordinate(n.position),visible:a.visible,interactive:i!=null,completeFraction:n.completeFraction,color:a.color,accentColor:n.accentColor,width:n.width,animateArrowsOnPath:n.animateArrowsOnPath,displayArrowsOnPath:n.displayArrowsOnPath,verticalOffset:a.altitude}}else if(o?.type==="image"){let n=o.components[0];return{id:o.id,type:"image",position:this.convert3DMapPositionToCoordinate(n.position),visible:o.components[1].visible,verticalOffset:n.feature.properties.verticalOffset??0,opacity:o.components[1].opacity,flipImageToFaceCamera:o.components[1].flipImageToFaceCamera,width:n.feature.properties.width??0,height:n.feature.properties.height??0,rotation:n.feature.properties.rotation??0}}else if(o?.type==="text3d"&&o.components[0]instanceof gy&&"textArea"in o.components[0].feature.properties){kM(o);let n=o.components[0],i=o.components[1],{textMesh:a}=n,l=n.mesh?.parent;l instanceof hr&&l.children.find(u=>u.type==="batchedtext")?.getWorldPosition(s(this,wh)),s(this,Au).set(0,0,0);let c=a?a.getWorldPosition(s(this,Au)):s(this,Au);return Object.assign({},wp,i.getState(),{id:o.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(c.add(s(this,wh))),visible:n.visible??!1,content:n.feature.properties.content??""})}else return}}setState(t,o){if(typeof t=="object"&&o==null){"hoverColor"in t&&(mm(t.hoverColor)?s(this,j).hoverColor=t.hoverColor??s(this,j).hoverColor:A.warn(`Failed to update global hover color. Invalid color "${t.hoverColor}".`)),"text3dHoverColor"in t&&(s(this,j).text3dHoverColor=t.text3dHoverColor??s(this,j).text3dHoverColor);return}let n=Tp(s(this,j),t);if(n!=null){if(n.type==="custom-geometry"){let i=s(this,j).geometry3DMap.get(n.id);if(i instanceof Mt&&i.components[0]instanceof Cu){let a=o;Ua(n,s(this,j),a.visible),Pp(n,a.altitude),U0(n,a.position,this.convertTo3DMapPosition),V0(n,this.getParentContainer(a.parent,!1)),zo(n,a.interactive,s(this,j))&&s(this,Ct).call(this)}}else if(n.type==="path"){let i=o;zo(n,i.interactive,s(this,j))&&s(this,Ct).call(this),Pp(n,i.verticalOffset),FM(n,s(this,j),i)}else if(n.type==="model"){let i=o;zo(n,i.interactive,s(this,j))&&s(this,Ct).call(this),Ua(n,s(this,j),i.visible),LM(n,i)}else if(n.type==="group-container"){let i=o;Ua(n,s(this,j),i.visible)&&(s(this,B).pathSystem.verticalDistanceDirty=!0,s(this,B).geometryInFocusSystem.focusablesDirty=!0),Pp(n,i.altitude)&&(s(this,B).pathSystem.verticalDistanceDirty=!0),zo(n,i.interactive,s(this,j))&&s(this,Ct).call(this),by(n,s(this,j),i.opacity)&&(s(this,B).outlineInterpolationSystem.outlineOpacitiesDirty=!0),i.preloadGeometry&&n.userData.preloadGeometry!==!0&&(n.userData.preloadGeometry=!0,s(this,B).outlineInterpolationSystem.geometries3DDirty=!0),xy(n,i.focusable)&&(s(this,B).geometryInFocusSystem.focusablesDirty=!0)}else if(n.type==="geometry-group"){let i=o;Ua(n,s(this,j),i.visible),gM(n,s(this,j),i),H0(n,s(this,j),i.outline),i.height!=null&&G0(n,s(this,j),i.height),Pp(n,i.altitude),MM(n,s(this,j),i),yM(n,s(this,j),i.shading),by(n,s(this,j),i.opacity)&&(s(this,B).outlineInterpolationSystem.outlineOpacitiesDirty=!0),zo(n,i.interactive,s(this,j))&&(s(this,Ct).call(this),s(this,Tr).call(this)),z0(n,s(this,j),i.side)}else if(n.type==="geometry"){if(n.components[0]instanceof fr){let i=o;Ua(n,s(this,j),i.visible),H0(n,s(this,j),i.outline),bM(n,i),xy(n,i.focusable)&&(s(this,B).geometryInFocusSystem.focusablesDirty=!0),EM(n,i.renderOrder)&&(s(this,B).meshDetachmentSystem.dirty=!0),OM(n,i.opacity)&&(s(this,B).meshDetachmentSystem.dirty=!0,s(this,B).interactionSystem.dirty3D=!0,s(this,B).outlineInterpolationSystem.outlineOpacitiesDirty=!0),$0(n,i.flipImageToFaceCamera),CM(n,i.enableImageCollisions),Pp(n,i.altitude),i.height!=null&&G0(n,s(this,j),i.height),wM(n,i)&&(s(this,B).meshDetachmentSystem.dirty=!0),xM(n,i),SM(n,i.hoverColor),zo(n,i.interactive,s(this,j)),TM(n,i.hovered),z0(n,s(this,j),i.side),PM(n,i)}s(this,Ct).call(this)}else if(n.type==="label"||n.type==="marker"){let i=o;IM(n,o,s(this,j)),vM(n,o,s(this,j))&&(s(this,Tr).call(this),s(this,B).domMutationSystem.dirty=!0),U0(n,i.position,this.convertTo3DMapPosition),V0(n,this.getParentContainer(i.parent,!1))&&(s(this,Tr).call(this),s(this,B).panBoundsSystem.dirty=!0),yy(n,i.enabled),Ua(n,s(this,j),i.visible)}else if(n.type==="image"){let i=o;Ua(n,s(this,j),i.visible),by(n,s(this,j),i.opacity),$0(n,i.flipImageToFaceCamera)}else if(n.type==="text3d"){let i=o;AM(n,s(this,j),i)}this.render()}}convertTo3DMapPosition(t,o,n=0,i){if(Array.isArray(t))return this.convertTo3DMapPosition(t[1],t[0],t[2]??n,typeof o=="function"?o:void 0);if(typeof o!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:l}=my(s(this,j).center?.[1]??0,s(this,j).center?.[0]??0,t,o);return i?(i.set(a,l,n),i):new ae(a,l,n)}get backgroundColor(){return typeof s(this,_r).backgroundColor=="string"?s(this,_r).backgroundColor:`#${s(this,_r).backgroundColor.getHexString()}`}get backgroundAlpha(){return s(this,_r).backgroundAlpha}getThreeRenderer(){return s(this,_r)}getCenter(t){let o=Array.isArray(t)?t:this.getBoundingArea(t);return o?rM(o):void 0}isInView(t){let o=Tp(s(this,j),t);if(s(this,Ch).identity().multiply(s(this,Vt).projectionMatrix).multiply(s(this,Vt).matrixWorldInverse),s(this,zc).setFromProjectionMatrix(s(this,Ch)),o instanceof k0)return s(this,zc).containsPoint(o.position);if(o instanceof Mt){let n=o?.components[0];if(n instanceof Cu||n instanceof xl)return s(this,zc).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof fr){let i=new sr(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,zc).intersectsBox(i)}}return!1}queryGeometry2DInView(t){let{screenOffsets:o,fullyContains:n}=t??{},[i,a,l,c]=sM(this.container,o),p=new rt(i,a,l,c);return s(this,B).collisionSystem.visibleCollidersQTree.queryRect(p).filter(b=>n?p.contains(b):p.intersects(b)).map(b=>s(this,j).geometry2DMap.get(b.userData.entityId)).filter(b=>b!=null).filter(b=>b.components[0]instanceof Ds||b.components[0]instanceof ks).map(b=>b.id.toString())}onMapLibreEvent(t,o){if(!this.map){A.warn(`Tried to add event listener "${t}" but MapLibre map is not initialized.`);return}this.map.on(t,o),s(this,Rn)[t]=s(this,Rn)[t]||[],s(this,Rn)[t].push(o)}offMapLibreEvent(t,o){!this.map||!Array.isArray(s(this,Rn)[t])||(this.map.off(t,o),s(this,Rn)[t]=s(this,Rn)[t].filter(n=>n!==o))}get aborted(){return s(this,$c).signal.aborted}onAbort(t){s(this,$c).signal.addEventListener("abort",t,{once:!0})}getSystems(){return s(this,B)}getInternalState(){return s(this,j)}getInternalTweenGroup(){return s(this,j).internalTweenGroup}getExternalTweenGroup(){return s(this,j).externalTweenGroup}computeMinZOffsetBetweenContainers(t,o,n){if(!t||!o)return-1;vp(t,"group-container"),vp(o,"group-container");let i=fy(t,this.getThreeCamera()),a=o.clone(),l=fy(a,this.getThreeCamera());if(!Bl(i)||!Bl(l))return-1;let c=0,p;n&&this.container.querySelectorAll(".debug-box").forEach(f=>f.remove());do{if(c>1e4)return-1;if(c+=20,a.position.z=c,a.updateMatrixWorld(),l.makeEmpty(),fy(a,s(this,Vt),l),p=i.intersectsBox(l),n){let u=N0(i,"blue",this.container),f=N0(l,p?"red":"green",this.container);u.classList.add("debug-box"),f.classList.add("debug-box")}}while(p);return c}};Jt=new WeakMap,Vt=new WeakMap,Uc=new WeakMap,gh=new WeakMap,Pu=new WeakMap,wl=new WeakMap,Vc=new WeakMap,Fu=new WeakMap,Jr=new WeakSet,J2=function(t){s(this,fa)!=="outdoors-overlay"&&this.map?.setPixelRatio(t),s(this,j).pixelRatio=this.resolutionScale},j=new WeakMap,Rn=new WeakMap,$c=new WeakMap,ct=new WeakMap,xi=new WeakMap,Kt=new WeakMap,Bn=new WeakMap,_r=new WeakMap,B=new WeakMap,yh=new WeakMap,Tr=new WeakMap,Ct=new WeakMap,U4=function(){w(this,ct,document.createElement("div")),s(this,ct).classList.add("mappedin__smart-collision-engine__container"),w(this,xi,document.createElement("canvas")),s(this,xi).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,ct)),w(this,Kt,document.createElement("canvas")),s(this,Kt).classList.add("mappedin__smart-collision-engine__container"),s(this,Kt).width=s(this,ct).clientWidth*this.resolutionScale,s(this,Kt).height=s(this,ct).clientHeight*this.resolutionScale,s(this,Kt).style.width=s(this,ct).clientWidth+"px",s(this,Kt).style.height=s(this,ct).clientHeight+"px",s(this,ct).appendChild(s(this,xi)),s(this,ct).appendChild(s(this,Kt)),s(this,xi).width=s(this,ct).clientWidth,s(this,xi).height=s(this,ct).clientHeight,s(this,Kt).width=s(this,ct).clientWidth*this.resolutionScale,s(this,Kt).height=s(this,ct).clientHeight*this.resolutionScale,s(this,Kt).style.width=s(this,ct).clientWidth+"px",s(this,Kt).style.height=s(this,ct).clientHeight+"px"},V4=function(){w(this,Bn,document.createElement("div")),s(this,Bn).classList.add("mappedin-2d-entities"),Object.assign(s(this,Bn).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,Bn))},$4=function(){s(this,Kt).width=s(this,ct).clientWidth*this.resolutionScale,s(this,Kt).height=s(this,ct).clientHeight*this.resolutionScale,s(this,Kt).style.width=s(this,ct).clientWidth+"px",s(this,Kt).style.height=s(this,ct).clientHeight+"px",s(this,xi).width=s(this,ct).clientWidth,s(this,xi).height=s(this,ct).clientHeight,s(this,Kt).width=s(this,ct).clientWidth*this.resolutionScale,s(this,Kt).height=s(this,ct).clientHeight*this.resolutionScale,s(this,Kt).style.width=s(this,ct).clientWidth+"px",s(this,Kt).style.height=s(this,ct).clientHeight+"px",s(this,B).collisionSystem.collidersDirty=!0},fa=new WeakMap,bh=new WeakMap,xh=new WeakMap,vh=new WeakMap,Ih=new WeakMap,Du=new WeakMap,_x=new WeakMap,Sh=new WeakMap,ku=new WeakMap,Th=new WeakMap,Hc=new WeakMap,K2=function(t,o,n,i){let a=new k0(o,this.convertTo3DMapPosition(t[1],t[0],t[2]||0),i);return a.occluderId=n??s(this,B).occlusion2DSystem.backgroundId,s(this,j).geometry2DMap.set(a.id,a),a},zc=new WeakMap,Ch=new WeakMap,Mh=new WeakMap,To=new WeakMap,Co=new WeakMap,Q2=async function(){return vl.load(DD).then(t=>(s(this,Jt)&&(s(this,Jt).environment?.dispose(),t.mapping=iC,s(this,Jt).environment=t,this.render()),t))},Rx=new WeakMap,Bx=new WeakMap,Au=new WeakMap,wh=new WeakMap;var pz=new ae,rT=Y2;d();function dz(e,r){uz(e,r)(e.getScene(),r),mz(e,r),r.addFolder("Export").add({export:async()=>{let a=await e.getCurrentSceneGLTF({binary:!0}),l=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let p=window.URL.createObjectURL(l);c.href=p,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(p)}},"export");let n=r.addFolder("Camera"),i={get bearing(){return e.camera.bearing},set bearing(a){e.camera.setBearing(a)},get pitch(){return e.camera.pitch},set pitch(a){e.camera.setPitch(a)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(a){e.camera.setZoomLevel(a)}};n.add(i,"bearing",-359,359,1),n.add(i,"pitch",e.camera.minPitch,e.camera.maxPitch,1),n.add(i,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}function uz(e,r){let t=r;return function o(n,i){let a=i.addFolder(`${[n.type]} ${n.id.slice(0,16)}`);if(i.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let l={get height(){let c=e.getState(n.id);return c?.type==="geometry"?c.height:0},set height(c){e.getState(n.id)?.type==="geometry"&&e.setState(n,{height:c})},set flipImageToFaceCamera(c){e.getState(n.id)?.type==="image"&&e.setState(n,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=e.getState(n.id);return c?.type==="image"?c.flipImageToFaceCamera:!1},set visible(c){let p=e.getState(n.id);(p?.type==="geometry"||p?.type==="path"||p?.type==="image")&&e.setState(n,{visible:c})},get visible(){let c=e.getState(n.id);return c?.type==="geometry"||c?.type==="path"||c?.type==="image"?c.visible:!1},set outline(c){e.getState(n.id)?.type==="geometry"&&e.setState(n,{outline:c})},get outline(){let c=e.getState(n.id);return c?.type==="geometry"?c.outline:!1},get opacity(){let c=e.getState(n.id);return c?.type==="geometry"?c.opacity:1},set opacity(c){let p=e.getState(n.id);p?.type==="geometry"&&e.setState(p,{opacity:c})},get color(){let c=e.getState(n.id);return c?.type==="geometry"&&c.color?jC(c.color).toHexString():"#ffffff"},set color(c){let p=e.getState(n.id);p?.type==="geometry"&&e.setState(p,{color:c})},set interactive(c){let p=e.getState(n.id);(p?.type==="geometry"||p?.type==="model"||p?.type==="path")&&(e.setState(n,{interactive:c}),t.controllersRecursive().forEach(u=>u.updateDisplay()))},get interactive(){let c=e.getState(n.id);return c?.type==="geometry"||c?.type==="model"||c?.type==="path"?c.interactive:!1},get completeFraction(){let c=e.getState(n.id);return c?.type==="path"?c.completeFraction:1},set completeFraction(c){let p=e.getState(n.id);p?.type==="path"&&e.setState(p,{completeFraction:c})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=e.getState(n.id);c?.type==="model"||c?.type==="path"||c?.type==="image"?e.camera.focusOn([c.position]):c?.type==="geometry"&&e.camera.focusOn(e.getBoundingArea(c))}),a.add(l,"visible"),n.type==="image"?a.add(l,"flipImageToFaceCamera"):(a.add(l,"interactive"),n.type==="path"&&a.add(l,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(l,"color"),a.add(l,"outline"))),n.type==="geometry"&&(a.add(l,"height"),a.add(l,"opacity",0,1,.1))}else if(n.type==="marker"){let l={get interactive(){let c=e.getState(n.id);return c?.type==="marker"?c.options?.interactive:!1},set interactive(c){let p=e.getState(n.id);p?.type==="marker"&&(e.setState(p,{options:{interactive:c}}),t.controllersRecursive().forEach(u=>u.updateDisplay()))},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=e.getState(n.id);c?.type==="marker"&&e.camera.focusOn([c.position])}),a.add(l,"interactive")}else if(n.type==="label"){let l={get interactive(){let c=e.getState(n.id);return c?.type==="label"?c.options?.interactive:!1},set interactive(c){let p=e.getState(n.id);p?.type==="label"&&(e.setState(p,{options:{interactive:c}}),t.controllersRecursive().forEach(u=>u.updateDisplay()))},get text(){let c=e.getState(n.id);return c?.type==="label"?c.text:""},set text(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:c})},get"Text Color"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.textColor:"#000000"},set"Text Color"(c){e.getState(n.id)?.type==="label"&&e.setState(n.id,{text:l.text,options:{appearance:{textColor:c}}})},get"Text Size"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.textSize:10},set"Text Size"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{textSize:c}}})},get"Icon Size"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.iconSize:10},set"Icon Size"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{iconSize:c}}})},get"Pin Color"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinColor:"#000000"},set"Pin Color"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinColor:c}}})},get"Pin Color Inactive"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinColorInactive:"#000000"},set"Pin Color Inactive"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinColorInactive:c}}})},get"Pin Outline Color"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinOutlineColor:"#000000"},set"Pin Outline Color"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinOutlineColor:c}}})},get"Pin Outline Color Inactive"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinOutlineColorInactive:"#000000"},set"Pin Outline Color Inactive"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinOutlineColorInactive:c}}})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=e.getState(n.id);c?.type==="label"&&e.camera.focusOn([c.position])}),a.add(l,"interactive"),a.add(l,"text"),a.add(l,"Text Size",10,50),a.add(l,"Icon Size",10,50),a.addColor(l,"Text Color"),a.addColor(l,"Active Background Color"),a.addColor(l,"Inactive Background Color"),a.addColor(l,"Active Foreground Color"),a.addColor(l,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let l={get opacity(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.opacity:1},set opacity(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{opacity:c})},set visible(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{visible:c})},get visible(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.visible:!1},set outline(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{outline:c})},get outline(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.outline:!1},set altitude(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{altitude:c})},get altitude(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.altitude:0},set interactive(c){e.getState(n.id)?.type==="geometry-group"&&(e.setState(n,{interactive:c}),t.controllersRecursive().forEach(u=>u.updateDisplay()))},get interactive(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.interactive:!1},get shadingStart(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.shading?.start??0:0},set shadingStart(c){let p=e.getState(n.id);p?.type==="geometry-group"&&e.setState(p,{shading:{start:c}})},get shadingEnd(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.shading?.end??0:0},set shadingEnd(c){let p=e.getState(n.id);p?.type==="geometry-group"&&e.setState(p,{shading:{end:c}})},get shadingIntensity(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.shading?.intensity??0:0},set shadingIntensity(c){let p=e.getState(n.id);p?.type==="geometry-group"&&e.setState(p,{shading:{intensity:c}})}};a.add(l,"visible"),a.add(l,"opacity",0,1,.1),a.add(l,"interactive"),a.add(l,"outline"),a.add(l,"altitude",0,100,1),a.add(l,"shadingStart",0,1,.1),a.add(l,"shadingEnd",0,1,.1),a.add(l,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let l={set visible(c){e.getState(n.id)?.type==="group-container"&&e.setState(n,{visible:c})},get visible(){let c=e.getState(n.id);return c?.type==="group-container"?c.visible:!1},set interactive(c){let p=e.getState(n.id);p?.type==="group-container"&&(e.setState(p,{interactive:c}),t.controllersRecursive().forEach(u=>u.updateDisplay()))},get interactive(){let c=e.getState(n.id);return c?.type==="group-container"?c.interactive:!1}};a.add(l,"visible"),a.add(l,"interactive")}if(a.close(),n.children)for(let l of n.children.values())o(l,a)}}function mz(e,r){let t=r.addFolder("Watermark"),o={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};t.add(o,"padding",0,100,1),t.add(o,"scale",.5,1.5,.1),t.add(o,"color",["dark","light"]),t.add(o,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),t.add(o,"iconOnly"),t.onChange(()=>{e.updateWatermark(o)})}var H4="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",hz="https://auth.mappedin.com/oauth2/token";var Nx="";function oT(e){Nx=e,WC(e)}var Fc="";function nT(e){Fc=e}async function z4(e,r){let t=r?.useWorkers??!0,o={...r,watermark:r?.watermark,attribution:r?.attribution,antialias:r?.antialias,occlusionEnabled:r?.occlusionEnabled,transformImageRequest:r?.transformImageRequest,naturalBearing:r?.naturalBearing??0,imagePlacementOptions:r?.imagePlacementOptions,onWebGLContextCreationError:r?.onWebGLContextCreationError,onWebGLContextLost:r?.onWebGLContextLost,onWebGLContextRestored:r?.onWebGLContextRestored,onWebGLRendererError:r?.onWebGLRendererError,useStandaloneCamera:r?.useStandaloneCamera??!1,useCollisionWorker:r?.useCollisionWorker??!0,useWorkers:t};if(t===!0&&r?.outdoorView?.enabled){let{Map:n,MercatorCoordinate:i}=await import("./outdoor-context-v5-2BM4DXHN.js"),a=r.outdoorView.headers;a==null&&(a=await eM(hz));let l=r.center||[0,0],c=new n({container:e,style:r.outdoorView.style||H4,center:l,attributionControl:!1,zoom:r.zoomLevel??tT,pitch:r.pitch??q2,bearing:r.bearing??eT,transformRequest:JC(a),trackResize:!1,pixelRatio:r.outdoorView.lowDpi?1:Cp(),canvasContextAttributes:{antialias:typeof r.antialias=="boolean"?r.antialias:!0,powerPreference:"high-performance"},interactive:!1,validateStyle:!1,centerClampedToGround:!1,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),p=c.painter.context.gl,u=new rT(e,{center:l,zoomLevel:c.getZoom(),pitch:c.getPitch(),bearing:c.getBearing(),gl:p,map:c,mode:"outdoors-interleaved",...o}),f={center:c.getCenter().toArray(),zoom:c.getZoom(),bearing:c.getBearing(),pitch:c.getPitch(),elevation:c.getCenterElevation()};c.setMinZoom(u.camera.minZoomLevel),c.setMaxZoom(u.camera.maxZoomLevel),c.setMaxPitch(u.camera.maxPitch),c.setMinPitch(u.camera.minPitch),u.on("camera-change",E=>{f.center=E.center,f.zoom=E.zoomLevel,f.bearing=E.bearing,f.pitch=E.pitch,f.elevation=E.elevation,c.jumpTo(f)});let h=i.fromLngLat(l,0),b=qC(h,u.viewCamera,()=>{u.renderSync()}),v=async()=>{c&&(c.addLayer(b),u.renderSync())};u.onMapLibreEvent("style.load",v);let T=!1,x=!1,I=()=>{c&&(T||(u.publish("outdoor-view-loaded"),T=!0),x||(x=!0,u.publish("outdoor-style-loaded")))};u.onMapLibreEvent("idle",I);let M=E=>{E&&(E.sourceDataType==="metadata"||E.sourceDataType==="visibility"||E.dataType==="style"||E.type==="terrain")&&u.getSystems().htmlControlsSystem.updateData(c)},O=E=>{c&&E&&E.dataType==="style"&&E.type==="styledata"&&(x=!1),M(E)};u.onMapLibreEvent("styledata",O),u.onMapLibreEvent("sourcedata",M),u.onMapLibreEvent("terrain",M);let C=E=>{if(E.error?.url===H4){A.error(`Failed to load outdoor view style, possibly due to invalid token "${a["x-mappedin-tiles-key"]}"`);return}A.warn(E)};return u.onMapLibreEvent("error",C),u}else return new rT(e,o)}d();d();d();d();var Oh=class Oh{constructor(r,t,o){m(this,"id");m(this,"text");m(this,"target");m(this,"__type",Oh.__type);this.id=r,this.text=t,this.target=o}static is(r){return r.__type===Oh.__type}get focusTarget(){return this.target.anchorTarget}};m(Oh,"__type","label");var ha=Oh;d();var Wc,Lu=class Lu{constructor(r,t,o){m(this,"id");S(this,Wc);m(this,"__type",Lu.__type);m(this,"contentEl");this.id=r,this.contentEl=t,w(this,Wc,o)}get target(){return s(this,Wc)}get coordinate(){return s(this,Wc).anchorTarget}toJSON(){return{id:this.id,__type:Lu.__type,target:this.target,coordinate:this.coordinate}}static is(r){return r.__type===Lu.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(r){w(this,Wc,r)}};Wc=new WeakMap,m(Lu,"__type","marker");var us=Lu;d();var Ph,Fh,Eh=class Eh{constructor(r,t,o){S(this,Ph);S(this,Fh);m(this,"target");m(this,"__type",Eh.__type);w(this,Ph,r),w(this,Fh,t),this.target=o}static is(r){return r.__type===Eh.__type}get id(){return s(this,Ph)}get url(){return s(this,Fh)}};Ph=new WeakMap,Fh=new WeakMap,m(Eh,"__type","image-3d");var Zc=Eh;d();var Xc,_u=class _u{constructor(r,t,o){m(this,"id");m(this,"groupId");m(this,"__type",_u.__type);S(this,Xc);this.id=r,this.groupId=t,w(this,Xc,o)}get target(){return s(this,Xc)}static is(r){return r.__type===_u.__type}updateTarget(r){w(this,Xc,r)}toJSON(){return{id:this.id,__type:_u.__type,groupId:this.groupId,target:s(this,Xc)}}};Xc=new WeakMap,m(_u,"__type","model");var Yc=_u;d();var Dh=class Dh{constructor(r,t){m(this,"id");m(this,"coordinates");m(this,"__type",Dh.__type);this.id=r,this.coordinates=t}static is(r){return r.__type===Dh.__type}get focusTarget(){return this.coordinates}};m(Dh,"__type","path-segment");var Bu=Dh,Ru=class Ru{constructor(r,t,o,n){m(this,"id");m(this,"animation");m(this,"coordinates");m(this,"segments");m(this,"__type",Ru.__type);this.id=r,this.animation=t,this.coordinates=o,this.segments=n.map(({id:i,coordinates:a})=>new Bu(i.toString(),a))}static is(r){return r.__type===Ru.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:Ru.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};m(Ru,"__type","path");var Nn=Ru;d();var gz=7,Ol,Jc,kh=class{constructor(r,t){S(this,Ol);S(this,Jc);w(this,Ol,r),w(this,Jc,t?.precision??gz)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){let r=s(this,Ol).center;if(s(this,Jc)===-1)return r;let t=Di(r.latitude,s(this,Jc)),o=Di(r.longitude,s(this,Jc));return new fe({latitude:t,longitude:o,floorId:r.floorId,verticalOffset:r.verticalOffset})}get bearing(){return s(this,Ol).bearing}get pitch(){return s(this,Ol).pitch}get zoomLevel(){return Di(s(this,Ol).zoomLevel,5)}};Ol=new WeakMap,Jc=new WeakMap;d();var Ah=class Ah{constructor(r){m(this,"id");m(this,"__type",Ah.__type);this.id=r}static is(r){return r.__type===Ah.__type}get focusTarget(){return this}};m(Ah,"__type","shape");var ga=Ah;d();var Lh=class Lh{constructor(r,t){m(this,"id");m(this,"target");m(this,"__type",Lh.__type);this.id=r,this.target=t}static is(r){return r.__type===Lh.__type}};m(Lh,"__type","text-3d");var El=Lh;d();d();d();var yz=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
|
|
510
|
+
<path
|
|
511
|
+
fillRule="evenodd"
|
|
512
|
+
clipRule="evenodd"
|
|
513
|
+
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"
|
|
514
|
+
stroke="none"
|
|
515
|
+
/>
|
|
516
|
+
</svg>`],["close-16x16",`<svg viewBox="0 0 16 16">
|
|
517
|
+
<path
|
|
518
|
+
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"
|
|
519
|
+
stroke="none"
|
|
520
|
+
/>
|
|
521
|
+
<path
|
|
522
|
+
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"
|
|
523
|
+
stroke="none"
|
|
524
|
+
/>
|
|
525
|
+
</svg>`],["empty-64x40",`<svg viewBox="0 0 64 40">
|
|
526
|
+
<g>
|
|
527
|
+
<g clipPath="url(#clip0_499_175492)">
|
|
528
|
+
<path
|
|
529
|
+
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"
|
|
530
|
+
stroke="none"
|
|
531
|
+
fill="#F5F5F5"
|
|
532
|
+
/>
|
|
533
|
+
<path
|
|
534
|
+
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"
|
|
535
|
+
fill="none"
|
|
536
|
+
/>
|
|
537
|
+
<path
|
|
538
|
+
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"
|
|
539
|
+
fill="#FAFAFA"
|
|
540
|
+
/>
|
|
541
|
+
</g>
|
|
542
|
+
<defs>
|
|
543
|
+
<clipPath id="clip0_499_175492">
|
|
544
|
+
<rect width="64" height="40" fill="white" />
|
|
545
|
+
</clipPath>
|
|
546
|
+
</defs>
|
|
547
|
+
</g>
|
|
548
|
+
</svg>`],["caret-12x12",`<svg viewBox="0 0 12 12">
|
|
549
|
+
<path
|
|
550
|
+
stroke="none"
|
|
551
|
+
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"
|
|
552
|
+
/>
|
|
553
|
+
</svg>`],["plus-16x16",`<svg viewBox="0 0 16 16">
|
|
554
|
+
<path
|
|
555
|
+
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"
|
|
556
|
+
stroke="none"
|
|
557
|
+
/>
|
|
558
|
+
</svg>`],["recenter-16x16",`<svg viewBox="0 0 16 16">
|
|
559
|
+
<g stroke="none">
|
|
560
|
+
<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" />
|
|
561
|
+
<path
|
|
562
|
+
fillRule="evenodd"
|
|
563
|
+
clipRule="evenodd"
|
|
564
|
+
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"
|
|
565
|
+
/>
|
|
566
|
+
<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" />
|
|
567
|
+
</g>
|
|
568
|
+
</svg>`],["minus-16x16",`<svg viewBox="0 0 16 16">
|
|
569
|
+
<path
|
|
570
|
+
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"
|
|
571
|
+
stroke="none"
|
|
572
|
+
/>
|
|
573
|
+
</svg>`],["logo-horizontal-206x48",`<svg viewBox="0 0 206 48">
|
|
574
|
+
<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" />
|
|
575
|
+
<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" />
|
|
576
|
+
<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" />
|
|
577
|
+
<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" />
|
|
578
|
+
</svg>`],["share-16x16",`<svg viewBox="0 0 16 16">
|
|
579
|
+
<path
|
|
580
|
+
fillRule="evenodd"
|
|
581
|
+
clipRule="evenodd"
|
|
582
|
+
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"
|
|
583
|
+
stroke="none"
|
|
584
|
+
/>
|
|
585
|
+
</svg>`],["checkmark-16x16",`<svg viewBox="0 0 16 16">
|
|
586
|
+
<path
|
|
587
|
+
fillRule="evenodd"
|
|
588
|
+
clipRule="evenodd"
|
|
589
|
+
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"
|
|
590
|
+
stroke="none"
|
|
591
|
+
/>
|
|
592
|
+
</svg>`],["arrow-right-16x16",`<svg viewBox="0 0 16 16">
|
|
593
|
+
<path
|
|
594
|
+
fillRule="evenodd"
|
|
595
|
+
clipRule="evenodd"
|
|
596
|
+
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"
|
|
597
|
+
stroke="none"
|
|
598
|
+
/>
|
|
599
|
+
</svg>`],["arrow-up-16x16",`<svg viewBox="0 0 16 16">
|
|
600
|
+
<path
|
|
601
|
+
fillRule="evenodd"
|
|
602
|
+
clipRule="evenodd"
|
|
603
|
+
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"
|
|
604
|
+
stroke="none"
|
|
605
|
+
/>
|
|
606
|
+
</svg>`],["connection-stairs-16x16",`<svg viewBox="0 0 16 16">
|
|
607
|
+
<g stroke="none">
|
|
608
|
+
<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" />
|
|
609
|
+
<path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />
|
|
610
|
+
<path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />
|
|
611
|
+
<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" />
|
|
612
|
+
</g>
|
|
613
|
+
</svg>`],["connection-stairs-14x14",`<svg viewBox="0 0 14 14">
|
|
614
|
+
<path
|
|
615
|
+
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"
|
|
616
|
+
stroke="none"
|
|
617
|
+
/>
|
|
618
|
+
</svg>`],["connection-stairs-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
619
|
+
<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" />
|
|
620
|
+
<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" />
|
|
621
|
+
<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" />
|
|
622
|
+
<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" />
|
|
623
|
+
</svg>`],["connection-escalator-16x16",`<svg viewBox="0 0 16 16">
|
|
624
|
+
<g stroke="none">
|
|
625
|
+
<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" />
|
|
626
|
+
<path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />
|
|
627
|
+
<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" />
|
|
628
|
+
</g>
|
|
629
|
+
</svg>`],["connection-escalator-14x14",`<svg viewBox="0 0 14 14">
|
|
630
|
+
<path
|
|
631
|
+
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"
|
|
632
|
+
stroke="none"
|
|
633
|
+
/>
|
|
634
|
+
<path
|
|
635
|
+
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"
|
|
636
|
+
stroke="none"
|
|
637
|
+
/>
|
|
638
|
+
</svg>`],["connection-elevator-16x16",`<svg viewBox="0 0 16 16">
|
|
639
|
+
<g stroke="none">
|
|
640
|
+
<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" />
|
|
641
|
+
<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" />
|
|
642
|
+
<path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />
|
|
643
|
+
<path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />
|
|
644
|
+
</g>
|
|
645
|
+
</svg>`],["connection-elevator-14x14",`<svg viewBox="0 0 14 14">
|
|
646
|
+
<path
|
|
647
|
+
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"
|
|
648
|
+
stroke="none"
|
|
649
|
+
/>
|
|
650
|
+
<path
|
|
651
|
+
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"
|
|
652
|
+
stroke="none"
|
|
653
|
+
/>
|
|
654
|
+
<path
|
|
655
|
+
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"
|
|
656
|
+
stroke="none"
|
|
657
|
+
/>
|
|
658
|
+
</svg>`],["connection-elevator-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
659
|
+
<circle cx="1.9375" cy="4.4375" r="0.9375" />
|
|
660
|
+
<circle cx="1.9375" cy="7.5625" r="0.9375" />
|
|
661
|
+
<path
|
|
662
|
+
fillRule="evenodd"
|
|
663
|
+
clipRule="evenodd"
|
|
664
|
+
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"
|
|
665
|
+
/>
|
|
666
|
+
</svg>`],["new-tab-14x14",`<svg viewBox="0 0 14 14">
|
|
667
|
+
<g stroke="none">
|
|
668
|
+
<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" />
|
|
669
|
+
<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" />
|
|
670
|
+
</g>
|
|
671
|
+
</svg>`],["compress-16x16",`<svg viewBox="0 0 16 16">
|
|
672
|
+
<g stroke="none">
|
|
673
|
+
<path
|
|
674
|
+
id="Vector"
|
|
675
|
+
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"
|
|
676
|
+
/>
|
|
677
|
+
</g>
|
|
678
|
+
</svg>`],["washroom-14x14",`<svg viewBox="0 0 14 14" stroke="none">
|
|
679
|
+
<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" />
|
|
680
|
+
<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" />
|
|
681
|
+
<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" />
|
|
682
|
+
<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" />
|
|
683
|
+
<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" />
|
|
684
|
+
</svg>`],["point-of-interest-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
685
|
+
<path
|
|
686
|
+
stroke="none"
|
|
687
|
+
id="Subtract"
|
|
688
|
+
// Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs
|
|
689
|
+
fill-rule="evenodd"
|
|
690
|
+
clip-rule="evenodd"
|
|
691
|
+
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"
|
|
692
|
+
/>
|
|
693
|
+
</svg>`],["flag-20x20",`<svg viewBox="0 0 20 20" stroke="none">
|
|
694
|
+
<path
|
|
695
|
+
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"
|
|
696
|
+
stroke="none"
|
|
697
|
+
/>
|
|
698
|
+
</svg>`],["link-16x16",`<svg viewBox="0 0 16 16" stroke="none">
|
|
699
|
+
<path
|
|
700
|
+
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"
|
|
701
|
+
stroke="none"
|
|
702
|
+
/>
|
|
703
|
+
</svg>`]]),bz=/<svg([^>]*)>/g;function W4(e,r,t){let o=yz.get(e);return o?o.replace(bz,`<svg$1 style="fill:${r}; width:${t}px; height:${t}px">`):""}var xz=e=>`
|
|
704
|
+
<div class="pin-shadow" style="background: ${e}"></div>
|
|
705
|
+
<svg width="${20*.9}px" height="${48*.9}px" viewBox="0 0 20 48">
|
|
706
|
+
<path
|
|
707
|
+
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"
|
|
708
|
+
fill="${e}"
|
|
709
|
+
stroke="white"
|
|
710
|
+
strokeWidth="2"
|
|
711
|
+
/>
|
|
712
|
+
</svg>
|
|
713
|
+
`,vz=e=>`
|
|
714
|
+
<div class="pin-shadow" style="background: ${e}"></div>
|
|
715
|
+
<svg width="36" height="42" viewBox="-2 -2 40 46">
|
|
716
|
+
<path
|
|
717
|
+
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"
|
|
718
|
+
fill="none"
|
|
719
|
+
stroke="white"
|
|
720
|
+
strokeWidth="4"
|
|
721
|
+
/>
|
|
722
|
+
<path
|
|
723
|
+
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"
|
|
724
|
+
fill="${e}"
|
|
725
|
+
/>
|
|
726
|
+
</svg>
|
|
727
|
+
`,iT="#722ED1",sT="#1890FF",Z4=({type:e="departure",color:r=sT})=>`<div class="dropped-pin-wrapper">
|
|
728
|
+
${e==="departure"?xz(r):vz(r)}
|
|
729
|
+
</div>`,Iz=e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},X4=({type:e="stairs",color:r=iT,direction:t="up"})=>{let o=Iz("default"),n=o/2+2,i=t&&t!=="none";return`<div class="mappedin-connection-marker">
|
|
730
|
+
<div class="connection-circle"
|
|
731
|
+
role="button"
|
|
732
|
+
style="background:${r}; width:${o}px; height:${o}px;"
|
|
733
|
+
>
|
|
734
|
+
${W4("connection-"+e+"-16x16","white",n)||""}
|
|
735
|
+
</div>
|
|
736
|
+
${i?`<div style="margin-left: -${o*.2}px;">
|
|
737
|
+
<div class="bouncey">
|
|
738
|
+
<div class="connection-circle"
|
|
739
|
+
role="button"
|
|
740
|
+
style="width: ${o}px; height: ${o}px;">
|
|
741
|
+
<div class="${t==="up"?"":"arrow--down"}">
|
|
742
|
+
<svg viewBox="0 0 16 16" style="fill: white; width: ${n}px; height: ${n}px">
|
|
743
|
+
<path
|
|
744
|
+
fillRule="evenodd"
|
|
745
|
+
clipRule="evenodd"
|
|
746
|
+
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"
|
|
747
|
+
stroke="none"
|
|
748
|
+
/>
|
|
749
|
+
</svg>
|
|
750
|
+
</div>
|
|
751
|
+
</div>
|
|
752
|
+
</div>
|
|
753
|
+
</div>`:""}
|
|
754
|
+
</div>`};d();var Y4=async e=>new Promise(r=>setTimeout(r,e));var Sz=.01,Tz=.02,Cz={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},Mz={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},Pl={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:Cz,inactivePathOptions:Mz,markerOptions:{departureColor:sT,destinationColor:iT},animatePathDrawing:!0},ya,ms,jn,$e,Nh,ba,Kc,nr,$o,lo,Gn,Fl,ot,J4,K4,_h,Q4,aT,Rh,jx,Nu,lT,ju,Bh=class{constructor(r,t,o){S(this,ot);S(this,ya,new Map);S(this,ms);S(this,jn);S(this,$e,Pl);S(this,Nh);S(this,ba);S(this,Kc);S(this,nr,[]);S(this,$o);S(this,lo,new Map);S(this,Gn,new Map);S(this,Fl,new Map);S(this,ju,r=>{if(s(this,$e).createMarkers?.connection&&r.markers.length>0){let{instruction:t}=s(this,ya).get(r.markers[0]);t?.action.toFloor&&(s(this,$e).setMapOnConnectionClick&&this.currentMap.setFloor(t.action.toFloor.id,"navigation-connection-click"),s(this,jn).publish("navigation-connection-click",{instruction:t,fromFloor:t.action.fromFloor,toFloor:t.action.toFloor}))}});w(this,ms,r),w(this,Nh,o),w(this,jn,t)}get currentMap(){return s(this,Nh).call(this)}get isMultiFloor(){if(!s(this,nr).length)return!1;let r=new Set;for(let t of s(this,nr))for(let o of t.coordinates)if(o.floorId&&(r.add(o.floorId),r.size>1))return!0;return!1}getPathById(r){return s(this,lo).get(r)}getMarkerById(r){return s(this,ya).get(r)}get paths(){let r=new Set;return s(this,lo).forEach(({path:t})=>r.add(t)),Array.from(r)}get activeDirections(){return s(this,Fl).get(s(this,$o))}get activePath(){if(s(this,$o))return s(this,lo).get(s(this,$o).id)?.path}get floorStacks(){let r=s(this,jn).getMapData();if(!s(this,nr).length||!r)return[];let t=new Set;for(let o of s(this,nr))for(let n of o.coordinates)if(n.floorId){let i=r.getById("floor",n.floorId);i&&t.add(i.floorStack)}return Array.from(t)}get floors(){let r=s(this,jn).getMapData();if(!s(this,nr).length||!r)return[];let t=new Set;for(let o of s(this,nr))for(let n of o.coordinates)if(n.floorId){let i=r.getById("floor",n.floorId);i&&t.add(i)}return Array.from(t)}setActivePathByIndex(r){let t=s(this,nr)[r];if(!s(this,nr).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,nr)[r]){A.warn(`Direction #${r} does not exist`);return}let o=s(this,Gn).get(t);if(!o){A.warn("The direction is not a part of muli-direcional path");return}W(this,ot,jx).call(this,o)}setActivePath(r){if(!s(this,nr).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,Fl).get(r)){A.warn(`Path "${r.id}" is not a part of muli-direcional path`);return}W(this,ot,jx).call(this,r)}setActivePathByDirections(r){if(!s(this,nr).length){A.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let t=s(this,Gn).get(r);if(!t){let o=s(this,nr).find(n=>n.id===r.id);if(!o){A.warn("[setActivePathByDirections] Cannot find directions for id");return}t=s(this,Gn).get(o)}if(!t){A.warn("[setActivePathByDirections] Cannot find path for directions");return}W(this,ot,jx).call(this,t)}drawSync(r,t={}){s(this,Kc)&&this.clear(),w(this,Kc,!0),W(this,ot,aT).call(this,t);let o=Array.isArray(r)?r:[r],n=o[0],i=o[o.length-1],a=n.coordinates[0];w(this,nr,o),a.floorId&&s(this,$e).setMapToDeparture&&this.currentMap.setFloor(a.floorId),s(this,$e).createMarkers?.departure&&W(this,ot,Nu).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let l=0;l<o.length;l++){let c=o[l],p=l?{...s(this,$e).inactivePathOptions}:{...s(this,$e).pathOptions};if(c.coordinates.length<2){A.warn("Directions must have at least 2 coordinates");return}let u=this.currentMap.Paths.add(c.coordinates,{...p,animateDrawing:s(this,$e).animatePathDrawing,verticalOffset:W(this,ot,_h).call(this,l===0?"active":"inactive")}),f=u.paths.map(b=>b.id.toString()),h=new Nn(ut(),u.animation,c.coordinates,u.paths);for(let b of f){s(this,lo).set(b,{path:h,entityIds:f});let v=l?{...s(this,$e).inactivePathOptions}:{...s(this,$e).pathOptions};s(this,ms).setState(b,v)}s(this,lo).set(h.id,{path:h,entityIds:f}),s(this,Gn).set(c,h),s(this,Fl).set(h,c),s(this,$e).createMarkers?.connection&&W(this,ot,lT).call(this,c.instructions,"connection"),l===0&&(w(this,$o,s(this,Gn).get(s(this,nr)[0])),s(this,ms).on("click",s(this,ju)))}s(this,$e).createMarkers?.destination&&W(this,ot,Nu).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),s(this,jn).mapObjects.forEach(l=>{l.processFloorChange(l.currentFloorId)}),W(this,ot,Rh).call(this)}async draw(r,t={}){s(this,ba)&&this.clear(),W(this,ot,aT).call(this,t);let o=Array.isArray(r)?r:[r],i=o[0].coordinates[0];return w(this,nr,o),i.floorId&&s(this,$e).setMapToDeparture&&this.currentMap.setFloor(i.floorId),W(this,ot,Q4).call(this,o)}clear(){s(this,ya).forEach((r,t)=>{this.currentMap.Markers.remove(t.toString())}),s(this,ya).clear(),s(this,lo).forEach(({path:r,entityIds:t})=>{s(this,lo).delete(r.id),t.forEach(o=>s(this,lo).delete(o)),this.currentMap.Paths.remove(t)}),s(this,ba)&&(s(this,ba).cancel(),w(this,ba,void 0)),s(this,Kc)&&w(this,Kc,!1),w(this,nr,[]),s(this,Gn).clear(),s(this,Fl).clear(),w(this,$o,void 0),s(this,ms).off("click",s(this,ju)),s(this,jn).mapObjects.forEach(r=>{r.processFloorChange(r.currentFloorId)}),W(this,ot,Rh).call(this)}};ya=new WeakMap,ms=new WeakMap,jn=new WeakMap,$e=new WeakMap,Nh=new WeakMap,ba=new WeakMap,Kc=new WeakMap,nr=new WeakMap,$o=new WeakMap,lo=new WeakMap,Gn=new WeakMap,Fl=new WeakMap,ot=new WeakSet,J4=function(r){return r!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(r.type)},K4=function(){if(!s(this,$o))return;let r=s(this,lo).get(s(this,$o).id);if(r)for(let t of s(this,lo).values())if(t.path.id===s(this,$o).id)for(let o of r.path.segments)this.currentMap.api.updateState(o,{verticalOffset:W(this,ot,_h).call(this,"active")});else this.currentMap.api.updateState(t.path,{verticalOffset:W(this,ot,_h).call(this,"inactive")})},_h=function(r){return r==="active"?Tz+(s(this,$e).pathOptions?.verticalOffset??0):Sz+(s(this,$e).inactivePathOptions?.verticalOffset??0)},Q4=function(r){let t=r[0],o=r[r.length-1],n=!1;return w(this,ba,{promise:new Promise(async i=>{if(y.env.NODE_ENV!=="test"&&await Y4(500),n||!r.length){i();return}s(this,$e).createMarkers?.departure&&W(this,ot,Nu).call(this,t.coordinates[0],"departure",t.instructions[0]);for(let a=0;a<r.length;a++){let l=r[a],c=a===0?{...s(this,$e).pathOptions}:{...s(this,$e).inactivePathOptions};if(l.coordinates.length<2){A.warn("Directions must have at least 2 coordinates"),i();return}let p=this.currentMap.Paths.add(l.coordinates,{...c,animateDrawing:s(this,$e).animatePathDrawing,verticalOffset:W(this,ot,_h).call(this,a===0?"active":"inactive")}),u=p.paths.map(h=>h.id.toString()),f=new Nn(ut(),p.animation,l.coordinates,p.paths);for(let h of u)s(this,lo).set(h,{path:f,entityIds:u});if(s(this,lo).set(f.id,{path:f,entityIds:u}),s(this,Gn).set(l,f),s(this,Fl).set(f,l),a===0&&(w(this,$o,s(this,Gn).get(s(this,nr)[0])),s(this,ms).on("click",s(this,ju))),y.env.NODE_ENV!=="test"&&await p.animation,n){i();return}s(this,$e).createMarkers?.connection&&W(this,ot,lT).call(this,l.instructions,"connection")}if(s(this,$e).createMarkers?.destination&&W(this,ot,Nu).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),n){i();return}s(this,jn).mapObjects.forEach(a=>{a.processFloorChange(a.currentFloorId)}),W(this,ot,Rh).call(this),i()}),cancel:()=>{n=!0}}),s(this,ba).promise},aT=function(r){w(this,$e,{setMapOnConnectionClick:r.setMapOnConnectionClick??Pl.setMapOnConnectionClick,setMapToDeparture:r.setMapToDeparture??Pl.setMapToDeparture,pathOptions:{...Pl.pathOptions,...r.pathOptions},inactivePathOptions:{...Pl.inactivePathOptions,...r.inactivePathOptions},createMarkers:{...Pl.createMarkers,...r.createMarkers},markerOptions:{...Pl.markerOptions,...r.markerOptions},animatePathDrawing:r.animatePathDrawing??Pl.animatePathDrawing})},Rh=function(){s(this,jn).publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},jx=function(r){w(this,$o,r),s(this,nr).forEach(t=>{let o=s(this,Gn).get(t);if(o){let n=s(this,lo).get(o.id),i=n.path.id===s(this,$o).id?{...s(this,$e).pathOptions}:{...s(this,$e).inactivePathOptions};n.entityIds.forEach(a=>{s(this,ms).setState(a,i)})}}),s(this,jn).publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),W(this,ot,K4).call(this),W(this,ot,Rh).call(this)},Nu=function(r,t,o){if(t==="connection"&&o){let n=o.action.type==="ExitConnection"?s(this,$e).markerOptions.departureColor:s(this,$e).markerOptions.destinationColor,i;if(typeof s(this,$e).createMarkers?.connection=="function"){let l=s(this,$e).createMarkers.connection(o);s(this,ms).setState(l.id.toString(),{options:{interactive:!0}}),i={id:l.id,type:"marker"}}else i=this.currentMap.Markers.add(o.coordinate,X4({type:o.action.connection?.type??o.action.connectionType,color:n,direction:o.action.direction}),{interactive:!0,placement:"top",rank:"always-visible"});let a=this.currentMap.Markers.getContentEl(i.id.toString());if(!a)throw new Error("marker component should exist");s(this,ya).set(i.id,{instruction:o,marker:new us(i.id.toString(),a,o.coordinate)})}else{let n=t==="departure"?s(this,$e).markerOptions.departureColor:s(this,$e).markerOptions.destinationColor,i;typeof s(this,$e).createMarkers?.departure=="function"&&t==="departure"?i={id:s(this,$e).createMarkers.departure(o).id,type:"marker"}:typeof s(this,$e).createMarkers?.destination=="function"&&t==="destination"?i={id:s(this,$e).createMarkers.destination(o).id,type:"marker"}:i=this.currentMap.Markers.add(r,Z4({type:t,color:n}),{placement:"top",rank:"always-visible"}),s(this,ya).set(i.id,void 0)}},lT=function(r,t){r.filter(n=>W(this,ot,J4).call(this,n.action)).forEach(n=>{W(this,ot,Nu).call(this,n.coordinate,t,n)})},ju=new WeakMap;d();var Te,Gh,xa,Gx,cT,jh=class{constructor(r){S(this,xa);S(this,Te);S(this,Gh);m(this,"interactions",{set:r=>{r?.pan!=null&&(s(this,Te).getSystems().cameraSystem.enablePan=r.pan),r?.zoom!=null&&(s(this,Te).getSystems().cameraSystem.enableZoom=r.zoom),r?.bearingAndPitch!=null&&(s(this,Te).getSystems().cameraSystem.enableRotate=r.bearingAndPitch)},enable:()=>{s(this,Te).getSystems().cameraSystem.enablePan=!0,s(this,Te).getSystems().cameraSystem.enableZoom=!0,s(this,Te).getSystems().cameraSystem.enableRotate=!0},disable:()=>{s(this,Te).getSystems().cameraSystem.enablePan=!1,s(this,Te).getSystems().cameraSystem.enableZoom=!1,s(this,Te).getSystems().cameraSystem.enableRotate=!1}});m(this,"setMinPitch",r=>{s(this,Te).camera.setMinPitch(r)});m(this,"setMaxPitch",r=>{s(this,Te).camera.setMaxPitch(r)});m(this,"setMinZoomLevel",r=>{s(this,Te).camera.setMinZoomLevel(r,!0)});m(this,"setMaxZoomLevel",r=>{s(this,Te).camera.setMaxZoomLevel(r)});w(this,Gh,r),w(this,Te,r.core)}setScreenOffsets(r){s(this,Te).camera.setInsetPadding(r)}get screenOffsets(){return s(this,Te).camera.insetsPadding}get panMode(){return s(this,Te).camera.panMode}setPanMode(r){if(r!=="default"&&r!=="elevation")throw new Error("Invalid pan mode");r!==this.panMode&&s(this,Te).camera.setPanMode(r)}getFocusOnTransform(r,t){let o=s(this,Te).camera.getCameraFrameForCoordinates(W(this,xa,cT).call(this,r),{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});return{center:new fe(o.center[1],o.center[0]),zoomLevel:o.zoomLevel,bearing:t?.bearing??this.bearing,pitch:t?.pitch??this.pitch}}focusOn(r,t){return s(this,Te).camera.focusOn(W(this,xa,cT).call(this,r),{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(r,t){let{center:o,zoomLevel:n,bearing:i,pitch:a}=r,l=o??this.center;return s(this,Te).camera.animateTo({center:o!=null?[l.longitude,l.latitude,s(this,Te).camera.elevation]:void 0,zoomLevel:n,bearing:i,pitch:a,duration:t?.duration??600,easing:t?.easing})}set(r){let{center:t=this.center,zoomLevel:o=this.zoomLevel,bearing:n=this.bearing,pitch:i=this.pitch}=r,a=[t.longitude,t.latitude];s(this,Te).camera.setCenter(a),s(this,Te).camera.setZoomLevel(o),s(this,Te).camera.setBearing(n),s(this,Te).camera.setPitch(i)}get center(){let r=s(this,Te).camera.center;return new fe(r[1],r[0],void 0)}setAutoMinZoomLevel(r){s(this,Te).camera.setAutoMinZoomLevel(r)}get autoMinZoomLevel(){return s(this,Te).camera.autoMinZoomLevel}get zoomLevel(){return s(this,Te).camera.zoomLevel}get pitch(){return s(this,Te).camera.pitch}get minPitch(){return s(this,Te).camera.minPitch}get maxPitch(){return s(this,Te).camera.maxPitch}get bearing(){let r=s(this,Te).camera.bearing;return(r<0?r+360:r)%360}get minZoomLevel(){return s(this,Te).camera.minZoomLevel}get maxZoomLevel(){return s(this,Te).camera.maxZoomLevel}setElevation(r){s(this,Te).camera.setElevation(r)}get elevation(){return s(this,Te).camera.elevation}animateElevation(r,t){return s(this,Te).camera.animateElevation(r,t)}updateFacadesInView(){s(this,Te).getSystems().geometryInFocusSystem.raycast()}};Te=new WeakMap,Gh=new WeakMap,xa=new WeakSet,Gx=function(r){let t=s(this,Te).camera.elevation;return fe.is(r)&&r.floorId!=null?s(this,Te).getState(r.floorId)?.altitude??t:Bo.is(r)?s(this,Te).getState(r.id)?.altitude??t:"floor"in r&&Bo.is(r.floor)?s(this,Te).getState(r.floor.id)?.altitude??t:t},cT=function(r){let t=[],n=(Array.isArray(r)?r:[r]).flatMap(i=>i?.focusTarget??[i]);for(let i of n)if(i!=null)if(fe.is(i)){let a=W(this,xa,Gx).call(this,i);t.push([i.longitude,i.latitude,a])}else if(i?.id!=null){let a=W(this,xa,Gx).call(this,i);if(Bo.is(i)&&s(this,Gh).getMapDataInternal()?.enterpriseMode){t.push(i.id);continue}else if("geoJSON"in i&&i.geoJSON.geometry.coordinates.length>0){BC(i.geoJSON,c=>{t.push([c[0],c[1],a])});continue}let l=s(this,Te).getBoundingArea(i.id);if(l)t.push(...l.map(c=>[c[0],c[1],a]));else if("geoJSONBoundingBox"in i){let c=W(this,xa,Gx).call(this,i);if(i.geoJSONBoundingBox!=null){let p=[[i.geoJSONBoundingBox[0],i.geoJSONBoundingBox[1],c],[i.geoJSONBoundingBox[2],i.geoJSONBoundingBox[3],c]];t.push(...p)}}}else NS(i)&&t.push(i);return t};d();var Gu,Uh=class{constructor({currentMapGetter:r}){S(this,Gu);w(this,Gu,r)}get currentMap(){return s(this,Gu).call(this)}async getCurrentSceneGLTF(r){let t=s(this,Gu).call(this);return t?t?.Exporter.getCurrentSceneGLTF(r):(A.error("There is no map to export. Please load a map first."),new Blob)}};Gu=new WeakMap;d();var vi,$h,Vh=class{constructor({currentMapGetter:r}){S(this,vi,new Map);S(this,$h);w(this,$h,r)}get currentMap(){return s(this,$h).call(this)}getAll(){return Array.from(s(this,vi).values()).map(r=>r.label)}getById(r){return s(this,vi).get(r)}add(r,t,o){let n=r.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Labels.add(n,t,{...o,attachTo:su(r),rank:o?.rank==null||o?.rank==="initial"?"medium":o.rank}),l=new ha(a.id.toString(),t,r);return s(this,vi).set(l.id,{label:l,entityId:l.id}),l}__EXPERIMENTAL__all(r){let t=[];return this.currentMap?.Labels.all({onCreate:(o,n,i)=>{let a=new ha(o.toString(),n,i);s(this,vi).set(a.id,{label:a,entityId:a.id}),t.push(a)},labelOptions:r}),t}remove(r){let t=s(this,vi).get(r.id);t&&(this.currentMap?.Labels.remove(t),s(this,vi).delete(r.id.toString()))}removeAll(){let r=[];return s(this,vi).forEach(({label:t})=>{this.remove(t),r.push(t),s(this,vi).delete(t.id.toString())}),r}};vi=new WeakMap,$h=new WeakMap;d();d();var Ux={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},q4={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},ek={color:"red",opacity:.2,height:Ux.height+.1,visible:!0,borderVisible:!1},tk=.5,Ii=class{constructor(r,t,o=new Map){m(this,"containerId");m(this,"layers");m(this,"renderer");this.containerId=t,this.layers=o,this.renderer=r}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(r){this.renderer.setState(this.containerId,{visible:r})}},rk=0,Qc,Hh=class{constructor(r,t,o,n,i,a,l,c){m(this,"id");m(this,"name");m(this,"elevation");m(this,"containerId");m(this,"externalId");m(this,"metadata");m(this,"shortName");m(this,"subtitle");m(this,"occluderId");m(this,"loaded",!1);m(this,"styleMap",{});m(this,"obstructions");m(this,"entrances");m(this,"spaces");m(this,"floorImages");m(this,"floorText");m(this,"areas");m(this,"renderer");m(this,"mapObject");m(this,"options");m(this,"layers",new Map);m(this,"footprint");m(this,"floorStackId");m(this,"multiFloorView");m(this,"mapDataInternal");m(this,"facadesByStyleId",new Map);S(this,Qc);m(this,"load",()=>{if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let r=this.renderer.addGroupContainer(`${rs}-${this.id}`,{},this.id);this.layers.set(rs,new Ii(this.renderer,r.id.toString()));let t=this.renderer.addGroupContainer(`${li}-${this.id}`,{},this.id);this.layers.set(li,new Ii(this.renderer,t.id.toString()));let o=this.renderer.addGroupContainer(`${rr}-${this.id}`,{},this.id);this.layers.set(rr,new Ii(this.renderer,o.id.toString()));let n=this.renderer.addGroupContainer(`${os}-${this.id}`,{},this.id);if(this.layers.set(os,new Ii(this.renderer,n.id.toString())),this.footprint?.geometry!=null&&this.footprint?.geometry.coordinates.length!==0){let i=Ux;if(this.obstructions!=null&&this.obstructions.features.length>0){let c=this.obstructions.features.filter(p=>p.geometry.type==="LineString"&&p.properties.kind?.toLowerCase()==="wall"&&p.properties.footprintComponent===!0);c!=null&&c.length>0&&(i=this.styleMap[c[0].properties?.id])}let a=this.renderer.addGeometryGroup(`Footprint-${this.id}`,{features:[{geometry:this.footprint.geometry,properties:{id:`Footprint-Floor-${this.id}`}}]},{...i,height:this.multiFloorView?.floorGap??10,altitude:0,outline:this.options.style?.outlines??!0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":i.color,renderOrder:2},this.id);this.layers.set($d,new Ii(this.renderer,a.id.toString()));let l=this.renderer.addGroupContainer(`${al}-${this.id}`,{},this.id);this.layers.set(al,new Ii(this.renderer,l.id.toString()))}if(this.spaces!=null&&this.spaces.features.length>0){let i=[],a=new Map;this.spaces.features.filter(u=>u.geometry.type==="Polygon"&&u.properties.kind?.toLowerCase()!=="void").forEach(u=>{let f=this.mapDataInternal?.facadesBySpaceId[u.properties.id];if(f){let h=a.get(f.id)||[];a.set(f.id,[...h,u])}else i.push(u)});let l=y1(i,this.styleMap),c=this.renderer.addGroupContainer(`spaces-${this.id}`,{},o),p=0;for(let[u,f]of l){let h=this.renderer.addGeometryGroup(`Spaces-${this.id}-${p}`,{features:f},iu(u,this.options),c);p++;let b=c.id.toString();this.layers.get(rr).layers.set(u.id||b,h.id.toString())}if(a.size>0){let u=this.renderer.addGroupContainer(`${hc}-${this.id}`,{},this.id);this.layers.set(hc,new Ii(this.renderer,u.id.toString()));for(let[f,h]of a){let b=this.renderer.addGroupContainer(f,{focusable:!0},u),v=this.renderer.addGroupContainer(`${f}-geometry`,{},b),T=y1(h,this.styleMap),x=0;for(let[I,M]of T){let O=this.renderer.addGeometryGroup(`Facades-${this.id}-${f}-${x}`,{features:M},{...iu(I,this.options),renderOrder:3},v);x++;let C=I.id||O.id.toString();this.layers.get(hc).layers.set(`${f}-${C}`,O.id.toString()),this.facadesByStyleId.has(C)?this.facadesByStyleId.get(C)?.push(f):this.facadesByStyleId.set(C,[f])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let i=this.obstructions.features.filter(v=>v.geometry.type==="Polygon"&&(v.properties.kind==="object"||v.properties.kind==="unknown")),a=y1(i,this.styleMap),l=this.renderer.addGroupContainer(`objects-${this.id}`,{},o),c=0;for(let[v,T]of a){let x=this.renderer.addGeometryGroup(`Objects-${this.id}-${c}`,{features:T},iu(v,this.options),l);c++;let I=l.id.toString();this.layers.get(rr).layers.set(v.id||I,x.id.toString())}let p=this.obstructions.features.filter(v=>v.geometry.type==="LineString"&&v.properties.kind?.toLowerCase()==="wall"&&v.properties.footprintComponent===!1),u=this.obstructions.features.filter(v=>v.geometry.type==="LineString"&&v.properties.kind?.toLowerCase()==="wall"&&v.properties.footprintComponent===!0),f=this.entrances,h=Ux,b=Ux;if(p!=null&&p.length>0){let v=this.styleMap[p[0].properties?.id];v!=null&&(h={...v}),b=h;let{walls:T,entrances:x}=i2(p,f?.features||[]),I=Math.max(h.height-.11,tk),M={...q4,height:I},O=this.renderer.addGeometryGroup(`InteriorDoors-${this.id}`,x,M,o);this.layers.get(rr).layers.set(Ud,O.id.toString());let C=this.renderer.addGeometryGroup(`Walls-${this.id}`,{features:[T]},iu(h,this.options),o);this.layers.get(rr).layers.set(sl,C.id.toString())}if(u!=null&&u.length>0){let v=this.styleMap[u[0].properties?.id];v!=null&&(b={...v,id:ts});let{walls:T,entrances:x}=i2(u,f?.features||[]),I=Math.max(b.height-.11,tk),M={...q4,height:I},O=this.renderer.addGeometryGroup(`ExteriorDoors-${this.id}`,x,M,o);this.layers.get(rr).layers.set(Vd,O.id.toString());let C=this.renderer.addGeometryGroup(`ExteriorWalls-${this.id}`,{features:[T]},iu(b,this.options),o);this.layers.get(rr).layers.set(ts,C.id.toString())}}if(this.floorImages!=null){let i=this.renderer.addGroupContainer(`images-${this.id}`,{},this.id);for(let a of this.floorImages.features||[])if(!("anchorId"in a.properties||"anchorId"in a.properties&&a.properties?.anchorId==null)){let l=Z5(a,rk);this.mapObject.api.Image3D.add(new fe({latitude:a.geometry.coordinates[1],longitude:a.geometry.coordinates[0],floorId:this.id}),a.properties.path,{id:l,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...a.properties}),rk++}this.layers.set(Hd,new Ii(this.renderer,i.id.toString()))}if(this.floorText!=null)for(let i of this.floorText.features||[]){let a=0;"geometryId"in i.properties?a=this.renderer.getState(i.properties.geometryId)?.height??0:a=i.properties.verticalOffset??0,this.renderer.addText3D(ut(),{...i,properties:{...i.properties,verticalOffset:a}},{},this.id)}if(this.areas!=null){let i=this.renderer.addGroupContainer(`areas-${this.id}`,{},this.id);this.layers.set(fc,new Ii(this.renderer,i.id.toString()));let a=this.renderer.addGeometryGroup(`Areas-${this.id}`,{features:this.areas.features},{color:ek.color},i);for(let l of this.areas.features||[])this.renderer.setState(l.properties.id,{...ek,visible:!1});this.layers.get(fc).layers.set(a.id.toString(),a.id.toString())}return this.multiFloorView?.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorGap}),this.renderer.render(),this});this.mapObject=o,this.renderer=o.renderer,this.id=t.id,this.options=i;let p=this.renderer.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:i.preloadFloors?.map(u=>u.id).includes(t.id)},r);this.containerId=p.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.elevation=t.elevation,a!=null&&l!=null&&(this.styleMap=l,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.areas=a.area?.[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=a.floorImages?.[this.id],this.floorText=a.enterprise?.floorText?.[this.id],this.footprint=a["floor.geojson"]?.features.find(u=>u.properties.id===t.id)),this.floorStackId=r,this.multiFloorView=n,this.mapDataInternal=c}get geoJSONBoundingBox(){if(s(this,Qc))return s(this,Qc);if(!this.footprint){A.warn(`Attempting to get bounding box with no footprint for floor ${this.id}`);return}return w(this,Qc,b1(this.footprint)),s(this,Qc)}addOccluder(){let r=this.layers.get(al);if(r==null||r.containerId==null||this.footprint==null){A.warn(`Tried to add occluder to floor ${this.id} but the floor does not have an occlusion layer.`);return}this.occluderId=this.renderer.addOccluder(this.footprint,r.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(r){this.renderer.setState(this.containerId,{visible:r})}};Qc=new WeakMap;d();var Uu,zh=class{constructor(r,t,o,n){m(this,"id");m(this,"externalId");m(this,"name");m(this,"type");m(this,"floorIds");m(this,"defaultFloorId");m(this,"floorObjects",[]);m(this,"floorObjectsByElevation",new Map);m(this,"metadata");m(this,"containerId");m(this,"facade");m(this,"renderer");S(this,Uu);this.id=r.id,this.externalId=r.externalId,this.name=r.name,this.type=r.type,this.metadata=r.metadata,this.floorIds=r.floors??r.maps,this.defaultFloorId=r.defaultFloor,this.renderer=o;let i=o.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=i.id.toString(),this.facade=n}get defaultFloor(){if(s(this,Uu)==null){if(this.floorObjects.length===0)throw new wr(`No floors in floor stack (${this.id}). Could not get default floor.`);let r;this.defaultFloorId&&(r=this.floorObjects.find(t=>t.id===this.defaultFloorId)),r||(r=this.floorObjects.reduce((t,o)=>Math.abs(o.elevation)<Math.abs(t.elevation)?o:t)),w(this,Uu,r)}return s(this,Uu)}get isOutdoors(){return this.type?.toLowerCase()==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(t=>t.hasFacadeGeometry)}addFloor(r){if(this.floorObjectsByElevation.has(r.elevation)){A.error(`Floor with same elevation ${r.elevation} already exists in Stack (${this.id}). Floor (${r.id}) will not be added.`);return}this.floorObjects.push(r),this.floorObjectsByElevation.set(r.elevation,r),this.facade&&this.renderer.setState(r.containerId,{focusable:!0})}loadAllFloors(){for(let r of this.floorObjects)r.load(),!this.isOutdoors&&!r.hasFacadeGeometry&&r.footprint!=null&&r.addOccluder()}};Uu=new WeakMap;d();function dT(e,r,t,o){let n={outdoorOpacity:1,floorStates:[]},i=e.sort((u,f)=>u.elevation-f.elevation),a=Math.min(0,i[0].elevation),l=i[i.length-1].elevation,c,p;for(let u=a;u<=l;u++){let f=i.find(x=>x.elevation===u);if(f==null){u>=0&&(c==null?c=u:p=u);continue}let h=0,b=u<0?Math.abs(f.elevation)*t:t,v=!1;if(c===0&&p!=null){let x=t*p;h=-x,b=x,v=!0}else if(c!=null&&p!=null){let x=c,I=e.find(O=>O.elevation===x-1),M=n.floorStates.find(O=>O.floor===I);if(M){let O=t*(p-c+2);M.state.footprint={...M.state.footprint,altitude:0,height:O,visible:!0}}}c=void 0,p=void 0;let T={floor:f,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1},areas:{visible:!1}}};n.floorStates.push(T),f.id===r.id?(T.state.visible=!0,T.state.geometry.visible=!0,T.state.labels.enabled=!0,T.state.markers.enabled=!0,T.state.occlusion.enabled=!0,T.state.areas.visible=!0,(f.elevation<0||v)&&(f.elevation<0&&(n.outdoorOpacity=.2),T.state.footprint.height=b,T.state.footprint.altitude=h,T.state.footprint.visible=!0)):o.includes(f.id)&&f.elevation<r.elevation?(T.state.visible=!0,T.state.geometry.visible=!0,T.state.markers.enabled=!0,T.state.occlusion.enabled=!0,T.state.footprint.visible=!0,f.elevation<0?(T.state.footprint.height=b,T.state.footprint.altitude=h,n.outdoorOpacity=.2):(T.state.footprint.height=b,T.state.footprint.altitude=h)):r.elevation>0&&f.elevation<r.elevation&&f.elevation>=0&&(T.state.visible=!0,T.state.footprint.visible=!0,T.state.footprint.height=t,T.state.footprint.altitude=h)}return n}var fs,Wh=class extends ke{constructor(t,o,n,i){super();m(this,"floorStacksById",new Map);m(this,"floorsById",new Map);m(this,"startingFloorId","");m(this,"currentFloorId","");m(this,"currentFloorStackId","");m(this,"outdoorFloorStacks",new Set);m(this,"id");m(this,"renderer");m(this,"api");m(this,"mvf");m(this,"options",{});m(this,"styleMap");m(this,"animations",new Map);m(this,"Models",{add:(t,o,n)=>{let{floorId:i,scale:a,...l}=n,c=i?this.floorsById.get(i):this.currentFloor,p={...l};a!=null&&(p.scale=Array.isArray(n.scale)?n.scale:[n.scale,n.scale,n.scale]);let u=this.renderer.addModelGroup(t,{type:"FeatureCollection",features:o.map(f=>({type:"Feature",properties:{id:ut(),rotation:n.rotation,scale:p.scale,interactive:n.interactive,verticalOffset:f.verticalOffset+(n.verticalOffset??0)},geometry:{type:"Point",coordinates:kn(f)}}))},p,{parent:c.id});if(u==null)throw new wr("error creating model");return this.renderer.getState(u).children},remove:(t,o)=>{this.renderer.remove(t),this.renderer.getState(o).children.length===0&&this.renderer.remove(o)}});m(this,"Image3D",{add:(t,o,n)=>{let{floorId:i,flipImageToFaceCamera:a,...l}=n,c=i?this.floorsById.get(i):this.currentFloor,p={type:"Feature",properties:l,geometry:{type:"Point",coordinates:t}};return this.renderer.addImage(n.id??ut(),p,{url:o,flipImageToFaceCamera:a??!1},c.id)},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});m(this,"Markers",{add:(t,o,n)=>{let i=a2(t,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:a,...l}=n,c=l;l.rank==="initial"&&(c.rank="medium");let p=i.layers.get(li),u=this.renderer.addMarker2D(kn(t),o,{...c,occluderId:i?.occluderId,attachTo:a},p?.containerId);if(!u)throw new wr("Failed to create Marker");return u},remove:t=>{this.renderer.remove(t)},getContentEl:t=>{let o=this.renderer.getState(t);if(o?.type==="marker")return o.element},removeAll:()=>{},setPosition:(t,o,n)=>{let i=this.renderer.getState(t),a=n?this.floorsById.get(n):this.currentFloor;if(!i){A.error(`Failed to retrieve state for Marker with id "${t}".`);return}if(i.type!=="marker"){A.error(`Geometry with id "${t}" is not of type "marker".`);return}this.renderer.setState(i,{position:o,parent:a?.layers.get(li)?.containerId})},animateTo:(t,o,n,i)=>{let a=this.renderer.getState(t),l=n?this.floorsById.get(n):this.currentFloor;if(!a)return A.error(`Failed to retrieve state for Marker with id "${t}".`),Promise.resolve();if(a.type!=="marker")return A.error(`Geometry with id "${t}" is not of type "marker".`),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...i};this.cancelAnimation(t);let p=new ui({lon:a.position[0],lat:a.position[1]}).to({lon:o[0],lat:o[1]},c.duration).easing(ls[c.easing]).onUpdate(({lon:u,lat:f})=>{if(!this.renderer.getState(t))this.cancelAnimation(t);else{let b=l?.layers.get(li)?.containerId;b&&this.Markers.setPosition(t,[u,f],b)}}).start();return this.renderer.getInternalTweenGroup().add(p),this.renderer.render(),this.animations.set(t,p),s2(p).then(()=>{this.animations.delete(t)})}});m(this,"Exporter",{getCurrentSceneGLTF:async t=>this.renderer.getCurrentSceneGLTF(t)});m(this,"Shapes",{add:(t,o,n)=>{let i=n?.floorId?this.floorsById.get(n?.floorId):this.currentFloor,a="shape-"+ut();return this.renderer.addGeometryGroup(a,t,o,i.id),a},remove:t=>(this.renderer.remove(t.id),t.id)});m(this,"Text3D",{label:(t,o,n)=>{if(!this.api.getMapDataInternal()?.enterpriseMode){A.warn("Enterprise mode is not enabled, skipping label creation");return}let i=ok(this.renderer,t,o,n);if(i)return{textInfo:i,target:t}},labelAll:(t={})=>{if(!this.api.getMapDataInternal()?.enterpriseMode)return A.warn("Enterprise mode is not enabled, skipping label creation"),[];let o=this.api.getMapData();if(!o)return[];let n=[];return o.getByType("space").forEach(i=>{if(i.locations[0]){let a=ok(this.renderer,i,i.locations[0]?.name??i.name,t);a&&n.push({textInfo:a,target:i})}}),n},remove:t=>{if(!this.api.getMapDataInternal()?.enterpriseMode){A.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(t),t}});m(this,"Labels",{all:({onCreate:t,labelOptions:o={}})=>{for(let n of Object.entries(this.mvf.space)){let[i,a]=n;a&&a.features.forEach(l=>{let c=this.api.getMapData()?.getById("space",l.properties.id);if(!c)return;let p=this.styleMap[l.properties.id]?.showImage,u=l.properties.details?.images,h={icon:(p&&u?.[0]?.url?{icon:u[0].url}:{}).icon,...o.appearance},v=(i?this.floorsById.get(i):this.currentFloor).layers.get(rs);if(l.properties.center&&c.name!==""){let T=this.renderer.addLabel2D(l.properties.center,c.name,{id:l.properties.id+"-label",...o,appearance:h,rank:o.rank,attachTo:su(c)},vr.is(c)?c.id:v?.containerId);T&&t(T.id,c.name,c)}})}},add:(t,o,n={})=>{let{attachTo:i,...a}=n,l=a2(t,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=l.layers.get(rs),p=this.renderer.addLabel2D(kn(t),o,{...a,occluderId:l.occluderId,attachTo:i},c?.containerId);if(!p)throw new wr("label creating failed");return p},remove:({entityId:t})=>{this.renderer.remove(t)},removeAll:()=>{}});m(this,"Paths",{add:(t,o)=>{let n=o?.animateDrawing??!0,i=[],a=t[0].floorId||"root",l=0;for(let p of t){let{floorId:u="root",latitude:f,longitude:h}=p;u!==a&&(l++,a=u),i[l]==null&&i.push({floorId:u,coordinates:[]});let b=u===p.floorId?p:new fe({longitude:h,latitude:f,floorId:u});i[l].coordinates.push(b)}let c=i.reduce((p,{floorId:u,coordinates:f},h)=>{if(h!==0){let T=i[h-1],x=T.coordinates[T.coordinates.length-1],I=f[0],M=kn(x),O=kn(I),C=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:T.floorId},geometry:{type:"Point",coordinates:M}},{type:"Feature",properties:{parentId:u},geometry:{type:"Point",coordinates:O}}]},o,this.id);C&&(n&&this.renderer.setState(C.id,{completeFraction:0}),p.push({...C,coordinates:[x,I]}))}if(f.length<2)return p;let b=this.floorsById.get(u)?.layers.get(os)?.containerId,v=this.renderer.addPath({type:"FeatureCollection",features:f.map(T=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:kn(T)}}))},o,b??u);return v&&(n&&this.renderer.setState(v.id,{completeFraction:0}),p.push({...v,coordinates:f})),p},[]);if(n){let p=[],u=this.api.getMapData();return c.forEach(f=>{let h=W5(f,u,this.api);p.push(new ui({fraction:0}).to({fraction:1},h?o?.drawDuration??1500:0).onUpdate(b=>{this.renderer.setState(f.id,{completeFraction:b.fraction})}))}),p.forEach((f,h)=>{h<p.length-1&&f.chain(p[h+1]),this.renderer.getInternalTweenGroup().add(f)}),p[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),p[0]),{paths:c,animation:s2(p[p.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},remove:t=>{t.forEach(o=>{this.cancelAnimation(o),this.renderer.remove(o)})}});S(this,fs,{enabled:!1,floorGap:10,updateCameraElevationOnFloorChange:!0});this.renderer=i.core,this.api=i,this.id=t,this.renderer.addGroupContainer(t,{},"root"),this.options=n??{},this.mvf=o?.mvf??{};let a=$5(this.mvf["styles.json"]||{});if(this.styleMap=a,w(this,fs,{enabled:!1,floorGap:10,updateCameraElevationOnFloorChange:!0,...n?.multiFloorView}),!o){this.id!=="outdoors-container"&&A.warn(`Map (${this.id}) created with no data.`);let p=new zh({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(p.id,p),this.currentFloorStackId=p.id;let u=new Hh(p.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,s(this,fs),n??{});this.floorsById.set(u.id,u),p.addFloor(u),this.setFloor(u.id);return}let l=o.getMVFFeatureByType("floor-stack");if(l==null||l.length===0)throw new wr("MVF does not contain any Floor Stacks.");for(let p of l){let u=new zh(p,this.id,this.renderer,this.mvf.facade?.[p.id]);if(u.floorIds.length!==0){for(let f of u.floorIds){let h=o.getMVFFeatureById("floor",f);if(h!=null){let b=this.mvf.space[h.id],v=this.mvf.obstruction[h.id];if((b==null||b.features.length===0)&&(v==null||v.features.length===0))continue;let T=new Hh(u.id,h,this,s(this,fs),n??{},this.mvf,a,o);this.floorsById.set(T.id,T),u.addFloor(T)}}this.floorStacksById.set(p.id,u),this.currentFloorStackId||(this.currentFloorStackId=p.id)}}for(let[p]of Object.entries(o.facadesBySpaceId)){let u=o.getById("space",p);u&&(this.outdoorFloorStacks.add(u.floor.floorStack.id),this.floorsById.get(u.floor.id)?.setVisible(!0))}let c=this.mvf.enterprise?.venue.defaultMap;if(n?.initialFloor){let p=xf(n.initialFloor);p&&this.floorsById.has(p)?c=p:A.error(`Invalid initial floor specified (${n.initialFloor}), using default behavior instead`)}c||(c=this.currentFloorStack.defaultFloor.id),this.startingFloorId=c}get currentFloorStack(){let t=this.floorStacksById.get(this.currentFloorStackId);if(!t)throw new wr(`Current floor stack with id "${this.currentFloorStackId}" not found`);return t}setFloorStack(t,o){if(this.currentFloorStackId===t)return;let n=this.floorStacksById.get(t);if(n==null){A.error(`Invalid floor stack passed to setFloorStack (${t}), the floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}if(n.floorObjects.length===0){A.error(`Floor stack (${t}) has no floors. The floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}this.setFloor(n.defaultFloor.id,o)}get currentFloor(){let t=this.floorsById.get(this.currentFloorId);if(!t)throw new wr(`Floor with id "${this.currentFloorId}" not found`);return t}get floors(){return Array.from(this.floorsById.values())}processFloorChange(t){if(this.api.manualFloorVisibility===!0)return;let o=this.api.getMapDataInternal()?.getById("floor",t),n=this.api.getMapDataInternal()?.getById("floor-stack",this.currentFloorStackId);if(o&&n)if(!s(this,fs)?.enabled||o.floorStack.id!==n?.id)for(let i of this.floorStacksById.values())i.floorObjects.forEach(a=>{a.id!==t&&a.setVisible(!1)});else{let i=dT(n.floors,o,s(this,fs).floorGap,this.api.Navigation?.floors?.map(a=>a.id)||[]);this.api?.Outdoor?.setOpacity(i.outdoorOpacity),i.floorStates.forEach(a=>{if(a.floor){let l=this.api.getMapData()?.getById("floor",a.floor.id);l&&this.api.updateState(l,a.state)}}),s(this,fs).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(o.elevation*s(this,fs).floorGap)}}setFloor(t,o){if(this.currentFloorId===t)return;if(!this.floorsById.get(t)){A.error(`Invalid floor passed to setFloor (${t}), the floor was not changed. Current floor is still ${this.currentFloor.id}`);return}let i=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:i,floorId:t,reason:o}),this.currentFloorStack&&this.processFloorChange(t),this.currentFloorId=t,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.updatePathLayersVisibility(),this.publish("floor-change",{reason:o,floorId:this.currentFloor.id,previousFloorId:i})}updatePathLayersVisibility(){let t=this.api.hidePathsNotOnCurrentFloor===!0&&!this.options.multiFloorView?.enabled;for(let o of this.floorsById.values()){let n=o.layers.get(os);if(!n)continue;let i=!t||o.id===this.currentFloor.id;n.setVisible(i)}}cancelAnimation(t){let o=this.animations.get(t);o&&(o.stop(),this.animations.delete(t),this.renderer.getInternalTweenGroup().remove(o))}loadAllFloors(){for(let t of this.floorStacksById.values())t.loadAllFloors()}};fs=new WeakMap;function ok(e,r,t,o){return e.labelText3D(r.id,t??r.name,{...o,parentId:r.floor.id})}d();var Un,Xh,Zh=class{constructor({currentMapGetter:r}){S(this,Un,new Map);S(this,Xh);w(this,Xh,r)}get currentMap(){return s(this,Xh).call(this)}getAll(){return Array.from(s(this,Un).values()).map(({marker:r})=>r)}getById(r){return s(this,Un).get(r)}add(r,t,o){let n=r.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,{...o,rank:o?.rank||"medium",dynamicResize:o?.dynamicResize??!0,attachTo:su(r)});if(a==null)throw new Error("error creating marker");let l=i.Markers.getContentEl(a.id.toString());if(!l)throw new Error("marker component should exist");let c=new us(a.id.toString(),l,r);return s(this,Un).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(r){let t=s(this,Un).get(r.id);t&&(this.currentMap?.Markers.remove(t.entityId),s(this,Un).delete(r.id.toString()))}removeAll(){let r=[];return s(this,Un).forEach(({marker:t})=>{this.remove(t),r.push(t),s(this,Un).delete(t.id.toString())}),r}setPosition(r,t){let o=t.anchorTarget;if(!o){A.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){A.error("Cannot determine the current map.");return}let i=s(this,Un).get(r.id);if(!i){A.error(`Cannot find the Marker with id "${r.id}".`);return}n.Markers.setPosition(i.entityId,kn(o),o.floorId??n.currentFloorId),i.marker.updateTarget(t)}animateTo(r,t,o){let n=t.anchorTarget;if(!n)return A.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return A.error("Cannot determine the current map."),Promise.resolve();let a=s(this,Un).get(r.id);return a?(a.marker.updateTarget(t),i.Markers.animateTo(a.entityId,kn(n),n.floorId??i.currentFloorId,o)):(A.error(`Cannot find the Marker with id "${r.id}".`),Promise.resolve())}};Un=new WeakMap,Xh=new WeakMap;d();var va,Jh,Yh=class{constructor({currentMapGetter:r}){S(this,va,new Map);S(this,Jh);w(this,Jh,r)}get currentMap(){return s(this,Jh).call(this)}getById(r){return s(this,va).get(r)}add(r,t,o){let n=r.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(kn(n),t,{...o,floorId:n.floorId,verticalOffset:n.verticalOffset+(o.verticalOffset??0)});if(!a)throw new Error("image component should exist");let l=new Zc(a.id.toString(),t,r);return s(this,va).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(r){let t=s(this,va).get(r.id);t&&(this.currentMap?.Image3D.remove(t.entityId),s(this,va).delete(r.id.toString()))}removeAll(){let r=[];return s(this,va).forEach(({image:t})=>{this.remove(t),r.push(t),s(this,va).delete(t.id.toString())}),r}};va=new WeakMap,Jh=new WeakMap;d();var hs,Qh,Kh=class{constructor({currentMapGetter:r}){S(this,hs,new Map);S(this,Qh);w(this,Qh,r)}get currentMap(){return s(this,Qh).call(this)}getById(r){return s(this,hs).get(r)}add(r,t,o){let n=[r],i=n.reduce((c,p)=>p?(c.has(p.floorId)||c.set(p.floorId,[]),c.get(p.floorId)?.push(p),c):(A.error("Cannot determine coordinate from options."),c),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 l=[];return i.forEach((c,p)=>{let u=ut();a.Models.add(u,c,{...o,url:t,floorId:p}).forEach(h=>{let b=new Yc(h.toString(),u,c[0]);s(this,hs).set(b.id,{model:b,entityId:h.toString(),groupId:u}),l.push(b)})}),l[0]}remove(r){let t=s(this,hs).get(r.id);t&&(this.currentMap?.Models.remove(t.entityId,t.groupId),s(this,hs).delete(r.id.toString()))}removeAll(){let r=[];return s(this,hs).forEach(({model:t})=>{let o=s(this,hs).get(t.id);o&&(r.push(t),this.currentMap?.Models.remove(o.entityId,o.groupId),s(this,hs).delete(t.id.toString()))}),r}};hs=new WeakMap,Qh=new WeakMap;d();var gs,eg,qh=class{constructor({currentMapGetter:r}){S(this,gs,new Map);S(this,eg);w(this,eg,r)}get currentMap(){return s(this,eg).call(this)}getById(r){return s(this,gs).get(r)}add(r,t){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let n=o.Paths.add(r,t),i=n.paths.map(l=>l.id.toString()),a=new Nn(ut(),n.animation,r,n.paths);for(let l of i)s(this,gs).set(l,{path:a,entityIds:i});return s(this,gs).set(a.id,{path:a,entityIds:i}),a}remove(r){let t=s(this,gs).get(r.id);t&&(this.currentMap?.Paths.remove(t.entityIds),s(this,gs).delete(r.id),t.entityIds.forEach(o=>s(this,gs).delete(o)))}removeAll(){let r=[];return s(this,gs).forEach(({path:t})=>{this.remove(t),r.push(t)}),r}};gs=new WeakMap,eg=new WeakMap;d();d();var Zk=gp(Lk(),1),Xk=gp($C(),1);d();var sg="blue-dot",_k="blue-dot-accuracy-ring";var TT="#2266ff",yZ="#808080",Rk="#f5f5f5";var Bk={radius:10,color:TT,inactiveColor:yZ,heading:{color:TT,opacity:.7,displayWhenInactive:!1},accuracyRing:{color:TT,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1,accuracyThreshold:50,initialState:"hidden"};d();var Nk="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";d();var jk=(e,r,t=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let o=t/Math.tan(e/2),n=t/Math.sin(e/2),i=n+r,a=10,l=new Na;l.moveTo(-n*Math.sin(e/2),n*Math.cos(e/2)-o);for(let c=0;c<a;c++)l.lineTo(-(i*Math.sin(e/2-e/a*c)),i*Math.cos(e/2-e/a*c)-o);for(let c=0;c<a;c++)l.lineTo(-(t*Math.sin(Math.PI/-2+Math.PI/a*c)),t*Math.cos(Math.PI/-2+Math.PI/a*c));return new ja(l,{depth:.1,bevelEnabled:!1,UVGenerator:xZ(r)})},CT=(e,r,t)=>{let n=Math.sqrt(Math.pow(e,2)+Math.pow(r,2))/t;return n>1?n=1:n<0&&(n=0),new Me(0,n)},xZ=e=>({generateTopUV:(r,t,o,n,i)=>{let a=t[o*3],l=t[o*3+1],c=t[n*3],p=t[n*3+1],u=t[i*3],f=t[i*3+1];return[CT(a,l,e),CT(c,p,e),CT(u,f,e)]},generateSideWallUV:()=>[new Me(0,1),new Me(0,1),new Me(0,1),new Me(0,1)]});function Gk(e,r){if(r==null)return e;let t={latitude:e?.latitude,longitude:e?.longitude,accuracy:e?.accuracy,floor:e?.floor,heading:e?.heading,timestamp:e?.timestamp};return"latitude"in r&&(t.latitude=r?.latitude==null||r.latitude==="device"?e?.latitude:r.latitude),"longitude"in r&&(t.longitude=r.longitude==null||r.longitude==="device"?e?.longitude:r.longitude),"accuracy"in r&&(t.accuracy=r.accuracy==="device"?e?.accuracy:r.accuracy),"floor"in r&&(t.floor=r.floor==="device"?e?.floor:r.floor),"heading"in r&&(t.heading=r.heading==="device"?e?.heading:r.heading),"timestamp"in r&&(t.timestamp=r.timestamp),t}function vZ([e,r],[t,o],[n,i]){let a=t-e,l=o-r,c=a**2+l**2;if(c===0)return;let p=((n-e)*a+(i-r)*l)/c,u;p<=0?u=[e,r]:p>=1?u=[t,o]:u=[e+p*a,r+p*l];let f=iy([n,i],u);return{proportion:Math.max(0,Math.min(1,p)),intersection:u,distance:f}}function Uk(e,r){if(e==null||e.length<2)return;let t=Number.MAX_SAFE_INTEGER,o,n=0,i=0;for(let a=0;a<e.length-1;a++){let l=e[a],c=e[a+1],p=vZ(l,c,r);p!=null&&p.distance<t&&(t=p.distance,o=p.intersection,n=a,i=p.proportion)}if(o)return{intersection:o,distance:t,segmentIndex:n,proportion:i}}function Vk(e,r){let t=new Ei({color:e,opacity:r,transparent:!0,depthTest:!1,depthWrite:!1}),o=.35,n=.35*4,i=jk(Math.PI/6,n,o);new xp().load(Nk,l=>{t.alphaMap=l,t.needsUpdate=!0});let a=new Le(i,t);return a.position.z=-.05,a.renderOrder=0,a}function $k(e,r){let t=new ty(1,1,.05,32),o=new Ei({transparent:!0,color:e,opacity:r,depthTest:!1,depthWrite:!1}),n=new Le(t,o);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}function Hk(e){let r=new ty(.35,.35,.07,32),t=new Ei({transparent:!0,color:Rk,depthTest:!1,depthWrite:!1}),o=new Le(r,t);o.renderOrder=2;let n=new ty(.35*.8,.35*.8,.01,32),i=new Ei({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),a=new Le(n,i);return a.renderOrder=3,o.rotation.x=Math.PI/2,o.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:o,innerMesh:a}}var Yk=gp(zk(),1);var Re,Rr,tp,ys,cn,Cr,Ca,rp,op,np,st,Ho,ag,Ma,Et,lg,cg,Wu,Qx,qx,e0,pg,t0,dg,r0,ug,o0,Si,wa,Zu,n0,kl,Xu,bs,mg,i0,s0,Yu=class extends ke{constructor(t,o){super();S(this,Re);S(this,Rr);S(this,tp,null);m(this,"primaryGeometry");m(this,"secondaryGeometry");S(this,ys);S(this,cn);S(this,Cr);S(this,Ca);S(this,rp);S(this,op);S(this,np);S(this,st,Bk);S(this,Ho,1);S(this,ag);S(this,Ma);S(this,Et,new Kx);m(this,"bounds");m(this,"state","disabled");m(this,"following",!1);S(this,lg,t=>s(this,Rr).getMapData()?.getById("floor",t));S(this,cg,t=>{let o;if(t!=null){let n=s(this,Rr).currentMap?.currentFloorStack.floorObjectsByElevation.get(t);o=n?s(this,lg).call(this,n.id):void 0}return o});S(this,Wu,()=>this.state!=="hidden"&&this.state!=="disabled");S(this,Qx,(t,o)=>{s(this,o0).call(this),t.scale.set(s(this,Ho),s(this,Ho),s(this,Ho)),t.position.z=.07/2*s(this,Ho),o.scale.set(s(this,Ho),s(this,Ho),s(this,Ho)),o.position.z=.07*s(this,Ho),this.state==="active"?o.material.color.set(s(this,st).color):this.state==="inactive"&&o.material.color.set(s(this,st).inactiveColor)});S(this,qx,t=>{let o=this.heading;if(o!=null){t.visible=!0,s(this,np)&&s(this,np).stop();let{start:n,end:i}=sy(t.rotation.z,-Ue.degToRad(o));w(this,np,new ui({rotation:n}).to({rotation:i},150).onUpdate(({rotation:l})=>{t.rotation.z=l}).start()),s(this,Re).getInternalTweenGroup().add(s(this,np)),t.scale.set(s(this,Ho),s(this,Ho),1);let a=this.state==="inactive"?s(this,st).inactiveColor:s(this,st).heading.color;t.material.color.set(a)}else t.visible=!1});S(this,e0,(t,o)=>{if(this.state==="active"){let i=this.accuracy;i!=null?(t.visible=!0,s(this,op)&&s(this,op).stop(),w(this,op,new ui({scale:t.scale.x}).to({scale:i/2},150).onUpdate(({scale:a})=>{t.scale.set(a,1,a)}).start()),s(this,Re).getInternalTweenGroup().add(s(this,op))):t.visible=!1}else t.visible=!1;this.state==="active"||this.state==="inactive"&&s(this,st).heading.displayWhenInactive?s(this,qx).call(this,o):o.visible=!1});S(this,pg,t=>{if(!s(this,Wu).call(this))return;let[o,n]=t.children;!o||!n||s(this,Qx).call(this,o,n)});S(this,t0,t=>{if(!s(this,Wu).call(this))return;let[,,o,n]=t.children;!o||!n||s(this,e0).call(this,o,n)});S(this,dg,(t,o)=>{let n;try{n=MZ.parse(Gk(t,s(this,cn)))}catch(l){s(this,Si).call(this,"error"),A.error("BlueDot: Position parse failed",l instanceof F.ZodError?l.message:String(l));return}s(this,st).debug&&A.log("BlueDot: Parsed position",n);let{min:i,max:a}=this.bounds||{};if(i!=null&&a!=null&&isFinite(i.x)&&isFinite(i.y)&&isFinite(a.x)&&isFinite(a.y)){let l=s(this,Re).convertTo3DMapPosition(n.latitude,n.longitude,0);if(!(l.x>=i.x&&l.x<=a.x&&l.y>=i.y&&l.y<=a.y)){A.warn(`BlueDot: Position [${n.longitude}, ${n.latitude}] is outside map bounds. Position update will be discarded.`);return}}if(s(this,i0).call(this,n.accuracy)){if(o?.silent||s(this,Si).call(this,"position-update"),!s(this,Wu).call(this)){A.warn(`BlueDot: Cannot update position because BlueDot state is '${this.state}'. BlueDot must be enabled first.`);return}s(this,r0).call(this,n,o)}});S(this,r0,(t,o)=>{w(this,Cr,t),o?.silent||(s(this,ug).call(this),s(this,Rr).getMapDataInternal()?.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:t.latitude,longitude:t.longitude,floorLevel:t.floor?.elevation,accuracy:t.accuracy}}));let n,i=0;if(!this.primaryGeometry)n=[t.longitude,t.latitude,0],i=t.floor?.id?s(this,Re).getState(t.floor?.id).altitude:0,s(this,Et).matrixAutoUpdate=!1,s(this,Et).userData.floorId=t.floor?.id,this.primaryGeometry=s(this,Re).addCustomGeometry(sg,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:c=>{let p=this.state==="inactive"?s(this,st).inactiveColor:s(this,st).color,{outerMesh:u,innerMesh:f}=Hk(p);s(this,Et).add(u),s(this,Et).add(f),c.add(s(this,Et));let h=s(this,Et).userData.floorId?s(this,Re).getState(s(this,Et).userData.floorId):void 0;h?.altitude!=null?s(this,Et).matrix.elements[14]=h?.altitude:s(this,Et).matrix.identity(),s(this,pg).call(this,s(this,Et))},update:()=>{let c=s(this,Et).userData.floorId?s(this,Re).getState(s(this,Et).userData.floorId):void 0;c?.altitude!=null?s(this,Et).matrix.elements[14]=c?.altitude:s(this,Et).matrix.identity(),s(this,pg).call(this,s(this,Et))}},{visible:!0,interactive:!0}),this.secondaryGeometry=s(this,Re).addCustomGeometry(_k,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:()=>{let c=$k(s(this,st).accuracyRing.color,s(this,st).accuracyRing.opacity),p=Vk(s(this,st).heading.color,s(this,st).heading.opacity);s(this,Et).add(c),s(this,Et).add(p),p.visible=!1,c.visible=!1},update:()=>{s(this,t0).call(this,s(this,Et))}},{visible:!0,interactive:!1});else{let c=s(this,Re).getState(this.primaryGeometry);if(n=[c.position[0],c.position[1],0],s(this,Et).userData.floorId){let p=s(this,Re).getState(s(this,Et).userData.floorId);i=(c.position[2]??0)+(p?.altitude??0)}}if(s(this,rp)&&s(this,rp).stop(),s(this,Et).userData.floorId!==t.floor?.id){let c=t.floor?.id?s(this,Re).getState(t.floor?.id).altitude:0,p=i;s(this,Et).userData.floorId=t.floor?.id,n[2]=p-c}let a=[t.longitude,t.latitude,0],l=c=>{let p={position:c};this.primaryGeometry&&this.secondaryGeometry&&s(this,Re).setState(this.primaryGeometry,p),this.secondaryGeometry&&s(this,Re).setState(this.secondaryGeometry,p)};o?.animate===!1?l(a):(w(this,rp,new ui(n).to(a,1e3).easing(Vo.Cubic.Out).onUpdate(l).start()),s(this,Re).getInternalTweenGroup().add(s(this,rp))),o?.silent||this.publish("blue-dot-position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),s(this,Re).render()});m(this,"onPositionUpdate",t=>{if(this.state==="disabled")return;try{CZ.parse(t)}catch(n){s(this,Si).call(this,"error"),A.error("BlueDot: Browser sent invalid position",n instanceof F.ZodError?n.message:String(n));return}w(this,ys,{latitude:t.coords?.latitude,longitude:t.coords?.longitude,accuracy:t.coords?.accuracy,heading:t.coords?.heading,floor:s(this,cg).call(this,t.coords?.floorLevel),timestamp:t.timestamp});let o=s(this,ys);if(s(this,Zu)){let n=s(this,s0).call(this,s(this,ys));if(n===void 0){s(this,st).debug&&A.log("BlueDot: Position update discarded by position processor");return}o=n}s(this,dg).call(this,o)});m(this,"onPositionError",t=>{switch(s(this,Si).call(this,"error"),t.code){case t.PERMISSION_DENIED:A.error("Geolocation permission denied by the user.",t),s(this,Rr).getMapDataInternal()?.Analytics.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:A.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:A.error("Geolocation request timed out.",t);break;default:A.error("An unknown geolocation error occurred.",t);break}this.publish("blue-dot-position-error",t)});S(this,ug,()=>{s(this,Ca)&&clearTimeout(s(this,Ca)),typeof s(this,st).timeout=="number"&&s(this,st).timeout<1/0&&w(this,Ca,setTimeout(()=>{s(this,st).debug&&A.log(`BlueDot: Position timed out after ${s(this,st).timeout}ms`),s(this,Si).call(this,"timeout"),s(this,Re).render()},s(this,st).timeout))});S(this,o0,()=>{let t=Math.round(s(this,Re).camera.zoomLevel*1e5);if(t!==s(this,ag)){w(this,ag,t);let o=s(this,Re).getMetresPerPixel()??1;w(this,Ho,Math.max(s(this,st).radius/(.35/o),1))}});S(this,Si,t=>{let o=TZ[this.state].actions[t];if(o){switch(s(this,st).debug&&A.log(`BlueDot: Transitioning from ${this.state} to ${o} using ${t}`),o){case"hidden":case"disabled":this.primaryGeometry&&s(this,Re).setState(this.primaryGeometry,{visible:!1}),this.secondaryGeometry&&s(this,Re).setState(this.secondaryGeometry,{visible:!1});break;case"active":case"inactive":this.primaryGeometry&&s(this,Re).setState(this.primaryGeometry,{visible:!0}),this.secondaryGeometry&&s(this,Re).setState(this.secondaryGeometry,{visible:!0});break}this.state!==o&&(this.state=o,this.publish("blue-dot-state-change",{state:o,action:t}))}else A.warn(`BlueDot: Invalid state transition from ${this.state} to ${o} using ${t}`)});S(this,wa);S(this,Zu);S(this,n0,()=>{if(s(this,wa)==null&&s(this,Rr).Navigation.activeDirections!=null){let o=(Array.isArray(s(this,Rr).Navigation.activeDirections)?s(this,Rr).Navigation.activeDirections.flatMap(n=>n.coordinates):s(this,Rr).Navigation.activeDirections.coordinates).filter(n=>n.floorId===s(this,Rr).currentFloor.id);w(this,wa,(0,Yk.default)(o.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,wa)});S(this,kl,()=>{s(this,Re).camera.isAnimating&&s(this,Re).camera.cancelAnimation(),s(this,bs)&&(this.off("blue-dot-position-update",s(this,bs)),w(this,bs,void 0)),this.following=!1,w(this,wa,void 0),s(this,Re).off("user-interaction-start",s(this,kl)),s(this,Rr).off("navigation-active-path-change",s(this,Xu)),this.publish("blue-dot-follow-change",{following:!1})});S(this,Xu,()=>{w(this,wa,void 0)});S(this,bs);m(this,"follow",(t,o)=>{if(t===!1){s(this,kl).call(this);return}t!=="position-only"&&o?.bearing!=null&&A.warn(`BlueDot: Camera bearing option will be ignored in follow mode '${t}'. To control the bearing manually, use mode 'position-only'.`);let n={zoomLevel:o?.zoomLevel??21,bearing:t==="position-only"?o?.bearing:void 0,pitch:o?.pitch??45,duration:o?.duration??1e3,easing:o?.easing??"ease-in-out"};this.following?s(this,bs)&&this.off("blue-dot-position-update",s(this,bs)):(this.following=!0,s(this,Re).on("user-interaction-start",s(this,kl)),s(this,Rr).on("navigation-active-path-change",s(this,Xu))),w(this,bs,i=>{let{coordinate:a,heading:l,floor:c}=i;if(n.center=[a.longitude,a.latitude],c!=null&&c.id!==s(this,Rr).currentFloor.id&&(s(this,Rr).currentMap.setFloor(c.id),w(this,wa,void 0)),t==="position-and-heading")n.bearing=l??void 0;else if(t==="position-and-path-direction"){let p=s(this,n0).call(this);if(p!=null){let u=Uk(p,[a.longitude,a.latitude]);if(u!=null){let f=p[u.segmentIndex],h=p[u.segmentIndex+1];n.bearing=OC(f,h)}}}s(this,Re).camera.animateTo(n)}),this.on("blue-dot-position-update",s(this,bs)),this.publish("blue-dot-follow-change",{following:!0,mode:t})});S(this,mg,t=>{this.bounds=t});S(this,i0,t=>{if(t==null)return this.state!=="disabled";let o=t<=s(this,st).accuracyThreshold;return s(this,st).debug&&!o&&A.log(`BlueDot: Dropping position update with accuracy ${t}m (exceeds threshold ${s(this,st).accuracyThreshold}m)`),o});S(this,s0,t=>{let o={latitude:s(this,Cr)?.latitude,longitude:s(this,Cr)?.longitude,accuracy:s(this,Cr)?.accuracy,heading:s(this,Cr)?.heading,floor:s(this,Cr)?.floor,timestamp:s(this,Cr)?.timestamp};try{return s(this,Zu).call(this,o,t)}catch(n){return A.error("BlueDot: Position processor callback threw an error",n instanceof Error?n.message:String(n)),t}});w(this,Re,t),w(this,Rr,o)}get heading(){return s(this,Cr)?.heading}get accuracy(){return s(this,Cr)?.accuracy}get coordinate(){if(s(this,Cr)!=null)return(s(this,Ma)==null||this.floor?.id!==s(this,Ma).floorId||s(this,Cr).latitude!==s(this,Ma).latitude||s(this,Cr).longitude!==s(this,Ma).longitude)&&w(this,Ma,new fe(s(this,Cr).latitude,s(this,Cr).longitude,this.floor?.id)),s(this,Ma)}get floor(){return s(this,Cr)?.floor}enable(t){w(this,st,(0,Zk.default)({},t,s(this,st))),s(this,Si).call(this,"enable"),s(this,st).initialState==="inactive"&&s(this,Si).call(this,"initialize"),this.watchDevicePosition(s(this,st).watchDevicePosition),this.bounds||(this.bounds=s(this,Re).getSystems().cameraSystem.panBounds,s(this,Re).on("pan-bounds-change",s(this,mg)))}updateState(t){let o=s(this,st).watchDevicePosition;w(this,st,(0,Xk.default)({},s(this,st),t)),t.watchDevicePosition!=null&&t.watchDevicePosition!==o&&this.watchDevicePosition(t.watchDevicePosition),t.timeout!=null&&this.state==="active"&&s(this,ug).call(this),s(this,Re).render()}disable(){s(this,Re).remove(s(this,Et).id),w(this,Et,new Kx),this.primaryGeometry&&(s(this,Re).remove(this.primaryGeometry.id),this.primaryGeometry=void 0),this.secondaryGeometry&&(s(this,Re).remove(this.secondaryGeometry.id),this.secondaryGeometry=void 0),s(this,Ca)&&(clearTimeout(s(this,Ca)),w(this,Ca,void 0)),this.following&&s(this,kl).call(this),this.watchDevicePosition(!1),w(this,Cr,void 0),w(this,cn,void 0),s(this,Si).call(this,"disable"),s(this,Re).off("user-interaction-start",s(this,kl)),s(this,Rr).off("navigation-active-path-change",s(this,Xu)),s(this,Re).off("pan-bounds-change",s(this,mg))}watchDevicePosition(t){if(s(this,tp)&&(navigator.geolocation.clearWatch(s(this,tp)),w(this,tp,null)),s(this,ys)&&w(this,ys,void 0),t){if(this.state==="disabled"){A.warn("BlueDot must be enabled before watching browser position.");return}w(this,tp,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(t,o){t==null?w(this,cn,void 0):"coords"in t?w(this,cn,Object.assign({},s(this,cn),{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,heading:t.coords.heading,floor:s(this,cg).call(this,t.coords.floorLevel),timestamp:t.timestamp})):(w(this,cn,Object.assign({},s(this,cn),t)),"floorOrFloorId"in t&&(s(this,cn).floor=typeof t.floorOrFloorId=="string"&&t.floorOrFloorId!=="device"?s(this,lg).call(this,t.floorOrFloorId):t.floorOrFloorId)),(s(this,cn)?.latitude!=null&&s(this,cn)?.longitude!=null||s(this,ys)!=null)&&s(this,dg).call(this,s(this,ys),o)}setPositionProcessor(t){w(this,Zu,t)}};Re=new WeakMap,Rr=new WeakMap,tp=new WeakMap,ys=new WeakMap,cn=new WeakMap,Cr=new WeakMap,Ca=new WeakMap,rp=new WeakMap,op=new WeakMap,np=new WeakMap,st=new WeakMap,Ho=new WeakMap,ag=new WeakMap,Ma=new WeakMap,Et=new WeakMap,lg=new WeakMap,cg=new WeakMap,Wu=new WeakMap,Qx=new WeakMap,qx=new WeakMap,e0=new WeakMap,pg=new WeakMap,t0=new WeakMap,dg=new WeakMap,r0=new WeakMap,ug=new WeakMap,o0=new WeakMap,Si=new WeakMap,wa=new WeakMap,Zu=new WeakMap,n0=new WeakMap,kl=new WeakMap,Xu=new WeakMap,bs=new WeakMap,mg=new WeakMap,i0=new WeakMap,s0=new WeakMap;var TZ={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",initialize:"inactive",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},CZ=F.object({coords:F.object({latitude:F.number(),longitude:F.number(),accuracy:F.number(),altitude:F.number().optional().nullable(),altitudeAccuracy:F.number().optional().nullable(),heading:F.number().optional().nullable(),speed:F.number().optional().nullable(),floorLevel:F.number().optional().nullable()}),timestamp:F.number()}),MZ=F.object({latitude:F.number(),longitude:F.number(),floor:F.custom().optional(),accuracy:F.number().optional(),heading:F.number().optional().nullable(),timestamp:F.number().optional()}),Kx=class extends Os{constructor(){super(...arguments);m(this,"children",[]);m(this,"userData",{})}};d();var Oa,hg,fg=class{constructor({currentMapGetter:r}){S(this,Oa,new Map);S(this,hg);w(this,hg,r)}get currentMap(){return s(this,hg).call(this)}getById(r){return s(this,Oa).get(r)}add(r,t,o){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Shapes.add(r,t||{},{floorId:o?.id}),a=new ga(i);return s(this,Oa).set(a.id,a),a}remove(r){s(this,Oa).get(r.id)&&(this.currentMap?.Shapes.remove(r),s(this,Oa).delete(r.id.toString()))}removeAll(){let r=[];return s(this,Oa).forEach(t=>{this.remove(t),r.push(t.id),s(this,Oa).delete(t.id.toString())}),r}};Oa=new WeakMap,hg=new WeakMap;d();var yg,gg=class{constructor({currentMapGetter:r}){S(this,yg);w(this,yg,r)}get currentMap(){return s(this,yg).call(this)}setFromStyleCollection(r){for(let t in r)for(let o of this.currentMap?.floors||[]){if(r[t]==null||!o.layers.has(rr))continue;let n=o.layers.get(rr);if(n?.layers.has(t)&&"color"in r[t]){let l=n.layers.get(t);l&&this.currentMap?.renderer.setState(l,{color:r[t].color})}if(n&&t===sl&&!(ts in r)){let l=n.layers.get(ts);l&&"color"in r[t]&&this.currentMap?.renderer.setState(l,{color:r[t].color})}if(!o.layers.has(hc))continue;let i=o.layers.get(hc),a=o.facadesByStyleId.get(t);if(a&&a.length>0)for(let l of a){let c=i.layers.get(`${l}-${t}`);c&&"color"in r[t]&&this.currentMap?.renderer.setState(c,{color:r[t].color})}}}};yg=new WeakMap;d();var MT={opacity:1},co,bg,xg,Al,Ea,ip,wT,Jk,Ju=class{constructor(r,t){S(this,ip);S(this,co);S(this,bg,[]);S(this,xg,{opacity:"initial"});S(this,Al,{opacity:new Map});S(this,Ea,new Set);w(this,co,r),w(this,bg,t||[]);let o=s(this,co).map;o&&o.on("idle",()=>{s(this,Al).opacity.size||W(this,ip,wT).call(this,o)})}setStyle(r){if(s(this,co).map){s(this,co).map?.setStyle(r),s(this,Ea).size&&(s(this,Ea).clear(),this.hide()),W(this,ip,Jk).call(this),W(this,ip,wT).call(this,s(this,co).map),this.setOpacity(s(this,xg).opacity),s(this,co).map?.moveLayer(A0);for(let[t,o,n]of s(this,bg)||[])s(this,co).hideOutdoorLayersIntersectingPolygons(t,o,n)}}get map(){return s(this,co).map}get enabled(){return!!s(this,co).map}get visible(){return s(this,Ea).size===0}show(){let r=s(this,co).map;if(!r)return;let t=r.getStyle().layers;t&&(t.forEach(o=>{s(this,Ea).has(o.id)&&r.setLayoutProperty(o.id,"visibility","visible")}),s(this,Ea).clear())}hide(r=[]){let t=s(this,co).map;if(!t)return;let o=t.getStyle().layers;o&&o.forEach(n=>{let i=t.getLayoutProperty(n.id,"visibility");!r.includes(n.id)&&i!=="none"&&(t.setLayoutProperty(n.id,"visibility","none"),s(this,Ea).add(n.id))})}setOpacity(r,t=[]){let o=s(this,co).map;if(!o)return;let n=s(this,co).map?.getStyle?.()?.layers;n&&o.once("idle",()=>{n.forEach(i=>{let a=o.getLayoutProperty(i.id,"visibility");if(!t.includes(i.id)&&a!=="none")try{let l=s(this,Al).opacity.get(i.id);l!==void 0&&(i.id==="background"||(i.type==="symbol"?(o.setPaintProperty(i.id,"icon-opacity",r==="initial"?l[0]:r),o.setPaintProperty(i.id,"text-opacity",r==="initial"?l[1]:r)):o.setPaintProperty(i.id,`${i.type}-opacity`,r==="initial"?l[0]:r)),s(this,xg).opacity=r)}catch(l){A.warn("Error setting opacity:",l)}})})}};co=new WeakMap,bg=new WeakMap,xg=new WeakMap,Al=new WeakMap,Ea=new WeakMap,ip=new WeakSet,wT=function(r){let t=r.getStyle().layers;t&&t.forEach(o=>{r.getLayoutProperty(o.id,"visibility")!=="none"&&(o.id==="background"||(o.type==="symbol"?s(this,Al).opacity.set(o.id,[r.getPaintProperty(o.id,"icon-opacity")??MT.opacity,r.getPaintProperty(o.id,"text-opacity")??MT.opacity]):s(this,Al).opacity.set(o.id,[r.getPaintProperty(o.id,`${o.type}-opacity`)??MT.opacity,void 0])))})},Jk=function(){Object.values(s(this,Al)).forEach(r=>r.clear())};d();function wZ(){j0(!1)}var Pa,Fa,Ll,vg=class{constructor({currentMapGetter:r}){S(this,Pa);S(this,Fa,new Map);S(this,Ll,new Map);w(this,Pa,r)}labelAll(r={}){let t=[],o=new Set;return s(this,Pa).call(this)?.Text3D.labelAll(r)?.forEach(({textInfo:n,target:i})=>{let a=n.id.toString(),l=s(this,Ll).get(a);if(l){o.has(a)||t.push(l.text3DView),o.add(a);return}o.add(a);let c=new El(a,i);s(this,Fa).set(c.id,{targetId:i.id,text3d:a,text3DView:c}),s(this,Ll).set(a,{text3DView:c}),t.push(c)}),t}label(r,t,o={}){if(s(this,Pa).call(this))if(vr.is(r)){let i=s(this,Pa).call(this)?.Text3D.label(r,t,o);if(!i)return;let a=i.textInfo.id.toString(),l=s(this,Ll).get(a);if(l)return l.text3DView;let c=new El(a,i.target);return s(this,Fa).set(c.id,{targetId:i.target.id,text3d:a,text3DView:c}),s(this,Ll).set(a,{text3DView:c}),c}else throw new Error("Non-space target is not supported")}remove(r){let t=typeof r=="string"?r:r.id,o=s(this,Fa).get(t);o&&(s(this,Pa).call(this)?.Text3D.remove(o.text3d),s(this,Fa).delete(t),s(this,Ll).delete(o.text3d))}removeAll(){s(this,Fa).forEach(r=>{s(this,Pa).call(this)?.Text3D.remove(r.text3d)}),s(this,Fa).clear()}};Pa=new WeakMap,Fa=new WeakMap,Ll=new WeakMap;d();d();d();function Kk(e){try{let r=e.shape;if("type"in r){let t=r.type;if(t instanceof F.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof F.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function Qk(e){if(e.success)return[];let r=e.error.flatten();return Object.keys(r.fieldErrors)}function qk(e,r){e.length>0&&A.warn(`${e.length} invalid field(s) in ${r??"unknown"} state: ${e.join(", ")}`)}function kt(e,r,t){if(r==null||typeof r!="object")return{};let o=e.partial().safeParse(r);if(o.success)return o.data;let n=Qk(o);t?.warn&&qk(n,Kk(e));let i={};for(let a of Object.keys(r))!n.includes(a)&&a in e.shape&&(i[a]=r[a]);return i}function Br(e,r,t){let o=e.safeParse(r);if(o.success)return o.data;if(t?.warn===!0){let n=Qk(o);qk(n,Kk(e))}return r}var eA="doors",sp=J.object({type:J.literal(eA).default(eA),color:J.string().default("#ffffff"),topColor:J.string().optional(),texture:J.object({url:J.string().optional()}).optional(),topTexture:J.object({url:J.string().optional()}).optional(),visible:J.boolean().default(!1),opacity:J.number().default(1)}),__e=sp.partial(),R_e=sp.strict();function tA(e){let{color:r,topColor:t,texture:o,topTexture:n,visible:i,opacity:a}=e;return Br(sp,{visible:i,color:r,topColor:t,opacity:a,texture:o?{url:o}:void 0,topTexture:n?{url:n}:void 0})}function a0(e,r){let t={};return r==null||(e.color&&(e.color==="initial"?t.color=r.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=r.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.opacity!==void 0&&(t.opacity=e.opacity)),t}d();var rA="facade",Ig=F.object({type:F.literal(rA).default(rA),opacity:F.number().default(1),visible:F.boolean().default(!0)}),U_e=Ig.partial(),V_e=Ig.strict();function oA(e){return Br(Ig,{opacity:e.opacity,visible:e.visible})}d();var xs="floor",nA=`${xs}.footprint`,iA=`${xs}.geometry`,sA=`${xs}.labels`,aA=`${xs}.markers`,lA=`${xs}.images`,cA=`${xs}.occlusion`,pA=`${xs}.paths`,dA=`${xs}.areas`,Sg=F.object({type:F.literal(nA).default(nA),altitude:F.number().default(0),visible:F.boolean().default(!1),height:F.number().default(0),opacity:F.number().default(1),side:F.enum(["double","front","back"]),color:F.string().default("#ffffff")}),Tg=F.object({type:F.literal(iA).default(iA),opacity:F.number().default(1),visible:F.boolean().default(!0)}),Cg=F.object({type:F.literal(sA).default(sA),enabled:F.boolean().default(!0)}),Mg=F.object({type:F.literal(aA).default(aA),enabled:F.boolean().default(!0)}),wg=F.object({type:F.literal(lA).default(lA),visible:F.boolean().default(!0)}),Og=F.object({type:F.literal(cA).default(cA),enabled:F.boolean().default(!0)}),Eg=F.object({type:F.literal(pA).default(pA),visible:F.boolean().default(!0)}),Pg=F.object({type:F.literal(xs).default(xs),visible:F.boolean().default(!1),altitude:F.number().default(0)}),Fg=F.object({type:F.literal(dA).default(dA),visible:F.boolean().default(!0)}),OZ=F.object({...Pg.shape,geometry:Tg,labels:Cg,markers:Mg,images:wg,footprint:Sg,occlusion:Og,paths:Eg,areas:Fg}),Y_e=F.object({...Pg.shape,geometry:Tg.partial(),labels:Cg.partial(),markers:Mg.partial(),images:wg.partial(),footprint:Sg.partial(),occlusion:Og.partial(),paths:Eg.partial(),areas:Fg.partial()}).partial(),J_e=F.object({...Pg.shape,geometry:Tg.strict(),labels:Cg.strict(),markers:Mg.strict(),images:wg.strict(),footprint:Sg.strict(),occlusion:Og.strict(),paths:Eg.strict(),areas:Fg.strict()});function uA(e,r,t){if(!r){A.error("Floor is not defined. Cannot get floor state.");return}let o=r.layers.get(rr),n=o?t?.getState(o.containerId):void 0,i=r.layers.get(rs),a=r.layers.get(li),l=r.layers.get($d),c=l?t?.getState(l.containerId):void 0,p=r.layers.get(al),u=p?t?.getState(p.containerId):void 0,f=r.layers.get(Hd),h=f?t?.getState(f.containerId):void 0,b=r.layers.get(os),v=b?t?.getState(b.containerId):void 0,T=r.layers.get(fc),x=T?t?.getState(T.containerId):void 0;return Br(OZ,{geometry:{opacity:n?.opacity,visible:n?.visible},labels:{enabled:i?.visible},markers:{enabled:a?.visible},footprint:{altitude:c?.altitude,visible:c?.visible,height:c?.height,opacity:c?.opacity,side:c?.side,color:c?.color},images:{visible:h?.visible},occlusion:{enabled:u?.visible},paths:{visible:v?.visible},areas:{visible:x?.visible},visible:e.visible,altitude:e.altitude})}d();var mA="geometry",Ku=F.object({type:F.literal(mA).default(mA),visible:F.boolean().default(!0),color:F.union([F.string(),F.literal("initial")]).default("#ffffff"),topColor:F.union([F.string(),F.literal("initial")]).optional(),hoverColor:F.union([F.string(),F.literal("initial")]).optional(),interactive:F.boolean().default(!1),opacity:F.number().default(1),height:F.number().default(0),altitude:F.number().default(0),texture:F.object({url:F.string()}).optional(),topTexture:F.object({url:F.string()}).optional(),flipImageToFaceCamera:F.boolean().default(!1),enableImageCollisions:F.boolean().default(!1),borderVisible:F.boolean().default(!1),borderColor:F.string().optional(),borderWidth:F.number().optional()}),t8e=Ku.partial(),r8e=Ku.strict();function fA(e,r){let t=r?.altitude?e.altitude+r.altitude:e.altitude,{interactive:o,hoverColor:n,color:i,visible:a,opacity:l,height:c,texture:p,topTexture:u,flipImageToFaceCamera:f,enableImageCollisions:h,topColor:b,borderVisible:v,borderColor:T,borderWidth:x}=e;return Br(Ku,{interactive:o,hoverColor:n,color:i,visible:a,opacity:l,height:c,texture:p?{url:e.texture}:void 0,topTexture:u?{url:u}:void 0,flipImageToFaceCamera:f,enableImageCollisions:h,topColor:b,altitude:t,borderVisible:v,borderColor:T,borderWidth:x})}function hA(e,r,t){let o={};return r==null||(e.color&&(e.color==="initial"?o.color=r.initialColor:o.color=e.color),e.topColor&&(e.topColor==="initial"?o.topColor=r.initialTopColor:o.topColor=e.topColor),e.visible!==void 0&&(o.visible=e.visible),e.texture?.url!==void 0&&(o.texture=e.texture.url),e.topTexture?.url!==void 0&&(o.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(o.hoverColor=e.hoverColor),e.interactive!==void 0&&(o.interactive=e.interactive),e.height!==void 0&&(o.height=e.height),e.opacity!==void 0&&(o.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(o.flipImageToFaceCamera=e.flipImageToFaceCamera),e.enableImageCollisions!==void 0&&(o.enableImageCollisions=e.enableImageCollisions),e.altitude!==void 0&&(o.altitude=e.altitude-(t?.altitude??0)),e.borderVisible!==void 0&&(o.borderVisible=e.borderVisible),e.borderColor!==void 0&&(o.borderColor=e.borderColor),e.borderWidth!==void 0&&(o.borderWidth=e.borderWidth)),o}d();var OT="label",ET=J.object({type:J.literal(OT).default(OT),text:J.string(),rank:J.custom(e=>cy.safeParse(e).success||e==="initial"),appearance:J.custom(e=>GC.safeParse(e).success),interactive:J.boolean().default(!1),enabled:J.boolean().default(!0),textPlacement:J.union([J.enum(E0),J.array(J.enum(E0))]).default(P0)}),l8e=ET.partial();function gA(e){let{text:r,enabled:t,options:o}=e;return{type:OT,text:r??"",appearance:UC(o?.appearance??{}),rank:o?.rank??"medium",enabled:t??!0,interactive:o?.interactive??!1,textPlacement:o?.textPlacement??P0}}function yA(e,r){let t={options:{}};if(!t.options)throw new Error("options should exist");return e.text&&(t.text=e.text),e.appearance&&(t.options.appearance=e.appearance),e.textPlacement&&(t.options.textPlacement=e.textPlacement),e.rank!=null&&(e.rank==="initial"?t.options.rank=r.initialRank||2:t.options.rank=e.rank),e.enabled!==void 0&&(t.enabled=e.enabled),e.interactive!==void 0&&(t.options.interactive=e.interactive),e.enabled!==void 0&&(t.enabled=e.enabled),t}d();var PT="marker",FT=J.object({type:J.literal(PT).default(PT),rank:J.custom(e=>cy.safeParse(e).success||e==="initial"),placement:J.union([J.enum(F0),J.array(J.enum(F0))]).optional(),interactive:J.union([J.boolean(),J.literal("pointer-events-auto")]).default(!1),dynamicResize:J.boolean().default(!0),enabled:J.boolean().default(!0),zIndex:J.number().optional(),lowPriorityPin:J.object({enabled:J.boolean().optional(),size:J.number().positive().optional(),color:J.string().optional()}).optional(),element:J.custom(e=>e instanceof HTMLElement,{message:"Must be an HTMLElement instance"}),contentHTML:J.string()}),h8e=FT.omit({element:!0}).partial();function bA(e,r){let t=r?.target?r.target.anchorTarget:void 0,{enabled:o,placement:n,element:i,dynamicResize:a,contentHTML:l,options:c,position:p,parent:u}=e,f=typeof u=="object"?u.id:u;return t==null&&(t=new fe({latitude:p?.[1]??0,longitude:p?.[0]??0,floorId:f?.toString()})),{type:PT,rank:c?.rank??"medium",interactive:c?.interactive??!1,enabled:o??!0,element:i,placement:n??[],zIndex:c?.zIndex,dynamicResize:a??!0,lowPriorityPin:c?.lowPriorityPin,contentHTML:l??""}}function xA(e,r){let t={};return t.options={},e.rank!=null&&(e.rank==="initial"?t.options.rank=r.initialRank||2:t.options.rank=e.rank),e.dynamicResize!=null&&(t.options.dynamicResize=e.dynamicResize),e.enabled!=null&&(t.enabled=e.enabled),e.interactive!=null&&(t.options.interactive=e.interactive),e.enabled!==null&&(t.enabled=e.enabled),e.contentHTML!==void 0&&(t.contentHTML=e.contentHTML),e.placement!=null&&(t.placement=e.placement),t}d();var vA="path",l0={color:"#4b90e2",width:1,completeFraction:0,visible:!0,verticalOffset:.1},Qu=J.object({type:J.literal(vA).default(vA),color:J.string().default(l0.color),width:J.union([J.number(),J.any()]),completeFraction:J.number().default(l0.completeFraction),visible:J.boolean().default(l0.visible),verticalOffset:J.number().default(l0.verticalOffset)}),v8e=Qu.partial(),I8e=Qu.strict();function IA(e){let{color:r,visible:t,width:o,verticalOffset:n,completeFraction:i}=e;return Br(Qu,{color:r,visible:t,width:o,verticalOffset:n,completeFraction:i})}d();var SA="shape",Dg=F.object({type:F.literal(SA).default(SA),visible:F.boolean().default(!0),altitude:F.number().default(0),color:F.string().default("#ffffff"),height:F.number().default(0),opacity:F.number().default(1),interactive:F.boolean().default(!1),bevel:F.object({enabled:F.boolean().optional(),thickness:F.number().optional(),size:F.number().optional(),offset:F.number().optional(),segments:F.number().optional()}).optional()}),O8e=Dg.partial(),E8e=Dg.strict();function TA(e){let{altitude:r,visible:t,color:o,opacity:n,interactive:i,height:a,children:l,bevel:c}=e;if(l==null||l.length<1){A.error("Expected at least one child for Shape. Cannot get shape state.");return}return Br(Dg,{altitude:r,visible:t,color:o,height:a,opacity:n,interactive:i,bevel:c})}d();var CA="text3d",MA=J.object({type:J.literal(CA).default(CA),position:J.custom(e=>e instanceof fe,{message:"Must be a Coordinate instance"})}),wA=lM.extend({...MA.shape}),OA=cM.extend({...MA.shape}).partial(),_8e=wA.strict();function EA(e){let{position:r,visible:t,color:o,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:l,outlineOpacity:c,outlineBlur:p,outlineWidth:u,outlineOffsetX:f,outlineOffsetY:h,strokeWidth:b,strokeOpacity:v,strokeColor:T,fillOpacity:x,hoverColor:I}=e;return Br(wA,{position:new fe({latitude:r?.[1]??0,longitude:r?.[0]??0}),visible:t,color:o,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:l,outlineOpacity:c,outlineBlur:p,outlineWidth:u,outlineOffsetX:f,outlineOffsetY:h,strokeWidth:b,strokeOpacity:v,strokeColor:T,fillOpacity:x,hoverColor:I})}d();var PA="walls",qu=J.object({type:J.literal(PA).default(PA),color:J.string().default("#ffffff"),topColor:J.string().optional(),texture:J.object({url:J.string()}).or(J.undefined()),topTexture:J.object({url:J.string()}).or(J.undefined()),visible:J.boolean().default(!0),height:J.number().default(0),opacity:J.number().default(1)}),G8e=qu.partial(),U8e=qu.strict();function FA(e){let{color:r,topColor:t,texture:o,topTexture:n,visible:i,height:a,opacity:l}=e;return Br(qu,{visible:i,color:r,topColor:t,texture:o?{url:o}:void 0,topTexture:n?{url:n}:void 0,height:a,opacity:l})}function DT(e,r){let t={};return r==null||(e.color&&(e.color==="initial"?t.color=r.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=r.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.height!==void 0&&(t.height=e.height),e.opacity!==void 0&&(t.opacity=e.opacity)),t}d();var kT="image3d",AT=F.object({type:F.literal(kT).default(kT),visible:F.boolean().default(!0),opacity:F.number().min(0).max(1).default(1),position:F.custom(e=>e instanceof fe,{message:"Must be a Coordinate instance"}),width:F.number().default(1),height:F.number().default(1),rotation:F.number().default(0),verticalOffset:F.number().default(0),flipImagesToFaceCamera:F.boolean().default(!1)}),W8e=AT.partial();function DA(e){let{position:r}=e;return{type:kT,visible:e.visible??!0,opacity:e.opacity??1,position:new fe({latitude:r?.[1]??0,longitude:r?.[0]??0,verticalOffset:r?.[2]}),width:e.width??1,height:e.height??1,rotation:e.rotation??0,verticalOffset:e.verticalOffset??0,flipImagesToFaceCamera:e.flipImageToFaceCamera??!1}}d();var kA="model",LT=C2.extend({type:F.literal(kA).default(kA),color:F.string().optional(),position:F.custom(e=>e instanceof fe,{message:"Must be a Coordinate instance"}),visible:F.boolean().default(!0),rotation:F.tuple([F.number(),F.number(),F.number()]).default([0,0,0]),scale:F.tuple([F.number(),F.number(),F.number()]).default([1,1,1]),verticalOffset:F.number().default(0),opacity:F.number().default(1),material:F.record(F.string(),M2).optional(),interactive:F.boolean().default(!1)}),AA=LT.extend({scale:F.union([F.number(),F.tuple([F.number(),F.number(),F.number()])]),rotation:F.union([F.number(),F.tuple([F.number(),F.number(),F.number()])])}).partial(),q8e=LT.strict();function LA(e){let{color:r,position:t,rotation:o,scale:n,visible:i,interactive:a,opacity:l,material:c,verticalOffset:p,parent:u}=e,f=typeof u=="object"?u?.id?.toString():u?.toString();return Br(LT,{color:r,position:new fe({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:f}),rotation:o,scale:n,visible:i,interactive:a,opacity:l,material:c,verticalOffset:p})}d();d();function _A(e,r){[...e.getByType("space"),...e.getByType("object")].forEach(t=>{t.name==null||t.name===""||r.updateState(t,{interactive:!0})})}d();d();d();var{entries:zA,setPrototypeOf:RA,isFrozen:EZ,getPrototypeOf:PZ,getOwnPropertyDescriptor:FZ}=Object,{freeze:wo,seal:Vn,create:WA}=Object,{apply:GT,construct:UT}=typeof Reflect<"u"&&Reflect;wo||(wo=function(r){return r});Vn||(Vn=function(r){return r});GT||(GT=function(r,t,o){return r.apply(t,o)});UT||(UT=function(r,t){return new r(...t)});var c0=Oo(Array.prototype.forEach),DZ=Oo(Array.prototype.lastIndexOf),BA=Oo(Array.prototype.pop),kg=Oo(Array.prototype.push),kZ=Oo(Array.prototype.splice),d0=Oo(String.prototype.toLowerCase),_T=Oo(String.prototype.toString),NA=Oo(String.prototype.match),Ag=Oo(String.prototype.replace),AZ=Oo(String.prototype.indexOf),LZ=Oo(String.prototype.trim),Ti=Oo(Object.prototype.hasOwnProperty),Mo=Oo(RegExp.prototype.test),Lg=_Z(TypeError);function Oo(e){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return GT(e,r,o)}}function _Z(e){return function(){for(var r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return UT(e,t)}}function je(e,r){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d0;RA&&RA(e,null);let o=r.length;for(;o--;){let n=r[o];if(typeof n=="string"){let i=t(n);i!==n&&(EZ(r)||(r[o]=i),n=i)}e[n]=!0}return e}function RZ(e){for(let r=0;r<e.length;r++)Ti(e,r)||(e[r]=null);return e}function Da(e){let r=WA(null);for(let[t,o]of zA(e))Ti(e,t)&&(Array.isArray(o)?r[t]=RZ(o):o&&typeof o=="object"&&o.constructor===Object?r[t]=Da(o):r[t]=o);return r}function _g(e,r){for(;e!==null;){let o=FZ(e,r);if(o){if(o.get)return Oo(o.get);if(typeof o.value=="function")return Oo(o.value)}e=PZ(e)}function t(){return null}return t}var jA=wo(["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","section","select","shadow","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"]),RT=wo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),BT=wo(["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"]),BZ=wo(["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"]),NT=wo(["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"]),NZ=wo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),GA=wo(["#text"]),UA=wo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),jT=wo(["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","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","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-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"]),VA=wo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),p0=wo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jZ=Vn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),GZ=Vn(/<%[\w\W]*|[\w\W]*%>/gm),UZ=Vn(/\$\{[\w\W]*/gm),VZ=Vn(/^data-[\-\w.\u00B7-\uFFFF]+$/),$Z=Vn(/^aria-[\-\w]+$/),ZA=Vn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),HZ=Vn(/^(?:\w+script|data):/i),zZ=Vn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),XA=Vn(/^html$/i),WZ=Vn(/^[a-z][.\w]*(-[.\w]+)+$/i),$A=Object.freeze({__proto__:null,ARIA_ATTR:$Z,ATTR_WHITESPACE:zZ,CUSTOM_ELEMENT:WZ,DATA_ATTR:VZ,DOCTYPE_NAME:XA,ERB_EXPR:GZ,IS_ALLOWED_URI:ZA,IS_SCRIPT_OR_DATA:HZ,MUSTACHE_EXPR:jZ,TMPLIT_EXPR:UZ}),Rg={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ZZ=function(){return typeof window>"u"?null:window},XZ=function(r,t){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));let i="dompurify"+(o?"#"+o:"");try{return r.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},HA=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function YA(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZZ(),r=he=>YA(he);if(r.version="3.2.6",r.removed=[],!e||!e.document||e.document.nodeType!==Rg.document||!e.Element)return r.isSupported=!1,r;let{document:t}=e,o=t,n=o.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:p,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:b}=e,v=c.prototype,T=_g(v,"cloneNode"),x=_g(v,"remove"),I=_g(v,"nextSibling"),M=_g(v,"childNodes"),O=_g(v,"parentNode");if(typeof a=="function"){let he=t.createElement("template");he.content&&he.content.ownerDocument&&(t=he.content.ownerDocument)}let C,E="",{implementation:_,createNodeIterator:G,createDocumentFragment:R,getElementsByTagName:N}=t,{importNode:X}=o,z=HA();r.isSupported=typeof zA=="function"&&typeof O=="function"&&_&&_.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ee,ERB_EXPR:re,TMPLIT_EXPR:ue,DATA_ATTR:Ce,ARIA_ATTR:Oe,IS_SCRIPT_OR_DATA:Pe,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:ce}=$A,{IS_ALLOWED_URI:Ee}=$A,ye=null,Ge=je({},[...jA,...RT,...BT,...NT,...GA]),Ie=null,Xe=je({},[...UA,...jT,...VA,...p0]),se=Object.seal(WA(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}})),nt=null,dt=null,$t=!0,k=!0,H=!1,P=!0,q=!1,K=!0,Q=!1,De=!1,xt=!1,dr=!1,ir=!1,ur=!1,wi=!0,cp=!1,im="user-content-",pp=!0,Rl=!1,ka={},Is=null,$g=je({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),h0=null,sm=je({},["audio","video","img","source","image","track"]),Aa=null,Hg=je({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),dp="http://www.w3.org/1998/Math/MathML",up="http://www.w3.org/2000/svg",Ss="http://www.w3.org/1999/xhtml",mp=Ss,g0=!1,y0=null,b7=je({},[dp,up,Ss],_T),zg=je({},["mi","mo","mn","ms","mtext"]),Wg=je({},["annotation-xml"]),x7=je({},["title","style","font","a","script"]),am=null,v7=["application/xhtml+xml","text/html"],I7="text/html",Mr=null,fp=null,S7=t.createElement("form"),WT=function(L){return L instanceof RegExp||L instanceof Function},b0=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(fp&&fp===L)){if((!L||typeof L!="object")&&(L={}),L=Da(L),am=v7.indexOf(L.PARSER_MEDIA_TYPE)===-1?I7:L.PARSER_MEDIA_TYPE,Mr=am==="application/xhtml+xml"?_T:d0,ye=Ti(L,"ALLOWED_TAGS")?je({},L.ALLOWED_TAGS,Mr):Ge,Ie=Ti(L,"ALLOWED_ATTR")?je({},L.ALLOWED_ATTR,Mr):Xe,y0=Ti(L,"ALLOWED_NAMESPACES")?je({},L.ALLOWED_NAMESPACES,_T):b7,Aa=Ti(L,"ADD_URI_SAFE_ATTR")?je(Da(Hg),L.ADD_URI_SAFE_ATTR,Mr):Hg,h0=Ti(L,"ADD_DATA_URI_TAGS")?je(Da(sm),L.ADD_DATA_URI_TAGS,Mr):sm,Is=Ti(L,"FORBID_CONTENTS")?je({},L.FORBID_CONTENTS,Mr):$g,nt=Ti(L,"FORBID_TAGS")?je({},L.FORBID_TAGS,Mr):Da({}),dt=Ti(L,"FORBID_ATTR")?je({},L.FORBID_ATTR,Mr):Da({}),ka=Ti(L,"USE_PROFILES")?L.USE_PROFILES:!1,$t=L.ALLOW_ARIA_ATTR!==!1,k=L.ALLOW_DATA_ATTR!==!1,H=L.ALLOW_UNKNOWN_PROTOCOLS||!1,P=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=L.SAFE_FOR_TEMPLATES||!1,K=L.SAFE_FOR_XML!==!1,Q=L.WHOLE_DOCUMENT||!1,dr=L.RETURN_DOM||!1,ir=L.RETURN_DOM_FRAGMENT||!1,ur=L.RETURN_TRUSTED_TYPE||!1,xt=L.FORCE_BODY||!1,wi=L.SANITIZE_DOM!==!1,cp=L.SANITIZE_NAMED_PROPS||!1,pp=L.KEEP_CONTENT!==!1,Rl=L.IN_PLACE||!1,Ee=L.ALLOWED_URI_REGEXP||ZA,mp=L.NAMESPACE||Ss,zg=L.MATHML_TEXT_INTEGRATION_POINTS||zg,Wg=L.HTML_INTEGRATION_POINTS||Wg,se=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&WT(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(se.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&WT(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(se.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(k=!1),ir&&(dr=!0),ka&&(ye=je({},GA),Ie=[],ka.html===!0&&(je(ye,jA),je(Ie,UA)),ka.svg===!0&&(je(ye,RT),je(Ie,jT),je(Ie,p0)),ka.svgFilters===!0&&(je(ye,BT),je(Ie,jT),je(Ie,p0)),ka.mathMl===!0&&(je(ye,NT),je(Ie,VA),je(Ie,p0))),L.ADD_TAGS&&(ye===Ge&&(ye=Da(ye)),je(ye,L.ADD_TAGS,Mr)),L.ADD_ATTR&&(Ie===Xe&&(Ie=Da(Ie)),je(Ie,L.ADD_ATTR,Mr)),L.ADD_URI_SAFE_ATTR&&je(Aa,L.ADD_URI_SAFE_ATTR,Mr),L.FORBID_CONTENTS&&(Is===$g&&(Is=Da(Is)),je(Is,L.FORBID_CONTENTS,Mr)),pp&&(ye["#text"]=!0),Q&&je(ye,["html","head","body"]),ye.table&&(je(ye,["tbody"]),delete nt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lg('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lg('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=L.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=XZ(b,n)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));wo&&wo(L),fp=L}},ZT=je({},[...RT,...BT,...BZ]),XT=je({},[...NT,...NZ]),T7=function(L){let Y=O(L);(!Y||!Y.tagName)&&(Y={namespaceURI:mp,tagName:"template"});let pe=d0(L.tagName),Gt=d0(Y.tagName);return y0[L.namespaceURI]?L.namespaceURI===up?Y.namespaceURI===Ss?pe==="svg":Y.namespaceURI===dp?pe==="svg"&&(Gt==="annotation-xml"||zg[Gt]):!!ZT[pe]:L.namespaceURI===dp?Y.namespaceURI===Ss?pe==="math":Y.namespaceURI===up?pe==="math"&&Wg[Gt]:!!XT[pe]:L.namespaceURI===Ss?Y.namespaceURI===up&&!Wg[Gt]||Y.namespaceURI===dp&&!zg[Gt]?!1:!XT[pe]&&(x7[pe]||!ZT[pe]):!!(am==="application/xhtml+xml"&&y0[L.namespaceURI]):!1},Oi=function(L){kg(r.removed,{element:L});try{O(L).removeChild(L)}catch{x(L)}},hp=function(L,Y){try{kg(r.removed,{attribute:Y.getAttributeNode(L),from:Y})}catch{kg(r.removed,{attribute:null,from:Y})}if(Y.removeAttribute(L),L==="is")if(dr||ir)try{Oi(Y)}catch{}else try{Y.setAttribute(L,"")}catch{}},YT=function(L){let Y=null,pe=null;if(xt)L="<remove></remove>"+L;else{let mr=NA(L,/^[\r\n\t ]+/);pe=mr&&mr[0]}am==="application/xhtml+xml"&&mp===Ss&&(L='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+L+"</body></html>");let Gt=C?C.createHTML(L):L;if(mp===Ss)try{Y=new h().parseFromString(Gt,am)}catch{}if(!Y||!Y.documentElement){Y=_.createDocument(mp,"template",null);try{Y.documentElement.innerHTML=g0?E:Gt}catch{}}let Kr=Y.body||Y.documentElement;return L&&pe&&Kr.insertBefore(t.createTextNode(pe),Kr.childNodes[0]||null),mp===Ss?N.call(Y,Q?"html":"body")[0]:Q?Y.documentElement:Kr},JT=function(L){return G.call(L.ownerDocument||L,L,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},x0=function(L){return L instanceof f&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},KT=function(L){return typeof l=="function"&&L instanceof l};function Ts(he,L,Y){c0(he,pe=>{pe.call(r,L,Y,fp)})}let QT=function(L){let Y=null;if(Ts(z.beforeSanitizeElements,L,null),x0(L))return Oi(L),!0;let pe=Mr(L.nodeName);if(Ts(z.uponSanitizeElement,L,{tagName:pe,allowedTags:ye}),K&&L.hasChildNodes()&&!KT(L.firstElementChild)&&Mo(/<[/\w!]/g,L.innerHTML)&&Mo(/<[/\w!]/g,L.textContent)||L.nodeType===Rg.progressingInstruction||K&&L.nodeType===Rg.comment&&Mo(/<[/\w]/g,L.data))return Oi(L),!0;if(!ye[pe]||nt[pe]){if(!nt[pe]&&eC(pe)&&(se.tagNameCheck instanceof RegExp&&Mo(se.tagNameCheck,pe)||se.tagNameCheck instanceof Function&&se.tagNameCheck(pe)))return!1;if(pp&&!Is[pe]){let Gt=O(L)||L.parentNode,Kr=M(L)||L.childNodes;if(Kr&&Gt){let mr=Kr.length;for(let Eo=mr-1;Eo>=0;--Eo){let Cs=T(Kr[Eo],!0);Cs.__removalCount=(L.__removalCount||0)+1,Gt.insertBefore(Cs,I(L))}}}return Oi(L),!0}return L instanceof c&&!T7(L)||(pe==="noscript"||pe==="noembed"||pe==="noframes")&&Mo(/<\/no(script|embed|frames)/i,L.innerHTML)?(Oi(L),!0):(q&&L.nodeType===Rg.text&&(Y=L.textContent,c0([ee,re,ue],Gt=>{Y=Ag(Y,Gt," ")}),L.textContent!==Y&&(kg(r.removed,{element:L.cloneNode()}),L.textContent=Y)),Ts(z.afterSanitizeElements,L,null),!1)},qT=function(L,Y,pe){if(wi&&(Y==="id"||Y==="name")&&(pe in t||pe in S7))return!1;if(!(k&&!dt[Y]&&Mo(Ce,Y))){if(!($t&&Mo(Oe,Y))){if(!Ie[Y]||dt[Y]){if(!(eC(L)&&(se.tagNameCheck instanceof RegExp&&Mo(se.tagNameCheck,L)||se.tagNameCheck instanceof Function&&se.tagNameCheck(L))&&(se.attributeNameCheck instanceof RegExp&&Mo(se.attributeNameCheck,Y)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(Y))||Y==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&Mo(se.tagNameCheck,pe)||se.tagNameCheck instanceof Function&&se.tagNameCheck(pe))))return!1}else if(!Aa[Y]){if(!Mo(Ee,Ag(pe,Fe,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&L!=="script"&&AZ(pe,"data:")===0&&h0[L])){if(!(H&&!Mo(Pe,Ag(pe,Fe,"")))){if(pe)return!1}}}}}}return!0},eC=function(L){return L!=="annotation-xml"&&NA(L,ce)},tC=function(L){Ts(z.beforeSanitizeAttributes,L,null);let{attributes:Y}=L;if(!Y||x0(L))return;let pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie,forceKeepAttr:void 0},Gt=Y.length;for(;Gt--;){let Kr=Y[Gt],{name:mr,namespaceURI:Eo,value:Cs}=Kr,lm=Mr(mr),v0=Cs,Qr=mr==="value"?v0:LZ(v0);if(pe.attrName=lm,pe.attrValue=Qr,pe.keepAttr=!0,pe.forceKeepAttr=void 0,Ts(z.uponSanitizeAttribute,L,pe),Qr=pe.attrValue,cp&&(lm==="id"||lm==="name")&&(hp(mr,L),Qr=im+Qr),K&&Mo(/((--!?|])>)|<\/(style|title)/i,Qr)){hp(mr,L);continue}if(pe.forceKeepAttr)continue;if(!pe.keepAttr){hp(mr,L);continue}if(!P&&Mo(/\/>/i,Qr)){hp(mr,L);continue}q&&c0([ee,re,ue],oC=>{Qr=Ag(Qr,oC," ")});let rC=Mr(L.nodeName);if(!qT(rC,lm,Qr)){hp(mr,L);continue}if(C&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!Eo)switch(b.getAttributeType(rC,lm)){case"TrustedHTML":{Qr=C.createHTML(Qr);break}case"TrustedScriptURL":{Qr=C.createScriptURL(Qr);break}}if(Qr!==v0)try{Eo?L.setAttributeNS(Eo,mr,Qr):L.setAttribute(mr,Qr),x0(L)?Oi(L):BA(r.removed)}catch{hp(mr,L)}}Ts(z.afterSanitizeAttributes,L,null)},C7=function he(L){let Y=null,pe=JT(L);for(Ts(z.beforeSanitizeShadowDOM,L,null);Y=pe.nextNode();)Ts(z.uponSanitizeShadowNode,Y,null),QT(Y),tC(Y),Y.content instanceof i&&he(Y.content);Ts(z.afterSanitizeShadowDOM,L,null)};return r.sanitize=function(he){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,pe=null,Gt=null,Kr=null;if(g0=!he,g0&&(he="<!-->"),typeof he!="string"&&!KT(he))if(typeof he.toString=="function"){if(he=he.toString(),typeof he!="string")throw Lg("dirty is not a string, aborting")}else throw Lg("toString is not a function");if(!r.isSupported)return he;if(De||b0(L),r.removed=[],typeof he=="string"&&(Rl=!1),Rl){if(he.nodeName){let Cs=Mr(he.nodeName);if(!ye[Cs]||nt[Cs])throw Lg("root node is forbidden and cannot be sanitized in-place")}}else if(he instanceof l)Y=YT("<!---->"),pe=Y.ownerDocument.importNode(he,!0),pe.nodeType===Rg.element&&pe.nodeName==="BODY"||pe.nodeName==="HTML"?Y=pe:Y.appendChild(pe);else{if(!dr&&!q&&!Q&&he.indexOf("<")===-1)return C&&ur?C.createHTML(he):he;if(Y=YT(he),!Y)return dr?null:ur?E:""}Y&&xt&&Oi(Y.firstChild);let mr=JT(Rl?he:Y);for(;Gt=mr.nextNode();)QT(Gt),tC(Gt),Gt.content instanceof i&&C7(Gt.content);if(Rl)return he;if(dr){if(ir)for(Kr=R.call(Y.ownerDocument);Y.firstChild;)Kr.appendChild(Y.firstChild);else Kr=Y;return(Ie.shadowroot||Ie.shadowrootmode)&&(Kr=X.call(o,Kr,!0)),Kr}let Eo=Q?Y.outerHTML:Y.innerHTML;return Q&&ye["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Mo(XA,Y.ownerDocument.doctype.name)&&(Eo="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
|
|
755
|
+
`+Eo),q&&c0([ee,re,ue],Cs=>{Eo=Ag(Eo,Cs," ")}),C&&ur?C.createHTML(Eo):Eo},r.setConfig=function(){let he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b0(he),De=!0},r.clearConfig=function(){fp=null,De=!1},r.isValidAttribute=function(he,L,Y){fp||b0({});let pe=Mr(he),Gt=Mr(L);return qT(pe,Gt,Y)},r.addHook=function(he,L){typeof L=="function"&&kg(z[he],L)},r.removeHook=function(he,L){if(L!==void 0){let Y=DZ(z[he],L);return Y===-1?void 0:kZ(z[he],Y,1)[0]}return BA(z[he])},r.removeHooks=function(he){z[he]=[]},r.removeAllHooks=function(){z=HA()},r}var JA=YA();var YZ={"connection-stairs-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
756
|
+
<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" />
|
|
757
|
+
<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" />
|
|
758
|
+
<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" />
|
|
759
|
+
<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" />
|
|
760
|
+
</svg>`,"connection-elevator-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
761
|
+
<circle cx="1.9375" cy="4.4375" r="0.9375" />
|
|
762
|
+
<circle cx="1.9375" cy="7.5625" r="0.9375" />
|
|
763
|
+
<path
|
|
764
|
+
fillRule="evenodd"
|
|
765
|
+
clipRule="evenodd"
|
|
766
|
+
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"
|
|
767
|
+
/>
|
|
768
|
+
</svg>`,"point-of-interest-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
769
|
+
<path
|
|
770
|
+
stroke="none"
|
|
771
|
+
id="Subtract"
|
|
772
|
+
fill-rule="evenodd"
|
|
773
|
+
clip-rule="evenodd"
|
|
774
|
+
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"
|
|
775
|
+
/>
|
|
776
|
+
</svg>`,"door-12x12":`<svg viewBox="0 0 13 12">
|
|
777
|
+
<path
|
|
778
|
+
stroke="none"
|
|
779
|
+
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"
|
|
780
|
+
/>
|
|
781
|
+
</svg>`,"building-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
782
|
+
<path
|
|
783
|
+
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"
|
|
784
|
+
stroke="none"
|
|
785
|
+
/>
|
|
786
|
+
</svg>`},JZ=/<svg([^>]*)>/g;function KA(e,r,t){let o=YZ[e];return o?o.replace(JZ,`<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:${r}; width:${t}px; height:${t}px">`):null}function KZ(e){return JA.sanitize(e,{USE_PROFILES:{svg:!0}})}function QZ(e,r){let n=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;return n==null||n.tagName==="parsererror"||n.tagName.toLowerCase()!=="svg"?(A.error("Failed to parse SVG",{svg:e,tagName:n?.tagName}),e):(r!=null&&(n.setAttribute("color",r),n.querySelectorAll("*").forEach(l=>{(l.getAttribute("fill")!=null||l.tagName==="path")&&l.getAttribute("fill")!=="none"&&l.setAttribute("fill","currentColor"),l.getAttribute("stroke")!=null&&l.getAttribute("stroke")!=="none"&&l.setAttribute("stroke","currentColor")})),new XMLSerializer().serializeToString(n))}async function QA(e,r){let t="";try{if(e.trim()==="")throw new Error("URL is empty!");r?.style==="fill"&&(e=e.replace(".svg","-fill.svg"));let o=await tn()(e),n=o.headers.get("content-type");if(n?.includes("image/svg+xml")){let i=await o.text();return t=KZ(i),r?.color!=null&&(t=QZ(t,r.color)),{icon:t,type:"svg"}}else{if(n?.includes("image"))return{icon:e,type:"image"};throw new Error(`Expected SVG or Image content, but received: ${n}`)}}catch(o){return A.error(`Failed to fetch icon from ${e}.`,o),null}}d();function qA(e){return e.locationProfiles.some(r=>r.categories.some(t=>t.name.includes("Restroom")))}function e7(e){return e.locationProfiles.some(r=>r.categories.some(t=>t.name.includes("Parking")))}var ap={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F",parking:"#418425",door:"#A0552C"},Bg={elevator:"connection-elevator-12x12",escalator:"connection-stairs-12x12",stairs:"connection-stairs-12x12",point:"point-of-interest-12x12",door:"door-12x12",building:"building-12x12"};function qZ(e){let r=null;if(an.is(e))switch(e.type){case"elevator":r=Bg.elevator;break;case"escalator":case"stairs":default:r=Bg.stairs}else sn.is(e)?r=Bg.point:go.is(e)?r=Bg.door:Ar.is(e)&&(r=Bg.building);return r!=null?KA(r,"#FFFFFF",12):null}function t7(e){return an.is(e)?ap.connection:Ar.is(e)?ap.default:qA(e)?ap.washroom:e7(e)?ap.parking:sn.is(e)?ap.point:go.is(e)?ap.door:ap.default}async function eX(e,r){let t=null,o="locationProfiles"in e?e.locationProfiles.find(n=>n.icon!=null)?.icon:null;if(o?.url!=null&&(t=await QA(o.url,{color:r.color,style:"fill"})),t==null){let n=qZ(e);n!=null&&(t={icon:n,type:"svg"})}return t}async function tX(e){return an.is(e)||go.is(e)?"low":sn.is(e)||Ar.is(e)?"high":"medium"}async function rX(e){let r={appearance:{color:t7(e),pinOutlineColor:t7(e),iconPadding:8,iconSize:24,textSize:12.5,iconScale:{on:"zoom-level",input:[18,20],output:[.7,1]}},rank:await tX(e),interactive:!0},t=await eX(e,{color:"#FFFFFF"});return t!=null&&(r.appearance.icon=t.icon,t.type==="svg"?Ar.is(e)&&(r.appearance.iconSize=30,r.appearance.iconPadding=10):t.type==="image"&&(r.appearance.iconSize=48,r.appearance.iconPadding=2,r.appearance.pinOutlineColor="#FFFFFF",r.rank="high")),r}function r7(e,r){let t=[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space"),...e.getByType("object"),...e.getByType("door"),...e.getByType("facade")].flatMap(async o=>{let n=[],i=await rX(o);return an.is(o)?n=o.coordinates.map(a=>r.Labels.add(a,o.name,i)):Ar.is(o)?o.spaces.length>0&&o.floorStack.name!=null&&o.floorStack.name!==""&&n.push(r.Labels.add(o.spaces[0],o.floorStack.name,i)):"name"in o&&o.name!=null&&o.name!==""&&n.push(r.Labels.add(o,o.name,i)),n});return Promise.all(t).then(o=>o.flat())}async function o7(e,r){let t=[r7(e,r),_A(e,r)],[o]=await Promise.all(t);return{labels:o}}var u0=.05,jg,Gg,Ng=class extends ke{constructor(t,o,n){super();m(this,"core");m(this,"mapObjects",[]);m(this,"id");m(this,"mapDataExternal",{});m(this,"mapsByFloorId",{});m(this,"mapData");m(this,"currentMap");m(this,"hiddenOutdoorGeometries",[]);m(this,"lastFacadeIntersected");S(this,jg,!1);S(this,Gg,!1);m(this,"mapView");m(this,"externalPubSub");m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"Outdoor");m(this,"BlueDot");m(this,"Shapes");m(this,"Style");m(this,"Image3D");m(this,"update",()=>{this.core.render()});this.core=t,this.mapView=o,this.externalPubSub=n,this.Camera=new jh(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new Wh("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,this.core.on("pre-render",()=>{n.publish("pre-render")}),this.core.on("post-render",()=>{n.publish("post-render")}),this.core.on("resize",()=>{n.publish("resize")}),this.core.on("render-error",({error:u})=>{n.publish("render-error",{error:new nC(u instanceof Error?u.message:"Unknown error")})});let a=u=>{let f=this.getMapDataObject(u);switch(f?.__type){case"facade":return f;case"floor":return f.floorStack.facade;default:return null}};this.core.on("geometry-in-focus",u=>{let f=new Set;for(let h of u){let b=a(h);b&&f.add(b)}n.publish("facades-in-view-change",{facades:Array.from(f)})}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{n.publish("state-change-internal",{Camera:this.getCameraState()})});let l=new kh(this.Camera,{precision:7});this.core.on("camera-change",()=>{n.publish("camera-change",l)});let c=u=>f=>{let h=[],b=[],v=[],T=[];f.labels.forEach(R=>{let N=this.Labels.getById(R.toString());N&&h.push(N.label)}),f.markers.forEach(R=>{let N=this.Markers.getById(R.toString())||this.Navigation.getMarkerById(R.toString());N&&b.push(N.marker)}),f.models.forEach(R=>{let N=this.Models.getById(R.toString());N&&v.push(N.model)}),f.paths.forEach(R=>{let N=this.Paths.getById(R.toString())||this.Navigation.getPathById(R.toString());N&&T.push(N.path)});let x=f.geometry.includes(sg),I=f.geometry.filter(R=>R!==sg),M;I.length>0&&(M=I.map(R=>this.getMapDataInternal()?.getById("space",R)).filter(Boolean)[0],M||(M=I.map(R=>this.getMapDataInternal()?.getById("object",R)).filter(Boolean)[0]),M||(M=I.map(R=>this.getMapDataInternal()?.getById("area",R)).filter(Boolean)[0]),M||(M=I.map(R=>this.Shapes.getById(R)).filter(Boolean)[0]));let O=f.containers.reduce((R,N)=>{let X=this.getMapDataInternal()?.getById("floor",N);return X&&Bo.is(X)&&R.push(X),R},[]),C,E=0;if(O.length>0){C=O[0].id;let R=this.core.getState(C);E=f.coordinate[2]?f.coordinate[2]-R.altitude:E}let _;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(R=>{this.core.setState(R.id,{hovered:!1})}),M&&vr.is(M)&&(_=I.map(R=>this.getMapDataInternal()?.facadesBySpaceId[R]).filter(Boolean)[0],_&&_.spaces.forEach(R=>{this.core.setState(R.id,{hovered:!0})})),this.lastFacadeIntersected=_;let G={coordinate:new fe({latitude:f.coordinate[1],longitude:f.coordinate[0],floorId:C,verticalOffset:E}),spaces:M&&vr.is(M)?[M]:[],objects:M&&No.is(M)?[M]:[],areas:M&&On.is(M)?[M]:[],shapes:M&&ga.is(M)?[M]:[],markers:b,labels:h,models:v,paths:T,floors:O,facades:_?[_]:[]};"pointerEvent"in f&&(G.pointerEvent=f.pointerEvent),x&&(u==="click"?this.BlueDot.publish("click",{coordinate:new fe({longitude:f.coordinate[0],latitude:f.coordinate[1]})}):u==="hover"&&this.BlueDot.publish("hover")),n.publish(u,G)};this.core.on("hover",c("hover")),this.core.on("click",c("click")),this.core.on("user-interaction-start",()=>{n.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{n.publish("user-interaction-end")});let p={currentMapGetter:()=>this.currentMap};this.Markers=new Zh(p),this.Models=new Kh(p),this.Labels=new Vh(p),this.Text3D=new vg(p),this.Exporter=new Uh(p),this.Paths=new qh(p),this.Navigation=new Bh(this.core,this,p.currentMapGetter),this.on("navigation-state-change",u=>{this.externalPubSub.publish("state-change-internal",{Navigation:u})}),this.on("navigation-connection-click",u=>{this.externalPubSub.publish("navigation-connection-click",u)}),this.on("navigation-active-path-change",u=>{this.externalPubSub.publish("navigation-active-path-change",u)}),this.BlueDot=new Yu(this.core,this),this.BlueDot.on("blue-dot-position-update",()=>{this._publishBlueDotState({coordinate:this.BlueDot.coordinate,heading:this.BlueDot.heading,accuracy:this.BlueDot.accuracy,floor:this.BlueDot.floor})}),this.BlueDot.on("blue-dot-state-change",()=>{this._publishBlueDotState({state:this.BlueDot.state})}),this.BlueDot.on("blue-dot-follow-change",()=>{this._publishBlueDotState({following:this.BlueDot.following})}),this.Outdoor=new Ju(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{n.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{n.publish("outdoor-style-loaded")})),this.Image3D=new Yh(p),this.Shapes=new fg(p),this.Style=new gg(p)}get manualFloorVisibility(){return s(this,jg)}set manualFloorVisibility(t){w(this,jg,t),this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:t})}get hidePathsNotOnCurrentFloor(){return s(this,Gg)}set hidePathsNotOnCurrentFloor(t){w(this,Gg,t),this.currentMap?.updatePathLayersVisibility()}preloadFloors(t){t.forEach(o=>{o instanceof Bo&&this.core.setState(o.id,{preloadGeometry:!0})})}updateState(t,o){if(o==null||typeof o!="object")return;if(t==="interior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(rr);if(a){let l=a.layers.get(sl);l&&this.core.hasState(l)&&this.core.setState(l,DT(kt(qu,o,{warn:!0}),this.core.getState(l)))}});return}if(t==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(rr);if(a){let l=a.layers.get(ts);l&&this.core.hasState(l)&&this.core.setState(l,DT(kt(qu,o,{warn:!0}),this.core.getState(l)))}});return}if(t==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(rr);if(a){let l=a.layers.get(Ud);l&&this.core.hasState(l)&&this.core.setState(l,a0(kt(sp,o,{warn:!0}),this.core.getState(l)))}});return}if(t==="exterior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(rr);if(a){let l=a.layers.get(Vd);l&&this.core.hasState(l)&&this.core.setState(l,a0(kt(sp,o,{warn:!0}),this.core.getState(l)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(n.__type!==Nn.__type&&!this.core.hasState(n.id)){A.warn(`Failed to update state for "${n.id}". No ${n.__type} found with that ID.`);return}if(ha.is(n))return this.core.setState(n.id,yA(kt(ET,o,{warn:!0}),this.core.getState(n.id)));if(us.is(n))return this.core.setState(n.id,xA(kt(FT,o,{warn:!0}),this.core.getState(n.id)));if(vr.is(n)||No.is(n)){let i=this.core.getState(n.id);if(i!=null){let a=i.parent&&i.parent.type==="geometry-group"?this.core.getState(i.parent):void 0;this.core.setState(n.id,hA(kt(Ku,o,{warn:!0}),i,a))}}if(On.is(n)&&this.core.setState(n.id,kt(Ku,o,{warn:!0})),Zc.is(n)&&this.core.setState(n.id,kt(AT,o,{warn:!0})),go.is(n)&&this.core.setState(n.id,a0(kt(sp,o,{warn:!0}),this.core.getState(n.id))),ga.is(n)&&this.core.setState(n.id,kt(Dg,o,{warn:!0})),Yc.is(n)){let{position:i,scale:a,rotation:l,...c}=kt(AA,o,{warn:!0}),p=c;i&&(p.position=[i.longitude,i.latitude,i.verticalOffset]),a!=null&&(Array.isArray(a)?p.scale=a:p.scale=[a,a,a]),l!=null&&(Array.isArray(l)?p.rotation=l:p.rotation=[l,l,l]),i&&n.updateTarget(i),this.core.setState(n.id,p)}if(Bo.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;let a=kt(Pg,o,{warn:!0});this.core.setState(n.id,a);let l=i.layers.get(rr);l!=null&&"geometry"in o&&o.geometry&&this.core.setState(l.containerId,kt(Tg,o.geometry,{warn:!0}));let c=i.layers.get(rs);if(c!=null&&"labels"in o&&o.labels){let T=kt(Cg,o.labels,{warn:!0});"enabled"in T&&typeof T.enabled=="boolean"&&c.setVisible(T.enabled)}let p=i.layers.get(li);if(p!=null&&"markers"in o&&o.markers){let T=kt(Mg,o.markers,{warn:!0});"enabled"in T&&typeof T.enabled=="boolean"&&p.setVisible(T.enabled)}let u=i.layers.get($d);u!=null&&"footprint"in o&&o.footprint&&this.core.setState(u.containerId,kt(Sg,o.footprint,{warn:!0}));let f=i.layers.get(al);if(f!=null&&"occlusion"in o&&o.occlusion){let T=kt(Og,o.occlusion,{warn:!0});"enabled"in T&&typeof T.enabled=="boolean"&&f.setVisible(T.enabled)}let h=i.layers.get(Hd);if(h!=null&&"images"in o&&o.images){let T=kt(wg,o.images,{warn:!0});"visible"in T&&typeof T.visible=="boolean"&&h.setVisible(T.visible)}let b=i.layers.get(os);if(b!=null&&"paths"in o&&o.paths!=null){let T=kt(Eg,o.paths,{warn:!0});T.visible!=null&&typeof T.visible=="boolean"&&b.setVisible(T.visible)}let v=i.layers.get(fc);if(v!=null&&"areas"in o&&o.areas!=null){let T=kt(Fg,o.areas,{warn:!0});T.visible!=null&&typeof T.visible=="boolean"&&v.setVisible(T.visible)}}if(Ar.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,kt(Ig,o,{warn:!0}))}if(El.is(n)&&this.core.setState(n.id,kt(OA,o,{warn:!0})),Nn.is(n))for(let i of n.segments)this.core.setState(i.id,kt(Qu,o,{warn:!0}));Bu.is(n)&&this.core.setState(n.id,kt(Qu,o,{warn:!0}))}}getMapDataObject(t){return this.getMapDataInternal()?.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Om(this.mapData)}getMapData(){return this.mapData}addMap(t,o){return new Promise(n=>{let i;try{i=Om(t)}catch(h){A.error("Error adding map",h),n(t);return}this.mapDataExternal[t.mapName]=t,this.mapData=t;let{mvf:a}=i,l=a["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new fe(l[1],l[0])});let c=a["manifest.geojson"].features[0].properties.name,p=new Wh(`mapObject-${c}`,i,o,this);this.currentMap=p,this.currentMap.loadAllFloors(),this.currentMap.setFloor(this.currentMap.startingFloorId);let u=this.core.getBoundingArea(p.currentFloor.id);u==null&&A.error("Could not determine bounding box for map:",p.currentFloor.id);let f=o?.outdoorView?.layersHiddenByGeometry??[];if(f.length>0){let h,b=[];for(let v of p.floorStacksById.values())if(v.defaultFloor.footprint&&v.defaultFloor.footprint.geometry!=null&&v.defaultFloor.footprint.geometry?.coordinates.length>0){let T=v.defaultFloor.footprint,x=b1(T);h==null?h=x:z5(h,x),b.push(T)}b.length>0&&h!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(h,b,f),this.hiddenOutdoorGeometries.push([h,b,f]))}if(this.mapObjects.push(p),i.getMVFFeatureByType("floor").forEach(h=>{this.mapsByFloorId[h.id]=p}),p.on("floor-change-start",h=>{this.externalPubSub.publish("floor-change-start",{reason:h.reason,floor:this.getMapDataInternal()?.getById("floor",h.floorId)??this.currentFloor,previousFloor:this.getMapDataInternal()?.getById("floor",h.previousFloorId)??this.currentFloor})}),p.on("floor-change",h=>{this.externalPubSub.publish("floor-change",{reason:h.reason,floor:this.currentFloor,previousFloor:this.getMapDataInternal()?.getById("floor",h.previousFloorId)??this.currentFloor}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})}),o?.zoomLevel!=null)this.core.camera.setZoomLevel(o.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&u){let h=o?.screenOffsets??{top:u0*this.core.canvasHeight,left:u0*this.core.canvasWidth,right:u0*this.core.canvasWidth,bottom:u0*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:k5,padding:h}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),n(t)})}else n(t)})}setFloor(t,o){return this.currentMap.setFloor(xf(t),o)}setFloorStack(t,o){return this.currentMap.setFloorStack(xf(t),o)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){let t=this.currentMap.currentFloorStack.id;if(!t)throw new wr("Missing currentFloorStack.");let o=this.mapData?.getById("floor-stack",t);if(!o)throw new wr("FloorStack was not found in map data.");return o}get currentFloor(){let t=this.currentMap.currentFloor.id;if(!t)throw new wr("Missing currentFloor object from GeoJsonApi");let o=this.mapData?.getById("floor",t);if(!o)throw new wr("Missing currentFloor");return o}getState(t){typeof t=="object"&&Nn.is(t)&&A.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let o=H5(t,this),n=this.core.getState(o);if(n){if(["interior-walls","exterior-walls"].includes(t)&&n.type==="geometry-group")return FA(n);if(["interior-doors","exterior-doors"].includes(t)&&n.type==="geometry-group")return tA(n);if(n.type==="geometry"){let i;return"parent"in n&&n.parent&&n.parent.type==="geometry-group"&&(i=this.core.getState(n.parent)),fA(n,i)}else{if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return gA(n);if(n.type==="marker"&&n.options?.rank!==void 0&&n.options.interactive!==void 0)return bA(n,this.Markers.getById(n.id.toString())?.marker);if(n.type==="model")return LA(n);if(n.type==="image")return DA(n);if(n.type==="text3d")return EA(n);if(n.type==="geometry-group"&&t&&typeof t!="string"&&ga.is(t))return TA(n);if(n.type==="path")return IA(n);if(n.type==="group-container"&&typeof t!="string"&&Bo.is(t))return uA(n,this.currentMap.floorsById.get(t.id),this.core);if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Ar.is(t)){let i=this.core.getState(n.children[0].id);return oA(i)}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return t?.type==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,o,n){if(n!=null){let p=this.core.projectScreenXYToCoordinate(t,o,!0);return p?new fe(p.coordinate[1],p.coordinate[0],n.id):void 0}let i=this.core.projectScreenXYToCoordinate(t,o);if(i==null||i.coordinate==null)return;let{coordinate:a,groupContainers:l}=i,c=l?.find(p=>{let u=p.userData.entityId.toString();return u.includes("f_")||u.includes("m_")})?.userData.entityId.toString();return new fe(a[1],a[0],c)}getScreenCoordinateFromCoordinate(t){let o=0;if(t.floorId!=null){let n=this.mapData?.getById("floor",t.floorId);n!=null&&(o=this.getState(n)?.altitude??0)}return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude,o])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}getInView(t,o){let n=this.core.queryGeometry2DInView({screenOffsets:o?.screenOffsets,fullyContains:o?.fullyContains});if(n.length===0)return[];let i=[];switch(t){case ha.__type:i=n.map(a=>this.Labels.getById(a)).filter(a=>a!=null).map(a=>a.label);break;case us.__type:i=n.map(a=>this.Markers.getById(a)).filter(a=>a!=null).map(a=>a.marker)}return i}async __EXPERIMENTAL__auto(){let t=this.getMapDataInternal();if(!t)throw new Error("Map data not found");return await o7(t,this)}tween(t){let o=new ui(t);return this.core.getExternalTweenGroup().add(o),this.core.render(),o}removeTween(t){this.core.getExternalTweenGroup().remove(t)}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}}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.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Image3D.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}_publishBlueDotState(t){let o;if(t)o=t;else{let{state:n,following:i,heading:a,accuracy:l,coordinate:c,floor:p}=this.BlueDot;o={state:n,following:i,heading:a,accuracy:l,coordinate:c,floor:p}}this.externalPubSub.publish("state-change-internal",{BlueDot:o})}getOptimalVisualDistanceBetweenFloors(t,o=!1){let n=this.currentMap;if(!n){A.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(t.length<2){A.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let i=n.renderer.getInternalState().geometry3DMap.get(t[0].id),a=n.renderer.getInternalState().geometry3DMap.get(t[1].id);if(!i||!a){A.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}if(vp(i,"group-container"),vp(a,"group-container"),o){let c=new sr;c.setFromObject(i);let p=new sr;if(p.setFromObject(a),i.children.forEach(x=>{x instanceof Le&&x.userData.debugBox&&Ht(x)}),a.children.forEach(x=>{x instanceof Le&&x.userData.debugBox&&Ht(x)}),!Bl(c)||!Bl(p))return;let u=new Wn(c.max.x-c.min.x,c.max.y-c.min.y,c.max.z-c.min.z),f=new Nr({color:255,transparent:!0,opacity:.5}),h=new Le(u,f);h.position.set((c.min.x+c.max.x)/2,(c.min.y+c.max.y)/2,(c.min.z+c.max.z)/2),h.userData.debugBox=!0;let b=new Wn(p.max.x-p.min.x,p.max.y-p.min.y,p.max.z-p.min.z),v=new Nr({color:"cyan",transparent:!0,opacity:.5}),T=new Le(b,v);T.position.set((p.min.x+p.max.x)/2,(p.min.y+p.max.y)/2,(p.min.z+p.max.z)/2),T.userData.debugBox=!0,i.add(h),a.add(T)}let l=n.renderer.computeMinZOffsetBetweenContainers(i,a);if(l!==-1)return l}};jg=new WeakMap,Gg=new WeakMap;function oX(e){if(e===""){nT(""),oT("");return}oT(`${e}/${R0}`),nT(`${e}/${_0}`)}d();var m0=class{constructor(r){m(this,"state");m(this,"update");this.update=r.Debug.update.bind(r.Debug),this.state=r.Debug.state}};d();var n7=J.object({environment:J.union([J.literal("basic"),J.literal(!1)]).optional(),text3d:J.object({hoverColor:J.string().optional()}).optional(),geometry:J.object({hoverColor:J.string().optional()}).optional(),backgroundColor:J.string().optional(),backgroundAlpha:J.number().optional()}).strict();d();var VT=gp($C(),1);var nX=(e,r)=>{let t={},o=(n,i,a)=>{for(let l in i){let c=n[l],p=i[l];typeof p=="object"&&!Array.isArray(p)&&p!==null&&typeof c=="object"&&!Array.isArray(c)&&c!==null?(a[l]={},o(c,p,a[l])):a[l]=c}};return o(e,r,t),t},i7=(e,r)=>{let t=nX(e,r),o=(0,VT.default)({},t,r),n=(0,VT.default)({},t),i=(a,l,c,p=n)=>{for(let u in l){let f=a[u],h=l[u];if(typeof h=="number"&&typeof f=="number")p[u]=f+(h-f)*c;else if(typeof h=="string"&&typeof f=="string"){if(mm(f)&&mm(h)){let b=M0(f),v=M0(h);b&&v?p[u]=EC([b[0]+(v[0]-b[0])*c,b[1]+(v[1]-b[1])*c,b[2]+(v[2]-b[2])*c]):A.warn(`Color "${u}" could not be animated!`)}}else typeof h=="object"&&h!==null&&typeof f=="object"&&f!==null?i(f,h,c,p[u]):A.warn(`Value "${u}" could not be animated!`)}};return a=>(a=Math.min(Math.max(a,0),1),a===0?e:a===1?o:(i(t,r,a),n))};var lp,ne,$n,Ug=class{constructor(r){S(this,lp);S(this,ne);S(this,$n);m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Image3D");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"__BlueDot");m(this,"Style");m(this,"Shapes");m(this,"Outdoor");m(this,"update",()=>{s(this,ne).core.render()});m(this,"__LEGACY_GET_DIRECTIONS_SYNC",(r,t,o)=>s(this,ne).getMapData()?.__LEGACY_GET_DIRECTIONS_SYNC(r,t,o)??void 0);m(this,"getDirections",(r,t,o)=>s(this,ne).getMapData()?.getDirections(r,t,o)??Promise.resolve(void 0));m(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(r,t,o)=>s(this,ne).getMapData()?.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(r,t,o)??void 0);m(this,"getDirectionsMultiDestination",(r,t,o)=>s(this,ne).getMapData()?.getDirectionsMultiDestination(r,t,o)??Promise.resolve(void 0));m(this,"on",(r,t)=>{s(this,lp).on(r,t)});m(this,"off",(r,t)=>{s(this,lp).off(r,t)});m(this,"Debug");w(this,lp,new ke),w(this,$n,r);let t=new Ng(r,this,s(this,lp));w(this,ne,t),this.Camera=s(this,ne).Camera,this.Markers=s(this,ne).Markers,this.Models=s(this,ne).Models,this.Labels=s(this,ne).Labels,this.Text3D=s(this,ne).Text3D,this.Exporter=s(this,ne).Exporter,this.Paths=s(this,ne).Paths,this.Navigation=s(this,ne).Navigation,this.__BlueDot=s(this,ne).BlueDot,this.Shapes=s(this,ne).Shapes,this.Style=s(this,ne).Style,this.Outdoor=s(this,ne).Outdoor,this.Image3D=s(this,ne).Image3D,s(this,$n).container.dataset.version=y.env.npm_package_version,this.Debug=new m0(s(this,ne).core)}updateState(r,t){return s(this,ne).updateState(r,t)}animateState(r,t,o){let n=s(this,ne).getState(r);if(n==null)return A.warn(`Cannot animate state of ${r}.`),new Promise(p=>p({result:"completed"}));let i=i7(n,t),a=s(this,ne).tween({percent:0}).to({percent:1},o?.duration??1e3).onUpdate(({percent:c})=>{s(this,ne).updateState(r,i(c))});o?.easing&&o.easing in ls&&a.easing(ls[o.easing]);let l=new Promise(c=>{a.onComplete(()=>{s(this,ne).removeTween(a),c({result:"completed"})}).onStop(()=>{s(this,ne).removeTween(a),c({result:"cancelled"})}),a.start()});return l.cancel=()=>{a.stop(),s(this,ne).updateState(r,i(0))},l}updateGlobalState(r){try{n7.parse(r)}catch(t){A.error("updateGlobalState",t);return}if(typeof r=="object"){let t={};if(r.text3d?.hoverColor&&(t.text3dHoverColor=r.text3d.hoverColor),r.geometry?.hoverColor&&(t.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let o=r.backgroundColor??s(this,ne).core.backgroundColor,n=r.backgroundAlpha??s(this,ne).core.backgroundAlpha;s(this,ne).core.setBackgroundColor(o,n)}r.environment!=null&&s(this,ne).core.setEnvironment(r.environment),s(this,ne).core.setState(t)}}get options(){return _5(s(this,ne).currentMap.options)}getGlobalState(){let r=s(this,ne).core.getState();return{backgroundColor:s(this,ne).core.backgroundColor,backgroundAlpha:s(this,ne).core.backgroundAlpha,environment:s(this,ne).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){if(s(this,ne).mapData==null)throw new wr("MapData not found.");return s(this,ne).mapData}getDimensions(){return{width:s(this,$n).canvasWidth,height:s(this,$n).canvasHeight}}addMap(r,t){return s(this,ne).addMap(r,t)}setFloor(r,t){return s(this,ne).setFloor(r,t?.context)}setFloorStack(r,t){return s(this,ne).setFloorStack(r,t?.context)}preloadFloors(r){s(this,ne).preloadFloors(r)}tween(r){return s(this,ne).tween(r)}removeTween(r){s(this,ne).removeTween(r)}get tweenGroup(){return s(this,ne).tweenGroup()}get currentFloorStack(){return s(this,ne).currentFloorStack}get currentFloor(){return s(this,ne).currentFloor}updateWatermark(r){s(this,ne).updateWatermark(r)}getState(r){return s(this,ne).getState(r)}setHoverColor(r){s(this,ne).setHoverColor(r)}getHoverColor(){return s(this,ne).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return s(this,ne).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return s(this,ne).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return s(this,ne).isInView(r)}getInView(r,t){return s(this,ne).getInView(r,t)}getDistance(r,t){return s(this,ne).getMapData()?.getDistance(r,t)}createCoordinate(r,t,o){return typeof r=="object"?new fe(r):new fe(r,t,o?.id)}createCoordinateFromScreenCoordinate(r,t,o){return s(this,ne).createCoordinateFromScreenCoordinate(r,t,o)}getScreenCoordinateFromCoordinate(r){return s(this,ne).getScreenCoordinateFromCoordinate(r)}__EXPERIMENTAL__auto(){return s(this,ne).__EXPERIMENTAL__auto()}get __core(){if(y.env.INTERNAL==="true")return s(this,ne).core;throw new Error("__core is not available.")}get container(){return s(this,$n).container}publishAllState(){s(this,ne).publishAllState()}clear(){s(this,ne).clear()}destroy(){s(this,ne).destroy()}async enableDebug(r={}){let{Inspector:t}=await import("./inspector-YYGLNTAO.js");await new t(this,s(this,ne)).enable(r)}async takeScreenshot(r){let t={withOutdoorContext:r?.withOutdoorContext??!1},o=s(this,$n).rendererDomElement;if(t.withOutdoorContext){let n=s(this,$n).map;if(!n)return await s(this,$n).renderSync(),o.toDataURL("image/png");n.loaded()||await new Promise(c=>{n.once("idle",c)});let i=n.getCanvas(),a=document.createElement("canvas"),l=a.getContext("2d");if(a.width=o.width,a.height=o.height,!l)throw new Error("Failed to get 2D context for composite canvas");return l.drawImage(i,0,0,a.width,a.height),l.drawImage(o,0,0,a.width,a.height),a.toDataURL("image/png")}return await s(this,$n).renderSync(),o.toDataURL("image/png")}get manualFloorVisibility(){return s(this,ne).manualFloorVisibility}set manualFloorVisibility(r){s(this,ne).manualFloorVisibility=r}getOptimalVisualDistanceBetweenFloors(r){return s(this,ne).getOptimalVisualDistanceBetweenFloors(r)}get __INTERNAL__hidePathsNotOnCurrentFloor(){return s(this,ne).hidePathsNotOnCurrentFloor}set __INTERNAL__hidePathsNotOnCurrentFloor(r){s(this,ne).hidePathsNotOnCurrentFloor=!!r}};lp=new WeakMap,ne=new WeakMap,$n=new WeakMap;d();var iX=1e3*60*60*2,_l,tm,At,vs,Ci,Hn,Mi,rm,om,Vg,jt,s7,a7,em,f0,$T,HT,zT,nm=class{constructor(r,t){S(this,jt);S(this,_l,new ke);S(this,tm);S(this,At);S(this,vs);S(this,Ci);S(this,Hn);S(this,Mi);S(this,rm);S(this,om);S(this,Vg,()=>{"key"in s(this,At)&&"secret"in s(this,At)&&W(this,jt,em).call(this),W(this,jt,f0).call(this)});m(this,"on",(r,t)=>s(this,_l).on(r,t));m(this,"off",(r,t)=>s(this,_l).off(r,t));w(this,tm,r),w(this,At,t)}setMapIds(r){w(this,tm,r)}setEnterprise(r){s(this,At).enterprise=r}async readySync(){if((!("key"in s(this,At))||!("secret"in s(this,At)))&&!("accessToken"in s(this,At))){A.error("No API keys or access token provided! Cannot preload tokens.");return}let r=[W(this,jt,em).call(this),null];s(this,At).enterprise||(r[1]=this.getSasTokensAsync());let[t,o]=await Promise.all(r);W(this,jt,zT).call(this),W(this,jt,$T).call(this,t),o!=null&&W(this,jt,HT).call(this,o),um()&&globalThis.addEventListener?.("focus",s(this,Vg))}async refreshing(){let r=[];return s(this,vs)!=null&&r.push(s(this,vs)),s(this,Ci)!=null&&r.push(s(this,Ci)),Promise.all(r)}getAccessTokenAsync(){return W(this,jt,em).call(this)}getSasTokensAsync(){return W(this,jt,f0).call(this)}getAccessToken(){return s(this,Hn)==null?(A.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):s(this,Hn)}getSasToken(r){return this.isEnterpriseMode()?(A.error("SAS tokens are not available in the enterprise mode!"),{token:""}):s(this,Mi)==null?(A.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):r in s(this,Mi).tokens?s(this,Mi).tokens[r]:(A.error(`SAS token for map ${r} not found!`),{token:""})}isEnterpriseMode(){return s(this,At).enterprise??!1}destroy(){W(this,jt,zT).call(this),s(this,_l).destroy(),um()&&globalThis.removeEventListener("focus",s(this,Vg))}};_l=new WeakMap,tm=new WeakMap,At=new WeakMap,vs=new WeakMap,Ci=new WeakMap,Hn=new WeakMap,Mi=new WeakMap,rm=new WeakMap,om=new WeakMap,Vg=new WeakMap,jt=new WeakSet,s7=function(r){let t=r.token!==s(this,Hn)?.token;w(this,Hn,r),t&&s(this,_l).publish("access-token-refreshed",{accessToken:r})},a7=function(r){let t=JSON.stringify(r.tokens)!==JSON.stringify(s(this,Mi)?.tokens);w(this,Mi,r),t&&s(this,_l).publish("sas-tokens-refreshed",{sasTokens:r.tokens})},em=async function(r=!1){if("accessToken"in s(this,At)&&typeof s(this,At).accessToken=="string"){let t={token:s(this,At).accessToken,expires:Date.now()+72e5};return w(this,Hn,t),t}if(!("key"in s(this,At))||!("secret"in s(this,At))||typeof s(this,At).key!="string"||typeof s(this,At).secret!="string")throw new Error("No API keys or access token provided!");return s(this,vs)!=null?s(this,vs):s(this,Hn)!=null&&s(this,Hn).expires!=null&&s(this,Hn).expires>Date.now()&&!r?s(this,Hn):(w(this,vs,hf({...s(this,At),key:s(this,At).key,secret:s(this,At).secret},s(this,At).enterprise??!1).then(t=>{let o={token:t.accessToken,expires:t.expiresTimestamp*1e3};return W(this,jt,s7).call(this,o),o}).catch(t=>{throw t}).finally(()=>{w(this,vs,void 0)})),s(this,vs))},f0=async function(r=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:s(this,Ci)!=null?s(this,Ci):s(this,Mi)!=null&&s(this,Mi).expires>Date.now()&&!r?s(this,Mi):(w(this,Ci,new Promise((t,o)=>{W(this,jt,em).call(this).then(n=>{let i={},a=s(this,tm).map(l=>pS({...s(this,At),mapId:l},n.token).then(c=>{i[l]={token:c.token,expires:c.expires}}).catch(c=>{A.error(`Error getting SAS token for map ${l}:`,c)}));Promise.all(a).then(()=>{let l={tokens:i,expires:Math.min(...Object.values(i).map(c=>c.expires??1/0))};W(this,jt,a7).call(this,l),t(l)})}).catch(n=>{o(n)})})),s(this,Ci).catch(t=>{throw t}).finally(()=>{w(this,Ci,void 0)}),s(this,Ci))},$T=function(r){if(!("key"in s(this,At))||!("secret"in s(this,At)))return;let t=r.expires!=null?r.expires-Date.now():iX;isFinite(t)&&w(this,rm,setTimeout(()=>{W(this,jt,em).call(this,!0).then(o=>{W(this,jt,$T).call(this,o)})},t-e5))},HT=function(r){let t=r.expires-Date.now();isFinite(t)&&w(this,om,setTimeout(()=>{W(this,jt,f0).call(this,!0).then(o=>{W(this,jt,HT).call(this,o)})},t-o5))},zT=function(){s(this,rm)!=null&&clearTimeout(s(this,rm)),s(this,om)!=null&&clearTimeout(s(this,om))};d();var sX=async(e,r)=>{let t=("mvfVersion"in(r??{})?r?.mvfVersion:void 0)??("options"in e&&"version"in(e.options??{})?e.options?.version:void 0),o={prefetchTokens:!0,...r||{},mvfVersion:t},n,i=tl();i.updateByUserOption(o);let a={};if("type"in e&&typeof e.type=="string"){if(a.enterprise=e.options?.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){n=await n1(e.main,o.mvfVersion),a.languagePacks=[];for(let v of e.languagePacks??[])v.localePack instanceof Uint8Array&&a.languagePacks.push({language:v.language,localePack:await Td(v.localePack)})}else if(e.type==="json")n=e.main,a.languagePacks=e.languagePacks??[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(a.binaryBundle=e.main)}else n=e,a.enterprise=n.enterprise!=null;i.setEnterprise(a.enterprise??!1);let l=o1(n),c=l.length>0?l:[o.mapId];o.baseAuthUri=i.getBaseAuthUri();let p=new nm(c,{...o,enterprise:a.enterprise}),u;if("accessToken"in o&&o.accessToken)u=o.accessToken;else if("key"in o&&"secret"in o){let v;try{v=await p.getAccessTokenAsync()}catch(T){A.error("Failed getting token during hydrateMapData",T)}u=v?.token||""}if(a.outdoorViewToken=u,a.env=i,a.getMapDataOptions=o,o.prefetchTokens)try{await p.readySync()}catch(v){A.error("Failed to ready token manager!",v)}Nf()&&(a.enterprise&&A.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),o.mvfVersion!=="3.0.0"&&A.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let f=new Pc(n,a);u&&f.Analytics.init({accessToken:u,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:i.getAnalyticsBaseUri(),context:o.analytics?.context});let h=new wm(f),b=f.findPreferredLanguage({languageCode:o.language,fallbackToNavigatorLanguage:!1});if(b)try{await h.changeLanguage(b.code)}catch{}return typeof r?.onMVFParsed=="function"&&r.onMVFParsed(n),h};d();var l7=(e,{id:r}={})=>{let t=Array.isArray(e)?e:[e];if(!t.every(i=>typeof i=="string"))return;let o=t.join(""),n=null;if(r){let i=document.getElementById(r);i instanceof HTMLStyleElement&&(n=i)}n==null&&(n=document.createElement("style")),r&&r!==""&&(n.id=r),n.textContent=o,document.head.appendChild(n)};var c7=`:root {
|
|
787
|
+
--pin-shadow-hover-scale: 0.9;
|
|
788
|
+
--pin-shadow-width: 12px;
|
|
789
|
+
--pin-shadow-height: 5px;
|
|
790
|
+
--pin-shadow-opacity: 0.35;
|
|
791
|
+
--pin-drop-animation-duration-ms: 250ms;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
@keyframes drop-pin {
|
|
795
|
+
0% {
|
|
796
|
+
transform: translateY(-200%);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
100% {
|
|
800
|
+
transform: translateY(0);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
@keyframes pin-shadow {
|
|
805
|
+
0% {
|
|
806
|
+
transform: scale(var(--pin-shadow-hover-scale));
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
100% {
|
|
810
|
+
transform: scale(1);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.mappedin-dropped-pin-wrapper {
|
|
815
|
+
position: relative;
|
|
816
|
+
|
|
817
|
+
width: fit-content;
|
|
818
|
+
height: fit-content;
|
|
819
|
+
width: 36px;
|
|
820
|
+
height: 42px;
|
|
821
|
+
|
|
822
|
+
& svg {
|
|
823
|
+
position: absolute;
|
|
824
|
+
left: calc(50% - var(--pin-shadow-width));
|
|
825
|
+
animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
& > .pin-shadow {
|
|
829
|
+
position: absolute;
|
|
830
|
+
left: calc(50% - (var(--pin-shadow-width) / 2));
|
|
831
|
+
bottom: 0;
|
|
832
|
+
|
|
833
|
+
height: var(--pin-shadow-height);
|
|
834
|
+
width: var(--pin-shadow-width);
|
|
835
|
+
border-radius: 100%;
|
|
836
|
+
|
|
837
|
+
opacity: var(--pin-shadow-opacity);
|
|
838
|
+
|
|
839
|
+
animation: pin-shadow 250ms ease-in;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
@keyframes bounce {
|
|
844
|
+
0% {
|
|
845
|
+
transform: translateY(-10px);
|
|
846
|
+
opacity: 0;
|
|
847
|
+
}
|
|
848
|
+
12.5% {
|
|
849
|
+
transform: translateY(0);
|
|
850
|
+
opacity: 1;
|
|
851
|
+
}
|
|
852
|
+
25% {
|
|
853
|
+
transform: translateY(0);
|
|
854
|
+
}
|
|
855
|
+
37.5% {
|
|
856
|
+
transform: translateY(-10px);
|
|
857
|
+
}
|
|
858
|
+
50% {
|
|
859
|
+
transform: translateY(0);
|
|
860
|
+
}
|
|
861
|
+
62.5% {
|
|
862
|
+
transform: translateY(-10px);
|
|
863
|
+
}
|
|
864
|
+
75% {
|
|
865
|
+
transform: translateY(0);
|
|
866
|
+
}
|
|
867
|
+
87.5% {
|
|
868
|
+
transform: translateY(-10px);
|
|
869
|
+
}
|
|
870
|
+
100% {
|
|
871
|
+
transform: translateY(0);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
.mappedin-connection-marker {
|
|
876
|
+
position: relative;
|
|
877
|
+
display: flex;
|
|
878
|
+
|
|
879
|
+
.bouncey {
|
|
880
|
+
animation: bounce 2.5s linear;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.arrow--down {
|
|
884
|
+
transform: rotate(180deg);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.connection-circle {
|
|
888
|
+
display: flex;
|
|
889
|
+
box-sizing: border-box;
|
|
890
|
+
justify-content: center;
|
|
891
|
+
align-items: center;
|
|
892
|
+
border-radius: 50%;
|
|
893
|
+
border: 2px solid white;
|
|
894
|
+
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
|
|
895
|
+
background: #595959;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
`;var p7=`.mappedin-marker {
|
|
899
|
+
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
900
|
+
font-weight: normal;
|
|
901
|
+
top: 0;
|
|
902
|
+
position: absolute;
|
|
903
|
+
font-weight: bold;
|
|
904
|
+
color: black;
|
|
905
|
+
display: flex;
|
|
906
|
+
flex-direction: row;
|
|
907
|
+
will-change: transform, opacity;
|
|
908
|
+
transition: opacity 150ms ease-in-out;
|
|
909
|
+
justify-content: center;
|
|
910
|
+
opacity: 0;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/* Low priority pin strategy styles */
|
|
914
|
+
|
|
915
|
+
/* Hide child elements as well */
|
|
916
|
+
.mappedin-marker[data-placement='hidden'] > .mappedin-marker-content {
|
|
917
|
+
visibility: hidden;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/* Create the pin using ::before pseudo-element */
|
|
921
|
+
.mappedin-marker::before {
|
|
922
|
+
content: '';
|
|
923
|
+
display: none;
|
|
924
|
+
border-radius: 50%;
|
|
925
|
+
position: relative;
|
|
926
|
+
/* Default values - will be overridden by inline styles */
|
|
927
|
+
width: var(--mappedin-pin-size, 2px);
|
|
928
|
+
height: var(--mappedin-pin-size, 2px);
|
|
929
|
+
background-color: var(--pin-color, #666);
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
.mappedin-marker[data-placement='hidden']::before {
|
|
933
|
+
display: block;
|
|
934
|
+
}
|
|
935
|
+
`;var d7=`.mappedin__smart-collision-engine__container {
|
|
936
|
+
position: absolute;
|
|
937
|
+
left: 0px;
|
|
938
|
+
top: 0px;
|
|
939
|
+
bottom: 0px;
|
|
940
|
+
right: 0px;
|
|
941
|
+
pointer-events: none;
|
|
942
|
+
/* Enables colliders to use translate3D */
|
|
943
|
+
transform-style: preserve-3d;
|
|
944
|
+
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.mappedin__smart-collision-engine-debug__container {
|
|
948
|
+
position: absolute;
|
|
949
|
+
left: 0px;
|
|
950
|
+
top: 0px;
|
|
951
|
+
bottom: 0px;
|
|
952
|
+
right: 0px;
|
|
953
|
+
transition: opacity 300ms ease-in-out;
|
|
954
|
+
pointer-events: none;
|
|
955
|
+
will-change: opacity;
|
|
956
|
+
&.interacting {
|
|
957
|
+
opacity: 0.2;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
`;var u7=`.mappedin-map {
|
|
961
|
+
.mappedin-interactive {
|
|
962
|
+
cursor: grab;
|
|
963
|
+
|
|
964
|
+
&:active {
|
|
965
|
+
cursor: grabbing;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
&.mappedin-interaction-hover {
|
|
969
|
+
cursor: pointer;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
`;var m7=`.mappedin-map {
|
|
974
|
+
.mappedin-control-container {
|
|
975
|
+
position: absolute;
|
|
976
|
+
left: 0px;
|
|
977
|
+
top: 0px;
|
|
978
|
+
bottom: 0px;
|
|
979
|
+
right: 0px;
|
|
980
|
+
pointer-events: none;
|
|
981
|
+
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
982
|
+
|
|
983
|
+
.mappedin-ctrl-top-left,
|
|
984
|
+
.mappedin-ctrl-top-right,
|
|
985
|
+
.mappedin-ctrl-bottom-left,
|
|
986
|
+
.mappedin-ctrl-bottom-right {
|
|
987
|
+
position: absolute;
|
|
988
|
+
pointer-events: none;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.mappedin-ctrl-top-left {
|
|
992
|
+
top: 0;
|
|
993
|
+
left: 0;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.mappedin-ctrl-top-right {
|
|
997
|
+
top: 0;
|
|
998
|
+
right: 0;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
.mappedin-ctrl-bottom-left {
|
|
1002
|
+
bottom: 0;
|
|
1003
|
+
left: 0;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.mappedin-ctrl-bottom-right {
|
|
1007
|
+
bottom: 0;
|
|
1008
|
+
right: 0;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.mappedin-ctrl-attrib {
|
|
1012
|
+
display: block;
|
|
1013
|
+
position: relative;
|
|
1014
|
+
pointer-events: auto;
|
|
1015
|
+
font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
1016
|
+
padding: 3px 5px 1px 5px;
|
|
1017
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
1018
|
+
margin: 0;
|
|
1019
|
+
min-width: 11px;
|
|
1020
|
+
min-height: 11px;
|
|
1021
|
+
user-select: none;
|
|
1022
|
+
|
|
1023
|
+
summary.mappedin-ctrl-attrib-button {
|
|
1024
|
+
appearance: none;
|
|
1025
|
+
list-style: none;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
summary.mappedin-ctrl-attrib-button::-webkit-details-marker {
|
|
1029
|
+
display: none;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
&.mappedin-compact .mappedin-ctrl-attrib-button,
|
|
1033
|
+
&.mappedin-compact-show .mappedin-ctrl-attrib-inner {
|
|
1034
|
+
display: inline-block;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
&.mappedin-compact {
|
|
1038
|
+
background-color: transparent;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
&.mappedin-compact-show {
|
|
1042
|
+
min-width: 15px;
|
|
1043
|
+
min-height: 15px;
|
|
1044
|
+
box-sizing: border-box;
|
|
1045
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.mappedin-ctrl-attrib-top-left {
|
|
1050
|
+
float: left;
|
|
1051
|
+
border-bottom-right-radius: 4px;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
.mappedin-ctrl-attrib-top-right {
|
|
1055
|
+
float: right;
|
|
1056
|
+
border-bottom-left-radius: 4px;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.mappedin-ctrl-attrib-bottom-left {
|
|
1060
|
+
float: left;
|
|
1061
|
+
border-top-right-radius: 4px;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
.mappedin-ctrl-attrib-bottom-right {
|
|
1065
|
+
float: right;
|
|
1066
|
+
border-top-left-radius: 4px;
|
|
1067
|
+
}
|
|
1068
|
+
.mappedin-ctrl-attrib-top-left,
|
|
1069
|
+
.mappedin-ctrl-attrib-bottom-left {
|
|
1070
|
+
padding: 3px 5px 1px 20px;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
.mappedin-ctrl-attrib-inner {
|
|
1074
|
+
display: inline-block;
|
|
1075
|
+
margin-right: 12px;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
.mappedin-ctrl-attrib-inner,
|
|
1079
|
+
.mappedin-ctrl-attrib-inner a {
|
|
1080
|
+
color: rgba(0, 0, 0, 0.75);
|
|
1081
|
+
text-decoration: none;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
.mappedin-ctrl-attrib-inner-bold,
|
|
1085
|
+
.mappedin-ctrl-attrib-inner-bold a {
|
|
1086
|
+
font-weight: bold;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
.mappedin-ctrl-attrib-inner a:hover {
|
|
1090
|
+
color: #017ef1;
|
|
1091
|
+
text-decoration: underline;
|
|
1092
|
+
cursor: pointer;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.mappedin-ctrl-attrib-button {
|
|
1096
|
+
display: none;
|
|
1097
|
+
cursor: pointer;
|
|
1098
|
+
position: absolute;
|
|
1099
|
+
width: 15px;
|
|
1100
|
+
height: 15px;
|
|
1101
|
+
box-sizing: border-box;
|
|
1102
|
+
border-radius: 50%;
|
|
1103
|
+
top: 0;
|
|
1104
|
+
right: 2px;
|
|
1105
|
+
border: 1px;
|
|
1106
|
+
}
|
|
1107
|
+
.mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,
|
|
1108
|
+
.mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {
|
|
1109
|
+
left: 2px;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
`;var f7=`.maplibregl-map {
|
|
1114
|
+
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
|
|
1115
|
+
overflow: hidden;
|
|
1116
|
+
position: relative;
|
|
1117
|
+
-webkit-tap-highlight-color: rgb(0 0 0 / 0%);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
.maplibregl-canvas {
|
|
1121
|
+
position: absolute;
|
|
1122
|
+
left: 0;
|
|
1123
|
+
top: 0;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
.maplibregl-map:fullscreen {
|
|
1127
|
+
width: 100%;
|
|
1128
|
+
height: 100%;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
.maplibregl-ctrl-group button.maplibregl-ctrl-compass {
|
|
1132
|
+
touch-action: none;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
.maplibregl-canvas-container.maplibregl-interactive,
|
|
1136
|
+
.maplibregl-ctrl-group button.maplibregl-ctrl-compass {
|
|
1137
|
+
cursor: grab;
|
|
1138
|
+
user-select: none;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {
|
|
1142
|
+
cursor: pointer;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.maplibregl-canvas-container.maplibregl-interactive:active,
|
|
1146
|
+
.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {
|
|
1147
|
+
cursor: grabbing;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,
|
|
1151
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {
|
|
1152
|
+
touch-action: pan-x pan-y;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan,
|
|
1156
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {
|
|
1157
|
+
touch-action: pinch-zoom;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,
|
|
1161
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {
|
|
1162
|
+
touch-action: none;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,
|
|
1166
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {
|
|
1167
|
+
touch-action: pan-x pan-y;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
.maplibregl-ctrl-top-left,
|
|
1171
|
+
.maplibregl-ctrl-top-right,
|
|
1172
|
+
.maplibregl-ctrl-bottom-left,
|
|
1173
|
+
.maplibregl-ctrl-bottom-right {
|
|
1174
|
+
position: absolute;
|
|
1175
|
+
pointer-events: none;
|
|
1176
|
+
z-index: 2;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
.maplibregl-ctrl-top-left {
|
|
1180
|
+
top: 0;
|
|
1181
|
+
left: 0;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
.maplibregl-ctrl-top-right {
|
|
1185
|
+
top: 0;
|
|
1186
|
+
right: 0;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
.maplibregl-ctrl-bottom-left {
|
|
1190
|
+
bottom: 0;
|
|
1191
|
+
left: 0;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.maplibregl-ctrl-bottom-right {
|
|
1195
|
+
right: 0;
|
|
1196
|
+
bottom: 0;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
.maplibregl-ctrl {
|
|
1200
|
+
clear: both;
|
|
1201
|
+
pointer-events: auto;
|
|
1202
|
+
|
|
1203
|
+
/* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */
|
|
1204
|
+
transform: translate(0, 0);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
.maplibregl-ctrl-top-left .maplibregl-ctrl {
|
|
1208
|
+
margin: 10px 0 0 10px;
|
|
1209
|
+
float: left;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.maplibregl-ctrl-top-right .maplibregl-ctrl {
|
|
1213
|
+
margin: 10px 10px 0 0;
|
|
1214
|
+
float: right;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.maplibregl-ctrl-bottom-left .maplibregl-ctrl {
|
|
1218
|
+
margin: 0 0 10px 10px;
|
|
1219
|
+
float: left;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
.maplibregl-ctrl-bottom-right .maplibregl-ctrl {
|
|
1223
|
+
margin: 0 10px 10px 0;
|
|
1224
|
+
float: right;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
.maplibregl-ctrl-group {
|
|
1228
|
+
border-radius: 4px;
|
|
1229
|
+
background: #fff;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
.maplibregl-ctrl-group:not(:empty) {
|
|
1233
|
+
box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
@media (forced-colors: active) {
|
|
1237
|
+
.maplibregl-ctrl-group:not(:empty) {
|
|
1238
|
+
box-shadow: 0 0 0 2px ButtonText;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.maplibregl-ctrl-group button {
|
|
1243
|
+
width: 29px;
|
|
1244
|
+
height: 29px;
|
|
1245
|
+
display: block;
|
|
1246
|
+
padding: 0;
|
|
1247
|
+
outline: none;
|
|
1248
|
+
border: 0;
|
|
1249
|
+
box-sizing: border-box;
|
|
1250
|
+
background-color: transparent;
|
|
1251
|
+
cursor: pointer;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.maplibregl-ctrl-group button + button {
|
|
1255
|
+
border-top: 1px solid #ddd;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.maplibregl-ctrl button .maplibregl-ctrl-icon {
|
|
1259
|
+
display: block;
|
|
1260
|
+
width: 100%;
|
|
1261
|
+
height: 100%;
|
|
1262
|
+
background-repeat: no-repeat;
|
|
1263
|
+
background-position: center center;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
@media (forced-colors: active) {
|
|
1267
|
+
.maplibregl-ctrl-icon {
|
|
1268
|
+
background-color: transparent;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
.maplibregl-ctrl-group button + button {
|
|
1272
|
+
border-top: 1px solid ButtonText;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */
|
|
1277
|
+
.maplibregl-ctrl button::-moz-focus-inner {
|
|
1278
|
+
border: 0;
|
|
1279
|
+
padding: 0;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.maplibregl-ctrl-attrib-button:focus,
|
|
1283
|
+
.maplibregl-ctrl-group button:focus {
|
|
1284
|
+
box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.maplibregl-ctrl button:disabled {
|
|
1288
|
+
cursor: not-allowed;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {
|
|
1292
|
+
opacity: 0.25;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
@media (hover: hover) {
|
|
1296
|
+
.maplibregl-ctrl button:not(:disabled):hover {
|
|
1297
|
+
background-color: rgb(0 0 0/5%);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
.maplibregl-ctrl button:not(:disabled):active {
|
|
1302
|
+
background-color: rgb(0 0 0/5%);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
.maplibregl-ctrl-group button:focus:focus-visible {
|
|
1306
|
+
box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
.maplibregl-ctrl-group button:focus:not(:focus-visible) {
|
|
1310
|
+
box-shadow: none;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.maplibregl-ctrl-group button:focus:first-child {
|
|
1314
|
+
border-radius: 4px 4px 0 0;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.maplibregl-ctrl-group button:focus:last-child {
|
|
1318
|
+
border-radius: 0 0 4px 4px;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
.maplibregl-ctrl-group button:focus:only-child {
|
|
1322
|
+
border-radius: inherit;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
|
|
1326
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
|
|
1330
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
@media (forced-colors: active) {
|
|
1334
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
|
|
1335
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
|
|
1339
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1344
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
|
|
1345
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
|
|
1349
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {
|
|
1354
|
+
background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
|
|
1358
|
+
background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
@media (forced-colors: active) {
|
|
1362
|
+
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {
|
|
1363
|
+
background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
|
|
1367
|
+
background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1372
|
+
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {
|
|
1373
|
+
background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
|
|
1377
|
+
background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
|
|
1382
|
+
background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
@media (forced-colors: active) {
|
|
1386
|
+
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
|
|
1387
|
+
@svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {
|
|
1388
|
+
fill: #fff;
|
|
1389
|
+
#south { fill: #999; }
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
background-image: svg-inline(ctrl-compass-white);
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1397
|
+
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
|
|
1398
|
+
background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
@svg-load ctrl-globe url("svg/maplibregl-ctrl-globe.svg") {
|
|
1403
|
+
stroke: #333;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
@svg-load ctrl-globe-enabled url("svg/maplibregl-ctrl-globe.svg") {
|
|
1407
|
+
stroke: #33b5e5;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon {
|
|
1411
|
+
background-image: svg-inline(ctrl-globe);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon {
|
|
1415
|
+
background-image: svg-inline(ctrl-globe-enabled);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {
|
|
1419
|
+
fill: #333;
|
|
1420
|
+
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {
|
|
1424
|
+
fill: #33b5e5;
|
|
1425
|
+
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {
|
|
1429
|
+
background-image: svg-inline(ctrl-terrain);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {
|
|
1433
|
+
background-image: svg-inline(ctrl-terrain-enabled);
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1437
|
+
fill: #333;
|
|
1438
|
+
#stroke { display: none; }
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1442
|
+
fill: #fff;
|
|
1443
|
+
#stroke { display: none; }
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1447
|
+
fill: #000;
|
|
1448
|
+
#stroke { display: none; }
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1452
|
+
fill: #aaa;
|
|
1453
|
+
#stroke { fill: #f00; }
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1457
|
+
fill: #999;
|
|
1458
|
+
#stroke { fill: #f00; }
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1462
|
+
fill: #666;
|
|
1463
|
+
#stroke { fill: #f00; }
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1467
|
+
fill: #33b5e5;
|
|
1468
|
+
#stroke { display: none; }
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1472
|
+
fill: #e58978;
|
|
1473
|
+
#stroke { display: none; }
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1477
|
+
fill: #33b5e5;
|
|
1478
|
+
#stroke { display: none; }
|
|
1479
|
+
#dot { display: none; }
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1483
|
+
fill: #e54e33;
|
|
1484
|
+
#stroke { display: none; }
|
|
1485
|
+
#dot { display: none; }
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
|
|
1489
|
+
background-image: svg-inline(ctrl-geolocate);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {
|
|
1493
|
+
background-image: svg-inline(ctrl-geolocate-disabled);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
|
|
1497
|
+
background-image: svg-inline(ctrl-geolocate-active);
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {
|
|
1501
|
+
background-image: svg-inline(ctrl-geolocate-active-error);
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {
|
|
1505
|
+
background-image: svg-inline(ctrl-geolocate-background);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {
|
|
1509
|
+
background-image: svg-inline(ctrl-geolocate-background-error);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {
|
|
1513
|
+
animation: maplibregl-spin 2s infinite linear;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
@media (forced-colors: active) {
|
|
1517
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
|
|
1518
|
+
background-image: svg-inline(ctrl-geolocate-white);
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {
|
|
1522
|
+
background-image: svg-inline(ctrl-geolocate-disabled-white);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
|
|
1526
|
+
background-image: svg-inline(ctrl-geolocate-active);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {
|
|
1530
|
+
background-image: svg-inline(ctrl-geolocate-active-error);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {
|
|
1534
|
+
background-image: svg-inline(ctrl-geolocate-background);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {
|
|
1538
|
+
background-image: svg-inline(ctrl-geolocate-background-error);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1543
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
|
|
1544
|
+
background-image: svg-inline(ctrl-geolocate-black);
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {
|
|
1548
|
+
background-image: svg-inline(ctrl-geolocate-disabled-black);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
@keyframes maplibregl-spin {
|
|
1553
|
+
0% { transform: rotate(0deg); }
|
|
1554
|
+
100% { transform: rotate(360deg); }
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
a.maplibregl-ctrl-logo {
|
|
1558
|
+
width: 88px;
|
|
1559
|
+
height: 23px;
|
|
1560
|
+
margin: 0 0 -4px -4px;
|
|
1561
|
+
display: block;
|
|
1562
|
+
background-repeat: no-repeat;
|
|
1563
|
+
cursor: pointer;
|
|
1564
|
+
overflow: hidden;
|
|
1565
|
+
background-image: svg-load("svg/maplibregl-ctrl-logo.svg");
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
1569
|
+
width: 14px;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
@media (forced-colors: active) {
|
|
1573
|
+
a.maplibregl-ctrl-logo {
|
|
1574
|
+
@svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {
|
|
1575
|
+
#outline { opacity: 1; }
|
|
1576
|
+
#fill { opacity: 1; }
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
background-color: transparent;
|
|
1580
|
+
background-image: svg-inline(ctrl-logo-white);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1585
|
+
a.maplibregl-ctrl-logo {
|
|
1586
|
+
@svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {
|
|
1587
|
+
#outline { opacity: 1; fill: #fff; stroke: #fff; }
|
|
1588
|
+
#fill { opacity: 1; fill: #000; }
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
background-image: svg-inline(ctrl-logo-black);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
.maplibregl-ctrl.maplibregl-ctrl-attrib {
|
|
1596
|
+
padding: 0 5px;
|
|
1597
|
+
background-color: rgb(255 255 255 / 50%);
|
|
1598
|
+
margin: 0;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
@media screen {
|
|
1602
|
+
.maplibregl-ctrl-attrib.maplibregl-compact {
|
|
1603
|
+
min-height: 20px;
|
|
1604
|
+
padding: 2px 24px 2px 0;
|
|
1605
|
+
margin: 10px;
|
|
1606
|
+
position: relative;
|
|
1607
|
+
background-color: #fff;
|
|
1608
|
+
color: #000;
|
|
1609
|
+
border-radius: 12px;
|
|
1610
|
+
box-sizing: content-box;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
.maplibregl-ctrl-attrib.maplibregl-compact-show {
|
|
1614
|
+
padding: 2px 28px 2px 8px;
|
|
1615
|
+
visibility: visible;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,
|
|
1619
|
+
.maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {
|
|
1620
|
+
padding: 2px 8px 2px 28px;
|
|
1621
|
+
border-radius: 12px;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {
|
|
1625
|
+
display: none;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
.maplibregl-ctrl-attrib-button {
|
|
1629
|
+
display: none;
|
|
1630
|
+
cursor: pointer;
|
|
1631
|
+
position: absolute;
|
|
1632
|
+
background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");
|
|
1633
|
+
background-color: rgb(255 255 255 / 50%);
|
|
1634
|
+
width: 24px;
|
|
1635
|
+
height: 24px;
|
|
1636
|
+
box-sizing: border-box;
|
|
1637
|
+
border-radius: 12px;
|
|
1638
|
+
outline: none;
|
|
1639
|
+
top: 0;
|
|
1640
|
+
right: 0;
|
|
1641
|
+
border: 0;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {
|
|
1645
|
+
appearance: none;
|
|
1646
|
+
list-style: none;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {
|
|
1650
|
+
display: none;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,
|
|
1654
|
+
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {
|
|
1655
|
+
left: 0;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,
|
|
1659
|
+
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
|
|
1660
|
+
display: block;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {
|
|
1664
|
+
background-color: rgb(0 0 0 / 5%);
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1668
|
+
bottom: 0;
|
|
1669
|
+
right: 0;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
.maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1673
|
+
top: 0;
|
|
1674
|
+
right: 0;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1678
|
+
top: 0;
|
|
1679
|
+
left: 0;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
.maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1683
|
+
bottom: 0;
|
|
1684
|
+
left: 0;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
@media screen and (forced-colors: active) {
|
|
1689
|
+
.maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1690
|
+
background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
@media screen and (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1695
|
+
.maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1696
|
+
background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
.maplibregl-ctrl-attrib a {
|
|
1701
|
+
color: rgb(0 0 0 / 75%);
|
|
1702
|
+
text-decoration: none;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
.maplibregl-ctrl-attrib a:hover {
|
|
1706
|
+
color: inherit;
|
|
1707
|
+
text-decoration: underline;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
.maplibregl-attrib-empty {
|
|
1711
|
+
display: none;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
.maplibregl-ctrl-scale {
|
|
1715
|
+
background-color: rgb(255 255 255 / 75%);
|
|
1716
|
+
font-size: 10px;
|
|
1717
|
+
border-width: medium 2px 2px;
|
|
1718
|
+
border-style: none solid solid;
|
|
1719
|
+
border-color: #333;
|
|
1720
|
+
padding: 0 5px;
|
|
1721
|
+
color: #333;
|
|
1722
|
+
box-sizing: border-box;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
.maplibregl-popup {
|
|
1726
|
+
position: absolute;
|
|
1727
|
+
top: 0;
|
|
1728
|
+
left: 0;
|
|
1729
|
+
display: flex;
|
|
1730
|
+
will-change: transform;
|
|
1731
|
+
pointer-events: none;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
.maplibregl-popup-anchor-top,
|
|
1735
|
+
.maplibregl-popup-anchor-top-left,
|
|
1736
|
+
.maplibregl-popup-anchor-top-right {
|
|
1737
|
+
flex-direction: column;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
.maplibregl-popup-anchor-bottom,
|
|
1741
|
+
.maplibregl-popup-anchor-bottom-left,
|
|
1742
|
+
.maplibregl-popup-anchor-bottom-right {
|
|
1743
|
+
flex-direction: column-reverse;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
.maplibregl-popup-anchor-left {
|
|
1747
|
+
flex-direction: row;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
.maplibregl-popup-anchor-right {
|
|
1751
|
+
flex-direction: row-reverse;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
.maplibregl-popup-tip {
|
|
1755
|
+
width: 0;
|
|
1756
|
+
height: 0;
|
|
1757
|
+
border: 10px solid transparent;
|
|
1758
|
+
z-index: 1;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
|
|
1762
|
+
align-self: center;
|
|
1763
|
+
border-top: none;
|
|
1764
|
+
border-bottom-color: #fff;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {
|
|
1768
|
+
align-self: flex-start;
|
|
1769
|
+
border-top: none;
|
|
1770
|
+
border-left: none;
|
|
1771
|
+
border-bottom-color: #fff;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
|
|
1775
|
+
align-self: flex-end;
|
|
1776
|
+
border-top: none;
|
|
1777
|
+
border-right: none;
|
|
1778
|
+
border-bottom-color: #fff;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
|
|
1782
|
+
align-self: center;
|
|
1783
|
+
border-bottom: none;
|
|
1784
|
+
border-top-color: #fff;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {
|
|
1788
|
+
align-self: flex-start;
|
|
1789
|
+
border-bottom: none;
|
|
1790
|
+
border-left: none;
|
|
1791
|
+
border-top-color: #fff;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
|
|
1795
|
+
align-self: flex-end;
|
|
1796
|
+
border-bottom: none;
|
|
1797
|
+
border-right: none;
|
|
1798
|
+
border-top-color: #fff;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
|
|
1802
|
+
align-self: center;
|
|
1803
|
+
border-left: none;
|
|
1804
|
+
border-right-color: #fff;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
|
|
1808
|
+
align-self: center;
|
|
1809
|
+
border-right: none;
|
|
1810
|
+
border-left-color: #fff;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
.maplibregl-popup-close-button {
|
|
1814
|
+
position: absolute;
|
|
1815
|
+
right: 0;
|
|
1816
|
+
top: 0;
|
|
1817
|
+
border: 0;
|
|
1818
|
+
border-radius: 0 3px 0 0;
|
|
1819
|
+
cursor: pointer;
|
|
1820
|
+
background-color: transparent;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
.maplibregl-popup-close-button:hover {
|
|
1824
|
+
background-color: rgb(0 0 0 / 5%);
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
.maplibregl-popup-content {
|
|
1828
|
+
position: relative;
|
|
1829
|
+
background: #fff;
|
|
1830
|
+
border-radius: 3px;
|
|
1831
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
|
|
1832
|
+
padding: 15px 10px;
|
|
1833
|
+
pointer-events: auto;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-content {
|
|
1837
|
+
border-top-left-radius: 0;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-content {
|
|
1841
|
+
border-top-right-radius: 0;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {
|
|
1845
|
+
border-bottom-left-radius: 0;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {
|
|
1849
|
+
border-bottom-right-radius: 0;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
.maplibregl-popup-track-pointer {
|
|
1853
|
+
display: none;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
.maplibregl-popup-track-pointer * {
|
|
1857
|
+
pointer-events: none;
|
|
1858
|
+
user-select: none;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.maplibregl-map:hover .maplibregl-popup-track-pointer {
|
|
1862
|
+
display: flex;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
.maplibregl-map:active .maplibregl-popup-track-pointer {
|
|
1866
|
+
display: none;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
.maplibregl-marker {
|
|
1870
|
+
position: absolute;
|
|
1871
|
+
top: 0;
|
|
1872
|
+
left: 0;
|
|
1873
|
+
will-change: transform;
|
|
1874
|
+
transition: opacity 0.2s;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
.maplibregl-user-location-dot {
|
|
1878
|
+
background-color: #1da1f2;
|
|
1879
|
+
width: 15px;
|
|
1880
|
+
height: 15px;
|
|
1881
|
+
border-radius: 50%;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
.maplibregl-user-location-dot::before {
|
|
1885
|
+
background-color: #1da1f2;
|
|
1886
|
+
content: "";
|
|
1887
|
+
width: 15px;
|
|
1888
|
+
height: 15px;
|
|
1889
|
+
border-radius: 50%;
|
|
1890
|
+
position: absolute;
|
|
1891
|
+
animation: maplibregl-user-location-dot-pulse 2s infinite;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.maplibregl-user-location-dot::after {
|
|
1895
|
+
border-radius: 50%;
|
|
1896
|
+
border: 2px solid #fff;
|
|
1897
|
+
content: "";
|
|
1898
|
+
height: 19px;
|
|
1899
|
+
left: -2px;
|
|
1900
|
+
position: absolute;
|
|
1901
|
+
top: -2px;
|
|
1902
|
+
width: 19px;
|
|
1903
|
+
box-sizing: border-box;
|
|
1904
|
+
box-shadow: 0 0 3px rgb(0 0 0 / 35%);
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
@keyframes maplibregl-user-location-dot-pulse {
|
|
1908
|
+
0% { transform: scale(1); opacity: 1; }
|
|
1909
|
+
70% { transform: scale(3); opacity: 0; }
|
|
1910
|
+
100% { transform: scale(1); opacity: 0; }
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
.maplibregl-user-location-dot-stale {
|
|
1914
|
+
background-color: #aaa;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
.maplibregl-user-location-dot-stale::after {
|
|
1918
|
+
display: none;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
.maplibregl-user-location-accuracy-circle {
|
|
1922
|
+
background-color: #1da1f233;
|
|
1923
|
+
width: 1px;
|
|
1924
|
+
height: 1px;
|
|
1925
|
+
border-radius: 100%;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
.maplibregl-crosshair,
|
|
1929
|
+
.maplibregl-crosshair .maplibregl-interactive,
|
|
1930
|
+
.maplibregl-crosshair .maplibregl-interactive:active {
|
|
1931
|
+
cursor: crosshair;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
.maplibregl-boxzoom {
|
|
1935
|
+
position: absolute;
|
|
1936
|
+
top: 0;
|
|
1937
|
+
left: 0;
|
|
1938
|
+
width: 0;
|
|
1939
|
+
height: 0;
|
|
1940
|
+
background: #fff;
|
|
1941
|
+
border: 2px dotted #202020;
|
|
1942
|
+
opacity: 0.5;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
.maplibregl-cooperative-gesture-screen {
|
|
1946
|
+
background: rgba(0 0 0 / 40%);
|
|
1947
|
+
position: absolute;
|
|
1948
|
+
inset: 0;
|
|
1949
|
+
display: flex;
|
|
1950
|
+
justify-content: center;
|
|
1951
|
+
align-items: center;
|
|
1952
|
+
color: white;
|
|
1953
|
+
padding: 1rem;
|
|
1954
|
+
font-size: 1.4em;
|
|
1955
|
+
line-height: 1.2;
|
|
1956
|
+
opacity: 0;
|
|
1957
|
+
pointer-events: none;
|
|
1958
|
+
transition: opacity 1s ease 1s;
|
|
1959
|
+
z-index: 99999;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.maplibregl-cooperative-gesture-screen.maplibregl-show {
|
|
1963
|
+
opacity: 1;
|
|
1964
|
+
transition: opacity 0.05s;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
|
|
1968
|
+
display: none;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
@media (hover: none), (pointer: coarse) {
|
|
1972
|
+
.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {
|
|
1973
|
+
display: none;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
|
|
1977
|
+
display: block;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
.maplibregl-pseudo-fullscreen {
|
|
1982
|
+
position: fixed !important;
|
|
1983
|
+
width: 100% !important;
|
|
1984
|
+
height: 100% !important;
|
|
1985
|
+
top: 0 !important;
|
|
1986
|
+
left: 0 !important;
|
|
1987
|
+
z-index: 99999;
|
|
1988
|
+
}
|
|
1989
|
+
`;d();function mX(e){if(!(!e.languages||!um()||!globalThis.navigator?.languages?.length))for(let r=0;r<globalThis.navigator.languages.length;r++){let t=e.languages.find(o=>o.code.toLowerCase()===globalThis.navigator.languages[r].toLowerCase());if(t)return{code:t.code,name:t.name}}}function b2(e,r){let t=r?.languageCode??"",o=r?.fallbackToNavigatorLanguage??!0,n=e?.languages?.find(a=>a.code.toLowerCase()===t.toLowerCase()),i;if(n)i=n;else if(o??!0)try{let a=mX(e);a&&(i=a)}catch(a){A.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",a)}return i??e.defaultLanguage}var fX=[c7,p7,d7,u7,m7,f7],h7;function zNe(e){h7=e}var WNe=async(e,r)=>{let t,o=tl();r&&o.updateByUserOption(r);try{r&&(t=(await hf({...r,baseAuthUri:o.getBaseAuthUri()})).accessToken)}catch(a){A.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new Pc(e,{outdoorViewToken:t,languagePacks:r?.languagePacks,env:o});return new wm(n)},g7=!1;function ZNe(e){g7=e}var y7=!1;function XNe(e){y7=e}function Nf(){return y7}var hX=async e=>{let r=g7,t,o=tl();o.updateByUserOption(e);let n={prefetchTokens:!0,...e,fallbackToNavigatorLanguage:e.fallbackToNavigatorLanguage??!0},i=new nm([n.mapId],n);if("accessToken"in n&&n.accessToken){t=n.accessToken;let{aud:x,sub:I}=ny(t);(A5.some(M=>x.includes(M))||I&&I.startsWith("client"))&&(r=!0,o.setEnterprise(r),i.setEnterprise(r))}else if("key"in n&&"secret"in n){if(n.key.startsWith("mipk_"))throw new Error(`Partner API keys detected!
|
|
1990
|
+
|
|
1991
|
+
Partner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.`);n.key.startsWith("mik_")||(r=!0,o.setEnterprise(r),i.setEnterprise(r)),n.baseAuthUri=o.getBaseAuthUri(),t=(await i.getAccessTokenAsync()).token}else throw new Error("Missing key or secret.");n.layoutId!=null&&(r?n.layoutId!=="draft"&&A.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):A.warn("layoutId is currently unsupported!")),n.baseUri=o.getBaseUri();let a=performance.now(),l,c;if(r){let x={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"},I=await mS(x);l=I.compressed,c=I.localePacks}else l=await fS(n,t);let p=performance.now(),u=await n1(l,n.mvfVersion),f=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(u);let h=o1(u);if(h.length>0?i.setMapIds(h):i.setMapIds([n.mapId]),n.prefetchTokens)try{await i.readySync()}catch(x){A.error("Failed to ready token manager!",x)}Nf()&&(r&&A.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),n.mvfVersion!=="3.0.0"&&A.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let b=new Pc(u,{env:o,outdoorViewToken:t,tokenManager:i,enterprise:r,localePacksUrls:c,binaryBundle:l,getMapDataOptions:n}),v=new wm(b,{search:e.search});b.Analytics.init({accessToken:t,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:o.getAnalyticsBaseUri(),context:n.analytics?.context}),b.Analytics.sendGetMapDataEvent({parseDuration:f-p,downloadDuration:p-a,viewId:n.viewId});let T=b.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:n.fallbackToNavigatorLanguage});if(T)try{await v.changeLanguage(T.code)}catch{}return v},YNe=hX,gX=async()=>{if(Fc===""||Nx==="")return!1;let e=[fetch(Fc,{mode:"same-origin"}),fetch(Nx,{mode:"same-origin"})],[r,t]=[{ok:!1},{ok:!1}];try{[r,t]=await Promise.all(e)}catch{}return{collision:r.ok,maplibre:t.ok}},yX=async(e,r,t)=>{let o=performance.now(),n=zS(t,r);n&&HS(n),(n.injectStyles??!0)&&l7(fX,{id:"mappedin__styles"});let i=L5(r.outdoorViewToken??""),a=Om(r);n.outdoorView?.style&&a.envControl.updateTileServerBaseUrl(n.outdoorView?.style);let l=!1,c=!1,p=await gX();p&&(p.collision||(l=!0),p.maplibre||(c=!0));let u=await z4(e,{center:[r.mapCenter.longitude,r.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:n.style?.backgroundAlpha,backgroundColor:n.style?.backgroundColor,outdoorView:!c&&n.outdoorView?.token?{headers:{"x-mappedin-tiles-key":n.outdoorView?.token},style:r.getEnv().tileServerUri,enabled:!!n.outdoorView?.enabled,lowDpi:n.outdoorView?.lowDpi}:void 0,watermark:{...n.watermark,visible:n.watermark?.visible??(!a.enterpriseMode&&!i.remove_watermark),onClick:h7||void 0},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!n.antialiasing?.enabled,accessToken:r.outdoorViewToken,occlusionEnabled:!0,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:r.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:!l}),f=new Ug(u);return await f.addMap(r,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-o,dimension:f.getDimensions(),collisionWorkerDisabled:l,outdoorsWorkerDisabled:c}),f},JNe=()=>y.env.npm_package_version,KNe=yX;export{fe as a,wn as b,ic as c,ac as d,On as e,go as f,vr as g,Bo as h,t$ as i,an as j,No as k,sn as l,ia as m,u1 as n,Ar as o,es as p,m1 as q,o2 as r,hS as s,gS as t,n1 as u,j5 as v,n2 as w,G5 as x,h1 as y,g1 as z,ml as A,Sc as B,f1 as C,Lk as D,AD as E,ls as F,dz as G,dT as H,wZ as I,OT as J,PT as K,oX as L,Ug as M,sX as N,b2 as O,zNe as P,WNe as Q,ZNe as R,XNe as S,Nf as T,hX as U,YNe as V,gX as W,yX as X,JNe as Y,KNe as Z};
|
|
1992
|
+
//# sourceMappingURL=chunk-LZEM3W53.js.map
|